GDSF Configuration
This practical shows how to configure OGSA-DAI to
work with a Xindice database on localhost and a MySQL database on a remote host.
When the configuration is complete, it is tested by running a command client.
The client contacts the registry, retrieves a GDSF handle, connects to the GDSF
and requests a GDS to be created. After creating the GDS, it performs a simple
query on the database.
1. Configuration of Xindice database
- Start Xindice
#> cd xml-xindice-1.0
#> ./start
- Now run the database creator to create example data:
- change to the OGSADAI base directory
- set the classpath with setenv.sh
- run the following line
#> java uk.org.ogsadai.client.dbcreate.CreateTestXindiceDB
You
should see the following output: Opening base collection
Creating new collection named 'littleblackbook'
Adding 10000 documents to 'littleblackbook'...
Closing collections.
Done!
This step created a collection called "littleblackbook" below the base
collection, containing 10000 example records.
GDSF configuration for Xindice database
This section describes the
configuration of the GDSF for a MySQL database on localhost.
- Setup the DataResource Configuration file:
- open TOMCAT/webapps/ogsa/WEB-INF/etc/dataResourceConfigXindice.xml
- check the following elements:
- driverManager: the implementation attribute points to the XMLDB data
resource implementation
implementation="uk.org.ogsadai.porttype.gds.dataresource.XMLDBDataResourceImplementation"
- driver: the driverImplementation element contains the xindice driver
class and the driverURI element contains the correct connection URI and
database name
<driverImplementation>org.apache.xindice.client.xmldb.DatabaseImpl</driverImplementation>
<driverURI>xmldb:xindice://localhost:4080/db/littleblackbook>/driverURI>
- roleMap: the implementation attribute points to the
SimpleFileRoleMapper the configuration attribute points to an existing
rolemap file
implementation="uk.org.ogsadai.common.rolemap.SimpleFileRoleMapper"
configuration="TOMCAT/webapps/ogsa/WEB-INF/etc/ExampleDatabaseRoles.xml"
- Setup the rolemap file:
- Setup the parameters in the server-config.wsdd:
- open <TOMCAT>/webapps/ogsa/WEB-INF/server-config.wsdd
- search for the service element with name "GridDataServiceFactoryXindice"
and check that the following parameters are pointing to the correct
configuration files (as created above):
- ogsadai.gdsf.config.xml.file - the
dataResourceConfigXindice.xml file
- ogsadai.gdsf.registrations.xml.file - the
registrationList.xml file
- Start Xindice if it is not running:
#> cd xindice
#> ./start
- Start the container
#> cd tomcat/bin
#> ./startup.sh
- Run the end-to-end client as a test.
#> cd ogsadai
#> ./setenv.sh
#> java uk.org.ogsadai.client.Client -test http://localhost:8080/ogsa/services/ogsadai/DAIServiceGroupRegistry examples/GDSPerform/XMLDB/xpath/queryCollection1.xml
You should the see output as shown below.
GDSF configuration for MySQL database
This section describes the
configuration of the GDSF for a MySQL database on an external host.
- Setup the DataResource Configuration file:
Output:
Perform results:
<gridDataServiceResponse xmlns="http://ogsadai.org.uk/namespaces/2003/07/gds/types"><result name="myActivityOutput" status="COMPLETE"><![CDATA[<resourceSet>
<resource>
<entry id="1" xmlns:src="http://xml.apache.org/xindice/Query" src:col="/db/littleblackbook" src:key="1">
<name>Ally Antonioletti</name>
<address>826 Hume Crescent, Southampton</address>
<phone>01670061244</phone>
</entry>
</resource>
<resource>
<entry id="10" xmlns:src="http://xml.apache.org/xindice/Query" src:col="/db/littleblackbook" src:key="10">
<name>Martin Laws</name>
<address>224 Palansuriya Lane, Winchester</address>
<phone>06686142062</phone>
</entry>
</resource>
....
<entry id="98" xmlns:src="http://xml.apache.org/xindice/Query" src:col="/db/littleblackbook" src:key="98">
<name>Norman Jackson</name>
<address>033 Borley Avenue, San Jose</address>
<phone>03480099767</phone>
</entry>
</resource>
<resource>
<entry id="99" xmlns:src="http://xml.apache.org/xindice/Query" src:col="/db/littleblackbook" src:key="99">
<name>Paul Krause</name>
<address>100 Watson Crescent, Winchester</address>
<phone>01908557297</phone>
</entry>
</resource>
</resourceSet>
]]></result><result name="myActivity" status="COMPLETE"/></gridDataServiceResponse>