uk.co.lakesidetech.springxmldb.dao
Class BaseXQueryXMLDBDao

java.lang.Object
  extended byuk.co.lakesidetech.springxmldb.dao.AbstractXMLDBDao
      extended byuk.co.lakesidetech.springxmldb.dao.BaseXQueryXMLDBDao
All Implemented Interfaces:
IXQueryXMLDBDao
Direct Known Subclasses:
BaseExistXQueryXMLDBDao

public class BaseXQueryXMLDBDao
extends AbstractXMLDBDao
implements IXQueryXMLDBDao

Implementation of IXQueryXMLDBDao using XML:DB apis to be reusable across any XML database which supports a pure XML:DB api. Currently Xindice doesnt support XQuery so dont attempt to use this with Xindice.

Author:
Stuart Eccles

Field Summary
protected static java.lang.String XQUERYSERVICE_NAME
           
protected static java.lang.String XQUERYSERVICE_VERSION
           
 
Fields inherited from class uk.co.lakesidetech.springxmldb.dao.AbstractXMLDBDao
dataSource, RESOURCETYPE_XMLRESOURCE, XPATHQUERYSERVICE_NAME, XPATHQUERYSERVICE_VERSION, XUPDATEQUERYSERVICE_NAME, XUPDATEQUERYSERVICE_VERSION
 
Constructor Summary
BaseXQueryXMLDBDao()
           
 
Method Summary
protected  org.xmldb.api.modules.XQueryService getXQueryServiceFromCollection(org.xmldb.api.base.Collection collection)
          Return a XML:DB IXQueryXMLDBDao for a given collection
 java.util.Map queryWithXQueryCollectionAsString(java.lang.String xQuery, java.lang.String collectionPath)
          Query a collection with XQuery and return a map of results with keys of the resource IDs and values of String xml of the results (not necessarily the resource documents, but the result of the query)
 java.util.Map queryWithXQueryCollectionAsString(java.lang.String xQuery, java.lang.String collectionPath, java.util.Map variables)
          Query a collection with XQuery and return a map of results with keys of the resource IDs and values of String xml of the results (not necessarily the resource documents, but the result of the query).
 
Methods inherited from class uk.co.lakesidetech.springxmldb.dao.AbstractXMLDBDao
getDataSource, getNameSpaces, getXPathQueryServiceFromCollection, getXUpdateServiceFromCollection, processResourceSetToDocuments, processResourceSetToStrings, setDataSource, setNameSpaces
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XQUERYSERVICE_VERSION

protected static final java.lang.String XQUERYSERVICE_VERSION
See Also:
Constant Field Values

XQUERYSERVICE_NAME

protected static final java.lang.String XQUERYSERVICE_NAME
See Also:
Constant Field Values
Constructor Detail

BaseXQueryXMLDBDao

public BaseXQueryXMLDBDao()
Method Detail

getXQueryServiceFromCollection

protected org.xmldb.api.modules.XQueryService getXQueryServiceFromCollection(org.xmldb.api.base.Collection collection)
                                                                      throws org.xmldb.api.base.XMLDBException
Return a XML:DB IXQueryXMLDBDao for a given collection

Parameters:
collection - the collection to find a service for
Returns:
Throws:
org.xmldb.api.base.XMLDBException

queryWithXQueryCollectionAsString

public java.util.Map queryWithXQueryCollectionAsString(java.lang.String xQuery,
                                                       java.lang.String collectionPath)
                                                throws XMLDBDataAccessException
Description copied from interface: IXQueryXMLDBDao
Query a collection with XQuery and return a map of results with keys of the resource IDs and values of String xml of the results (not necessarily the resource documents, but the result of the query)

Specified by:
queryWithXQueryCollectionAsString in interface IXQueryXMLDBDao
Parameters:
xQuery -
collectionPath -
Returns:
Throws:
XMLDBDataAccessException
See Also:
IXQueryXMLDBDao.queryWithXQueryCollectionAsString(java.lang.String, java.lang.String)

queryWithXQueryCollectionAsString

public java.util.Map queryWithXQueryCollectionAsString(java.lang.String xQuery,
                                                       java.lang.String collectionPath,
                                                       java.util.Map variables)
                                                throws XMLDBDataAccessException
Description copied from interface: IXQueryXMLDBDao
Query a collection with XQuery and return a map of results with keys of the resource IDs and values of String xml of the results (not necessarily the resource documents, but the result of the query). Add a list of variables to the query which can then be used in the query syntax as a replacement.

Specified by:
queryWithXQueryCollectionAsString in interface IXQueryXMLDBDao
Parameters:
xQuery -
collectionPath -
variables -
Returns:
Throws:
XMLDBDataAccessException
See Also:
IXQueryXMLDBDao.queryWithXQueryCollectionAsString(java.lang.String, java.lang.String, java.util.Map)