uk.co.lakesidetech.springxmldb.spring
Interface IXMLDBFacade

All Known Implementing Classes:
CachingXMLDBFacade, SimpleXMLDBFacade

public interface IXMLDBFacade

The IXMLDBFacade defines the implementation of a facade to XML database data access layer providing simple methods to the base web controllers and tiles components

Author:
Stuart Eccles

Method Summary
 java.lang.String insertUpdateXMLDocument(java.lang.String xmlDocument, java.lang.String docID, java.lang.String collectionPath)
          insert or update a String xml document
 org.w3c.dom.Node queryResourceWithXPathCollectionAsString(java.lang.String resourceId, java.lang.String xPathQuery, java.lang.String collectionPath)
          query a specific resource with xpath
 org.w3c.dom.Node queryWithXPathCollectionAsString(java.lang.String xPathQuery, java.lang.String collectionPath)
          query a collection with xpath
 org.w3c.dom.Node queryWithXPathCollectionAsString(java.lang.String xPathQuery, java.lang.String collectionPath, int noResults)
          query a collection with xpath and limit the number of results obtained
 org.w3c.dom.Node queryWithXQueryCollectionAsString(java.lang.String xQuery, java.lang.String collectionPath)
          query a collection with an XQuery
 org.w3c.dom.Node queryWithXQueryCollectionAsString(java.lang.String xQuery, java.lang.String collectionPath, int noResults)
          query a collection with XQuery and limit to a number of results to return
 org.w3c.dom.Node queryWithXQueryCollectionAsString(java.lang.String xQuery, java.lang.String collectionPath, java.util.Map variables)
          query a collection with XQuery using a map of subsitiution parameters in the xquery
 org.w3c.dom.Node queryWithXQueryCollectionAsString(java.lang.String xQuery, java.lang.String collectionPath, java.util.Map variables, int noResults)
          query a collection with XQuery using a map of subsitiution parameters in the xquery.
 boolean removeDocument(java.lang.String docID, java.lang.String collectionPath)
          remove a document from the xml database
 org.xmldb.api.base.Resource retrieveDocumentAsResource(java.lang.String docID, java.lang.String collectionPath)
          Retrieve a XML:DB Resource object which could a XML or binary document
 java.lang.String retrieveDocumentAsString(java.lang.String docID, java.lang.String collectionPath)
          Retrieve a XML document as a String given the document id and collection path
 void xupdateCollection(java.lang.String xupdate, java.lang.String collectionPath)
          run an xupdate command on an collection in the xml database
 void xupdateXMLDocument(java.lang.String xupdate, java.lang.String docID, java.lang.String collectionPath)
          run an xupdate command on an XML document
 

Method Detail

xupdateXMLDocument

public void xupdateXMLDocument(java.lang.String xupdate,
                               java.lang.String docID,
                               java.lang.String collectionPath)
run an xupdate command on an XML document

Parameters:
xupdate - the String representation of xupdate commands
docID - the document id to insert or update under
collectionPath - the collection path to insert or update the document in
Returns:
the id of the document

xupdateCollection

public void xupdateCollection(java.lang.String xupdate,
                              java.lang.String collectionPath)
run an xupdate command on an collection in the xml database

Parameters:
xupdate - the String representation of xupdate command
collectionPath - the collection path to insert or update the document in
Returns:
the id of the document

insertUpdateXMLDocument

public java.lang.String insertUpdateXMLDocument(java.lang.String xmlDocument,
                                                java.lang.String docID,
                                                java.lang.String collectionPath)
insert or update a String xml document

Parameters:
xmlDocument - the String representation of xml document
docID - the document id to insert or update under
collectionPath - the collection path to insert or update the document in
Returns:
the id of the document

removeDocument

public boolean removeDocument(java.lang.String docID,
                              java.lang.String collectionPath)
remove a document from the xml database

Parameters:
docID - the id of the document to remove
collectionPath - the collection path the document is in
Returns:
true if deleted

retrieveDocumentAsString

public java.lang.String retrieveDocumentAsString(java.lang.String docID,
                                                 java.lang.String collectionPath)
Retrieve a XML document as a String given the document id and collection path

Parameters:
docID - the id of the document to retrieve
collectionPath - the collection the document is under
Returns:
A String XML document

retrieveDocumentAsResource

public org.xmldb.api.base.Resource retrieveDocumentAsResource(java.lang.String docID,
                                                              java.lang.String collectionPath)
Retrieve a XML:DB Resource object which could a XML or binary document

Parameters:
docID - the resource id to retrieve
collectionPath - the collection the resource is under
Returns:
the XML:DB resource

queryWithXPathCollectionAsString

public org.w3c.dom.Node queryWithXPathCollectionAsString(java.lang.String xPathQuery,
                                                         java.lang.String collectionPath)
                                                  throws XMLParsingException
query a collection with xpath

Parameters:
xPathQuery - the xpath query
collectionPath - the collection path to query
Returns:
a map of resource ids and results
Throws:
XMLParsingException

queryWithXPathCollectionAsString

public org.w3c.dom.Node queryWithXPathCollectionAsString(java.lang.String xPathQuery,
                                                         java.lang.String collectionPath,
                                                         int noResults)
                                                  throws XMLParsingException
query a collection with xpath and limit the number of results obtained

Parameters:
xPathQuery - the xpath query
collectionPath - the colleciton path to query
noResults - the max number of results to return. 0 will return all
Returns:
a map of resource ids and results
Throws:
XMLParsingException

queryResourceWithXPathCollectionAsString

public org.w3c.dom.Node queryResourceWithXPathCollectionAsString(java.lang.String resourceId,
                                                                 java.lang.String xPathQuery,
                                                                 java.lang.String collectionPath)
                                                          throws XMLParsingException
query a specific resource with xpath

Parameters:
resourceId - the resource id to query
xPathQuery - the xpath query
collectionPath - the collection path the resource is in
Returns:
a map of resource ids and results
Throws:
XMLParsingException

queryWithXQueryCollectionAsString

public org.w3c.dom.Node queryWithXQueryCollectionAsString(java.lang.String xQuery,
                                                          java.lang.String collectionPath)
                                                   throws XMLParsingException
query a collection with an XQuery

Parameters:
xQuery - the xquery to use
collectionPath - the collection to query
Returns:
a map of resource ids and results
Throws:
XMLParsingException

queryWithXQueryCollectionAsString

public org.w3c.dom.Node queryWithXQueryCollectionAsString(java.lang.String xQuery,
                                                          java.lang.String collectionPath,
                                                          int noResults)
                                                   throws XMLParsingException
query a collection with XQuery and limit to a number of results to return

Parameters:
xQuery - the xquery to use
collectionPath - the collection to query
noResults - the max number of results to return. 0 will return all
Returns:
Throws:
XMLParsingException

queryWithXQueryCollectionAsString

public org.w3c.dom.Node queryWithXQueryCollectionAsString(java.lang.String xQuery,
                                                          java.lang.String collectionPath,
                                                          java.util.Map variables)
                                                   throws XMLParsingException
query a collection with XQuery using a map of subsitiution parameters in the xquery

Parameters:
xQuery - teh xquery to use
collectionPath - the collection to query
variables - map of variables which can be used for substitution in the query
Returns:
a map of resource ids and results
Throws:
XMLParsingException

queryWithXQueryCollectionAsString

public org.w3c.dom.Node queryWithXQueryCollectionAsString(java.lang.String xQuery,
                                                          java.lang.String collectionPath,
                                                          java.util.Map variables,
                                                          int noResults)
                                                   throws XMLParsingException
query a collection with XQuery using a map of subsitiution parameters in the xquery. limited to a max number of resuls

Parameters:
xQuery - teh xquery to use
collectionPath - the collection to query
variables - map of variables which can be used for substitution in the query
noResults - max results to return. 0 will return all.
Returns:
a map of resource ids and results
Throws:
XMLParsingException