com.centrasite.jaxr
Interface CentraSiteBusinessQuery


public interface CentraSiteBusinessQuery


Field Summary
static java.lang.String CONTEXT_OBJECT
          Context object variable string used inside the business query.
static java.lang.String FIND_QUALIFIER_OBJECT_CACHE_EAGER
          Eager object cache population.
static java.lang.String FIND_QUALIFIER_OBJECT_CACHE_LAZY
          Lazy object cache population.
 
Method Summary
 void addClassifications(java.util.Collection<javax.xml.registry.infomodel.Classification> classifications)
          Add a classification comparison to this query's predicate conjunction.
 void addComparison(java.lang.String path, java.lang.Boolean value)
          Add a value comparison to this query's predicate conjunction.
 void addComparison(java.lang.String path, java.util.List<java.lang.String> values)
          Add a value comparison to this query's predicate conjunction.
 void addComparison(java.lang.String path, java.lang.String value)
          Add a value comparison to this query's predicate conjunction.
 void addComparisonCaseInsensitive(java.lang.String path, java.lang.String value)
          Add a case-insensitive value comparison to this query's predicate conjunction.
 void addContains(java.lang.String path, java.lang.String value)
          Add a contains to this query's predicate conjunction.
 void addKeywordSearch(java.lang.String path, java.lang.String searchString)
          Add keyword search string for a specific path.
 void addOrderBy(java.lang.String path, boolean descending)
          Add an order by clause.
 void addOrderByRelevance(java.util.Collection keywords, boolean descending)
          Add an order by clause specifically for sorting by relevance w.r.t. a certain set of keywords
 void addPredicate(java.lang.String predicate)
          Add a free style predicate.
 void addPrologExtension(java.lang.String p)
          Append to query specific entry for the XQuery prolog
 void addQueryBodyPrefix(java.lang.String p)
          Append to query specific prefix for the query body
 void addStartsWith(java.lang.String path, java.lang.String value)
          Add a starts-with to this query's predicate conjunction.
 void addStartsWithCaseInsensitive(java.lang.String path, java.lang.String value)
          Add a case-insensitive starts-with to this query's predicate conjunction.
 void enableEmptyPredicate()
          Turn on full doctype retrieval
 void excludeClassifiedObjects(java.util.Collection<java.lang.String> conceptKeys)
          Restrict the search result not to contain any objects that are classified with any concept that is identified by a collection of concept key ids.
 javax.xml.registry.BulkResponse execute()
          Execute this query
 javax.xml.namespace.QName getDoctypeQName(java.lang.String objectType)
          Return doctype QName for object type
 java.lang.String getPrefixForNamespaceUri(java.lang.String uri, boolean importRequired)
          Get a prefix for given namespace URI
 java.lang.String getPrologExtension()
          Get query specific entry for the XQuery prolog
 java.lang.String getQueryBodyPrefix()
          Get query specific prefix for the query body
 java.lang.String getQueryString()
          Obtain the query string needed for executing this BusinessQuery
 void includeClassifiedObjects(java.util.Collection<java.lang.String> conceptKeys)
          Restrict the search result to contain only objects that are classified with any concept that is identified by a collection of concept key ids.
 void setKeywordSearch(java.util.Collection keywords)
          Pass a group of words or phrases for keyword search.
 void setKeywordSearch(java.lang.String searchString)
          Set asset search keyword string for this BusinessQuery.
 void setPrologExtension(java.lang.String p)
          Set query specific entry for the XQuery prolog
 void setQueryBodyPrefix(java.lang.String p)
          Set query specific prefix for the query body
 void setUseLogicalOperatorOR(boolean useOR)
          Set logical operator for combining predicates.
 void translatePatterns(java.lang.String name, java.util.Collection patterns)
          Translates namePatterns argument of findXXX methods to its XQuery representation.
 

Field Detail

FIND_QUALIFIER_OBJECT_CACHE_EAGER

static final java.lang.String FIND_QUALIFIER_OBJECT_CACHE_EAGER
Eager object cache population.

See Also:
Constant Field Values

FIND_QUALIFIER_OBJECT_CACHE_LAZY

static final java.lang.String FIND_QUALIFIER_OBJECT_CACHE_LAZY
Lazy object cache population.

See Also:
Constant Field Values

CONTEXT_OBJECT

static final java.lang.String CONTEXT_OBJECT
Context object variable string used inside the business query.

See Also:
Constant Field Values
Method Detail

addComparison

void addComparison(java.lang.String path,
                   java.lang.String value)
Add a value comparison to this query's predicate conjunction.

Parameters:
path - the path expression
value - the comparison value

addComparisonCaseInsensitive

void addComparisonCaseInsensitive(java.lang.String path,
                                  java.lang.String value)
Add a case-insensitive value comparison to this query's predicate conjunction.

Parameters:
path - the path expression
value - the comparison value

addComparison

void addComparison(java.lang.String path,
                   java.util.List<java.lang.String> values)
                   throws javax.xml.registry.JAXRException
Add a value comparison to this query's predicate conjunction. The comparison will be logical OR of the values.

Parameters:
path - the path expression
values - the collection of values which this comparison can have.
Throws:
javax.xml.registry.JAXRException

addComparison

void addComparison(java.lang.String path,
                   java.lang.Boolean value)
                   throws javax.xml.registry.JAXRException
Add a value comparison to this query's predicate conjunction.

Parameters:
path - the path expression
value - the comparison value
Throws:
javax.xml.registry.JAXRException

addClassifications

void addClassifications(java.util.Collection<javax.xml.registry.infomodel.Classification> classifications)
                        throws javax.xml.registry.JAXRException
Add a classification comparison to this query's predicate conjunction.

Parameters:
classifications -
Throws:
javax.xml.registry.JAXRException

addStartsWith

void addStartsWith(java.lang.String path,
                   java.lang.String value)
Add a starts-with to this query's predicate conjunction.

Parameters:
path - the path expression
value - the comparison value

addStartsWithCaseInsensitive

void addStartsWithCaseInsensitive(java.lang.String path,
                                  java.lang.String value)
Add a case-insensitive starts-with to this query's predicate conjunction.

Parameters:
path - the path expression
value - the comparison value

addContains

void addContains(java.lang.String path,
                 java.lang.String value)
Add a contains to this query's predicate conjunction.

Parameters:
path - the path expression
value - the comparison value

addKeywordSearch

void addKeywordSearch(java.lang.String path,
                      java.lang.String searchString)
                      throws javax.xml.registry.JAXRException
Add keyword search string for a specific path.

Parameters:
path - the path specifying the nodes to be searched
searchString - a string containing a blank separated list of search words and quoted phrases
Throws:
javax.xml.registry.JAXRException

addOrderByRelevance

void addOrderByRelevance(java.util.Collection keywords,
                         boolean descending)
Add an order by clause specifically for sorting by relevance w.r.t. a certain set of keywords

Parameters:
keywords - The keywords
descending - If the sorting will be descending.

addOrderBy

void addOrderBy(java.lang.String path,
                boolean descending)
Add an order by clause.

Parameters:
path - The path expression used for the sorting - should refer to CONTEXT_OBJECT
descending - If the sorting will be descending.

addPredicate

void addPredicate(java.lang.String predicate)
Add a free style predicate.

Parameters:
predicate - the predicate string

enableEmptyPredicate

void enableEmptyPredicate()
Turn on full doctype retrieval


execute

javax.xml.registry.BulkResponse execute()
                                        throws javax.xml.registry.JAXRException
Execute this query

Returns:
the list of keys, wrapped in a BulkResponse
Throws:
javax.xml.registry.JAXRException

getPrefixForNamespaceUri

java.lang.String getPrefixForNamespaceUri(java.lang.String uri,
                                          boolean importRequired)
Get a prefix for given namespace URI

Parameters:
uri - the namespace URI
Returns:
the corresponding prefix

getQueryString

java.lang.String getQueryString()
                                throws javax.xml.registry.JAXRException
Obtain the query string needed for executing this BusinessQuery

Returns:
the query string
Throws:
javax.xml.registry.JAXRException

