|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.client.toolkit.activity.RequestComponent | +--uk.org.ogsadai.client.toolkit.activity.Activity | +--uk.org.ogsadai.client.toolkit.activity.xmldb.XPathQuery
This activity queries a resource/collection exposed by an XMLDB data service resource using an XPath expression.
It has no input and one output - the query result in XML. The format of the output is OGSA-DAI specific XML. For example:
<resourceSet>
<resource>
<someMatchingResource
xmlns:src="http://xml.apache.org/xindice/Query"
src:col="someCollection" src:key="someKey">
<someElt name="someAttribute"/>
<someElt name="someAttribute"/>
</someMatchingResource>
</resource>
</resourceSet>
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
Copyright statement |
private java.lang.String |
mCollectionName
Name of collection to query |
private java.lang.String |
mExpression
XPath expression |
private java.util.Map |
mNamespaces
Namespace bindings used in the XPath expression |
private java.lang.String |
mResourceName
Name of resource to query |
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.Activity |
|
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent |
|
Constructor Summary | |
XPathQuery()
Constructs an XPath query request. |
|
XPathQuery(java.lang.String expression)
Constructs a request to query a resource/collection using XPath. |
Method Summary | |
protected java.lang.String |
generateXML()
Generates the XML representing the activity. |
ActivityOutput |
getOutput()
Gets the activity's only output - the XPath query result. |
org.xmldb.api.base.ResourceSet |
getResourceSet()
Get the results of the query as a ResourceSet . |
void |
setCollectionName(java.lang.String collectionName)
Set the collection name. |
void |
setExpression(java.lang.String expression)
Set the XPath expression. |
void |
setNamespaceBinding(java.lang.String prefix,
java.lang.String url)
Add a binding from a namespace prefix used within the XPath query to a namespace URL. |
void |
setNamespaceBindings(java.util.Map bindings)
Add a collection of bindings from namespace prefixes used within the XPath query to namespace URLs. |
void |
setResourceName(java.lang.String resourceName)
Set the resource name. |
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.Activity |
addInput, addOutput, addOutputs, getDataResourceID, getInputParameters, getOutputParameters, getOutputs, replaceSpecialCharacters, setDataResourceID, setInput |
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent |
getDataService, getName, getSession, setDataService, setSession |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private java.lang.String mExpression
private java.lang.String mResourceName
private java.lang.String mCollectionName
private java.util.Map mNamespaces
Constructor Detail |
public XPathQuery()
setExpression
All resources in the base collection and its sub-collections
will be queried.
public XPathQuery(java.lang.String expression)
expression
- XPath query expression.
java.lang.IllegalArgumentException
- If expression
is null
Method Detail |
public void setExpression(java.lang.String expression)
expression
- XPath query expression.
java.lang.IllegalArgumentException
- If expression
is null
public void setResourceName(java.lang.String resourceName)
null
then the query
will be executed on all the resources in the selected
collection.
resourceName
- The name of the resource or null
.public void setCollectionName(java.lang.String collectionName)
null
then the query
will be executed within the base collection.
collectionName
- The name of the collection or null
.public void setNamespaceBinding(java.lang.String prefix, java.lang.String url)
prefix
- A namespace prefix.url
- A legal URL e.g. http://www.org/test
java.lang.IllegalArgumentException
- If prefix
or url
are
null
or url
is not a legal URL.public void setNamespaceBindings(java.util.Map bindings)
bindings
- A collection of mappings from prefix strings to URL strings.
java.lang.IllegalArgumentException
- If bindings
is null
or contains
entries whose prefix or URL are null
or
whose URLs are not legal.If prefix
or url
are
null
or url
is not a legal URL.
public ActivityOutput getOutput()
public org.xmldb.api.base.ResourceSet getResourceSet() throws NoActivityOutputException, DataFormatException
ResourceSet
.
ResourceSet
.
NoActivityOutputException
- if there is no output data or the data has not yet been
processed to this output or the activity that generates
this output has not yet been executed.
DataFormatException
- if the output from the activity cannot be parsed into a
ResourceSet
.protected java.lang.String generateXML()
RequestComponent
generateXML
in class Activity
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |