|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This interface defines all the access methods for concurrent XML. Wherever addresses are involved in creating new resources, all non-existing collections in the specified path to the resource will be created automatically.
All the methods throw the following exceptions:
DTD Identifiers are of the form: 'root of project' + IDataConstants.SEP_MAJOR + 'ID'
For example: file:///home/ept/BEOWULF/cotlib.damage where "file:///home/ept/BEOWULF" is the root of the project and "cotlib.damage" is the specific identifier of the DTD.
These methods are currently experimental and subject to
change without notice. If you wish to use these methods, please speak
with Neil <neil@s-z.org>.
| Method Summary | |
boolean |
deleteCXML(String address,
String dtdID,
String location)
Removes the node at the specified location in the resource. |
String |
getCXML(String address,
String[] dtdIDs)
Combine the specified hierarchies of the CXML content and return the result as a pseudo-XML string. |
void |
insertCXML(String address,
String dtdID,
String location,
org.dom4j.Node newContent)
Inserts the given XML node into the CXML resource at the indicated location. |
Object |
queryCXML(String xmlResourceAddress,
String[] dtdIDs,
String query,
short returnType)
Executes the given query on the CXML resource and returns the results as a list of org.dom4j.Nodes. |
void |
replaceCXML(String address,
String dtdID,
String location,
org.dom4j.Node newContent)
Replaces the node at the specified location in the resource with a new node at the same location. |
void |
replaceCXMLContent(String xmlResourceAddress,
int beginIndex,
int endIndex,
String newContent)
(unimplemented) Treats a CXML resource as text resource (all tags are treated as though they did not exist) and replaces the text from beginIndex to endIndex-1 with the new text content. |
boolean |
storeCXML(String address,
String[] dtdIDs,
String content,
boolean force)
Creates a new CXML resource. |
| Method Detail |
public String getCXML(String address,
String[] dtdIDs)
throws MalformedAddressException,
ResourceNotFoundException,
IOException
null or
an empty array, combine all the hierarchies. If dtdIDs contains a
single DTD and the document is well-formed with respect to that DTD,
the result will be proper XML.
address - address of the CXML resource.dtdIDs - an array of DTD identifiers, specifying which hierarchies
to combine. If this parameter is null or empty, all the
hierarchies are combined.
String with the combined hierarchies.
ResourceNotFoundException - if the resource doesn't exist
MalformedAddressException
IOException
public boolean storeCXML(String address,
String[] dtdIDs,
String content,
boolean force)
throws MalformedAddressException,
IOException
content should be the empty string;
if not, that content will not be located properly with respect to
other nodes. This will be fixed.
address - the address at which to store the CXML resourcedtdIDs - an array of DTD identifierscontent - the CXML data to be written (currently, the empty string)force - flag indicating whether the resource should be overwritten
if it already exists.
MalformedAddressException
IOException
public void insertCXML(String address,
String dtdID,
String location,
org.dom4j.Node newContent)
throws MalformedAddressException,
ResourceNotFoundException,
InvalidNodePathException,
IOException
[[beg:end]]", where
beg and end are the
integer coordinates of the node, used to position it with respect to
other nodes.
address - address of the resource.dtdID - identifier of the corresponding DTD.location - location for the new node, as specified above.newContent - new node, which should be either an
org.dom4j.Element or an org.dom4j.Text.
The node's content is ignored; only the top-level node itself is
used.
ResourceNotFoundException - if the resource doesnt exist
InvalidNodePathException - if the given location is invalid.
MalformedAddressException
IOException
public void replaceCXML(String address,
String dtdID,
String location,
org.dom4j.Node newContent)
throws MalformedAddressException,
ResourceNotFoundException,
InvalidNodePathException,
IOException
deleteCXML(java.lang.String, java.lang.String, java.lang.String).
address - address of the resource.dtdID - identifier of the corresponding DTD.location - location and tag name of an existing node, as
specified by deleteCXML(java.lang.String, java.lang.String, java.lang.String).newContent - the node to replace the deleted node; this should
be as the argument to insertCXML(java.lang.String, java.lang.String, java.lang.String, org.dom4j.Node).
ResourceNotFoundException - if the resource doesnt exist.
InvalidNodePathException - if the given location is invalid.
MalformedAddressException
IOException
public boolean deleteCXML(String address,
String dtdID,
String location)
throws MalformedAddressException,
ResourceNotFoundException,
InvalidNodePathException,
IOException
[[beg:end]]|tag",
where beg and end are the
integer coordinates of the node (the coordinates passed to
insertCXML(java.lang.String, java.lang.String, java.lang.String, org.dom4j.Node) when the node was originally inserted) and
tag is the tag name of the node to be removed
(or "st:string" to remove text content).
address - address of the resourcedtdID - identifier of the corresponding DTD.location - location and tag name of an existing node, as
specified above.
ResourceNotFoundException - if the resource doesnt exist
InvalidNodePathException - if the location is invalid.
MalformedAddressException
IOException
public void replaceCXMLContent(String xmlResourceAddress,
int beginIndex,
int endIndex,
String newContent)
throws MalformedAddressException,
ResourceNotFoundException,
IndexOutOfBoundsException,
IOException
xmlResourceAddress - address of the resourcebeginIndex - beginIndex, inclusiveendIndex - endIndex, exclusivenewContent - new text content
ResourceNotFoundException - if the resource doesnt exist
IndexOutOfBoundsException - if the beginIndex is negative, or beginIndex is larger than endIndex and endIndex is not EOF.
MalformedAddressException
IOException
public Object queryCXML(String xmlResourceAddress,
String[] dtdIDs,
String query,
short returnType)
throws MalformedAddressException,
ResourceNotFoundException,
MalformedQueryException,
IOException,
InvalidTypeException
org.dom4j.Nodes. Each such node is either
an Element or a Text object.
The query is of the form
"op[[from:to]]
where from and to are the coordinates of the context
range (these are the same coordinates used by insertCXML(java.lang.String, java.lang.String, java.lang.String, org.dom4j.Node)).
op indicates the type of query to perform, and may be one of:
children: return all children (strict descendants not
strictly contained in other descendants). Does not return nodes which
cover exactly the context range.
ancestors: return all ancestors (nodes which
strictly contain the context range).
parents: return all parents (ancestors which
do not strictly contain other ancestors).
xmlResourceAddress - address of the XML resourcedtdIDs - an array of DTD identifiers, specifying which of the
hierarchies to consider for the query. If this parameter is
null or empty, then all the hierarchies are considered.query - the query, as specified above.returnType - return type. This argument is currently ignored.
List of dom4j Element
and Text nodes.
ResourceNotFoundException - if the resource doesnt exist
MalformedQueryException - if the query is malformed
InvalidTypeException - if the return type specified is
unrecognized (should never happen)
MalformedAddressException
IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||