Overview
Documents setting up code, config, and data in a development environment using Eclipse.
Prerequisites
- Java 7 installed
- Mysql 5.5 or 5.6 installed
- Maven 3.2.+ installed
- Tomcat 7 installed and configured
Details
Step 1
Clone the Github repository to a local directory (e.g. c:/workspace/SNOMED-Terminology-Server)
Step 2
- Create a directory to hold your configuration and data files (e.g. c:/data)
- Copy the term-server-config/src/main/resources/data/snomedct-20140131-mini folder to your data directory (e.g. c:/data).
- Copy the term-server-config/src/main/resources/data/icd9cm-2013.xml file into your data directory (e.g. c:/data)
- Copy the term-server-config/src/main/resources/config.properties.dev to your data directory (e.g. c:/data) and rename it to "config.properties"
Step 3
Edit the configuration file to set correctly for your environment. In particular, edit these:
- javax.persistence.jdbc.url
- javax.persistence.jdbc.user
- javax.persistence.jdbc.password
- hibernate.search.default.indexBase ( recommend choosing something below your data dir, e.g. c:/data/indexes)
- loader.SNOMEDCT.input.data (set to the path of your SNOMED data, e.g. c:/data/snomedct-20140131-mini)
- ihtsdo.security.activated (set to false for dev environment)
Step 4
Set three environment variables:
- MVN_HOME - path to mvn installation (so bin/mvn is accessible from there)
- Only needed on Windows, assume "mvn" is in path on Linux
- SERVER_CONFIG - path to the configuration file (e.g. c:/data/config.properties).
- SERVER_HOME - path to where the code is installed, (e.g. c:/workspace/SNOMED-Terminology-Server)
Step 5
Create a MySQL UTF8 database. e.g.
- CREATE database tsdb CHARACTER SET utf8 default collate utf8_unicode_ci;
Step 6
Run the admin loader script for your platform. See term-server-admin/loader/src/main/resources/scripts
- load.bat - for Windows
- load.sh - for Linux
Step 7
Build all modules with "mvn clean install" at the top level - either through Eclipse or via the command line. Among other things, this will produce a term-server-rest.war file that can be deployed.
Step 8
Deploy the term-server--rest.war file to a Tomcat server - either through Eclipse or a standalone tomcat installation.
Setting up Tomcat in Eclipse is very easy, you follow these steps.
- Download and install apache tomcat 7 in c:/apache-tomcat-XXXX
- In Eclipse use the J2EE perspective and click on the "Servers" tab.
- From here, you can add a server which simply involves pointing Eclipse to the install directory.
- You can right-click on term-server-rest.war file and use "Run As->Run on Server" to deploy to Tomcat.
Double-click on the Tomcat server you installed, open the launch configuration and add a
-Drun.config=/path/to/your/config.properties
Step 9
Check that it all works by going to
http://localhost:8080/term-server-rest/index.html
This should be a "swagger" Api documenting the current state of the API.
Everything is still configured to use security so you'd need to at least authenticate and then the other methods would be available using "admin" as the auth token. I'll check if this works...