DOMWrapper
Keywords: uk.ac.bbk.dcs.automed.xml.wrappers.DOMWrapper class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## uk.ac.bbk.dcs.automed.xml.wrappers
Class DOMWrapper

    java.lang.Object
      uk.ac.ic.doc.automed.wrappers.AutoMedWrapper
          uk.ac.bbk.dcs.automed.xml.wrappers.XMLWrapper
              uk.ac.bbk.dcs.automed.xml.wrappers.DOMWrapper

    public class DOMWrapper

extends XMLWrapper

A lower level wrapper that conforms to the XMLWrapper class. The DOMWrapper class uses XPath and DOM. The DOMWrapper holds both the schema and the instance documents in memory.

Author:
  Lucas Zamboulis

Field Summary

Fields inherited from class uk.ac.bbk.dcs.automed.xml.wrappers.XMLWrapper
`logger, resultList, schemaDoc, schemaUIDDoc`

Fields inherited from class uk.ac.ic.doc.automed.wrappers.AutoMedWrapper
`am, awf, debug, driver, emptyKeyProtection, emptyKeys, optionKeyProtection, optionKeys, password, s, url, username`

Constructor Summary
`DOMWrapper(AccessMethod am, java.lang.String password)`

Method Summary
`protected ASG` | `compositeQuery(ASG query)`
`protected ASG` | `elementAttributeQuery(java.lang.String elementCID, java.lang.String attributeName)`
`protected ASG` | `elementElementQuery(java.lang.String searchNode1, java.lang.String searchNode2, int order)` Nodes are compared based on elementName:count, not their whole UID
`protected ASG` | `elementPCDataQuery(java.lang.String element, int order)`
`protected ASG` | `elementQuery(java.lang.String elemCID)`
`protected AutoMedWrapperFactory` | `getDefaultWrapperFactory()` Returns a new instance of the default wrapper factory for this wrapper
`org.w3c.dom.Document` | `getInputDoc()`
`java.lang.String` | `getProtocolName()` The name of the `Protocol` that this wrapper uses
`QueryParser` | `getQueryParser(ASG query)` Return a parser that will accept queries for the wrapper.
`boolean` | `insertIQL(ASG q)` Execute an IQL insert on the datasource.
`protected ASG` | `textQuery()`

Methods inherited from class uk.ac.bbk.dcs.automed.xml.wrappers.XMLWrapper
`assignCIDs, connect, elementElementQuery, elementPCDataQuery, executeIQL, executeLocalQuery, executeXMLQuery, getSchemaDoc, getSchemaName, getSchemaUIDDoc, getSODefinition, getURI, getXMLDSS, initialiseWrapper, newAutoMedWrapper, selectNewAutoMedWrapper, xpathForAttributeQuery, xpathForElementQuery, xpathForTextQuery`

Methods inherited from class uk.ac.ic.doc.automed.wrappers.AutoMedWrapper
`atDebugLevel, cacheWrapper, deleteIQL, executeIQL, getAccessMethod, getAutoMedWrapper, getAutoMedWrapper, getAutoMedWrapperFactory, getDrivers, getOption, getOptionKeyProtection, getOptionKeys, getProtocol, getQueryCache, getQueryCache, getSchema, getSchema, getSODefinition, newAutoMedSchema, newAutoMedWrapper, newAutoMedWrapper, registerWrapper, selectNewAutoMedWrapper, setDebugLevel, setOption, updateCache`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DOMWrapper

    public DOMWrapper(AccessMethod am,
                      java.lang.String password)
               throws DataSourceException,
                      XMLNotFoundException,
                      IntegrityException

Throws:
  `DataSourceException`
  `XMLNotFoundException`
  `IntegrityException`

Method Detail

### getQueryParser

    public QueryParser getQueryParser(ASG query)

  Description copied from class: `AutoMedWrapper`
  Return a parser that will accept queries for the wrapper. The default parser is `Schemes`, which accepts only single schemes, with no other IQL operators supported. The `SimpleComp` parser will allow simple list comprehensions to be passed to the wrapper.

  Overrides:
    `getQueryParser` in class `AutoMedWrapper`

