atg.projects.store.gifts
Class StoreSearchFormHandler

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.commerce.gifts.SearchFormHandler
                      extended by atg.projects.store.gifts.StoreSearchFormHandler
All Implemented Interfaces:
atg.droplet.DropletFormHandler, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener
Direct Known Subclasses:
InternationalSearchFormHandler

public class StoreSearchFormHandler
extends atg.commerce.gifts.SearchFormHandler

Estore version of DCS' GiftlistSearch form handler. Resets form errors when necessary.


Field Summary
static java.lang.String CLASS_VERSION
          Class version
protected static java.lang.String MSG_EMPTY_FIRST_LAST_NAME
          Invalid e-mail format message key.
 
Fields inherited from class atg.commerce.gifts.SearchFormHandler
ALL, CURRENT, mCurrentPage, mFirstNamePropertyName, mLastNamePropertyName, mResultsPerPage, mSearchErrorURL, mSearchSuccessURL, mSortCaseSensitive, mSortDirection, mSortField, mTotalItemCount, mUseContainsForNames, SORT_DIRECTION_ASCENDING, SORT_DIRECTION_DESCENDING
 
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
StoreSearchFormHandler()
           
 
Method Summary
protected  java.lang.String formatUserMessage(java.lang.String pResourceKey, atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Retrieves a message from default resource bundle.
 boolean handleClearForm(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This handler clears form inputs for advanced search along with form exceptions.
 void preSearch(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Validates entered first and last name.
 boolean validateSearchInput()
          Ensures that at least one of the first name or last name fields is not empty.
 
Methods inherited from class atg.commerce.gifts.SearchFormHandler
buildQueryOptions, buildSortDirectives, calculateEndIndex, calculateStartIndex, doSearch, executeCountQuery, generateAdvancedSearchQuery, generateNameSearchQuery, generatePublishedSearchQuery, generateResultSet, generateSearchQuery, generateSearchValues, generateSiteConstrainedQuery, getAdvancedSearchPropertyNames, getCurrentPage, getFirstNamePropertyName, getGiftlistManager, getGiftlistRepository, getItemTypes, getLastNamePropertyName, getLoggingIdentifier, getNameSearchPropertyNames, getPropertyValues, getPropertyValuesByType, getPublishedSearchPropertyNames, getQueryOptions, getResultsPerPage, getSearchErrorURL, getSearchInput, getSearchResults, getSearchResultsByItemType, getSearchSuccessURL, getSiteGroupManager, getSiteIds, getSiteScope, getSortCaseSensitive, getSortDirection, getSortField, getStatePropertyName, getTotalItemCount, handleSearch, isDoAdvancedSearch, isDoNameSearch, isDoPagedSearch, isDoPublishedSearch, isUseContainsForNames, postSearch, setAdvancedSearchPropertyNames, setCurrentPage, setDoAdvancedSearch, setDoNameSearch, setDoPagedSearch, setDoPublishedSearch, setFirstNamePropertyName, setGiftlistManager, setGiftlistRepository, setItemTypes, setLastNamePropertyName, setLoggingIdentifier, setNameSearchPropertyNames, setPropertyValues, setPublishedSearchPropertyNames, setQueryOptions, setResultsPerPage, setSearchErrorURL, setSearchInput, setSearchSuccessURL, setSiteGroupManager, setSiteIds, setSiteScope, setSortCaseSensitive, setSortDirection, setSortField, setStatePropertyName, setTotalItemCount, setUseContainsForNames
 
Methods inherited from class atg.droplet.GenericFormHandler
addFormException, addUncheckedFormException, afterSet, beforeSet, 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, beforeGet
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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

See Also:
Constant Field Values

MSG_EMPTY_FIRST_LAST_NAME

protected static final java.lang.String MSG_EMPTY_FIRST_LAST_NAME
Invalid e-mail format message key.

See Also:
Constant Field Values
Constructor Detail

StoreSearchFormHandler

public StoreSearchFormHandler()
Method Detail

handleClearForm

public boolean handleClearForm(atg.servlet.DynamoHttpServletRequest pRequest,
                               atg.servlet.DynamoHttpServletResponse pResponse)
                        throws javax.servlet.ServletException,
                               java.io.IOException
This handler clears form inputs for advanced search along with form exceptions.

Parameters:
pRequest - - current HTTP request.
pResponse - - current HTTP response.
Returns:
always true
Throws:
javax.servlet.ServletException - if something goes wrong.
java.io.IOException - if something goes wrong.

preSearch

public void preSearch(atg.servlet.DynamoHttpServletRequest pRequest,
                      atg.servlet.DynamoHttpServletResponse pResponse)
               throws javax.servlet.ServletException,
                      java.io.IOException
Validates entered first and last name.

Overrides:
preSearch in class atg.commerce.gifts.SearchFormHandler
Parameters:
pRequest - - current HTTP request.
pResponse - - current HTTP response.
Throws:
javax.servlet.ServletException - if something goes wrong.
java.io.IOException - if something goes wrong.

validateSearchInput

public boolean validateSearchInput()
Ensures that at least one of the first name or last name fields is not empty.

Returns:
true if at least one of the name's fields is not empty, false otherwise

formatUserMessage

protected java.lang.String formatUserMessage(java.lang.String pResourceKey,
                                             atg.servlet.DynamoHttpServletRequest pRequest,
                                             atg.servlet.DynamoHttpServletResponse pResponse)
Retrieves a message from default resource bundle. Resource bundle is defined with MY_RESOURCE_NAME field.

Parameters:
pResourceKey - - key to be searched within a resource bundle.
pRequest - - current HTTP request.
pResponse - - current HTTP response
Returns:
string obtained from the resource bundle.