Presentation is loading. Please wait.

Presentation is loading. Please wait.

LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Similar presentations


Presentation on theme: "LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009."— Presentation transcript:

1 LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009

2 LexEVS in a caGrid Environment Course Outline Course Learning Objectives Discuss the components required for installing a distributed environment. Discuss the download and setup of LexEVS 5.0 for the caGrid Environment. Provide hands-on code exercises.

3 Session Details: LexEVS in a caGrid Environment Lesson Syllabus Lesson 1: Overview of caGrid Environment Lesson 2: Hands-On Installation Lesson 3: Hands-On Code Examples

4 Lesson 1: Overview of Distributed Mode When you complete this lesson, you will be able to: Identify the components required for installing a LexEVS caGrid environment, for both the Analytical and Data Grid Services.

5 Lesson 1: Overview of Distributed Mode Distributed Environment Components The reference software stack: Java 1.5 MySQL 5.0.45 JBoss 4.0.5 GA LexEVS 5.0 local runtime LexEVS 5.0 distributed environment These should already be in place on your workstation. The LexEVS 5.0 local runtime, as well as the distributed envirnonment, have been installed and configured previously. Reference files: LexEVS_50_caGRIDServices_analytical_jboss.zip LexEVS_50_caGRIDServices_data_jboss.zip

6 Lesson 1: Overview of Distributed Mode Reference Files LexEVS_50_caGRIDServices_analytical_jboss.zip LexEVS 5.0 Analytical Grid Service Includes war directory structure (wsrf.war) to be deployed to JBoss server. Available from VKC download. LexEVS_50_caGRIDServices_data_jboss.zip LexEVS 5.0 Data Grid Service Includes war directory structure (wsrf.war) to be deployed to JBoss server. Available from VKC download.

7 Lesson 2: Hands-On Installation When you complete this lesson, you will be able to: Download and setup of LexEVS 5.0 caGrid environment for both the Analytical and Grid Services.

8 Lesson 2: Hands-On Installation Install Distributed Components Reference document: installsetupgridservices.doc We will take 15 minutes to perform this hands-on exercise.

9 Lesson 2: Hands-On Installation Review Installation Copy the Data Grid Service wsrf.war directory into incompleteLexevsServer\server\cacoreDataGrid\deploy directory. Copy the Analytical Grid Service wsrf.war directory into incompleteLexevsServer\server\analyticalGrid\deploy directory. First start the Data Grid Service server (startServer1.bat) Once that is started, start the Analytical Grid Service server (startServer2.bat)

10 Lesson 3: Hands-On Code Examples When you complete this lesson, you will be able to: Execute code examples in a caGrid environment.

11 Lesson 3: Hands-On Code Examples Exercises Code Examples for the LexEVS Grid Environment are split into two Eclipse Projects: bootcamp-analytical-grid Code examples for the LexEVS Analytical Grid Service bootcamp-data-grid Code Examples for the LexEVS Data Grid Service Hands-on code examples are broken down into three categories: Examples Exercises Solutions

12 Lesson 3: Hands-On Code Examples Analytical Grid Service The following Code Examples will focus on the LexEVS Analytical Grid Environment All source code will be find in the ‘bootcamp-analytical-grid’ Eclipse Project

