Documents setting up code, config, and data in a development environment using Eclipse.
Step 1 - Create directories
Setup for Windows
Setup for Unix/Linux/Mac
Step 2 - Clone repository
Clone the Github repository to the directory created to hold the code.
Step 3 - Build project
Build all project modules with "mvn clean install" at the top level - either through Eclipse or via the command line.
Step 4 - Setup Configuration
Choose a "dev-windows" or "prod" config project target and unzip it into the directory created to hold your config files.
Unzip the config/target/refset-config.*.zip file into the directory created to hold your data files (these are the sample data artifacts). For example, unzip to c:/refset/data when building a dev environment on Windows.
Step 5 - Edit configuration
Edit the "config.properties" file in your config files directory to set correctly for your environment. In particular, edit these:
identifier.assignment.handler.DEFAULT.url=http://dev-cis.ihtsdotools.org:3000/api
identifier.assignment.handler.DEFAULT.userName=EDIT_THIS
identifier.assignment.handler.DEFAULT.password=EDIT_THIS
terminology.handler=BROWSER,SNOWOWL,SNOWOWL-SE
terminology.handler.BROWSER.class=org.ihtsdo.otf.refset.jpa.services.handlers.BrowserTerminologyHandler
terminology.handler.BROWSER.defaultUrl=https://sct-rest.ihtsdotools.org/api
terminology.handler.BROWSER.apiKey=EDIT_THIS
terminology.handler.SNOWOWL.class=org.ihtsdo.otf.refset.jpa.services.handlers.SnowowlTerminologyHandler
terminology.handler.SNOWOWL.defaultUrl=https://authoring.ihtsdotools.org/snowowl/snomed-ct/v2
terminology.handler.SNOWOWL.authHeader=Basic EDIT_THIS
terminology.handler.SNOWOWL.apiKey=EDIT_THIS
terminology.handler.SNOWOWL-SE.class=org.ihtsdo.otf.refset.jpa.services.handlers.SnowowlTerminologyHandler
terminology.handler.SNOWOWL-SE.defaultUrl=https://se-authoring.ihtsdotools.org/snowowl/snomed-ct/v2
terminology.handler.SNOWOWL-SE.apiKey=EDIT_THIS
base.url=EDIT_THIS (e.g. http://localhost:8080/refset-rest)
logout.url=EDIT_THIS (e.g. http://localhost:8080/refset-rest/index.html)
Step 6 - Create database
Create a MySQL UTF8 database. e.g.
Step 7 - Generate sample data
Run the admin tool for generating sample data. Here is a sample command line invocation that clears the database and indexes, then loads the sample data. It assumes the config.properties file has been properly edited as described above.
# from top-level code directory cd admin mvn install -PSample -Drefset.config=/home/ihtsdo/config/config.properties -Dmode=create >&! mvn.log |
Following is a sample Eclipse run configuration for the same thing.
Step 8 - Deploy application, Launch Server
Deploy the refset-rest.war file to a Tomcat server - either through Eclipse or a standalone tomcat installation. NOTE: It should also be deployable to a simple Jetty container as an alternative.
Setting up Tomcat in Eclipse is very easy, you follow these steps.
The Tomcat server needs to be able to find the run configuration. Double-click on the Tomcat server you installed, open the launch configuration and add this setting:
-Drefset.config=c:/refset/config/config.properties |
Setting up Jetty in Eclipse is also very easy. Follow these steps:
In the "Arguments" tab, specify your run.config.umls setting as a VM argument, e.g.:
-Drefset.config=c:/refset/config/config.properties |
Step 9 - Test application
Check that it all works by going to
http://localhost:8080/refset-rest/index.html |
This should be a demo app that contains a basic terminology browser and (in the header) a link to a "swagger" Api documenting the service calls available. You should be able to log in to either the application or the Swagger services by authenticating with "guest" username and "guest" password.
NOTE: in the Eclipse dev environment, the swagger API does not load properly because Eclipse m2e is unable to handle the maven plugin executions that handle the interpolation of ${base.url} in the swagger files. Building and deploying the actual umls-server-rest.war file is needed for this to work properly.
Step 10 - Run the Examples
See the examples project for some sample code on using the REST APIs in a variety of different ways. You can run the examples against the standard dev database load through Maven.
cd /path/to/examples/ mvn install -DskipTests=false -Drefset.config=/path/to/config.properties |
NOTE: the examples require the server to be running, they do not access the database directly.