Activity - xmlResourceManagement
Activity Type: XML
Description
Run resource management operations on XMLDB data resources. In an
XMLDB a resource is an XML document. The following operations are
supported:
- Create new resources.
- Remove existing resources.
- List existing resources.
Examples
<xmlResourceManagement name="statement">
<collection>musicians/folksingers</collection>
<createResource name="newResource">
<entry xmlns="http://folksingers/contact-details">
<name>Smithers-Jones</name>
<address>12 Mill Hill East, London</address>
<phone>02636328605</phone>
</entry>
</createResource>
<outputStream name="statementOutput"/>
</xmlResourceManagement>
<xmlResourceManagement name="statement">
<createResource name="newResource" from="someActivityOutput"/>
<outputStream name="statementOutput"/>
</xmlResourceManagement>
<xmlResourceManagement name="statement">
<removeResource name="someResource"/>
<outputStream name="statementOutput"/>
</xmlResourceManagement>
<xmlResourceManagement name="statement">
<listResources/>
<outputStream name="statementOutput"/>
</xmlResourceManagement>
Specification
Element xmlResourceManagement:
-
Attribute name - unique name for the
activity.
-
Element collection (zero or one) - contains
the name of the collection that the operations will be performed within.
-
Relative to the data resource's base collection.
-
For example, if a data resource is configured for the db/littleblackbook collection then the first
example would perform the operations on the db/littleblackbook/musicians/folksingers collection.
-
If this element is omitted then the operations will be performed
on the base collection for the data resource, e.g. for the second to
fourth examples, db/littleblackbook.
-
One of three operation elements:
-
Element createResource - create a new
resource:
-
Attribute name - name of the new resource. If
omitted then a new name will be generated automatically.
-
Either an attribute specifying where to find the resource content or
the resource content itself:
-
XML content for the new resource e.g. the first example above.
-
Attribute from - name of an input stream
providing the contents of the new resource e.g. the
second example above.
-
Element listResources - list the resources in
the current collection.
-
Element removeCollection - remove an existing
resource.
-
Attribute name - name of the resource to
remove.
-
outputStream (required) - output
stream.
-
Attribute name - name of the activity's output
stream.
XML Schema
OGSA-DAI/schema/ogsadai/xsd/activities/xml_resource_management.xsd
Implementation
OGSA-DAI/src/java/activities/uk/org/ogsadai/activity/xmldb/XMLResourceManagementActivity.java