atg.commerce.catalog.custom
Class CatalogSearchFormHandler

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
                          extended by atg.commerce.catalog.custom.CatalogSearchFormHandler
All Implemented Interfaces:
DropletFormHandler, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class CatalogSearchFormHandler
extends SearchFormHandler

Does the same thing as atg.commerce.catalog.SearchFormHandler but it limits all searches to within the current catalog. (Current catalog as stored in the Profile.)


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String DEFAULT_CATALOG_ITEMS_CATALOG_PROPERTY
           
static java.lang.String DEFAULT_CATALOG_PROPERTY
           
 
Fields inherited from class atg.commerce.catalog.SearchFormHandler
INVALID_PRICE, mLastCatalogKey
 
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, 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
CatalogSearchFormHandler()
           
 
Method Summary
protected  Query generateSearchQuery(Repository pRepository, java.lang.String pItemType, QueryBuilder pQueryBuilder)
          Return the query that should be executed on the Repository View.
 java.lang.String getCatalogItemsCatalogProperty()
          The name of the property for each catalog item that contains the list of catalogs containing that item
 java.lang.String getCatalogPropertyName()
          The name of the profile property pointing to the catalog
protected  java.lang.Object getCurrentCatalog()
          Get the current catalog
 boolean isNullCatalogMeansNoResults()
          If this is true, and the profile's catalog is null, no results will be returned.
 void setCatalogItemsCatalogProperty(java.lang.String pCatalogItemsCatalogProperty)
           
 void setCatalogPropertyName(java.lang.String pCatalogPropertyName)
           
 void setNullCatalogMeansNoResults(boolean pNullCatalogMeansNoResults)
           
 
Methods inherited from class atg.commerce.catalog.SearchFormHandler
areSearchValuesEmpty, beforeGet, generatePriceQuery, generateSearchValues, generateSkuQuery, getAdvancedSearchPropertyNames, getAncestorCategoriesPropertyName, getCatalogKey, getCatalogTools, getChildSKUsPropertyName, getHierarchicalCategoryId, getKeywordInputSeparator, getKeywords, getKeywordsPropertyNames, getLoggingIdentifier, getPrice, getPricePropertyName, getPriceRelation, getPropertyValues, getPropertyValuesByType, getRepositoryKey, getRepositoryKeyParamName, getRepositoryView, getSearchInput, getSku, getTextSearchPropertyNames, handleSearch, prepare, prepareRepository, setAdvancedSearchPropertyNames, setAncestorCategoriesPropertyName, setCatalogKey, setCatalogTools, setChildSKUsPropertyName, setHierarchicalCategoryId, setKeywordInputSeparator, setKeywordsPropertyNames, setLoggingIdentifier, setPrice, setPricePropertyName, setPriceRelation, setPropertyValues, setPropertyValuesByType, setRepositoryKeyParamName, setSearchInput, setSku, setTextSearchPropertyNames
 
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 java.lang.String CLASS_VERSION
Class version string


DEFAULT_CATALOG_PROPERTY

public static final java.lang.String DEFAULT_CATALOG_PROPERTY
See Also:
Constant Field Values

DEFAULT_CATALOG_ITEMS_CATALOG_PROPERTY

public static final java.lang.String DEFAULT_CATALOG_ITEMS_CATALOG_PROPERTY
See Also:
Constant Field Values
Constructor Detail

CatalogSearchFormHandler

public CatalogSearchFormHandler()
Method Detail

setCatalogItemsCatalogProperty

public void setCatalogItemsCatalogProperty(java.lang.String pCatalogItemsCatalogProperty)

getCatalogItemsCatalogProperty

public java.lang.String getCatalogItemsCatalogProperty()
The name of the property for each catalog item that contains the list of catalogs containing that item


setCatalogPropertyName

public void setCatalogPropertyName(java.lang.String pCatalogPropertyName)

getCatalogPropertyName

public java.lang.String getCatalogPropertyName()
The name of the profile property pointing to the catalog


setNullCatalogMeansNoResults

public void setNullCatalogMeansNoResults(boolean pNullCatalogMeansNoResults)

isNullCatalogMeansNoResults

public boolean isNullCatalogMeansNoResults()
If this is true, and the profile's catalog is null, no results will be returned. Otherwise, the search is not limited by catalog. The default is true.


generateSearchQuery

protected Query generateSearchQuery(Repository pRepository,
                                    java.lang.String pItemType,
                                    QueryBuilder pQueryBuilder)
                             throws DropletFormException,
                                    RepositoryException
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. All queries contain an extra clause to ensure the result set only includes items in the current catalog.

Overrides:
generateSearchQuery in class SearchFormHandler
Parameters:
pRepository - The repository being search
pItemType - the type of item to search for. Typically corresponds to an item descriptor name in the catalog repository
pQueryBuilder - the builder that should be used to construct the query
Throws:
RepositoryException - if an error occured while forming the query
DropletFormException

getCurrentCatalog

protected java.lang.Object getCurrentCatalog()
                                      throws RepositoryException
Get the current catalog

Throws:
RepositoryException