Content starts here Generate a Mediator Client JAR File
This page last changed on Feb 26, 2008.

eDocs Home > BEA AquaLogic Data Services Platform Documentation > Data Services Developer's Guide > Contents

How To Generate a Mediator Client JAR File

To use the Static Mediator API in a client application, you must generate a Mediator Client JAR file. This JAR file contains the Static Mediator API interfaces, plus all the necessary SDO-compiled schemas for a dataspace.

One Java method is generated for each mapped data service operation. Method names match the mapped data service operation names. Client developers access data service operations by calling these methods.

This section explains how to generate a Mediator Client JAR by these two methods:

Tip: You can also generate a Mediator Client JAR using the Administration Console. See the ALDSP Adminstration Guide for details.

Using the IDE

To generate a mediator client JAR file using the IDE:

  1. Select File > Export.
  2. In the Export dialog, select AquaLogic Data Services Platform > Mediator Client JAR File.
  3. Click Next.
  4. Complete the Mediator Client JAR File dialog as follows:
  • Select a Dataspace project to export. You can only select one Dataspace  project at a time.
  • Specify a directory in which to place the exported JAR file. You can use the drop down list to select a recently specified directory or use the Browse button to locate one.
  • Unselect the Use default name checkbox if you want to enter a name for the JAR file.
  • Click Finish to create the JAR file.
    The ALDSP Console view displays the export task status and any errors that may have occurred. You can click the Cancel button to cancel the export task before it has completed.

Using the Command-Line Tool

This section explains how to generate a Mediator Client JAR file using the command-line tool. Before using the command-line tool, be sure you have the following:

  • WSL 9.2 MP1 or MP2 installed with ALDSP installed in the default location BEA_HOME/aldsp_3.0.
  • A Dataspace project on your local filesystem that contains data service (.ds) and schema (.xsd) files. Miscellaneous IDE files within the project folder are allowed and will not affect the export.
  • Ant installed and in your path.

To generate the client JAR, use this Ant command:

ant -Dapproot=PROJECT_HOME -f BEA_HOME/aldsp_3.0/bin/sdo_dspclientgen.xml

where PROJECT_HOME is the full path to the Data Space project's root folder, and BEA_HOME is the root path for your WebLogic installation.

For example (all on one line):

ant -Dapproot=/home/myprojects/myapp -f /home/bea/aldsp_3.0/bin/sdo_dspclientgen.xml

This Ant script produces a file named PROJECTNAME-dsp-client.jar in PROJECT_HOME, where PROJECTNAME is the name of the directory PROJECT_HOME (as opposed to the full path to that directory). For example, the above script produces the Mediator Client JAR file:

/home/myprojects/myapp/myapp-dsp-client.jar.

Optional command-line features include:

  • Your environment must contain a WL_HOME environment variable, pointing to the WLS 9.2 installation. If it does not, you can provide an alternate by adding -Dwl.home=/path to specify the WLS root directory.
  • Your ALDSP 3.0 installation must be in the default directory BEA_HOME/aldsp_3.0. If it is not, you can provide an alternate by adding -Ddsp.home=/path to specify the directory.
  • To specify a full directory path for the output, add -Doutdir=/dirpath to the Ant command. You must provide an absolute path; a relative path, including ".", will not work, as it is assumed to be relative to PROJECT_HOME.
  • To specify a different name for the JAR file, add -Dsdojarname=name.jar.
Document generated by Confluence on Apr 28, 2008 15:57