atg.epub.servlet
Class SearchFormHandler

java.lang.Object
  extended by BaseSearchFormHandler
      extended by atg.epub.servlet.SearchFormHandler
Direct Known Subclasses:
AssetSearchFormHandler, ProjectSearchFormHandler

public class SearchFormHandler
extends BaseSearchFormHandler

This form handler can be used to search repositories with any combination of several search types: Keyword, Text, Hierarchical, Advanced. Each of these types are enabled with a boolean parameter. The handler examines each boolean and if true, appends that search's subquery to the full query string.

General Properties

Set one or more of the following properties to "true" to enable a search type:

doKeywordSearch
look in multiple text properties for one or more keywords
doTextSearch
perform a full-text search for a specified search string in one or more text properties
doHierarchicalSearch
find all decendents of a specified repository item
doAdvancedSearch
similar to a Keyword search, except that we test properties for an exact match rather than matching substrings within the property

Keyword Search Properties

Keyword searching takes a set of property names and a search string(s). Each property will be searched for these strings. You may also search *ALL* string properties (excluding enumerated and non-queriable properties) of an item by simply leaving the property keywordSearchPropertyNames empty.

keywordSearchPropertyNames
array of property names to search in the format "item-type-name.property-name". Leave empty to search all string properties.
keywords
array of keyword strings to search for. If not set, will use keywordInput property
keywordInput
alternative way to search keywords. Unlike keywords, this property allows logical operators (AND, OR, NOT, &, |, !) and supports parenthesis '(' and ')' to group logic. Quote keyword values with single or double quotes if they include spaces. Quote types may not be mixed. Logical operators are optional; 'OR' will be used by default
toUpperCaseKeywords
set this to "true" to force keywords to be converted to upper-case before the query is run
toLowerCaseKeywords
set this to "true" to force keywords to be converted to lower-case before the query is run
 

Text Search Properties

Text searching takes a list of text property names and an input search string to do text pattern matching. Values entered will be used to build the sub-query for text searching.

textSearchPropertyNames
list of property names to search in the format "item-type-name.property-name". If not specified, the default list of text properties configured in the repository will be used.
searchStringFormat
the format to use i.e. "ORACLE_CONTEXT", "SYBASE_SDS"
textInput
The string to search for. If a repository is configured to simulate full-text queries (simulateTextSearchQueries=true), the SQL LIKE operator will be used to determine whether the target value is a substring of any of the text properties being searched.
allowWildcards
If true, the wildcard character '*' can be used anywhere in the input string to represent any number of characters. True by default.
minScore
minimum required score that the results must meet or exceed in order to be returned by the full-text search engine. See vendor docs for more information on the meaning and use of the score value. [NOTE: Current repository implementations don't yet support this feature of full-text searches.]
 

Hierarchical Search Properties

Hierarchical searches look in a subset of items, starting from a given item, including also that items's child items, and also those children's children, i.e. all descendants of the original item. The given item is indicated by the repository ID in the ancestorId property.

ancestorPropertyName
the name of the property in which to search for ancestor repository items
ancestorId
the property that represents the repositoryId of the ancestor item to search in
 

Advanced Search Properties

Advanced searching takes a list of properties and values or ranges of values for those properties and looks for an exact match. Additionally, the Advanced Search can be used to provide all possible search values for properties specified in AdvancedSearchPropertyNames. For example, enumerated types will be defined in the repository with a set number of values. Advanced searching can retrieve these values to be displayed in a select box.

advancedSearchPropertyNames
list of property names to search. Format: type.property
advancedSearchPropertyValues
propery names mapped to search values. Fortat: type.property=value
advancedSearchPropertyRanges
For each property searched, you can specify a value "range" rather than a single value. Either a maximum or minimum value or both may be specified. Ranges are set by item type, then property name, and finally by "max" or "min". For example, "mySearchHandler.advancedSearchPropertyRanges.product.creationDate.max"
propertyValuesByType
dictionary containing one key/value pair for each property named in advancedSearchPropertyNames whose type is either enumerated, RepositoryItem or a collection of RepositoryItems. The key is the name of the property and the value is a Collection of the possible values. If the property type a collection of RepositoryItems, the value will be a collection of RepositoryItem. Alternatively, if the property type is RepositoryItem a property of each item is returned as described below.
displayName
when a property of an item being searched is another RepositoryItem, by default we search the child item's property named "displayName" if it exists. In the same way, values returned by the property propertyValuesByType will be values of the property "displayName" when the property is a RepositoryItem. Use this property to override the default name of "displayName"
 

Form Actions

In addition to the standard "cancel" action of all form handlers:

search
execute the search and store the results. The Keyword and Text queries are OR'ed together. The Advanced and Hierarchical queries are AND'ed together, and these combined queries are then OR'ed. That is: ( (Keyword OR Text) AND (Advanced AND Hierarchical).
clearQuery
this action is used in combination with the property allowRefine. It will force the previous query to be cleared so that the user may begin refining their query anew.
 

See Also:
atg.epub.servlet.BaseSearchFormHandler

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String GENERATE_VALUES_BY_TYPE_FAILED
          droplet exception code: failed to generate possible values for a property
static java.lang.String INVALID_KEYWORD_SEARCH_STRING
          droplet exception code: syntax problem in keyword search string
static java.lang.String INVALID_PROP_COMBINATION
          droplet exception code: cant combine these properties
static java.lang.String INVALID_SEARCH_PROPERTY_NAMES
          droplet exception code: searched property names don't exist in item
static java.lang.String NO_PROPERTY_NAMES_FOR_ITEM
          droplet exception code: no property names specified for searched item
static java.lang.String UNMATCHED_QUOTES
          logical operator search string parse failed because quotes didn't match
 
Constructor Summary
SearchFormHandler()
           
 
Method Summary
protected  boolean areSearchValuesEmpty()
          Check to see if all search values are empty for enabled search types
 boolean beforeSet(DynamoHttpServletRequest request, DynamoHttpServletResponse response)
          Called before any setX methods on this form are set when a form that modifies properties of this form handler is submitted.
protected  Query generateAdvancedSearchQuery(Repository pRepository, java.lang.String pItemType, QueryBuilder pQueryBuilder)
          Return a query which represents an advanced search based on selected property values.
protected  Query generateHierarchicalSearchQuery(java.lang.String pItemType, QueryBuilder pQueryBuilder)
          Build a query which represents a hierarchical search, that is, a constraint to look only in a designated item, its child items, and so on, in effect, to all descendants of the designated item.
protected  Query generateKeywordSearchQuery(Repository pRepository, java.lang.String pItemType, QueryBuilder pQueryBuilder)
          Return a query which represents a keyword search.
protected  java.util.Collection generateResultSet(java.lang.String pItemType)
          For the supplied item type return a collection of ==sub-result set that will combined into the total result set.
protected  Query generateSearchQuery(Repository pRepository, java.lang.String pItemType, QueryBuilder pQueryBuilder)
          Return the query that should be executed on the Repository View.
protected  java.util.Collection generateSearchValues(java.lang.String pItemType, java.lang.String pPropertyName)
          Used by the advanced searching feature.
protected  Query generateSingleKeywordQuery(Repository pRepository, java.lang.String pItemType, QueryBuilder pQueryBuilder, java.lang.String pPropertyName, java.lang.String pInput)
          Parses pKeywordInput and converts into RQL statement where each keyword value is used to create a CONTAINS clause.
protected  Query generateSingleKeywordQuery(Repository pRepository, java.lang.String pItemType, QueryBuilder pQueryBuilder, java.lang.String pPropertyName, java.lang.String[] pKeywords)
          Return a query for the given property name against the set of supplied keywords.
protected  Query generateTextSearchQuery(java.lang.String pItemType, QueryBuilder pQueryBuilder, java.lang.String pInput)
          Return a query which represents a text search query.
 java.lang.String[] getAdvancedSearchPropertyNames()
          Returns property AdvancedSearchPropertyNames
 java.util.HashMap getAdvancedSearchPropertyRanges()
          Returns property AdvancedSearchPropertyRanges
 java.util.HashMap getAdvancedSearchPropertyValues()
          Returns property AdvancedSearchPropertyValues
 boolean getAllowWildcards()
          Returns property AllowWildcards
 java.lang.String getAncestorId()
          Returns property AncestorId
 java.lang.String getAncestorPropertyName()
          Returns property ancestorPropertyName
 java.lang.String getDisplayName()
          Returns property displayName
 java.lang.String getEncodedPathAndItemType()
          Get the value set as the encoded repository component path name and item descriptor name
 java.lang.String getFolderPath()
          Returns property FolderPath
 boolean getIgnoreCase()
           
 java.lang.String getKeywordInput()
          Returns property KeywordInput
 java.lang.String[] getKeywords()
          Returns property Keywords
 java.lang.String[] getKeywordSearchPropertyNames()
          Returns property KeywordSearchPropertyNames which is the set of property names for text search
 java.lang.Integer getMinScore()
          Returns property MinScore
 java.util.HashMap getPropertyValuesByType()
          Returns property PropertyValuesByType.
 java.lang.String getSearchStringFormat()
          Returns property SearchStringFormat
protected  java.lang.String getSingleKeywordSearchOperator(boolean pIsMulti)
          Return a keyword search operator based on the state of ignoreCase for non-multi items.
 java.lang.String getTextInput()
          Returns property TextInput
 java.lang.String[] getTextSearchPropertyNames()
          Returns property TextSearchPropertyNames which is the set of property names for text search
protected  VirtualFileSystem getVFSFromComponentPath(java.lang.String pComponentPath)
           
 VirtualFileSystem[] getVirtualFileSystems()
          Returns property VirtualFileSystems
protected  boolean isAdvancedSearchPropertyRangesEmpty()
          test if adv search property ranges null or empty
protected  boolean isAdvancedSearchPropertyValuesEmpty()
          test if adv search property values are null or empty
 boolean isDoAdvancedSearch()
          Returns property DoAdvancedSearch
 boolean isDoHierarchicalSearch()
          Returns property DoHierarchicalSearch
 boolean isDoKeywordSearch()
          Returns property DoKeywordSearch
 boolean isDoTextSearch()
          Returns property DoTextSearch
 boolean isIncludeSubFolders()
          Returns property IncludeSubFolders
 boolean isToLowerCaseKeywords()
          Returns property ToLowerCaseKeywords
 boolean isToUpperCaseKeywords()
          Returns property ToUpperCaseKeywords
 boolean isVirtualFileSystemSearch()
          Returns property VirtualFileSystemSearch
protected  void prepare(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Prepare search properties.
protected  java.util.ArrayList searchFolder(VirtualFile pFolder, atg.vfs.RegexVirtualFilenameFilter pRegexFilter, java.lang.String pFileType, boolean pIncludeSubFolders)
           
 void setAdvancedSearchPropertyNames(java.lang.String[] pAdvancedSearchPropertyNames)
          Sets property AdvancedSearchPropertyNames
 void setAdvancedSearchPropertyRanges(java.util.HashMap pRanges)
          Sets property AdvancedSearchPropertyRanges
 void setAdvancedSearchPropertyValues(java.util.HashMap pValues)
          Sets property AdvancedSearchPropertyValues
 void setAllowWildcards(boolean pAllowWildcards)
          Sets property AllowWildcards.
 void setAncestorId(java.lang.String pAncestorId)
          Sets property AncestorId.
 void setAncestorPropertyName(java.lang.String pAncestorPropertyName)
          Sets property ancestorPropertyName
 void setDisplayName(java.lang.String pDisplayName)
          Sets property displayName
 void setDoAdvancedSearch(boolean pDoAdvancedSearch)
          Sets property DoAdvancedSearch
 void setDoHierarchicalSearch(boolean pDoHierarchicalSearch)
          Sets property DoHierarchicalSearch
 void setDoKeywordSearch(boolean pDoKeywordSearch)
          Sets property DoKeywordSearch
 void setDoTextSearch(boolean pDoTextSearch)
          Sets property DoTextSearch
 void setEncodedPathAndItemType(java.lang.String pEncodedValue)
          Set a single repository component path and item descriptor name in an encoded string in which the repository component path and item descriptor name are seperated by a colon: /repository/path/name:itemDescriptorName Used in forms to make it easy to specify these values in a choice box.
 void setFolderPath(java.lang.String pFolderPath)
          Sets property FolderPath
 void setIgnoreCase(boolean pIgnoreCase)
          Set to true to use IGNORECASE in queries.
 void setIncludeSubFolders(boolean pIncludeSubFolders)
          Sets property IncludeSubFolders
 void setKeywordInput(java.lang.String pKeywordInput)
          Sets property KeywordInput
 void setKeywords(java.lang.String[] pKeywords)
          Sets property Keywords
 void setKeywordSearchPropertyNames(java.lang.String[] pKeywordSearchPropertyNames)
          Sets property KeywordSearchPropertyNames
 void setMinScore(java.lang.Integer pMinScore)
          Sets property MinScore.
 void setPropertyValuesByType()
          Sets property PropertyValuesByType.
 void setSearchStringFormat(java.lang.String pSearchStringFormat)
          Sets property SearchStringFormat used by Text search.
 void setTextInput(java.lang.String pTextInput)
          Sets property TextInput used for Text searches.
 void setTextSearchPropertyNames(java.lang.String[] pTextSearchPropertyNames)
          Sets property TextSearchPropertyNames
 void setToLowerCaseKeywords(boolean pToLowerCaseKeywords)
          Sets property ToLowerCaseKeywords
 void setToUpperCaseKeywords(boolean pToUpperCaseKeywords)
          Sets property ToUpperCaseKeywords
 void setVirtualFileSystems(VirtualFileSystem[] pVirtualFileSystems)
          Sets property VirtualFileSystems
 void setVirtualFileSystemSearch(boolean pVirtualFileSystemSearch)
          Sets property VirtualFileSystemSearch
protected  void splitPropertyNames(java.lang.String[] pTypes, java.lang.String[] pSource, java.util.HashMap pDest, java.lang.String pSearchType)
          Split property names into type and name from type.name
protected  java.lang.String[] transformKeywords(java.lang.String[] pKeywords)
          With the supplied keywords perform any modifications that are required to allow it to be used within a keyword query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


INVALID_SEARCH_PROPERTY_NAMES

public static final java.lang.String INVALID_SEARCH_PROPERTY_NAMES
droplet exception code: searched property names don't exist in item

See Also:
Constant Field Values

GENERATE_VALUES_BY_TYPE_FAILED

public static final java.lang.String GENERATE_VALUES_BY_TYPE_FAILED
droplet exception code: failed to generate possible values for a property

See Also:
Constant Field Values

NO_PROPERTY_NAMES_FOR_ITEM

public static final java.lang.String NO_PROPERTY_NAMES_FOR_ITEM
droplet exception code: no property names specified for searched item

See Also:
Constant Field Values

INVALID_KEYWORD_SEARCH_STRING

public static final java.lang.String INVALID_KEYWORD_SEARCH_STRING
droplet exception code: syntax problem in keyword search string

See Also:
Constant Field Values

INVALID_PROP_COMBINATION

public static final java.lang.String INVALID_PROP_COMBINATION
droplet exception code: cant combine these properties

See Also:
Constant Field Values

UNMATCHED_QUOTES

public static final java.lang.String UNMATCHED_QUOTES
logical operator search string parse failed because quotes didn't match

See Also:
Constant Field Values
Constructor Detail

SearchFormHandler

public SearchFormHandler()
Method Detail

setVirtualFileSystems

public void setVirtualFileSystems(VirtualFileSystem[] pVirtualFileSystems)
Sets property VirtualFileSystems


getVirtualFileSystems

public VirtualFileSystem[] getVirtualFileSystems()
Returns property VirtualFileSystems


setVirtualFileSystemSearch

public void setVirtualFileSystemSearch(boolean pVirtualFileSystemSearch)
Sets property VirtualFileSystemSearch


isVirtualFileSystemSearch

public boolean isVirtualFileSystemSearch()
Returns property VirtualFileSystemSearch


setFolderPath

public void setFolderPath(java.lang.String pFolderPath)
Sets property FolderPath


getFolderPath

public java.lang.String getFolderPath()
Returns property FolderPath


setIncludeSubFolders

public void setIncludeSubFolders(boolean pIncludeSubFolders)
Sets property IncludeSubFolders


isIncludeSubFolders

public boolean isIncludeSubFolders()
Returns property IncludeSubFolders


getEncodedPathAndItemType

public java.lang.String getEncodedPathAndItemType()
Get the value set as the encoded repository component path name and item descriptor name

Returns:
the encoded value

setEncodedPathAndItemType

public void setEncodedPathAndItemType(java.lang.String pEncodedValue)
Set a single repository component path and item descriptor name in an encoded string in which the repository component path and item descriptor name are seperated by a colon: /repository/path/name:itemDescriptorName Used in forms to make it easy to specify these values in a choice box.

Parameters:
pEncodedValue - the encoded repository component path and item descriptor name

setIgnoreCase

public void setIgnoreCase(boolean pIgnoreCase)
Set to true to use IGNORECASE in queries. Currently supported only in keyword searches

Parameters:
pIgnoreCase - true to ignore case

getIgnoreCase

public boolean getIgnoreCase()

setDoKeywordSearch

public void setDoKeywordSearch(boolean pDoKeywordSearch)
Sets property DoKeywordSearch

Parameters:
pDoKeywordSearch - the property to store the boolean value of whether or not to perform a keyword search.

isDoKeywordSearch

public boolean isDoKeywordSearch()
Returns property DoKeywordSearch

Returns:
The value of the property DoKeywordSearch.

setDoTextSearch

public void setDoTextSearch(boolean pDoTextSearch)
Sets property DoTextSearch

Parameters:
pDoTextSearch - the property to store the boolean value of whether or not to perform a text search.

isDoTextSearch

public boolean isDoTextSearch()
Returns property DoTextSearch

Returns:
The value of the property DoTextSearch.

setDoHierarchicalSearch

public void setDoHierarchicalSearch(boolean pDoHierarchicalSearch)
Sets property DoHierarchicalSearch

Parameters:
pDoHierarchicalSearch - the property to store the boolean value of whether or not to perform a hierarchical search.

isDoHierarchicalSearch

public boolean isDoHierarchicalSearch()
Returns property DoHierarchicalSearch

Returns:
The value of the property DoHierarchicalSearch

setDoAdvancedSearch

public void setDoAdvancedSearch(boolean pDoAdvancedSearch)
Sets property DoAdvancedSearch

Parameters:
pDoAdvancedSearch - the property to store the boolean value of whether or not to perform a advanced search.

isDoAdvancedSearch

public boolean isDoAdvancedSearch()
Returns property DoAdvancedSearch

Returns:
The value of the property DoAdvancedSearch

setKeywordSearchPropertyNames

public void setKeywordSearchPropertyNames(java.lang.String[] pKeywordSearchPropertyNames)
Sets property KeywordSearchPropertyNames

Parameters:
pKeywordSearchPropertyNames - The property to store the names of all the keyword properties. Expects names to be qualified by item-type (i.e. "item-type.property-name".

getKeywordSearchPropertyNames

public java.lang.String[] getKeywordSearchPropertyNames()
Returns property KeywordSearchPropertyNames which is the set of property names for text search

Returns:
The value of the property KeywordSearchPropertyNames.

setTextSearchPropertyNames

public void setTextSearchPropertyNames(java.lang.String[] pTextSearchPropertyNames)
Sets property TextSearchPropertyNames

Parameters:
pTextSearchPropertyNames - the property to store text search property names.

getTextSearchPropertyNames

public java.lang.String[] getTextSearchPropertyNames()
Returns property TextSearchPropertyNames which is the set of property names for text search

Returns:
The value of the property TextSearchPropertyNames

setAdvancedSearchPropertyNames

public void setAdvancedSearchPropertyNames(java.lang.String[] pAdvancedSearchPropertyNames)
Sets property AdvancedSearchPropertyNames

Parameters:
pAdvancedSearchPropertyNames - the property to store advanced search property names.

getAdvancedSearchPropertyNames

public java.lang.String[] getAdvancedSearchPropertyNames()
Returns property AdvancedSearchPropertyNames

Returns:
The value of the property which is the set of property names to search

setAdvancedSearchPropertyRanges

public void setAdvancedSearchPropertyRanges(java.util.HashMap pRanges)
Sets property AdvancedSearchPropertyRanges

Parameters:
Map - of range values (min & max) for Advanced Search property names

getAdvancedSearchPropertyRanges

public java.util.HashMap getAdvancedSearchPropertyRanges()
Returns property AdvancedSearchPropertyRanges

Returns:
map of the range values (min & max) for Advanced Search property names. Structure is map of item-type --> map of property names --> map of mix & max, i.e. product.creationDate.min = "1/1/1999"

isAdvancedSearchPropertyRangesEmpty

protected boolean isAdvancedSearchPropertyRangesEmpty()
test if adv search property ranges null or empty


getPropertyValuesByType

public java.util.HashMap getPropertyValuesByType()
Returns property PropertyValuesByType. Containing one key/value pair for each property named in advancedSearchPropertyNames whose type is either enumerated or RepositoryItem. The key is the name of the property and the value is a Collection of the possible values.

Returns:
The value of the property PropertyValuesByType

setPropertyValuesByType

public void setPropertyValuesByType()
Sets property PropertyValuesByType. Contains a map of item-types to maps of property name/values.


getAdvancedSearchPropertyValues

public java.util.HashMap getAdvancedSearchPropertyValues()
Returns property AdvancedSearchPropertyValues

Returns:
The value of the property AdvancedSearchPropertyValues which is the key/value pairs for each property you want to search

setAdvancedSearchPropertyValues

public void setAdvancedSearchPropertyValues(java.util.HashMap pValues)
Sets property AdvancedSearchPropertyValues

Parameters:
pAdvancedSearchPropertyValues - the property to store selected property values for advanced searching. The key is the item type and the value is another map of property name to search values.

isAdvancedSearchPropertyValuesEmpty

protected boolean isAdvancedSearchPropertyValuesEmpty()
test if adv search property values are null or empty


getDisplayName

public java.lang.String getDisplayName()
Returns property displayName

Returns:
The value of the property displayName

setDisplayName

public void setDisplayName(java.lang.String pDisplayName)
Sets property displayName

Parameters:
pDisplayName - the property name to use when an advanced search queries a property that is another RepositoryItem.

setKeywords

public void setKeywords(java.lang.String[] pKeywords)
Sets property Keywords

Parameters:
pKeywords - the property to store keywords to search for in keyword property names. if not set, the property "keywordInput" will be used

getKeywords

public java.lang.String[] getKeywords()
Returns property Keywords

Returns:
The value of the property Keywords which is the target values to search

setKeywordInput

public void setKeywordInput(java.lang.String pKeywordInput)
Sets property KeywordInput

Parameters:
pKeywordInput - the property to store the input search string. Keyword search will use this if keyword property is not set.

getKeywordInput

public java.lang.String getKeywordInput()
Returns property KeywordInput

Returns:
The value of the property KeywordInput.

setAncestorPropertyName

public void setAncestorPropertyName(java.lang.String pAncestorPropertyName)
Sets property ancestorPropertyName

Parameters:
pAncestorPropertyName - the property to store the value of ancestor property name.

getAncestorPropertyName

public java.lang.String getAncestorPropertyName()
Returns property ancestorPropertyName

Returns:
The value of the property ancestorPropertyName

setAncestorId

public void setAncestorId(java.lang.String pAncestorId)
Sets property AncestorId.

Parameters:
pAncestorId - the property to store the repositoryId of the ancestor to search in for Hierarchical searches.

getAncestorId

public java.lang.String getAncestorId()
Returns property AncestorId

Returns:
The value of the property AncestorId

setTextInput

public void setTextInput(java.lang.String pTextInput)
Sets property TextInput used for Text searches.

Parameters:
pTextInput - the property to store the input search string.

getTextInput

public java.lang.String getTextInput()
Returns property TextInput

Returns:
The value of the property TextInput.

setSearchStringFormat

public void setSearchStringFormat(java.lang.String pSearchStringFormat)
Sets property SearchStringFormat used by Text search. If not set, will use the default format.

Parameters:
pSearchStringFormat - the property to store any string formatting information parameters for searching.

getSearchStringFormat

public java.lang.String getSearchStringFormat()
Returns property SearchStringFormat

Returns:
The value of the property SearchStringFormat.

setAllowWildcards

public void setAllowWildcards(boolean pAllowWildcards)
Sets property AllowWildcards. If "true", the character '*' can be used as a wildcard in the Text search.

Parameters:
pAllowWildcards - a boolean property that determines if Text searching should allow the character '*' to be used as a wildcard

getAllowWildcards

public boolean getAllowWildcards()
Returns property AllowWildcards

Returns:
The value of the property AllowWildcards.

setMinScore

public void setMinScore(java.lang.Integer pMinScore)
Sets property MinScore. Used by Text Searches. Scoring is not yet implemented.

Parameters:
pMinScore - the property to store the minimum scoring used for text searching.

getMinScore

public java.lang.Integer getMinScore()
Returns property MinScore

Returns:
The value of the property MinScore

setToUpperCaseKeywords

public void setToUpperCaseKeywords(boolean pToUpperCaseKeywords)
Sets property ToUpperCaseKeywords

Parameters:
pToUpperCaseKeywords - the property to store the boolean value of whether or not to convert input string to upper case.

isToUpperCaseKeywords

public boolean isToUpperCaseKeywords()
Returns property ToUpperCaseKeywords

Returns:
The value of the property ToUpperCaseKeywords

setToLowerCaseKeywords

public void setToLowerCaseKeywords(boolean pToLowerCaseKeywords)
Sets property ToLowerCaseKeywords

Parameters:
pToLowerCaseKeywords - the property to store the boolean value of whether or not to convert input string to lower case.

isToLowerCaseKeywords

public boolean isToLowerCaseKeywords()
Returns property ToLowerCaseKeywords

Returns:
The value of the property ToLowerCaseKeywords

beforeSet

public boolean beforeSet(DynamoHttpServletRequest request,
                         DynamoHttpServletResponse response)
                  throws DropletFormException
Called before any setX methods on this form are set when a form that modifies properties of this form handler is submitted.

Throws:
DropletFormException

generateResultSet

protected java.util.Collection generateResultSet(java.lang.String pItemType)
For the supplied item type return a collection of ==sub-result set that will combined into the total result set. generateResultSet calls generateSearchQuery to build the query string based on options. The resulting query is executed on the Repository View and resultset returned.

Parameters:
pItemType - the type of item to search for.
Returns:
null if no items could be found

areSearchValuesEmpty

protected boolean areSearchValuesEmpty()
Check to see if all search values are empty for enabled search types


getVFSFromComponentPath

protected VirtualFileSystem getVFSFromComponentPath(java.lang.String pComponentPath)

searchFolder

protected java.util.ArrayList searchFolder(VirtualFile pFolder,
                                           atg.vfs.RegexVirtualFilenameFilter pRegexFilter,
                                           java.lang.String pFileType,
                                           boolean pIncludeSubFolders)

generateSearchQuery

protected Query generateSearchQuery(Repository pRepository,
                                    java.lang.String pItemType,
                                    QueryBuilder pQueryBuilder)
                             throws RepositoryException,
                                    DropletFormException
Return the query that should be executed on the Repository View. This method attempts to build its query from keyword, text, advanced, and hierarchical search subqueries. It calls each sub method to build the sub query. The method attempts to build an OR query between keyword and text search and an AND with advanced or hierarchical search queries

Parameters:
pRepository - the repository to search in
pItemType - the type of item to search for.
pQueryBuilder - the builder that should be used to construct the query
Throws:
RepositoryException - if an error occured while forming the query
DropletFormException

generateKeywordSearchQuery

protected Query generateKeywordSearchQuery(Repository pRepository,
                                           java.lang.String pItemType,
                                           QueryBuilder pQueryBuilder)
                                    throws RepositoryException,
                                           DropletFormException
Return a query which represents a keyword search. If keywords property is set, this method builds a sub-query for each attribute named in the KeywordSearchPropertyNames property. Each sub-query is OR'd together to form the total query. If the attribute named is of a Collection or array type, then an "includes any" query is formed. Single-value attributes use a CONTAINS comparison query. If keywords is empty, keywordInput is used to build an RQL statement instead.

Parameters:
pRepository - the Repository to search in
pItemType - the type of item to search for. Typically corresponds to an item descriptor name
pQueryBuilder - the builder that should be used to construct the query
Throws:
RepositoryException - if an error occured while forming the query
DropletFormException

generateSingleKeywordQuery

protected Query generateSingleKeywordQuery(Repository pRepository,
                                           java.lang.String pItemType,
                                           QueryBuilder pQueryBuilder,
                                           java.lang.String pPropertyName,
                                           java.lang.String[] pKeywords)
                                    throws RepositoryException
Return a query for the given property name against the set of supplied keywords. If the data type of the property is multi-value, then build an "includes any" query. Otherwise OR together a pattern match CONTAINS query for each keyword value and property combination.

Throws:
RepositoryException

getSingleKeywordSearchOperator

protected java.lang.String getSingleKeywordSearchOperator(boolean pIsMulti)
Return a keyword search operator based on the state of ignoreCase for non-multi items. Apparently INCLUDES does not accept this option.

Returns:
a keyword search operator

generateSingleKeywordQuery

protected Query generateSingleKeywordQuery(Repository pRepository,
                                           java.lang.String pItemType,
                                           QueryBuilder pQueryBuilder,
                                           java.lang.String pPropertyName,
                                           java.lang.String pInput)
                                    throws RepositoryException,
                                           DropletFormException
Parses pKeywordInput and converts into RQL statement where each keyword value is used to create a CONTAINS clause.

Throws:
RepositoryException
DropletFormException

generateTextSearchQuery

protected Query generateTextSearchQuery(java.lang.String pItemType,
                                        QueryBuilder pQueryBuilder,
                                        java.lang.String pInput)
                                 throws RepositoryException
Return a query which represents a text search query. This method builds a sub-query for each attribute named in the textSearchPropertyNames property. Each sub-query is OR'd together to form the total query. The search string format is configured with the searchStringFormat property.

Parameters:
pItemType - the type of item to search for.
pQueryBuilder - the builder that should be used to construct the query
pInput - the search string to use for the full text search
Throws:
RepositoryException - if an error occured while forming the query

generateAdvancedSearchQuery

protected Query generateAdvancedSearchQuery(Repository pRepository,
                                            java.lang.String pItemType,
                                            QueryBuilder pQueryBuilder)
                                     throws RepositoryException,
                                            DropletFormException
Return a query which represents an advanced search based on selected property values. This method builds a sub-query for each property found in mAdvancedSearchPropertyNames. If the property type is another repository item, we need to search below this level for the property value. To do this, we append .displayName to the property before searching. All advanced property sub-queries are AND'd together to form the final complete query string.

Parameters:
pRepository - the repository to search
pItemType - the type of item to search for.
pQueryBuilder - the builder that should be used to construct the query
Throws:
RepositoryException - if an error occured while forming the query
DropletFormException

generateHierarchicalSearchQuery

protected Query generateHierarchicalSearchQuery(java.lang.String pItemType,
                                                QueryBuilder pQueryBuilder)
                                         throws RepositoryException
Build a query which represents a hierarchical search, that is, a constraint to look only in a designated item, its child items, and so on, in effect, to all descendants of the designated item. The designated item is indicated by repository ID in the ancestorId property. If that repository ID is null or null string, then this method generates a null query.

Note: this query assumes that the item type being searched for has a property (as indicated by the value of theancestorPropertyName property) whose value is a collection of all its ancestor groups. If the designated item is contained in this collection, then this query returns true.

Parameters:
pItemType - the type of item to search for. Typically corresponds to an item descriptor name
pQueryBuilder - the builder that should be used to construct the query
Throws:
RepositoryException - if an error occured while forming the query

generateSearchValues

protected java.util.Collection generateSearchValues(java.lang.String pItemType,
                                                    java.lang.String pPropertyName)
Used by the advanced searching feature. Returns a list of available search options for pPropertyName. Will search through all itemTypes and collect all values for properties. For example, an enumerated property will be defined in the repository item descriptor with a set of values. This method will get possible values from the property descriptor. Other properties may need a repository query to obtain those options. This collection of searchValues can then be displayed in a select box to further refine advanced searching.

Parameters:
pItemType - item of the property to search for possible values
pPropertyName - name of the property to get possible values for
Returns:
options or null if no values could be found

splitPropertyNames

protected void splitPropertyNames(java.lang.String[] pTypes,
                                  java.lang.String[] pSource,
                                  java.util.HashMap pDest,
                                  java.lang.String pSearchType)
Split property names into type and name from type.name


transformKeywords

protected java.lang.String[] transformKeywords(java.lang.String[] pKeywords)
With the supplied keywords perform any modifications that are required to allow it to be used within a keyword query. This implementation checks the toLowerCaseKeywords and toUpperCaseKeywords properties to determine if String.toLowerCase or String.toUpperCase should be invoked.

Parameters:
pKeywords - the words to transform for querying

prepare

protected void prepare(DynamoHttpServletRequest pRequest,
                       DynamoHttpServletResponse pResponse)
Prepare search properties.