com.bea.apps.groupspace.search.utils
Class PropertySearchBuilder

java.lang.Object
  extended by com.bea.apps.groupspace.search.utils.PropertySearchBuilder

public class PropertySearchBuilder
extends Object

Use this class to build up expressions for use in the CmFullTextSearchControl and GsFullTextSearchControl Searches on either user-defined properties or CM system properties.

Use of this class assumes the Autonomy Search Engine is running.


Constructor Summary
PropertySearchBuilder()
           
 
Method Summary
 com.bea.content.expression.FullTextSearch allOfTheseWords(String[] allWords)
           
 IMetadataQueryParameter and(IMetadataQueryParameter one, IMetadataQueryParameter two)
          'AND' the two criteria
 com.bea.content.expression.FullTextSearch anyOfTheseWords(String[] anyWords)
          Construct a FullTextSearch object that will search content for "any of these words".
protected  IMetadataQueryParameter build(IMetadataQueryParameter[] pset, String doWhat)
           
protected  IMetadataQueryParameter build(Set<IMetadataQueryParameter> pset, String doWhat)
           
 IMetadataQueryParameter contains(IMetadataQuery.SystemProperty property, String criteria)
          Find items whose property contains exactly this criteria.
 IMetadataQueryParameter contains(String property, String criteria)
          Find items whose property contains exactly this criteria.
 IMetadataQueryParameter containsAll(IMetadataQuery.SystemProperty property, String[] criteria)
          Find items whose property contains all of these criteria.
 IMetadataQueryParameter containsAll(String property, String[] criteria)
          Find items whose property contains all of these criteria.
 IMetadataQueryParameter containsAny(IMetadataQuery.SystemProperty property, String[] criteria)
          Find items whose property contains any of these criteria.
 IMetadataQueryParameter containsAny(String property, String[] criteria)
          Find items whose property contains any of these criteria.
 IMetadataQueryParameter containsNone(IMetadataQuery.SystemProperty property, String[] criteria)
          Do not include these properties in the search.
 IMetadataQueryParameter containsNone(String property, String[] criteria)
          Do not include these properties in the search.
 IMetadataQueryParameter dateCriteria(IMetadataQuery.SystemProperty propertyField, Calendar date, ExpressionBuilder.DateCriteria criteria)
          Construct a propertydata search parameter for this CM property, restricted by date
 IMetadataQueryParameter dateCriteria(String propertyField, Calendar date, ExpressionBuilder.DateCriteria criteria)
          Construct a metadata search parameter for this CM-user property, restricted by date
 IMetadataQueryParameter dateRangeCriteria(IMetadataQuery.SystemProperty propertyField, Calendar startDate, Calendar endDate)
          Construct a propertydata search parameter for this system property, restricted by this date range
 IMetadataQueryParameter dateRangeCriteria(String propertyField, Calendar startDate, Calendar endDate)
          Construct a propertydata search parameter for this property, restricted by this date range
 IMetadataQueryParameter equals(IMetadataQuery.SystemProperty property, String criteria)
          Include this property in the search.
 IMetadataQueryParameter equals(String property, String criteria)
          Include this property in the search.
 IMetadataQueryParameter equalsAll(IMetadataQuery.SystemProperty property, String[] criteria)
          Include this property in the search.
 IMetadataQueryParameter equalsAll(String property, String[] criteria)
          Include this property in the search.
 IMetadataQueryParameter equalsAny(IMetadataQuery.SystemProperty property, String[] criteria)
          Include this property in the search.
 IMetadataQueryParameter equalsAny(String property, String[] criteria)
          Include this property in the search.
 IMetadataQueryParameter isNotNull(IMetadataQuery.SystemProperty property)
          Whose property is not null
 IMetadataQueryParameter isNotNull(String property)
          Whose property is not null
 IMetadataQueryParameter isNull(IMetadataQuery.SystemProperty property)
          Whose property is null
 IMetadataQueryParameter isNull(String property)
          Whose property is null
 IMetadataQueryParameter like(IMetadataQuery.SystemProperty property, String criteria, boolean ignoreCase)
          Find items whose property contains something similar to this criteria.
 IMetadataQueryParameter like(String property, String criteria, boolean ignoreCase)
          Find items whose property contains something similar to this criteria.
 IMetadataQueryParameter match(String[] allWords, String[] anyWords, String exactPhrase)
          CM metadata Construct an IMetadataQueryParameter that will search content subject to all of these restrictions.
 com.bea.content.expression.FullTextSearch noneOfTheseWords(String[] words)
          Construct a FullTextSearch object that will search for "none of these words".
 IMetadataQueryParameter notEquals(IMetadataQuery.SystemProperty property, String criteria)
          Do not include this property in the search.
 IMetadataQueryParameter notEquals(IMetadataQuery.SystemProperty property, String[] criteria)
          Do not include these properties in the search.
 IMetadataQueryParameter notEquals(String property, String criteria)
          Do not include this property in the search.
 IMetadataQueryParameter notEquals(String property, String[] criteria)
          Do not include these properties in the search.
 IMetadataQueryParameter numberCriteria(IMetadataQuery.SystemProperty property, Number count, ExpressionBuilder.CountCriteria criteria)
          Construct a propertydata search parameter to limit based on count.
 IMetadataQueryParameter numberCriteria(String property, Number count, ExpressionBuilder.CountCriteria criteria)
          Construct a propertydata search parameter to limit based on count.
 IMetadataQueryParameter or(IMetadataQueryParameter one, IMetadataQueryParameter two)
          'OR' the two criteria
 IMetadataQueryParameter wildcard(IMetadataQuery.SystemProperty property, String criteria)
          Used for matching criteria containing the wildcards '*' or '?'
 IMetadataQueryParameter wildcard(String property, String criteria)
          Used for matching criteria containing the wildcards '*' or '?'
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertySearchBuilder

