Prerequisites

Make sure that you have the following on a machine that has a public IP Address/Domain Name

Generate Domain Model

All caGrid data services are required to expose a domain model in their service metadata. This domain model describes the classes available in the data service, as well as their attributes, and relationships to one another. Using this model, a client can formulate queries, and discover data services which contain information they may be interested in. Additionally, the data service itself can use this information to validate queries for their correctness and map domain objects to their XML document representations. Models may be supplied from the caDSR, or from the local file system.

To create a domain model for our person object model, do the following:

cd $CAGRID_LOCATION/projects/dataExtensions

ant xmiToDomainModel
  1. Browse to the UML object model file created with ArgoUML (SDKArgoPeople.uml) in part 1 of this tutorial
  2. Select XMI Type as SDK 4.0 XMI from ArgoUML

source:exp/sds/exp1/images/sds13/GenDmnMdl-Def.png

  1. Type in a project short name and version
  2. Click OK
  3. Choose a location to save your domain model and type in a name along with the .xml file extension

source:exp/sds/exp1/images/sds13/GenDmnMdl-Sv.png

Define the Service

  1. Launch Introduce
    cd $CAGRID_LOCATION
    
    ant introduce
    
  2. Select Create caGrid Service Skeleton from the toolbar at the top of the Introduce portal, or select Tools -> Create caBIG Service from the menu. The Create caBIG Grid Service screen will appear.
  3. Choose a directory in which to place the generated service, for eg., /home/user/Person
  4. Type in the Service Name as Person
  5. Type the Package Name as edu.uab.uabgrid.cacoresdk.domain, same as in step 4 of part 1
  6. The Namespace will be auto-filled from the package and service names
  7. Select the Data Service radio button from the Customize Service section.
  8. Click Create

source:exp/sds/exp1/images/sds13/SvcSkel-Define.png

Configure Data Service

The caGrid data services extension provides a pluggable framework for creating highly custom data services known as data service styles. Styles may be provided by a third party, or installed with caGrid. Styles are provided to create data services backed by various caCORE SDK.

Select Service Style

When the data service configuration window appears,

  1. Select the service style as caCORE SDK 4.1
  2. Leave the rest unchecked
  3. Click OK

source:exp/sds/exp1/images/sds13/SvcSkel-SvcStyle.png

Configure Service

  1. When the following panel appears, Browse to the location where you've installed caCORE SDK-4.1. The wizard reads this directory and auto-locates the relevant files and properties defined inside

source:exp/sds/exp1/images/sds13/SvcSkel-Config1.png

  1. Click Next->API Type

Configure Security

  1. Select API Type as Remote API
  2. Type in your machine's Hostname (either FQDN/IP address)
  3. Type in the Port Number to which your tomcat is configured to (default will be 8080)

source:exp/sds/exp1/images/sds13/SvcSkel-Config2.png

  1. Click Next: Login. Since this is a simple data service, we have not enabled security when generating the object model with caCORESDK. So, we can skip this step.
  2. Click Next: Domain Model

Configure Domain Model

  1. For Domain Model Source, from the pull-down menu select Pre-Generated
  2. Browse to the Model Filename saved in step 6 of the Generate Domain Model

source:exp/sds/exp1/images/sds13/SvcSkel-Config3.png

  1. Click Next: Schemas

Map Package to Schema

  1. Every class exposed by the domain model must be supplied with a corresponding XML schema representation so it may be utilized in the grid. The mapping panel of this wizard streamlines this process by simultaneously generating the mapping from model to schema and configuring serialization of the XML data types to correspond to the domain model's Java beans.

source:exp/sds/exp1/images/sds13/SvcSkel-SchMap1.png

  1. Packages from the domain model are listed, along with a suggested XML schema namespace, a mapping status, and a button to manually resolve the mapping for each package. This panel contains two buttons which serve as convenience methods for mapping a large batch of packages to their schemas. The 'Map From GME' button attempts to locate the suggested namespaces in the Global Model Exchange service and pull the corresponding schemas. The 'Map From Config' button makes use of the XML schemas provided by the caCORE SDK's output to map to each package of the domain model.
  2. Click Automatically Map From SDK Generated Schemas
  3. If this operation succeeds, the mapping status of each package will change from 'No Schema Assigned' to 'OK', and the 'Done' button will be enabled.

source:exp/sds/exp1/images/sds13/SvcSkel-SchMap2.png

  1. Click the Done button

Deploy the Data Service

Continue to deploy the introduce created data service to tomcat

References

caGrid Tutorials