13 Lesson 3: Hands-On Code Examples Analytical Grid Service Example Overview ConnectToLexEVSAnalyticalGridService.java Demonstrates how to connect to the LexEVS Analytical Grid Service. Using the LexBIGServiceGridAdapter, a reference to a LexEVS Analytical Grid Service can be obtained given a URL. /** * Gets the LexBIG Service for the LexEVS Analytical Grid Service. * @return the analytical grid lex big service * @throws Exception the exception */ public LexBIGService getAnalyticalGridLexBIGService() throws Exception { //Obtain the LexBIGServiceGridAdapter with the appropriate //URL. From that, get the LexBIGServiceInterface. return new LexBIGServiceGridAdapter(SERVICE_URL).getLexBIGServiceInterface(); }

14 Lesson 3: Hands-On Code Examples Example 1: Analytical Grid Service Navigate to: lexevs.bootcamp.grid.analytical.examples.lexbigservice. ConnectToLexEVSAnalyticalGridService

15 Lesson 3: Hands-On Code Examples Exercise 1: Analytical Grid Service Navigate to: lexevs.bootcamp.grid.analytical.exercises.lexbigservice.ConnectToLexEVSAnalyticalGridServiceExercise HINT: Modify the method protected LexBIGService getAnalyticalGridLexBIGServicee () so that it instantiates LexBIGService using a LexBIGServiceGridAdapter.

16 Lesson 3: Hands-On Code Examples Answer 1: Analytical Grid Service Implemented method: private static String SERVICE_URL = BootcampConstants.ANALYTICAL_SERVICE_URL; public LexBIGService getAnalyticalGridLexBIGService() throws Exception { return new LexBIGServiceGridAdapter(SERVICE_URL) //Obtain the LexBIGServiceGridAdapter with the appropriate URL..getLexBIGServiceInterface(); //From that, get the LexBIGServiceInterface. }

17 Lesson 3: Hands-On Code Examples Demonstrate Service Contexts DemonstrateServiceContexts Demonstrates how the LexEVS Analytical Grid Service uses caGrid Service Contexts to provide a state-full Web Service.

18 Lesson 3: Hands-On Code Examples Example 2: Demonstrate Service Contexts Navigate to: lexevs.bootcamp.grid.analytical.examples.lexbigservice. DemonstrateServiceContexts The output of this example will demonstrate the actual classes returned to the client.

19 Lesson 3: Hands-On Code Examples Data Grid Service The following Code Examples will focus on the LexEVS Data Grid Environment All source code will be find in the ‘bootcamp-data-grid’ Eclipse Project

20 Lesson 3: Hands-On Code Examples Data Grid Service Example Overview GetDataGridServiceHandle.java Demonstrates how to connect to the LexEVS Data Grid Service. The DataServiceClient is then used to construct a DataServiceHandle, which provides easier access to caGrid Data Service APIs /** * Return a reference to a LexEVS DataGridService. * @return the data service handle * @throws Exception the exception */ protected DataServiceHandle getDataGridServiceHandle() throws Exception{ //Create a DataServiceClient, and create a //DataServiceHandle from that client. DataServiceClient svc = new DataServiceClient(SERVICE_URL); return new DataServiceHandle(svc); }

21 Lesson 3: Hands-On Code Examples Example 3: Data Grid Service Navigate to: lexevs.bootcamp.grid.data.examples.dataservice.GetDataG ridServiceHandle

22 Lesson 3: Hands-On Code Examples Exercise 3: Data Grid Service Navigate to: lexevs.bootcamp.grid.data.exercises.dataservice.GetData GridServiceHandleExercise HINT: Modify the method protected DataServiceHandle getDataGridServiceHandle() so that it instantiates DataServiceHandle using a DataServiceClient.

23 Lesson 3: Hands-On Code Examples Answer 3: Data Grid Service Implemented method: protected static String SERVICE_URL = BootcampConstants.DATA_GRID_SERVICE_URL; protected DataServiceHandle getDataGridServiceHandle() throws Exception { DataServiceClient svc = new DataServiceClient(SERVICE_URL); //Obtain the DataServiceClient with the correct URL return new DataServiceHandle(svc);//Instantiate a DataServiceHandle with the DataServiceClient }

24 Lesson 3: Hands-On Code Examples Search for Coding Scheme Example Overview CqlConcept.java Demonstrates how to connect to the LexEVS Data Grid Service and construct a CQL query to search for a CodingScheme.

25 Lesson 3: Hands-On Code Examples Example 4: Search for Coding Scheme Navigate to: lexevs.bootcamp.grid.data.examples.cql.CqlCodingScheme

26 Lesson 3: Hands-On Code Examples Exercise 4: Search for Coding Scheme Navigate to: lexevs.bootcamp.grid.data.exercises.cql.CqlCodingScheme Exercise HINT: Modify the method protected CQLQuery getCqlQuery () This method should produce a CQLQuery that matches every loaded CodingScheme on the system.

27 Lesson 3: Hands-On Code Examples Answer 4: Search for Coding Scheme Implemented method: @Override protected CQLQuery getCqlQuery() throws Exception { //Create a new CQLQuery CQLQuery query = new CQLQuery(); Object target = new Object(); //set the 'target' to 'CodingScheme' target.setName(CodingScheme.class.getName()); query.setTarget(target); //return the CQLQuery without specifying any //specific Attributes to search for. This will //match all CodingSchemes. return query; }

28 Lesson 3: Hands-On Code Examples Search for Concept Example Overview CqlConcept.java Demonstrates how to connect to the LexEVS Data Grid Service and construct a CQL query to search for a Concept.

29 Lesson 3: Hands-On Code Examples Example 5: Search for Concept Navigate to: lexevs.bootcamp.grid.data.examples.cql.CqlConcept

30 Lesson 3: Hands-On Code Examples Exercise 5: Search for Concept Navigate to: lexevs.bootcamp.grid.data.exercises.cql.CqlConceptExerc ise HINT: Modify the method protected Attribute getAttribute() This method should produces an 'Attribute' that will match a Concept with an 'entityCode that equals 'Muscle'.

31 Lesson 3: Hands-On Code Examples Answer 5: Search for Concept Implemented method: @Override protected Attribute getAttribute() throws Exception { Attribute attribute = new Attribute();//Construct a new 'Attribute' attribute.setName("entityCode");//Set the name to 'entityCode' attribute.setValue("Muscle");//Set the value to 'Muscle' attribute.setPredicate(Predicate.EQUAL_TO);//Specify that it must be 'EQUAL_TO' return attribute; }

32 LexEVS in caGrid Environment Questions?


Download ppt "LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009."

Similar presentations


Ads by Google