public PropertySearchBuilder()
Method Detail

noneOfTheseWords

public com.bea.content.expression.FullTextSearch noneOfTheseWords(String[] words)
                                                           throws Exception
Construct a FullTextSearch object that will search for "none of these words".

Throws
Exception

allOfTheseWords

public com.bea.content.expression.FullTextSearch allOfTheseWords(String[] allWords)
                                                          throws Exception
Throws
Exception

anyOfTheseWords

public com.bea.content.expression.FullTextSearch anyOfTheseWords(String[] anyWords)
                                                          throws Exception
Construct a FullTextSearch object that will search content for "any of these words".

Throws
Exception

dateCriteria

public IMetadataQueryParameter dateCriteria(String propertyField,
                                            Calendar date,
                                            ExpressionBuilder.DateCriteria criteria)
                                     throws InvalidQueryException
Construct a metadata search parameter for this CM-user property, restricted by date

Throws
InvalidQueryException

dateCriteria

public IMetadataQueryParameter dateCriteria(IMetadataQuery.SystemProperty propertyField,
                                            Calendar date,
                                            ExpressionBuilder.DateCriteria criteria)
                                     throws InvalidQueryException
Construct a propertydata search parameter for this CM property, restricted by date

Throws
InvalidQueryException

dateRangeCriteria

public IMetadataQueryParameter dateRangeCriteria(String propertyField,
                                                 Calendar startDate,
                                                 Calendar endDate)
                                          throws InvalidQueryException
Construct a propertydata search parameter for this property, restricted by this date range

Throws
InvalidQueryException

dateRangeCriteria

public IMetadataQueryParameter dateRangeCriteria(IMetadataQuery.SystemProperty propertyField,
                                                 Calendar startDate,
                                                 Calendar endDate)
                                          throws InvalidQueryException
Construct a propertydata search parameter for this system property, restricted by this date range

Throws
InvalidQueryException

numberCriteria

public IMetadataQueryParameter numberCriteria(String property,
                                              Number count,
                                              ExpressionBuilder.CountCriteria criteria)
                                       throws InvalidQueryException
Construct a propertydata search parameter to limit based on count. This is for user-defined properties on CM data.

Throws
InvalidQueryException

numberCriteria

public IMetadataQueryParameter numberCriteria(IMetadataQuery.SystemProperty property,
                                              Number count,
                                              ExpressionBuilder.CountCriteria criteria)
                                       throws InvalidQueryException
Construct a propertydata search parameter to limit based on count. This is for CM system properties.

Throws
InvalidQueryException

isNull

public IMetadataQueryParameter isNull(String property)
                               throws InvalidQueryException
Whose property is null

Throws
InvalidQueryException

isNull

public IMetadataQueryParameter isNull(IMetadataQuery.SystemProperty property)
                               throws InvalidQueryException
Whose property is null

Throws
InvalidQueryException

isNotNull

public IMetadataQueryParameter isNotNull(String property)
                                  throws InvalidQueryException
Whose property is not null

Throws
InvalidQueryException

isNotNull

public IMetadataQueryParameter isNotNull(IMetadataQuery.SystemProperty property)
                                  throws InvalidQueryException
Whose property is not null

Throws
InvalidQueryException

equals

public IMetadataQueryParameter equals(String property,
                                      String criteria)
                               throws InvalidQueryException
Include this property in the search.

Throws
InvalidQueryException

equals

public IMetadataQueryParameter equals(IMetadataQuery.SystemProperty property,
                                      String criteria)
                               throws InvalidQueryException
Include this property in the search.

Throws
InvalidQueryException

equalsAny

public IMetadataQueryParameter equalsAny(String property,
                                         String[] criteria)
                                  throws InvalidQueryException
Include this property in the search.

Throws
InvalidQueryException

equalsAny

public IMetadataQueryParameter equalsAny(IMetadataQuery.SystemProperty property,
                                         String[] criteria)
                                  throws InvalidQueryException
Include this property in the search.

Throws
InvalidQueryException

equalsAll

public IMetadataQueryParameter equalsAll(String property,
                                         String[] criteria)
                                  throws InvalidQueryException
Include this property in the search.

