Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


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

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

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

3 Session Details: Interacting with LexEVS 5.0 Lesson Syllabus Lesson 1: Overview of Distributed Mode 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 distributed environment.

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 These should already be in place on your workstation. The LexEVS 5.0 local runtime was installed during the local installation lesson. JBoss 4.0.5 GA is required for distributed configuration. Reference files: LexEVS_50_webRuntime_jboss.zip lexevs.properties

6 Lesson 1: Overview of Distributed Mode Reference Files LexEVS_50_webRuntime_jboss.zip Includes war file (lexevsapi50.war) to be deployed to the JBoss server. Available from VKC download. lexevs.properties Used to set LexEVS systems properties. Used to configure security restrictions. Specifies LG_CONFIG_FILE property used to determine the location of the local installation.

7 Lesson 2: Hands-On Installation When you complete this lesson, you will be able to: Download and setup of LexEVS 5.0 for a distributed environment.

8 Lesson 2: Hands-On Installation Install Distributed Components Reference document: installsetupdistributed.doc

9 Lesson 2: Hands-On Installation Review Installation Copy lexevsapi50.war into jboss-4.0.5.GA\server\cacoreDataGrid\deploy directory. Update and copy lexevs.properties file into jboss- 4.0.5.GA/server/cacoreDataGrid/conf directory. Start the JBoss server (startServer1.bat)

10 Lesson 2: Hands-On Installation Verify Installation Use the following link to verify the application has been installed and configured correctly: http://localhost:8080/lexevsapi50/GetHTML?query=org.LexGrid.codin gSchemes.CodingScheme&org.LexGrid.codingSchemes.CodingSch emehttp://localhost:8080/lexevsapi50/GetHTML?query=org.LexGrid.codin gSchemes.CodingScheme&org.LexGrid.codingSchemes.CodingSch eme

11 Lesson 2: Hands-On Installation Verify Installation If successful, all loaded coding schemes will be returned.

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

13 Lesson 3: Hands-On Code Examples Exercises Hands-on code examples are broken down into three categories: Examples Exercises Solutions Code coverage for these examples includes: LexBigService ConnectToDistributedLexBIGService.java DemonstrateProxies.java LexEvsDataService ConnectToDistributedLexEVSDataService.java DetachedCriteriaQuery.java HQLQuery.java QueryByExample.java Extensions GetRegisteredGenericExtensions.java

14 Lesson 3: Hands-On Code Examples Example 1 - Overview ConnectToDistributedLexBIGService.java Demonstrates how to connect to the distributed service. public LexBIGService getDistributedLexBIGService() throws Exception { return (LexBIGService)ApplicationServiceProvider. getApplicationServiceFromUrl(SERVICE_URL, SERVICE_NAME); SERVICE_URL = "http://localhost:8080/lexevsapi50"; SERVICE_NAME = "EvsServiceInfo";

15 Lesson 3: Hands-On Code Examples Example 1 - Example Navigate to: lexevs.bootcamp.distributed.examples.lexbigservice.Conn ectToDistributedLexBIGService.java

16 Lesson 3: Hands-On Code Examples Example 1 - Exercise Navigate to: lexevs.bootcamp.distributed.exercises.lexbigservice.Get LexBIGServiceExercise.java HINT: Modify the method protected LexBIGService getDistributedLexBIGService() so that it instantiates LexBIGService using ApplicationServiceProvider.

17 Lesson 3: Hands-On Code Examples Example 1 - Solution Implemented method: public LexBIGService getDistributedLexBIGService() throws Exception { return (LexBIGService)ApplicationServiceProvider.getApplicatio nServiceFromUrl(SERVICE_URL, SERVICE_NAME); SERVICE_URL = "http://localhost:8080/lexevsapi50"; SERVICE_NAME = "EvsServiceInfo";

18 Lesson 3: Hands-On Code Examples Example 2 - Overview DemonstrateProxies.java Proxies help distributed API calls appear as if they are being called locally on the client. This makes coding from local to distributed very straightforward for the programmer (same API calls used).

19 Lesson 3: Hands-On Code Examples Example 2 - Example Navigate to: lexevs.bootcamp.distributed.examples.lexbigservice.Demo nstrateProxies.java

20 Lesson 3: Hands-On Code Examples Example 3 - Overview ConnectToDistributedLexEVSDataService.java Demonstrates how to connect to the distributed data service. public LexEVSDataService getDistributedLexEVSDataService() throws Exception { return (LexEVSDataService)ApplicationServiceProvider.getApplic ationServiceFromUrl(SERVICE_URL, SERVICE_NAME); SERVICE_URL = "http://localhost:8080/lexevsapi50"; SERVICE_NAME = "EvsServiceInfo";

21 Lesson 3: Hands-On Code Examples Example 3 - Example Navigate to: lexevs.bootcamp.distributed.examples.lexevsdataservice. ConnectToDistributedLexEVSDataService.java

22 Lesson 3: Hands-On Code Examples Example 3 - Exercise Navigate to: lexevs.bootcamp.distributed.exercises.lexevsdataservice.GetLexEVSDataServiceExercise.java Hint: Modify the method public LexEVSDataService getLexEVSDataService() so that it instantiates LexEVSDataService using ApplicationServiceProvider.

23 Lesson 3: Hands-On Code Examples Example 3 - Solution Implemented method: public LexEVSDataService getDistributedLexEVSDataService() throws Exception { return (LexEVSDataService)ApplicationServiceProvider. getApplicationServiceFromUrl(SERVICE_URL, SERVICE_NAME); SERVICE_URL = "http://localhost:8080/lexevsapi50"; SERVICE_NAME = "EvsServiceInfo";

24 Lesson 3: Hands-On Code Examples Example 4 - Overview DetachedCriteriaQuery.java Demonstrates how to query content using Hibernate Criteria Queries by creating a query outside the scope of a session and then executing it using an arbitrary session. The query is against a particular persistent class. protected DetachedCriteria buildDetachedCriteria() throws Exception { DetachedCriteria dc = DetachedCriteria.forClass(Concept.class); SimpleExpression restriction = Restrictions.like("_entityCode", "%Heart%"); dc.add(restriction); return dc; }

25 Lesson 3: Hands-On Code Examples Example 4 - Example Navigate to: lexevs.bootcamp.distributed.examples.lexevsdataservice. DetachedCriteriaQuery.java

26 Lesson 3: Hands-On Code Examples Example 4 - Exercise Navigate to: lexevs.bootcamp.distributed.exercises.lexevsdataservice.DetatchedCriteriaExercise.java Hint: Modify the method protected DetachedCriteria buildDetachedCriteria() so that it specifies the following detached criteria for the query. Class: Concept Term: ‘Bone’

27 Lesson 3: Hands-On Code Examples Example 4 - Solution Implemented method: protected DetachedCriteria buildDetachedCriteria() throws Exception { DetachedCriteria dc = DetachedCriteria.forClass(Concept.class); SimpleExpression restriction = Restrictions.eq("_entityCode", "Bone"); dc.add(restriction); return dc; }

28 Lesson 3: Hands-On Code Examples Example 5 - Overview HQLQuery.java Demonstrates how to query content using Hibernate Query Language (HQL). HQL is a powerful query language that is similar in appearance to SQL. public void runExample() throws Exception { LexEVSDataService lbds = getCaCoreService(); HQLCriteria hql = buildHqlQuery(); List concepts = lbds.query(hql); for(Concept concept : concepts){ PrintUtility.print(concept); } protected HQLCriteria buildHqlQuery() throws Exception { return new HQLCriteria("FROM org.LexGrid.concepts.Concept " + "as concept where concept._entityCode like '%ear%'"); }

29 Lesson 3: Hands-On Code Examples Example 5 - Example Navigate to: lexevs.bootcamp.distributed.examples.lexevsdataservice. HQLQuery.java

30 Lesson 3: Hands-On Code Examples Example 5 - Exercise Navigate to: lexevs.bootcamp.distributed.exercises.lexevsdataservice.HQLExercise.java Hint: Modify the method protected HQLCriteria buildHqlQuery() so that it specifies the following criteria for the query. Object: org.LexGrid.concepts.Concept Term: ‘Heart_Part’

31 Lesson 3: Hands-On Code Examples Example 5 - Solution Implemented method: protected HQLCriteria buildHqlQuery() throws Exception { return new HQLCriteria("FROM org.LexGrid.concepts.Concept " + "as concept where concept._entityCode = 'Heart_Part'"); }

32 Lesson 3: Hands-On Code Examples Example 6 - Overview QueryByExample.java Demonstrates how to utilize query-by-example. public void runExample() throws Exception { LexEVSDataService lbds = super.getCaCoreService(); Object qbeObect = buildQueryByExampleObject(); List concepts = lbds.search(qbeObect.getClass(), qbeObect); for(Concept concept : concepts){ PrintUtility.print(concept); } private Object buildQueryByExampleObject(){ Concept concept = new Concept(); concept.setEntityCode("Muscle"); return concept; }

33 Lesson 3: Hands-On Code Examples Example 6 - Example Navigate to: lexevs.bootcamp.distributed.examples.lexevsdataservice. QueryByExample.java

34 Lesson 3: Hands-On Code Examples Example 6 - Exercise Navigate to: lexevs.bootcamp.distributed.exercises.lexevsdataservice.QueryByExampleExercise.java Hint: Modify the method protected Object buildQueryByExampleObject() so that it specifies the following criteria for the query. Concept Entity Code ‘Heart_Part’

35 Lesson 3: Hands-On Code Examples Example 6 - Solution Implemented method: protected Object buildQueryByExampleObject() throws Exception { Concept concept = new Concept(); oncept.setEntityCode("Heart_Part"); return concept; }

36 Lesson 3: Hands-On Code Examples Example 7 - Overview GetRegisteredGenericExtensions.java Demonstrates that extensions that are available in the local environment are also available in distributed.

37 Lesson 3: Hands-On Code Examples Example 7 - Example Navigate to: lexevs.bootcamp.distributed.examples.extension.GetRegis teredGenericExtensions.java

38 Lesson 3: Hands-On Examples Resources Hibernate Query Language http://docs.jboss.org/hibernate/core/3.3/reference/en/html/queryhql.html Detatched Criteria Queries http://docs.jboss.org/hibernate/core/3.3/reference/en/html/querycriteria.html http://docs.jboss.org/hibernate/core/3.3/reference/en/html/querycriteria.html# querycriteria-detachedqueries

39 Lesson 3: Hands-On Examples Questions?


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

Similar presentations


Ads by Google