### textQuery

    protected final ASG textQuery()
                           throws TranslationException

  Specified by:
    `textQuery` in class `XMLWrapper`
  Returns:
    all PCData and CData nodes
  Throws:
    `TranslationException`

### elementQuery

    protected final ASG elementQuery(java.lang.String elemCID)
                              throws TranslationException,
                                     NotFoundException

  Specified by:
    `elementQuery` in class `XMLWrapper`
  Parameters:
    `searchNode` - the tag of the element (not its UID)
  Returns:
    ASG with the result elements
  Throws:
    `NotFoundException`
    `XMLException`
    `javax.xml.transform.TransformerException`
    `TranslationException`

### elementElementQuery

    protected final ASG elementElementQuery(java.lang.String searchNode1,
                                            java.lang.String searchNode2,
                                            int order)
                                     throws TranslationException,
                                            NotFoundException

  Nodes are compared based on elementName:count, not their whole UID

  Specified by:
    `elementElementQuery` in class `XMLWrapper`
  Parameters:
    `searchNode1` - parent element
    `searchNode2` - child element
    `order` - the order of the child element in its parent's nodelist, including PCData nodes. If -1 then order is unimportant
  Returns:
  Throws:
    `TranslationException`
    `NotFoundException`
    `XMLException`

### elementPCDataQuery

    protected final ASG elementPCDataQuery(java.lang.String element,
                                           int order)
                                    throws TranslationException,
                                           NotFoundException

  Specified by:
    `elementPCDataQuery` in class `XMLWrapper`
  Throws:
    `TranslationException`
    `NotFoundException`

### elementAttributeQuery

    protected final ASG elementAttributeQuery(java.lang.String elementCID,
                                              java.lang.String attributeName)
                                       throws TranslationException

  Specified by:
    `elementAttributeQuery` in class `XMLWrapper`
  Throws:
    `TranslationException`

### compositeQuery

    protected ASG compositeQuery(ASG query)
                          throws TranslationException

  Specified by:
    `compositeQuery` in class `XMLWrapper`
  Throws:
    `TranslationException`

### insertIQL

    public boolean insertIQL(ASG q)

  Description copied from class: `AutoMedWrapper`
  Execute an IQL insert on the datasource. Note that in later releases this method will become abstract, but at present no Wrapper implements this method.

  Overrides:
    `insertIQL` in class `AutoMedWrapper`
  Parameters:
    `q` - is the `ASG` representation of an IQL query of the form

    sub [t1, ..., tn] s

    where:
    - 'sub' is the sub-bag builtin function (this has the same semantics as sub-set if operating on sets, which is what the extents of schemes are)
    - [t1, ..., tn] are the tuples to be inserted/deleted
    - s is the scheme that they will be inserted into/deleted from

    The semantics and execution of the insert request will depend on the data source e.g. for a relational database it could be translated into a series of INSERT requests within a single transaction, which may fail or succeeed as a whole (and thus return False or True respectively from the insertIQL method). For a non-transactional repository like the HDM or XML flat files, we may choose to allow partial updates e.g. some of a set of tuples are inserted, while some already exist or violate some constraint or another.

### getInputDoc

    public org.w3c.dom.Document getInputDoc()
                                     throws XMLNotFoundException

  Returns:
    the instance XML data source
  Throws:
    `XMLNotFoundException`

### getProtocolName

    public java.lang.String getProtocolName()

  Description copied from class: `AutoMedWrapper`
  The name of the `Protocol` that this wrapper uses

  Specified by:
    `getProtocolName` in class `AutoMedWrapper`
  Returns:
    the name of the `Protocol`in the repository used to represent XML DOM connections.

### getDefaultWrapperFactory

    protected final AutoMedWrapperFactory getDefaultWrapperFactory()

  Returns a new instance of the default wrapper factory for this wrapper

  Specified by:
    `getDefaultWrapperFactory` in class `AutoMedWrapper`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD