com.esri.aims.mtier.model.metadata.query
Class Clause

java.lang.Object
  extended by com.esri.aims.mtier.model.metadata.query.Clause
All Implemented Interfaces:
Serializable

public class Clause
extends Object
implements Serializable

Defines a metadata query clause. These clauses can then be embedded to result in complex queries.

Starting from ArcIMS 9.1, the following rules must be followed when searching a Metadata Service:

1. A Clause instance can have other Clause instances as "inner" or "child" Clauses, but an "inner" Clause cannot have another Clause instance as an "inner" Clause. That is, the "base" or "parent" Clause cannot have a "grandchild" Clause.
2. Only an inner Clause can call these methods:
Group A : setDocumentInfoCollection(), setSubsetCollection(), setUpdatedAfter(), or setUpdatedBefore().
Group B : setTextQueryCollection(), setValueQueryCollection().
3. An inner Clause can only call methods either from Group A or Group B. You cannot mix the two groups.
4. Inner clauses that call methods from Group A must be added to the ClauseCollection of the base Clause before inner Clauses that call methods from Group B; Inner Clauses that call only one method from Group B should be added before inner Clauses that call multiple methods from Group B.
5. Methods from Group A cannot be combined in an inner Clause, though each method may be used multiple times. Methods from Group B may be combined in an inner Clause.
6. The base Clause may only contain one EnvelopeCollection, which in turn may only contain one Envelope. The EnvelopeCollection may be added to the base Clause in any order.

A sample following above rules would be:

 Clause baseClause = new Clause();
 ClauseCollection clauseCollect = new ClauseCollection();

 Clause innerClause1 = new Clause();
 DocumentInfo dInfo = new DocumentInfo();
 DocumentInfoCollection dInfoColl = new DocumentInfoCollection();
 dInfoColl.addDocumentInfo(dInfo);
 innerClause1.setDocumentInfoCollection(dInfoColl);

 Clause innerClause2 = new Clause();
 Subset sInfo=new Subset();
 SubsetCollection sColl=new SubsetCollection();
 sColl.addSubset(sInfo);
 innerClause2.setSubsetCollection(sColl);

 Clause innerClause3 = new Clause();
 TextQuery tQuery=new TextQuery();
 TextQueryCollection tQueryColl=new TextQueryCollection();
 tQueryColl.addQuery(tQuery);
 innerClause3.setTextQueryCollection(tQueryColl);

 Clause innerClause4 = new Clause();
 TextQuery tQuery2=new TextQuery();
 TextQueryCollection tQueryColl2=new TextQueryCollection();
 tQueryColl2.addQuery(tQuery2);
 ValueQuery vQuery=new ValueQuery();
 ValueQueryCollection vQueryColl=new ValueQueryCollection();
 vQueryColl.addQuery(vQuery);
 innerClause4.setTextQueryCollection(tQueryColl2);
 nnerClause4.setValueQueryCollection(vQueryColl);

 clauseCollect.addClause(innerClause1);
 clauseCollect.addClause(innerClause2);
 clauseCollect.addClause(innerClause3);
 clauseCollect.addClause(innerClause4);
 baseClause.setClauseCollection(clauseCollect);

 

See Also:
Serialized Form

Field Summary
static int AND_OPERATOR
           
static int CONTENTTYPE_SORT
           
static int DATE_SORT
           
static int DOCUMENT
           
static int GLOBALAREA_SORT
           
static int LOCALAREA_SORT
           
static int NAME_SORT
           
static int NONE
           
static int OR_OPERATOR
           
static int RELEVANCE_SORT
           
static int SEARCH
           
static int XOR_OPERATOR
           
 
Constructor Summary
Clause()
          Constructs an instance of a Clause object.
 
Method Summary
 DatasetCollection execute(ConnectionProxy connection)
          Executes the query and returns the results as a DatasetCollection.
 ClauseCollection getClauseCollection()
          Returns the ClauseCollection associated with this Clause.
 Element getClauseElement()
          Returns this object as an Element for building XML documents.
 DocumentInfoCollection getDocumentInfoCollection()
          Returns the DocumentInfoCollection.
 EnvelopeCollection getEnvelopeCollection()
          Returns the EnvelopeCollection.
 int getFolderMask()
          Returns the FolderMask.
 boolean getFullOutput()
          Returns the value of FullOutput.
 int getGndextent()
          Returns the value of Gndextent.
 String getGndextentString()
          Returns the string value of the Gndextent.
 int getMaxResults()
          Returns the maximum number of results that will be returned by the server.
 int getOperator()
          Returns the operator used to evaluate serach criteria.
 String getOperatorString()
          Returns the string value of the operator .
 int getSort()
          Returns the first type used to sort the results.
 int getSort2()
          Returns the second type used to sort the results.
 String getSort2String()
          Returns the string value of the second sort type.
 String getSortString()
          Returns the string value of the first sort type.
 int getStartResults()
          Returns the position from which the results will be returned.
 SubsetCollection getSubsetCollection()
          Returns the SubsetCollection.
 TextQueryCollection getTextQueryCollection()
          Returns the TextQueryCollection.
 boolean getThumbnail()
          Returns the value of thumbnail.
 String getUpdatedAfter()
          Returns the value of UpdatedAfter.
 String getUpdatedBefore()
          Returns the value of UpdatedBefore.
 ValueQueryCollection getValueQueryCollection()
          Returns the ValueQueryCollection.
 void setClauseCollection(ClauseCollection newClauseCollection)
          Sets the ClauseCollection.
 void setDocumentInfoCollection(DocumentInfoCollection newDocumentInfoCollection)
          Sets the DocumentInfoCollection.
 void setEnvelopeCollection(EnvelopeCollection newEnvelopeCollection)
          Sets the EnvelopeCollection.
 void setFolderMask(int newFolderMask)
          Sets the value of FolderMask.
 void setFullOutput(boolean fulloutput)
          Sets the FullOutput.
 void setGndextent(int gndextentValue)
          Sets the Gndextent.
 void setMaxResults(int newMaxResults)
          Sets the maximum number of results that will be returned by the server.
 void setOperator(int newOperator)
          Sets the operator used to evaluate serach criteria.
 void setSort(int sortValue)
          Set the first type used to sort the results.
 void setSort2(int sortValue)
          Sets the second type used to sort the results.
 void setStartResults(int newStartResults)
          Sets the position from which the results will be returned.
 void setSubsetCollection(SubsetCollection newSubsetCollection)
          Sets the SubsetCollection.
 void setTextQueryCollection(TextQueryCollection newTextQueryCollection)
          Sets the given TextQueryCollection.
 void setThumbnail(boolean thumbnail)
          Sets the thumbnail.
 void setUpdatedAfter(String updated)
          Sets the UdatedAfter.
 void setUpdatedBefore(String updated)
          Sets the UdatedBefore.
 void setValueQueryCollection(ValueQueryCollection newValueQueryCollection)
          Sets the ValueQueryCollection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AND_OPERATOR

public static final int AND_OPERATOR
See Also:
Constant Field Values

OR_OPERATOR

public static final int OR_OPERATOR
See Also:
Constant Field Values

XOR_OPERATOR

public static final int XOR_OPERATOR
See Also:
Constant Field Values

NAME_SORT

public static final int NAME_SORT
See Also:
Constant Field Values

RELEVANCE_SORT

public static final int RELEVANCE_SORT
See Also:
Constant Field Values

CONTENTTYPE_SORT

public static final int CONTENTTYPE_SORT
See Also:
Constant Field Values

LOCALAREA_SORT

public static final int LOCALAREA_SORT
See Also:
Constant Field Values

GLOBALAREA_SORT

public static final int GLOBALAREA_SORT
See Also:
Constant Field Values

DATE_SORT

public static final int DATE_SORT
See Also:
Constant Field Values

NONE

public static final int NONE
See Also:
Constant Field Values

DOCUMENT

public static final int DOCUMENT
See Also:
Constant Field Values

SEARCH

public static final int SEARCH
See Also:
Constant Field Values
Constructor Detail

Clause

public Clause()
Constructs an instance of a Clause object.

Method Detail

setEnvelopeCollection

public void setEnvelopeCollection(EnvelopeCollection newEnvelopeCollection)
Sets the EnvelopeCollection.


getEnvelopeCollection

public EnvelopeCollection getEnvelopeCollection()
Returns the EnvelopeCollection.


setClauseCollection

public void setClauseCollection(ClauseCollection newClauseCollection)
Sets the ClauseCollection.


getClauseCollection

public ClauseCollection getClauseCollection()
Returns the ClauseCollection associated with this Clause.


setTextQueryCollection

public void setTextQueryCollection(TextQueryCollection newTextQueryCollection)
Sets the given TextQueryCollection.


getTextQueryCollection

public TextQueryCollection getTextQueryCollection()
Returns the TextQueryCollection.


setValueQueryCollection

public void setValueQueryCollection(ValueQueryCollection newValueQueryCollection)
Sets the ValueQueryCollection.


getValueQueryCollection

public ValueQueryCollection getValueQueryCollection()
Returns the ValueQueryCollection.


setSubsetCollection

public void setSubsetCollection(SubsetCollection newSubsetCollection)
Sets the SubsetCollection.


getSubsetCollection

public SubsetCollection getSubsetCollection()
Returns the SubsetCollection.


