|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.droplet.EmptyFormHandler atg.droplet.GenericFormHandler atg.commerce.gifts.SearchFormHandler
public class SearchFormHandler
This search form handler is used to support giftlist searches. Giftlist searching will search the giftlist repository for published giftlists that match the search criteria. This formhandler is configurable to search giftlist most giftlist properties. At a minimum, doNameSearch and doAdvancedSearch are boolean properties that specify what type of searches to perform. HandleSearch looks at these values to build the search query and excutes on the Repository view.
Name
Name searching uses name properties and an input search string to
do a text pattern matching. Values entered will be used to build the
subQuery for name searching of giftlist owners. The name search query
will be constructed using an OR clause of both first name and last names.
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.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
protected java.lang.String |
mSearchErrorURL
|
protected java.lang.String |
mSearchSuccessURL
|
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 | |
---|---|
java.util.Collection |
doSearch(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Performs the search operation and generates the result set. |
protected Query |
generateAdvancedSearchQuery(java.lang.String pItemType,
QueryBuilder pQueryBuilder)
Return a query which represents an advanced search based on selected property values. |
protected Query |
generateNameSearchQuery(java.lang.String pItemType,
QueryBuilder pQueryBuilder,
java.lang.String pInput)
Return a query which represents a name search query. |
protected Query |
generatePublishedSearchQuery(java.lang.String pItemType,
QueryBuilder pQueryBuilder)
Generates a published search query to verify that lists are both public and published. |
protected java.util.Collection |
generateResultSet(java.lang.String pItemType)
For the supplied item type return a sub-result set that will combined into the total result set. |
protected Query |
generateSearchQuery(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. |
java.lang.String[] |
getAdvancedSearchPropertyNames()
Returns property AdvancedSearchPropertyNames |
Repository |
getGiftlistRepository()
Returns property GiftlistRepository |
java.lang.String[] |
getItemTypes()
Returns property ItemTypes |
java.lang.String |
getLoggingIdentifier()
Returns property LoggingIdentifier |
java.lang.String[] |
getNameSearchPropertyNames()
Returns property NameSearchPropertyNames |
java.util.Hashtable |
getPropertyValues()
Returns property PropertyValues |
java.util.HashMap |
getPropertyValuesByType()
Returns property PropertyValuesByType |
java.lang.String[] |
getPublishedSearchPropertyNames()
Returns property PublishedSearchPropertyNames |
QueryOptions |
getQueryOptions()
Returns property QueryOptions |
java.lang.String |
getSearchErrorURL()
|
java.lang.String |
getSearchInput()
Returns property SearchInput |
java.util.Collection |
getSearchResults()
Returns property SearchResults |
java.util.HashMap |
getSearchResultsByItemType()
Returns property SearchResultsByItemType |
java.lang.String |
getSearchStringFormat()
Returns property SearchStringFormat |
java.lang.String |
getSearchSuccessURL()
|
java.lang.String |
getStatePropertyName()
Returns property statePropertyName |
boolean |
handleSearch(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
For each item type specified in itemTypes, call generateSearchResultSet to generate a subResultSet for that item type based on query parameters. |
boolean |
isDoAdvancedSearch()
Returns property DoAdvancedSearch |
boolean |
isDoNameSearch()
Returns property DoNameSearch |
boolean |
isDoPublishedSearch()
Returns property DoPublishedSearch |
boolean |
isToLowerCaseKeywords()
Returns property ToLowerCaseKeywords |
boolean |
isToUpperCaseKeywords()
Returns property ToUpperCaseKeywords |
void |
postSearch(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Called after a search. |
void |
preSearch(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Called prior to the search taking place. |
void |
setAdvancedSearchPropertyNames(java.lang.String[] pAdvancedSearchPropertyNames)
Sets property AdvancedSearchPropertyNames |
void |
setDoAdvancedSearch(boolean pDoAdvancedSearch)
Sets property DoAdvancedSearch |
void |
setDoNameSearch(boolean pDoNameSearch)
Sets property DoNameSearch |
void |
setDoPublishedSearch(boolean pDoPublishedSearch)
Sets property DoPublishedSearch |
void |
setGiftlistRepository(Repository pGiftlistRepository)
Sets property giftlistRepository |
void |
setItemTypes(java.lang.String[] pItemTypes)
Sets property ItemTypes |
void |
setLoggingIdentifier(java.lang.String pLoggingIdentifier)
Sets property LoggingIdentifier |
void |
setNameSearchPropertyNames(java.lang.String[] pNameSearchPropertyNames)
Sets property NameSearchPropertyNames |
void |
setPropertyValues(java.util.Hashtable pPropertyValues)
Sets property PropertyValues |
void |
setPublishedSearchPropertyNames(java.lang.String[] pPublishedSearchPropertyNames)
Sets property PublishedSearchPropertyNames |
void |
setQueryOptions(QueryOptions pQueryOptions)
Sets property QueryOptions |
void |
setSearchErrorURL(java.lang.String pSearchErrorURL)
|
void |
setSearchInput(java.lang.String pSearchInput)
Sets property SearchInput |
void |
setSearchStringFormat(java.lang.String pSearchStringFormat)
Sets property SearchStringFormat |
void |
setSearchSuccessURL(java.lang.String pSearchSuccessURL)
|
void |
setStatePropertyName(java.lang.String pStatePropertyName)
Sets property statePropertyName |
void |
setToLowerCaseKeywords(boolean pToLowerCaseKeywords)
Sets property ToLowerCaseKeywords |
void |
setToUpperCaseKeywords(boolean pToUpperCaseKeywords)
Sets property ToUpperCaseKeywords |
Methods inherited from class atg.droplet.EmptyFormHandler |
---|
afterGet, beforeGet |
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 |
---|
public static final java.lang.String CLASS_VERSION
protected java.lang.String mSearchSuccessURL
protected java.lang.String mSearchErrorURL
Constructor Detail |
---|
public SearchFormHandler()
Method Detail |
---|
public java.lang.String getSearchSuccessURL()
public void setSearchSuccessURL(java.lang.String pSearchSuccessURL)
pSearchSuccessURL
- The searchSuccessURL to set.public java.lang.String getSearchErrorURL()
public void setSearchErrorURL(java.lang.String pSearchErrorURL)
pSearchErrorURL
- The searchErrorURL to set.public void setLoggingIdentifier(java.lang.String pLoggingIdentifier)
pLoggingIdentifier
- the property which identifies this object as the Catalog Search.public java.lang.String getLoggingIdentifier()
public void setSearchStringFormat(java.lang.String pSearchStringFormat)
pSearchStringFormat
- the property to store any string formatting information parameters for searching.public java.lang.String getSearchStringFormat()
public void setStatePropertyName(java.lang.String pStatePropertyName)
pStatePropertyName
- the property to store the owner state property.public java.lang.String getStatePropertyName()
public void setNameSearchPropertyNames(java.lang.String[] pNameSearchPropertyNames)
pNameSearchPropertyNames
- the property to store name search property names.public java.lang.String[] getNameSearchPropertyNames()
public void setDoNameSearch(boolean pDoNameSearch)
pDoNameSearch
- the property to store the boolean value of whether or not to perform a name search.public boolean isDoNameSearch()
public void setSearchInput(java.lang.String pSearchInput)
pStringInput
- the property to store the input search string to parse and search.public java.lang.String getSearchInput()
public void setToUpperCaseKeywords(boolean pToUpperCaseKeywords)
pToUpperCaseKeywords
- the property to store the boolean value of whether or not to convert input string to upper case.public boolean isToUpperCaseKeywords()
public void setToLowerCaseKeywords(boolean pToLowerCaseKeywords)
pToLowerCaseKeywords
- the property to store the boolean value of whether or not to convert input string to lower case.public boolean isToLowerCaseKeywords()
public void setGiftlistRepository(Repository pGiftlistRepository)
pGiftlistRepository
- the property to store the name of the giftlist repository.public Repository getGiftlistRepository()
public void setItemTypes(java.lang.String[] pItemTypes)
pItemTypes
- the property to store the item types to search in the repository (e.g. gift-list).public java.lang.String[] getItemTypes()
public void setQueryOptions(QueryOptions pQueryOptions)
pQueryOptions
- the property to store specific query options to used when generating the search string.public QueryOptions getQueryOptions()
public java.util.Collection getSearchResults()
public java.util.HashMap getSearchResultsByItemType()
public void setDoAdvancedSearch(boolean pDoAdvancedSearch)
pDoAdvancedSearch
- the property to store the boolean value of whether or not to perform a advanced search.public boolean isDoAdvancedSearch()
public void setAdvancedSearchPropertyNames(java.lang.String[] pAdvancedSearchPropertyNames)
pAdvancedSearchPropertyNames
- the property to store advanced search property names.public java.lang.String[] getAdvancedSearchPropertyNames()
public void setDoPublishedSearch(boolean pDoPublishedSearch)
pDoPublishedSearch
- the property to store the boolean value of whether or not to perform a published search.public boolean isDoPublishedSearch()
public void setPublishedSearchPropertyNames(java.lang.String[] pPublishedSearchPropertyNames)
pPublishedSearchPropertyNames
- the property to store published search property names.public java.lang.String[] getPublishedSearchPropertyNames()
public java.util.HashMap getPropertyValuesByType()
public void setPropertyValues(java.util.Hashtable pPropertyValues)
pPropertyValues
- the property to store selected property values for advanced searching.public java.util.Hashtable getPropertyValues()
public void preSearch(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- pResponse
-
javax.servlet.ServletException
java.io.IOException
public boolean handleSearch(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- the servlet's requestpResponse
- the servlet's response
javax.servlet.ServletException
- if there was an error while executing the code
java.io.IOException
- if there was an error with servlet iopublic java.util.Collection doSearch(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- pResponse
-
javax.servlet.ServletException
java.io.IOException
public void postSearch(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- pResponse
-
javax.servlet.ServletException
java.io.IOException
protected java.util.Collection generateSearchValues(java.lang.String pSearchType)
pSearchType
- the search type. Typically corresponds to an
item descriptor name in the giftlist repository
protected java.util.Collection generateResultSet(java.lang.String pItemType)
pItemType
- the type of item to search for. Typically corresponds to an
item descriptor name in the catalog repository
protected Query generateSearchQuery(java.lang.String pItemType, QueryBuilder pQueryBuilder) throws RepositoryException
pItemType
- the type of item to search for. Typically corresponds to an
item descriptor name in the giftlist repositorypQueryBuilder
- the builder that should be used to construct the query
RepositoryException
- if an error occured while forming the queryprotected Query generateNameSearchQuery(java.lang.String pItemType, QueryBuilder pQueryBuilder, java.lang.String pInput) throws RepositoryException
nameSearchPropertyNames
property. Each
sub-query is OR'd together to form the total query. The search string format is
configured with the searchStringFormat
property.
pItemType
- the type of item to search for. Typically corresponds to an
item descriptor name in the catalog repositorypQueryBuilder
- the builder that should be used to construct the querypInput
- the search string to use for the full name search
RepositoryException
- if an error occured while forming the queryprotected Query generatePublishedSearchQuery(java.lang.String pItemType, QueryBuilder pQueryBuilder) throws RepositoryException
pItemType
- the type of item to search for. Typically corresponds to an
item descriptor name in the catalog repositorypQueryBuilder
- the builder that should be used to construct the query
RepositoryException
- if an error occured while forming the queryprotected Query generateAdvancedSearchQuery(java.lang.String pItemType, QueryBuilder pQueryBuilder) throws RepositoryException
pItemType
- the type of item to search for. Typically corresponds to an
item descriptor name in the catalog repositorypQueryBuilder
- the builder that should be used to construct the query
RepositoryException
- if an error occured while forming the query
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |