How to Write an XML Data Resource Configuration Document
To write a data resource configuration document to expose an XMLDB
data resource:
-
Copy the following XML document:
<?xml version="1.0" encoding="UTF-8"?>
<dataResourceConfig
xmlns="http://ogsadai.org.uk/namespaces/2005/10/config">
<documentation>
MY-COMMENTS
</documentation>
<metaData>
<productInfo>
<productName>PRODUCT</productName>
<productVersion>VERSION</productVersion>
<vendorName>VENDOR</vendorName>
</productInfo>
<xmlMetaData>
<collectionSchema callback="uk.org.ogsadai.dataresource.SimpleXMLDBMetaDataExtractor"/>
</xmlMetaData>
CUSTOM-METADATA
</metaData>
<roleMap name="Name"
implementation="uk.org.ogsadai.common.rolemap.SimpleFileRoleMapper"
configuration="ROLE-MAP-FILE"/>
<dataResource>
<driver implementation="DATABASE-DRIVER">
<uri>DATABASE-URI</uri>
</driver>
</dataResource>
</dataResourceConfig>
-
Optionally, replace MY-COMMENTS with some
suitable text describing your data resource, or just remove it.
-
Replace PRODUCT with the name of your data
resource e.g. eXist.
-
Replace VERSION with the version of your data
resource e.g. 1.0.
-
Replace VENDOR with the vendor of your data
resource e.g. Sourceforge.
-
Optionally, replace CUSTOM-METADATA with some
suitable XML describing your data resource, or just remove it.
Any custom metadata element that is a direct child of the
<metadata> element will be published as a
data resource property by the service and can be accessed by clients.
The data resource property can be accessed by the name of the element.
For example,
<databaseName>
My database name
</databaseName>
will be published as data resource property under the name
{http://ogsadai.org.uk/namespaces/2005/10/properties}databaseName
and the value My database name.
-
Replace ROLE-MAP-FILE with the relative
or absolute location of a
role map file consistent with the OGSA-DAI role map document format
(which is described later in this guide).
Relative pathnames will be resolved against the home directory of the web application of a Web services hosting container, for example
CONTAINER/webapps/axis or
CONTAINER/webapps/wsrf.
-
Replace DATABASE-DRIVER with a Java database
driver class names. We have already given an overview of
recommended XML database drivers.
-
Replace DATABASE-URI with the driver-specific
URI of your data resource. For example:
- For eXist xmldb:exist://localhost:8080/exist/xmlrpc/db/littleblackbook