Throws
InvalidQueryException

equalsAll

public IMetadataQueryParameter equalsAll(IMetadataQuery.SystemProperty property,
                                         String[] criteria)
                                  throws InvalidQueryException
Include this property in the search.

Throws
InvalidQueryException

notEquals

public IMetadataQueryParameter notEquals(String property,
                                         String criteria)
                                  throws InvalidQueryException
Do not include this property in the search.

Throws
InvalidQueryException

notEquals

public IMetadataQueryParameter notEquals(IMetadataQuery.SystemProperty property,
                                         String criteria)
                                  throws InvalidQueryException
Do not include this property in the search.

Throws
InvalidQueryException

notEquals

public IMetadataQueryParameter notEquals(String property,
                                         String[] criteria)
                                  throws InvalidQueryException
Do not include these properties in the search.

Throws
InvalidQueryException

notEquals

public IMetadataQueryParameter notEquals(IMetadataQuery.SystemProperty property,
                                         String[] criteria)
                                  throws InvalidQueryException
Do not include these properties in the search.

Throws
InvalidQueryException

contains

public IMetadataQueryParameter contains(String property,
                                        String criteria)
                                 throws InvalidQueryException
Find items whose property contains exactly this criteria. Wildcards are not allowed; use the "like" construct for that.

Throws
InvalidQueryException

contains

public IMetadataQueryParameter contains(IMetadataQuery.SystemProperty property,
                                        String criteria)
                                 throws InvalidQueryException
Find items whose property contains exactly this criteria. Wildcards are not allowed; use the "like" construct for that.

Throws
InvalidQueryException

containsAll

public IMetadataQueryParameter containsAll(String property,
                                           String[] criteria)
                                    throws InvalidQueryException
Find items whose property contains all of these criteria. Wildcards are not allowed; use the "like" construct for that.

Throws
InvalidQueryException

containsAll

public IMetadataQueryParameter containsAll(IMetadataQuery.SystemProperty property,
                                           String[] criteria)
                                    throws InvalidQueryException
Find items whose property contains all of these criteria. Wildcards are not allowed; use the "like" construct for that.

Throws
InvalidQueryException

containsAny

public IMetadataQueryParameter containsAny(String property,
                                           String[] criteria)
                                    throws InvalidQueryException
Find items whose property contains any of these criteria. Wildcards are not allowed; use the "like" construct for that.

Throws
InvalidQueryException

containsAny

public IMetadataQueryParameter containsAny(IMetadataQuery.SystemProperty property,
                                           String[] criteria)
                                    throws InvalidQueryException
Find items whose property contains any of these criteria. Wildcards are not allowed; use the "like" construct for that.

Throws
InvalidQueryException

containsNone

public IMetadataQueryParameter containsNone(String property,
                                            String[] criteria)
                                     throws InvalidQueryException
Do not include these properties in the search.

Throws
InvalidQueryException

containsNone

public IMetadataQueryParameter containsNone(IMetadataQuery.SystemProperty property,
                                            String[] criteria)
                                     throws InvalidQueryException
Do not include these properties in the search.

Throws
InvalidQueryException

wildcard

public IMetadataQueryParameter wildcard(String property,
                                        String criteria)
                                 throws InvalidQueryException
Used for matching criteria containing the wildcards '*' or '?'

Throws
InvalidQueryException

wildcard

public IMetadataQueryParameter wildcard(IMetadataQuery.SystemProperty property,
                                        String criteria)
                                 throws InvalidQueryException
Used for matching criteria containing the wildcards '*' or '?'

Throws
InvalidQueryException

like

public IMetadataQueryParameter like(String property,
                                    String criteria,
                                    boolean ignoreCase)
                             throws InvalidQueryException
Find items whose property contains something similar to this criteria. Wildcards are allowed.

Throws
InvalidQueryException

like

public IMetadataQueryParameter like(IMetadataQuery.SystemProperty property,
                                    String criteria,
                                    boolean ignoreCase)
                             throws InvalidQueryException
Find items whose property contains something similar to this criteria. Wildcards are allowed.

Throws
InvalidQueryException

and

public IMetadataQueryParameter and(IMetadataQueryParameter one,
                                   IMetadataQueryParameter two)
'AND' the two criteria


or

public IMetadataQueryParameter or(IMetadataQueryParameter one,
                                  IMetadataQueryParameter two)
'OR' the two criteria


match

public IMetadataQueryParameter match(String[] allWords,
                                     String[] anyWords,
                                     String exactPhrase)
                              throws Exception
CM metadata Construct an IMetadataQueryParameter that will search content subject to all of these restrictions. These restrictions are 'ANDED' together

Throws
Exception

build

protected IMetadataQueryParameter build(Set<IMetadataQueryParameter> pset,
                                        String doWhat)
Parameters
pset -
doWhat -

build

protected IMetadataQueryParameter build(IMetadataQueryParameter[] pset,
                                        String doWhat)
Parameters
pset -
doWhat -


Copyright © 2006 BEA Systems, Inc. All Rights Reserved