|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.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
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.
Field Summary | |
---|---|
(package private) org.w3c.dom.Document |
inputDoc
|
Fields inherited from class uk.ac.bbk.dcs.automed.xml.wrappers.XMLWrapper |
---|
logger, protocol, resultList, schemaDoc, schemaUIDDoc, sid, sName |
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()
|
|
DOMWrapper(AccessMethod am,
java.lang.String password)
|
Method Summary | |
---|---|
protected ASG |
compositeQuery(ASG query)
|
(package private) java.util.ArrayList |
constructElementElementQueryResult(java.lang.String elem1CID,
java.lang.String elem2CID,
java.util.ArrayList resultNodeList)
|
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. |
(package private) void |
setInputDoc(org.w3c.dom.Document d)
|
protected ASG |
textQuery()
|
Methods inherited from class uk.ac.bbk.dcs.automed.xml.wrappers.XMLWrapper |
---|
connect, constructElementAttributeQueryResult, constructElementPCDataQueryResult, constructElementQueryResult, constructTextQueryResult, elementElementQuery, elementPCDataQuery, executeIQL, executeIQL, executeLocalQuery, executeXMLQuery, getSchemaDoc, getSchemaName, getSchemaUIDDoc, getURI, getXMLDSS, initialiseWrapper, newAutoMedWrapper, selectNewAutoMedWrapper, setSchemaDoc, setSchemaUIDDoc, setSID, xpathForAttributeQuery, xpathForElementQuery, xpathForElementRelQuery, xpathForTextQuery |
Methods inherited from class uk.ac.ic.doc.automed.wrappers.AutoMedWrapper |
---|
atDebugLevel, cacheWrapper, costIQL, deleteIQL, executeIQLIncrementally, executeSourceIQL, getAccessMethod, getAutoMedPeerInstance, getAutoMedWrapper, getAutoMedWrapper, getAutoMedWrapperFactory, getDrivers, getMetadata, getOption, getOptionKeyProtection, getOptionKeys, getProtocol, getRange, getSchema, getSchema, getURL, getUserName, newAutoMedSchema, newAutoMedWrapper, newAutoMedWrapper, newAutoMedWrapperInstance, registerWrapper, selectNewAutoMedWrapper, setDebugLevel, setOption |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
org.w3c.dom.Document inputDoc
Constructor Detail |
---|
DOMWrapper()
public DOMWrapper(AccessMethod am, java.lang.String password) throws DataSourceException, IntegrityException
DataSourceException
IntegrityException
Method Detail |
---|
public QueryParser getQueryParser(ASG query)
AutoMedWrapper
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.
getQueryParser
in class AutoMedWrapper
protected final ASG textQuery() throws TranslationException
textQuery
in class XMLWrapper
TranslationException
protected final ASG elementQuery(java.lang.String elemCID) throws TranslationException
elementQuery
in class XMLWrapper
searchNode
- the tag of the element (not its UID)
NotFoundException
XMLException
javax.xml.transform.TransformerException
TranslationException
protected final ASG elementElementQuery(java.lang.String searchNode1, java.lang.String searchNode2, int order) throws TranslationException
elementElementQuery
in class XMLWrapper
searchNode1
- parent elementsearchNode2
- child elementorder
- the order of the child element in its parent's nodelist, including PCData nodes. If -1 then order is unimportant
TranslationException
NotFoundException
XMLException
protected final ASG elementPCDataQuery(java.lang.String element, int order) throws TranslationException
elementPCDataQuery
in class XMLWrapper
TranslationException
protected final ASG elementAttributeQuery(java.lang.String elementCID, java.lang.String attributeName) throws TranslationException
elementAttributeQuery
in class XMLWrapper
TranslationException
protected ASG compositeQuery(ASG query) throws TranslationException
compositeQuery
in class XMLWrapper
TranslationException
public boolean insertIQL(ASG q)
AutoMedWrapper
insertIQL
in class AutoMedWrapper
q
- is the ASG
representation of an IQL query of the form
sub [t1, ..., tn] s
where: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.
public org.w3c.dom.Document getInputDoc() throws XMLNotFoundException
XMLNotFoundException
void setInputDoc(org.w3c.dom.Document d)
public java.lang.String getProtocolName()
AutoMedWrapper
Protocol
that this wrapper uses
getProtocolName
in class AutoMedWrapper
Protocol
in the repository used to represent XML DOM connections.protected final AutoMedWrapperFactory getDefaultWrapperFactory()
getDefaultWrapperFactory
in class AutoMedWrapper
final java.util.ArrayList constructElementElementQueryResult(java.lang.String elem1CID, java.lang.String elem2CID, java.util.ArrayList resultNodeList)
elem1CID
- elem2CID
- resultNodeList
- IMPORTANT: resultNodeList contains only the instances of CID2 found in the document!
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |