atg.commerce.catalog
Class SearchFormHandler

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.droplet.EmptyFormHandler
              extended by atg.droplet.GenericFormHandler
                  extended by atg.repository.servlet.SearchFormHandler
                      extended by atg.commerce.catalog.SearchFormHandler
All Implemented Interfaces:
DropletFormHandler, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener
Direct Known Subclasses:
B2CSearchFormHandler, CatalogSearchFormHandler, FilteringSearchFormHandler

public class SearchFormHandler
extends SearchFormHandler

This form handler is used to search the catalog repository for products and categories. The handler can be used to perform four types of searching: keywords, text, advanced, and hierarchical. All four types use a boolean to turn that searching feature on and propertyName to specify on which properties to search. This form handler examines each boolean and if true, appends that subquery to the full query string. The itemTypes property specify what items in the catalog repository definition to search. For the catalog, these will likely be 'product' or 'category' or both. Configuration files will be used to specify what searching to perform on which property values and item types.

Keyword
Keyword searching uses keyword property names and an input search string to search product and/or category keywords. Values entered will be used to build the subQuery for keyword matching.

keywordsPropertyNames
array of property names to search
keywords
array of keyword strings to search for. If not set, will search list of strings in property searchInput
searchInput
alternate strings to search for. If keywords property is not set, this string will be parsed using the deliminator keywordInputSeparator and the resulting array of strings will be used instead. This property is shared by Text searches.
keywordInputSeparator
a single character that is used as a deliminator to parse searchInput. The default value is a single space.
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
Text searching uses text property names and an input search string to do a text pattern matching on properties. Values entered will be used to build the subQuery for text searching.

textSearchPropertyNames
list of property names to search. 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"
searchInput
The string to search for. If a repository is configured to use a full-text search engine, this string can include native search language of that engine. On the other hand, 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. This property is also used for Keyword searches if the keywords property is not set.
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. It is provided for future use.]

Advanced
Advanced searches provide possible search options for each property specified in AdvancedSearchPropertyNames. For example, enumerated types will be defined in the repository with a set number of values. Advanced searching will retrieve these values from the definition to display in a select box. The advanced query will be built from options selected to further refine the catalog search.

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

Price
Price searches take a pricePropertyName, which is the name of the property of the product to search for the price on. This property can be a subreference (i.e., childSKUs.listPrice). It also takes a priceRelation, which is a comparison operator (i.e., ">", ">=", "=", etc.). Finally, it takes a price, which must be a valid number. The search will return the products whose priceProperty contains a value that has the proper relation with the price given.

Sku
This is an open-ended text search on the childSKUsPropertyName for the "sku" input. All products that contain a sku with an id that contains the given "sku" substring will be returned.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String INVALID_PRICE
          droplet exception code: invalid price
protected  java.lang.String mLastCatalogKey
          Member variable where prepareRepositories stores the last catalog key it saw.
 
Fields inherited from class atg.repository.servlet.SearchFormHandler
EMPTY_SEARCH_VALUES_DISALLOW, GENERATE_VALUES_BY_TYPE_FAILED, INVALID_ITEM_TYPE, INVALID_KEYWORD_SEARCH_STRING, INVALID_PROP_COMBINATION, INVALID_SEARCH_PROPERTY_NAMES, mEndIndex, mPreviouslySubmitted, mPreviousQuery, mSearchResults, mSearchResultsByItemType, mStartIndex, MULTIPLE_ITEM_TYPES_DISALLOW, NO_PROPERTY_NAMES_FOR_ITEM, QUERY_FAILURE, UNMATCHED_QUOTES
 
Fields inherited from class atg.droplet.GenericFormHandler
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
SearchFormHandler()
          Constructs an instanceof SearchFormHandler
 
Method Summary
protected  boolean areSearchValuesEmpty()
          Extends the base behavior to check the sku and price search values.
 void beforeGet(DynamoHttpServletRequest request, DynamoHttpServletResponse response)
          Called before getX methods on this form are called.
protected  Query generatePriceQuery(Repository pRepository, java.lang.String pItemType, QueryBuilder pQueryBuilder)
          generate subquery using RQL
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 pSearchType)
          generateSearchValues is used by the advanced searching feature.
protected  Query generateSkuQuery(java.lang.String pItemType, QueryBuilder pQueryBuilder, java.lang.String pInput)
          Generates a search for child skus of the product
 java.lang.String[] getAdvancedSearchPropertyNames()
          Returns property AdvancedSearchPropertyNames which is the set of property names to search
 java.lang.String getAncestorCategoriesPropertyName()
          Returns property ancestorCategoriesPropertyName
 java.lang.String getCatalogKey()
          Returns property CatalogKey
 CatalogTools getCatalogTools()
          Returns property catalogTools.
 java.lang.String getChildSKUsPropertyName()
          Returns property ChildSKUsPropertyName which is the name of the childSKUs property in the product item descriptor
 java.lang.String getHierarchicalCategoryId()
          Returns property HierarchicalCategoryId
 char getKeywordInputSeparator()
          Returns property KeywordInputSeparator
 java.lang.String[] getKeywords()
          Returns property Keywords.
 java.lang.String[] getKeywordsPropertyNames()
          Returns property KeywordsPropertyNames which is the set of property names to search
 java.lang.String getLoggingIdentifier()
          Returns property LoggingIdentifier
protected  java.lang.String getMessage(java.lang.String key, java.lang.Object[] args)
           
 java.lang.String getPrice()
          Returns property Price which is the price to search for
 java.lang.String getPricePropertyName()
          Returns property PricePropertyName
 java.lang.String getPriceRelation()
          Returns property PriceRelation
 java.util.HashMap getPropertyValues()
          Returns property PropertyValues
 java.util.HashMap getPropertyValuesByType()
          Returns property PropertyValuesByType.
 java.lang.String getRepositoryKey(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Retrieve the key to the catalog repository.
 java.lang.String getRepositoryKeyParamName()
          Returns property repositoryKeyParamName
 RepositoryView getRepositoryView(Repository pRepository, java.lang.String pViewName)
          Returns the repository view for the repository
 java.lang.String getSearchInput()
          Returns property SearchInput
 java.lang.String getSku()
          Returns property Sku
 java.lang.String[] getTextSearchPropertyNames()
          Returns property TextSearchPropertyNames which is the set of property names for text search
 boolean handleSearch(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          For each each item type in that repository, call generateSearchResultSet to generate a subResultSet for that item type based on query parameters.
 boolean isSkuExactMatch()
          Gets the SkuExactMatch property value.
protected  void prepare(DynamoHttpServletRequest request, DynamoHttpServletResponse response)
          Prepare search properties.
protected  void prepareRepository(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Set the catalog key and the repository to search based on the repository key that has been stored in pRequest, but only if the value of the key has changed since the last time prepareRepository was called.
 void setAdvancedSearchPropertyNames(java.lang.String[] pAdvancedSearchPropertyNames)
          Sets property AdvancedSearchPropertyNames
 void setAncestorCategoriesPropertyName(java.lang.String pAncestorCategoriesPropertyName)
          Sets property ancestorCategoriesPropertyName
 void setCatalogKey(java.lang.String pCatalogKey)
          Sets property CatalogKey
 void setCatalogTools(CatalogTools pCatalogTools)
          Sets property catalogTools.
 void setChildSKUsPropertyName(java.lang.String pChildSKUsPropertyName)
          Sets property ChildSKUsPropertyName
 void setHierarchicalCategoryId(java.lang.String pHierarchicalCategoryId)
          Sets property HierarchicalCategoryId
 void setKeywordInputSeparator(char pKeywordInputSeparator)
          Sets property KeywordInputSeparator
 void setKeywordsPropertyNames(java.lang.String[] pKeywordSearchPropertyNames)
          Sets property KeywordSearchPropertyNames
 void setLoggingIdentifier(java.lang.String pLoggingIdentifier)
          Sets property LoggingIdentifier
 void setPrice(java.lang.String pPrice)
          Sets property Price
 void setPricePropertyName(java.lang.String pPricePropertyName)
          Sets property PricePropertyName
 void setPriceRelation(java.lang.String pPriceRelation)
          Sets property PriceRelation
 void setPropertyValues(java.util.HashMap pPropertyValues)
          Sets property PropertyValues
 void setPropertyValuesByType()
          init with all possible values of each property
 void setRepositoryKeyParamName(java.lang.String pRepositoryKeyParamName)
          Sets property repositoryKeyParamName
 void setSearchInput(java.lang.String pSearchInput)
          Sets property SearchInput
 void setSku(java.lang.String pSku)
          Sets property Sku
 void setSkuExactMatch(boolean pSkuExactMatch)
          Sets the SkuExactMatch property value.
 void setTextSearchPropertyNames(java.lang.String[] pTextSearchPropertyNames)
          Sets property TextSearchPropertyNames
 
Methods inherited from class atg.repository.servlet.SearchFormHandler
beforeSet, generateAdvancedSearchQuery, generateHierarchicalSearchQuery, generateKeywordSearchQuery, generateResultSet, generateSearchValues, generateTextSearchQuery, getAdvancedSearchPropertyRanges, getAdvancedSearchPropertyValues, getAllowEmptySearch, getAllowRefine, getAllowWildcards, getAncestorId, getAncestorPropertyName, getClearQueryURL, getCurrentResultPageNum, getDisplayName, getEndCount, getEndIndex, getErrorURL, getItemTypes, getKeywordInput, getKeywordSearchPropertyNames, getMaxResultsPerPage, getMaxRowCount, getMinScore, getRepositories, getResultPageCount, getResultSetSize, getSearchResults, getSearchResultsByItemType, getSearchStringFormat, getStartCount, getStartIndex, getSuccessURL, getTextInput, handleClearQuery, handleCurrentResultPageNum, isAdvancedSearchPropertyRangesEmpty, isAdvancedSearchPropertyValuesEmpty, isDoAdvancedSearch, isDoHierarchicalSearch, isDoKeywordSearch, isDoTextSearch, isEnableCountQuery, isPrepared, isPreviouslySubmitted, isToLowerCaseKeywords, isToUpperCaseKeywords, isUseIncludesForKeywordQueryOnMultiProperties, setAdvancedSearchPropertyRanges, setAdvancedSearchPropertyValues, setAllowEmptySearch, setAllowRefine, setAllowWildcards, setAncestorId, setAncestorPropertyName, setClearQueryURL, setCurrentResultPageNum, setDisplayName, setDoAdvancedSearch, setDoHierarchicalSearch, setDoKeywordSearch, setDoTextSearch, setEnableCountQuery, setEndIndex, setErrorURL, setItemTypes, setKeywordInput, setKeywords, setKeywordSearchPropertyNames, setMaxResultsPerPage, setMaxRowCount, setMinScore, setPrepared, setRepositories, setResultSetSize, setSearchStringFormat, setStartIndex, setSuccessURL, setTextInput, setToLowerCaseKeywords, setToUpperCaseKeywords, setUseIncludesForKeywordQueryOnMultiProperties, splitPropertyNames, transformKeywords
 
Methods inherited from class atg.droplet.GenericFormHandler
addFormException, addUncheckedFormException, afterSet, checkFormRedirect, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleCancel, handleFormException, handleUncheckedFormException, hasUncheckedFormExceptions, isDeferForwardsAndRedirects, isRestorableForm, isUseForwards, isValidSession, redirectOrForward, resetFormExceptions, setCancelURL, setCheckForValidSession, setDeferForwardsAndRedirects, setFormName, setMessagePort, setMessageSource, setMessageType, setRestorableForm, setSendMessages, setUseForwards
 
Methods inherited from class atg.droplet.EmptyFormHandler
afterGet
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

INVALID_PRICE

public static final java.lang.String INVALID_PRICE
droplet exception code: invalid price

See Also:
Constant Field Values

mLastCatalogKey

protected java.lang.String mLastCatalogKey
Member variable where prepareRepositories stores the last catalog key it saw.

Constructor Detail

SearchFormHandler

public SearchFormHandler()
Constructs an instanceof SearchFormHandler

Method Detail

setKeywordsPropertyNames

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

Parameters:
pKeywordSearchPropertyNames - The property to store the names of all the keyword properties.

getKeywordsPropertyNames

public java.lang.String[] getKeywordsPropertyNames()
Returns property KeywordsPropertyNames which is the set of property names to search

Returns:
The value of the property KeywordsPropertyNames.

setAdvancedSearchPropertyNames

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

Overrides:
setAdvancedSearchPropertyNames in class SearchFormHandler
Parameters:
pAdvancedSearchPropertyNames - the property to store advanced search property names.

getAdvancedSearchPropertyNames

public java.lang.String[] getAdvancedSearchPropertyNames()
Returns property AdvancedSearchPropertyNames which is the set of property names to search

Overrides:
getAdvancedSearchPropertyNames in class SearchFormHandler
Returns:
The value of the property AdvancedSearchPropertyNames

setTextSearchPropertyNames

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

Overrides:
setTextSearchPropertyNames in class SearchFormHandler
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

Overrides:
getTextSearchPropertyNames in class SearchFormHandler
Returns:
The value of the property TextSearchPropertyNames.

setLoggingIdentifier

public void setLoggingIdentifier(java.lang.String pLoggingIdentifier)
Sets property LoggingIdentifier

Parameters:
pLoggingIdentifier - the property which identifies this object as the Catalog Search.

getLoggingIdentifier

public java.lang.String getLoggingIdentifier()
Returns property LoggingIdentifier

Returns:
The value of the property LoggingIdentifier.

setRepositoryKeyParamName

public void setRepositoryKeyParamName(java.lang.String pRepositoryKeyParamName)
Sets property repositoryKeyParamName

Parameters:
pRepositoryKeyParamName - the property to store the name of the input parameter for the repository key value.

getRepositoryKeyParamName

public java.lang.String getRepositoryKeyParamName()
Returns property repositoryKeyParamName

Returns:
The value of the property repositoryKeyParamName

setCatalogKey

public void setCatalogKey(java.lang.String pCatalogKey)
Sets property CatalogKey

Parameters:
pCatalogKey - the property to store the catalog key used as an index to available catalogs (e.g. multiple languages).

getCatalogKey

public java.lang.String getCatalogKey()
Returns property CatalogKey

Returns:
The value of the property catalogKey

setCatalogTools

public void setCatalogTools(CatalogTools pCatalogTools)
Sets property catalogTools.

Parameters:
pCatalogTools - the property to store the global service catalog tools factory to obtain the catalog to search in.

getCatalogTools

public CatalogTools getCatalogTools()
Returns property catalogTools.

Returns:
The value of the property catalogTools

setSearchInput

public void setSearchInput(java.lang.String pSearchInput)
Sets property SearchInput

Parameters:
pSearchInput - the property to store the input search string. Text search always uses this property and Keyword search will use this (after parsing using a configurable deliminator) if keyword property is not set.

getSearchInput

public java.lang.String getSearchInput()
Returns property SearchInput

Returns:
The value of the property SearchInput

getKeywords

public java.lang.String[] getKeywords()
Returns property Keywords. Overrides parent behavior. Parse searchInput into string array

Overrides:
getKeywords in class SearchFormHandler
Returns:
The value of the property Keywords which is the target values to search

setKeywordInputSeparator

public void setKeywordInputSeparator(char pKeywordInputSeparator)
Sets property KeywordInputSeparator

Parameters:
pKeywordInputSeparator - the property to store what characters to use to separate keywords in the SearchInput string.

getKeywordInputSeparator

public char getKeywordInputSeparator()
Returns property KeywordInputSeparator

Returns:
The value of the property KeywordInputSeparator

setHierarchicalCategoryId

public void setHierarchicalCategoryId(java.lang.String pHierarchicalCategoryId)
Sets property HierarchicalCategoryId

Parameters:
pHierarchicalCategoryId - the property to store the value of the hierarchical category id to search in.

getHierarchicalCategoryId

public java.lang.String getHierarchicalCategoryId()
Returns property HierarchicalCategoryId

Returns:
The value of the property HierarchicalCategoryId which is the category Id to start the search

setAncestorCategoriesPropertyName

public void setAncestorCategoriesPropertyName(java.lang.String pAncestorCategoriesPropertyName)
Sets property ancestorCategoriesPropertyName

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

getAncestorCategoriesPropertyName

public java.lang.String getAncestorCategoriesPropertyName()
Returns property ancestorCategoriesPropertyName

Returns:
The value of the property ancestorCategoriesPropertyName which is the name of ancestor category property

getPropertyValues

public java.util.HashMap getPropertyValues()
Returns property PropertyValues

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

setPropertyValues

public void setPropertyValues(java.util.HashMap pPropertyValues)
Sets property PropertyValues

Parameters:
pPropertyValues - the property to store selected property values for advanced searching.

getPropertyValuesByType

public java.util.HashMap getPropertyValuesByType()
Returns property PropertyValuesByType. Containing one key/value pair for each property named in advancedSearchPropertyValues 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.

Overrides:
getPropertyValuesByType in class SearchFormHandler
Returns:
The value of the property PropertyValuesByType

setPropertyValuesByType

public void setPropertyValuesByType()
init with all possible values of each property

Overrides:
setPropertyValuesByType in class SearchFormHandler

setChildSKUsPropertyName

public void setChildSKUsPropertyName(java.lang.String pChildSKUsPropertyName)
Sets property ChildSKUsPropertyName

Parameters:
pChildSKUsPropertyName - the name of the childSKUs property in the product item descriptor

getChildSKUsPropertyName

public java.lang.String getChildSKUsPropertyName()
Returns property ChildSKUsPropertyName which is the name of the childSKUs property in the product item descriptor

Returns:
The name of the childSKUs property in the product item descriptor

setPrice

public void setPrice(java.lang.String pPrice)
Sets property Price

Parameters:
pPrice - the price to search for

getPrice

public java.lang.String getPrice()
Returns property Price which is the price to search for

Returns:
The price to search for

getPriceRelation

public java.lang.String getPriceRelation()
Returns property PriceRelation

Returns:
The relation of prices to search for (i.e., ">=", "<=", "=")

setPriceRelation

public void setPriceRelation(java.lang.String pPriceRelation)
Sets property PriceRelation

Parameters:
pPriceRelation - the relation of prices to search for

getPricePropertyName

public java.lang.String getPricePropertyName()
Returns property PricePropertyName

Returns:
The name of the price property in the searchable item

setPricePropertyName

public void setPricePropertyName(java.lang.String pPricePropertyName)
Sets property PricePropertyName

Parameters:
pPricePropertyName - the name of the price property in the searchable item

getSku

public java.lang.String getSku()
Returns property Sku

Returns:
The sku to search for

setSku

public void setSku(java.lang.String pSku)
Sets property Sku

Parameters:
pSku - the sku to search for

isSkuExactMatch

public boolean isSkuExactMatch()
Gets the SkuExactMatch property value.

Returns:
The boolean value.

setSkuExactMatch

public void setSkuExactMatch(boolean pSkuExactMatch)
Sets the SkuExactMatch property value.

Parameters:
pSkuExactMatch - The boolean value.

handleSearch

public boolean handleSearch(DynamoHttpServletRequest pRequest,
                            DynamoHttpServletResponse pResponse)
                     throws javax.servlet.ServletException,
                            java.io.IOException
For each each item type in that repository, call generateSearchResultSet to generate a subResultSet for that item type based on query parameters. Each subResultSet will be both merged together in resultSet as well as stored in the property SearchResultsByItemType by item type.

Overrides:
handleSearch in class SearchFormHandler
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
false to stop form processing
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

beforeGet

public void beforeGet(DynamoHttpServletRequest request,
                      DynamoHttpServletResponse response)
Called before getX methods on this form are called.

Specified by:
beforeGet in interface DropletFormHandler
Overrides:
beforeGet in class SearchFormHandler

prepareRepository

protected void prepareRepository(DynamoHttpServletRequest pRequest,
                                 DynamoHttpServletResponse pResponse)
Set the catalog key and the repository to search based on the repository key that has been stored in pRequest, but only if the value of the key has changed since the last time prepareRepository was called.


prepare

protected void prepare(DynamoHttpServletRequest request,
                       DynamoHttpServletResponse response)
Prepare search properties.

Overrides:
prepare in class SearchFormHandler

getRepositoryKey

public java.lang.String getRepositoryKey(DynamoHttpServletRequest pRequest,
                                         DynamoHttpServletResponse pResponse)
                                  throws javax.servlet.ServletException,
                                         java.io.IOException
Retrieve the key to the catalog repository.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
the key to the catalog repository
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

generateSearchValues

protected java.util.Collection generateSearchValues(java.lang.String pSearchType)
generateSearchValues is used by the advanced searching feature. For each property supplied in the property pSearchType, this method will return a list of available search options for that property. 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:
pSearchType - the search type. Typically corresponds to an item descriptor name in the catalog repository
Returns:
options or null if no values could be found

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

Overrides:
generateSearchQuery in class SearchFormHandler
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

getRepositoryView

public RepositoryView getRepositoryView(Repository pRepository,
                                        java.lang.String pViewName)
                                 throws RepositoryException
Returns the repository view for the repository

Returns:
repository view
Throws:
RepositoryException

generatePriceQuery

protected Query generatePriceQuery(Repository pRepository,
                                   java.lang.String pItemType,
                                   QueryBuilder pQueryBuilder)
                            throws RepositoryException,
                                   java.lang.NumberFormatException
generate subquery using RQL

Parameters:
pRepository -
pItemType -
pQueryBuilder - the builder that should be used to construct the query
Returns:
Query instance
Throws:
RepositoryException - if an error occured while forming the query
java.lang.NumberFormatException

generateSkuQuery

protected Query generateSkuQuery(java.lang.String pItemType,
                                 QueryBuilder pQueryBuilder,
                                 java.lang.String pInput)
                          throws RepositoryException
Generates a search for child skus of the product

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

areSearchValuesEmpty

protected boolean areSearchValuesEmpty()
Extends the base behavior to check the sku and price search values.

Overrides:
areSearchValuesEmpty in class SearchFormHandler

getMessage

protected java.lang.String getMessage(java.lang.String key,
                                      java.lang.Object[] args)
Overrides:
getMessage in class SearchFormHandler