java.lang.Objectcom.collabnet.tracker.xml.QueryXMLHelper
public class QueryXMLHelper
Helper class to parse <query> and <adhocQuery> tags; also produces schema for same.
Also used to generate XML representation of a QueryCriteriaBuilder
The format of the XML document is:
<namedQuery xmlns="urn:ws.tracker.collabnet.com">
<tagName>tagName</tagName>
<namespace>namespace</namespace>
</namedQuery>
or
<adhocQuery xmlns="urn:ws.tracker.collabnet.com">
<artifactTypes>
<artifactType>
<tagName>xml-name</tagName>
<namespace>xml-uri</namespace>
<artifactType>
... additional artifactType elements ...
</artifactTypes>
<attributes>
<attribute>
<tagName>xml-name</tagName>
<namespace>xml-uri</namespace>
<condition>
... condition definition see ConditionXMLHelper
</condition>
</attribute>
...
</attributes>
<idRange>
<min>min</min>
<max>max</max>
</idRange>
<modifiedOn>
[range] OR [relative] condition
</modifiedOn>
<createdOn>
[range] OR [relative] condition
</createdOn>
<userConditions>
<userAttrMap>
... see ConditionXMLHelper.buildUserConditions(XPathProcessor, Node)
</userAttrMap>
<unassociated>
... see ConditionXMLHelper.buildUnassocUserConditions(XPathProcessor, Node)
</unassociated>
</userConditions>
</adhocQuery>
| Constructor Summary | |
|---|---|
QueryXMLHelper()
|
|
| Method Summary | |
|---|---|
void |
acceptSchemaVisitor(SchemaVisitor visitor)
|
com.collabnet.tracker.query.ProjectQueryCriteriaBuilder |
getQueryCriteriaBuilder(org.w3c.dom.Document document)
Parses the request document and extracts the query portion (i.e. |
java.util.List |
getSchemaReferences()
|
void |
visit(XMLVisitor visitor,
com.collabnet.tracker.query.ProjectQueryCriteriaBuilder queryCriteria)
Generates the XML representation of a QueryCriteriaBuilder. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public QueryXMLHelper()
| Method Detail |
|---|
public com.collabnet.tracker.query.ProjectQueryCriteriaBuilder getQueryCriteriaBuilder(org.w3c.dom.Document document)
throws XMLBuilderException
<namedQuery xmlns="urn:ws.tracker.collabnet.com">
<tagName>tagName</tagName>
<namespace>namespace</namespace>
</namedQuery>
or
<adhocQuery xmlns="urn:ws.tracker.collabnet.com">
<artifactTypes>
<artifactType>
<tagName>xml-name</tagName>
<namespace>xml-uri</namespace>
<artifactType>
... additional artifactType elements ...
</artifactTypes>
<attributes>
<attribute>
<tagName>xml-name</tagName>
<namespace>xml-uri</namespace>
<condition>
... condition definition see ConditionXMLHelper
</condition>
</attribute>
...
</attributes>
<idRange>
<min>min</min>
<max>max</max>
</idRange>
<modifiedOn>
[range] OR [relative] condition
</modifiedOn>
<createdOn>
[range] OR [relative] condition
</createdOn>
<userConditions>
<userAttrMap>
... see ConditionXMLHelper.buildUserConditions(XPathProcessor, Node)
</userAttrMap>
<unassociated>
... see ConditionXMLHelper.buildUnassocUserConditions(XPathProcessor, Node)
</unassociated>
</userConditions>
</adhocQuery>
document - the incoming document
XMLBuilderException - if the query XML is not valid
public java.util.List getSchemaReferences()
throws SchemaReferenceException
SchemaReferenceException
public void acceptSchemaVisitor(SchemaVisitor visitor)
throws SchemaGenerationException
visitor -
SchemaGenerationException
public void visit(XMLVisitor visitor,
com.collabnet.tracker.query.ProjectQueryCriteriaBuilder queryCriteria)
throws XMLVisitorException
visitor - the object to use for generating the XMLqueryCriteria - the Query definition to convert to XML.
XMLVisitorException