setKeywordSearch

void setKeywordSearch(java.util.Collection keywords)
                      throws javax.xml.registry.JAXRException
Pass a group of words or phrases for keyword search. Each string in Collection keywords contains a single word or a blank separated phrase.

Parameters:
keywords - a group words or phrases
Throws:
javax.xml.registry.JAXRException
See Also:
setKeywordSearch(String)

setKeywordSearch

void setKeywordSearch(java.lang.String searchString)
                      throws javax.xml.registry.JAXRException
Set asset search keyword string for this BusinessQuery.

This method will add predicates to the query that effectively make it search for keywords in these paths:

The search will all also match a $ro when it is related to an externalLink $el that matches the keywords in:

The search string consists of blank-separated words and phrases. A phrase consists of blank-separated words enclosed in quotes, it will match objects that contain all of these words in sequence, e.g. "\"light blue\"" will match objects that contain "light" and "blue" in this order, adjacent to each other.

The words and phrases in one search string are in a logical OR connection, i.e. searching for "red \"light blue\"" will match objects that match "red" as well as those matching "\"light blue\"".

Multiple calls of setKeywordSearch create multiple groups of search keywords. At query execution time, these groups are in a locical AND connection, unless setUseLogicalOperatorOR(boolean) is used to override. With an AND connection, an object matches the search if it matches all of the groups, whereas with an OR connection, it matches the search when it matches any of the groups.

Parameters:
searchString - a string containing a blank separated list of search words and quoted phrases
Throws:
javax.xml.registry.JAXRException

includeClassifiedObjects

void includeClassifiedObjects(java.util.Collection<java.lang.String> conceptKeys)
Restrict the search result to contain only objects that are classified with any concept that is identified by a collection of concept key ids.

Parameters:
conceptKeys - the collection of concept key ids.

excludeClassifiedObjects

void excludeClassifiedObjects(java.util.Collection<java.lang.String> conceptKeys)
Restrict the search result not to contain any objects that are classified with any concept that is identified by a collection of concept key ids.

Parameters:
conceptKeys - the collection of concept key ids.

getPrologExtension

java.lang.String getPrologExtension()
Get query specific entry for the XQuery prolog

Parameters:
p - the string to add to the XQuery prolog

setPrologExtension

void setPrologExtension(java.lang.String p)
Set query specific entry for the XQuery prolog

Parameters:
p - the string to add to the XQuery prolog

addPrologExtension

void addPrologExtension(java.lang.String p)
Append to query specific entry for the XQuery prolog

Parameters:
p - the string to add to the XQuery prolog

getQueryBodyPrefix

java.lang.String getQueryBodyPrefix()
Get query specific prefix for the query body

Returns:
the string to add in front of the query body

setQueryBodyPrefix

void setQueryBodyPrefix(java.lang.String p)
Set query specific prefix for the query body

Parameters:
p - the string to add in front of the query body

addQueryBodyPrefix

void addQueryBodyPrefix(java.lang.String p)
Append to query specific prefix for the query body

Parameters:
p - a string to add in front of the query body

setUseLogicalOperatorOR

void setUseLogicalOperatorOR(boolean useOR)
Set logical operator for combining predicates.

Parameters:
useOR - if true, predicates will be combined by a logical OR, otherwise they will be combined by a logical AND (which also is the default behaviour).

translatePatterns

void translatePatterns(java.lang.String name,
                       java.util.Collection patterns)
                       throws javax.xml.registry.JAXRException
Translates namePatterns argument of findXXX methods to its XQuery representation.

Parameters:
name - @see javax.xml.registry.BusinessQueryManager#findOrganizations(java.util.Collection, java.util.Collection, java.util.Collection, java.util.Collection, java.util.Collection, java.util.Collection)
patterns -
Throws:
javax.xml.registry.JAXRException

getDoctypeQName

javax.xml.namespace.QName getDoctypeQName(java.lang.String objectType)
Return doctype QName for object type

Parameters:
objectType - the object type (as in LifeCycleManager constants)
Returns:
the corresponding doctype QName