setDocumentInfoCollection

public void setDocumentInfoCollection(DocumentInfoCollection newDocumentInfoCollection)
Sets the DocumentInfoCollection.


getDocumentInfoCollection

public DocumentInfoCollection getDocumentInfoCollection()
Returns the DocumentInfoCollection.


setMaxResults

public void setMaxResults(int newMaxResults)
Sets the maximum number of results that will be returned by the server. When set to 0, the default, all results will be returned.


getMaxResults

public int getMaxResults()
Returns the maximum number of results that will be returned by the server.


setStartResults

public void setStartResults(int newStartResults)
Sets the position from which the results will be returned. If only 10 results will be returned each time, set it to 0 the first time to return results 0-9; the next time teh query is executed, set it to 10 to return results 10-19.


getStartResults

public int getStartResults()
Returns the position from which the results will be returned.


setFolderMask

public void setFolderMask(int newFolderMask)
Sets the value of FolderMask. This value specifies the types of documents to be included in the response. The value of FolderMask is an integer which is the sum of one or more of the following values:
1 = Root document
2 = "Normal" folders
4 = Document.
For example, use 4 to return documents only and 7(=1+2+4) to return all types of documents.


getFolderMask

public int getFolderMask()
Returns the FolderMask.


setOperator

public void setOperator(int newOperator)
Sets the operator used to evaluate serach criteria.


getOperator

public int getOperator()
Returns the operator used to evaluate serach criteria.


getOperatorString

public String getOperatorString()
Returns the string value of the operator .


setSort

public void setSort(int sortValue)
Set the first type used to sort the results.

Parameters:
sortValue -

getSort

public int getSort()
Returns the first type used to sort the results.

Returns:
the sort type as an integer

getSortString

public String getSortString()
Returns the string value of the first sort type.


setGndextent

public void setGndextent(int gndextentValue)
Sets the Gndextent. This value defines how extent information is written to the GND file. Set it to Clause.NONE, the default extent of the service is used; set it to Clause.DOCUMENT, the extent is taken from the metadata document; set it to Clause.SEARCH, the envelope specified in the query's Envelope is used.

Parameters:
gndextentValue -

getGndextent

public int getGndextent()
Returns the value of Gndextent.

Returns:
an integer

getGndextentString

public String getGndextentString()
Returns the string value of the Gndextent.

Returns:
String

setFullOutput

public void setFullOutput(boolean fulloutput)
Sets the FullOutput. When set to "true", an XML file containing the metadata document and a GND file for accessing the service described by the document are written to the output directory for each result returned by the query as appropriate.

Parameters:
fulloutput -

getFullOutput

public boolean getFullOutput()
Returns the value of FullOutput.

Returns:
an boolean

setThumbnail

public void setThumbnail(boolean thumbnail)
Sets the thumbnail. When set to true, a JPG file containing the document's thumbnail are written to the output directory for each result returned by the query as appropriate.

Parameters:
thumbnail -

getThumbnail

public boolean getThumbnail()
Returns the value of thumbnail.

Returns:
a boolean

setSort2

public void setSort2(int sortValue)
Sets the second type used to sort the results. Results with the same value used by the first sort will be ordered using their values for the second sort type.

Parameters:
sortValue -

getSort2

public int getSort2()
Returns the second type used to sort the results. Results with the same value used by the first sort will be ordered using their values for the second sort type.

Returns:
an integer

getSort2String

public String getSort2String()
Returns the string value of the second sort type.


setUpdatedAfter

public void setUpdatedAfter(String updated)
Sets the UdatedAfter.


getUpdatedAfter

public String getUpdatedAfter()
Returns the value of UpdatedAfter.


setUpdatedBefore

public void setUpdatedBefore(String updated)
Sets the UdatedBefore.


getUpdatedBefore

public String getUpdatedBefore()
Returns the value of UpdatedBefore.


getClauseElement

public Element getClauseElement()
                         throws com.esri.aims.mtier.model.axl.AXLAttributeException
Returns this object as an Element for building XML documents.

Throws:
com.esri.aims.mtier.model.axl.AXLAttributeException

execute

public DatasetCollection execute(ConnectionProxy connection)
                          throws com.esri.aims.mtier.model.axl.AXLAttributeException,
                                 ConnectionParameterException,
                                 com.esri.aims.mtier.io.http.UnableToPingEsrimapException,
                                 AuthenticationException,
                                 SAXException,
                                 IOException
Executes the query and returns the results as a DatasetCollection.

Throws:
com.esri.aims.mtier.model.axl.AXLAttributeException
ConnectionParameterException
com.esri.aims.mtier.io.http.UnableToPingEsrimapException
AuthenticationException
SAXException
IOException