Page History
...
For versions 6.4.0 and above the distributed java client features a mavenized project. This client has a large dependency set. Maven simplifies dependency resolution. Cloning and building the Client project provides a local maven repository version of the client jar and pom.
Step by step instructions for integration into a maven project in an eclipse environment.
This client has a large dependency set. Maven simplifies dependency resolution.
:
- Requires Java 1.7, Maven 3.2.3, Git, and Eclipse Neon or some other maven enabled Eclipse IDE.
- This example assumes some familiarity with Eclipse and Maven.
- run git clone https://github.com/lexevs/LexEVS_Distributed_Client.git
- change working directory to LexEVS_Distributed_Client
- Run mvn clean install, if tests fail you may add -DskipTests
- Create a new Java Project
- Configure as a Maven project
- add as dependency to the pom file:
Code Block | ||||
---|---|---|---|---|
| ||||
<dependencies> <dependency> <groupId>lexevs.dist.client</groupId> <artifactId>lexevs.dist.client</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> </dependencies> |
...
Users should be able to access a remote service with code similar to the following (Service URL should be adjusted to the current LexEVS API service or one they have created for themselves):
Code Block | ||||
---|---|---|---|---|
| ||||
package org.lexgrid.lexevs.remote.client; import org.LexGrid.LexBIG.DataModel.Collections.CodingSchemeRenderingList; import org.LexGrid.LexBIG.DataModel.InterfaceElements.CodingSchemeRendering; import org.LexGrid.LexBIG.Exceptions.LBInvocationException; import org.LexGrid.LexBIG.caCore.interfaces.LexEVSDistributed; import gov.nih.nci.system.client.ApplicationServiceProvider; public class MavenBasedPrototype { LexEVSDistributed lbs = null; private static String serviceUrl = "https://localhost.daplie.com:8443/lexevsapi64"; public void run() throws LBInvocationException{ try { lbs = (LexEVSDistributed)ApplicationServiceProvider.getApplicationServiceFromUrl(serviceUrl, "EvsServiceInfo"); } catch(Exception e){ System.out.println("Starting LexEVS Remote Client fails" + e); } CodingSchemeRenderingList list = lbs.getSupportedCodingSchemes(); for(CodingSchemeRendering rendering: list.getCodingSchemeRendering()){ System.out.println(rendering.getCodingSchemeSummary().getFormalName()); } } public static void main(String[] args) { try { new MavenBasedPrototype().run(); } catch (LBInvocationException e) { e.printStackTrace(); } } } |
...