atg.commerce.csr.search
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.commerce.csr.search.SearchFormHandler
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, javax.servlet.Servlet
Direct Known Subclasses:
OrderSearchFormHandler

public class SearchFormHandler
extends atg.droplet.GenericFormHandler
implements javax.servlet.Servlet

This SearchFormHandler class is used to build repository searches. The class builds a Query object and generates search resultset This class also implements javax.servlet.Servlet interface so that it can be used as a droplet to embed searches within jhtml pages.

Example jhtml usage (as a FormHandler):

 
  <FORM method="POST" action="searchresults.jhtml">
  Profile ID:
  <input type=hidden bean="RepositorySearchForm.SearchAttributes[1].Name" value="profileId">
  <input type=hidden bean="RepositorySearchForm.SearchAttributes[1].Method" value="0">
  <input type=hidden bean="RepositorySearchForm.SearchAttributes[1].CaseSensitive" value="0">
  <select bean="RepositorySearchForm.SearchAttributes[1].Relation">
  <option value="=="> ==
  <option value="!="> !=
  <option value="&lt"> <
  <option value="&gt"> >
  <option value="&lt="> <=
  <option value="&gt="> >=
  </select>
  <input type="text" bean="RepositorySearchForm.SearchAttributes[1].Values" value=""> </td>
  <input type="submit" bean="RepositorySearchForm.Search" value="Search">
  </FORM>


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected static java.lang.String DIR_ASCENDING_STRING
           
protected static java.lang.String DIR_DESCENDING_STRING
           
static java.lang.String OUTPUT
          output oparam
protected static java.lang.String SEARCHFORMRESOURCES
          resources file
protected static java.util.ResourceBundle sResourceBundle
          resources bundle
 
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()
          empty constructor
 
Method Summary
protected  boolean checkFormError(java.lang.String pErrorURL, java.lang.String pSuccessURL, atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Check to see if there were errors during the submit operation.
 void destroy()
           
protected  atg.repository.Repository findLocaleRepository(atg.servlet.DynamoHttpServletRequest request)
          ------------------------------------- findLocaleRepository Use user's current locale to find the right repository to search
protected  void generateFormException(java.lang.String whatException, java.lang.String substitutionText, atg.servlet.DynamoHttpServletRequest pRequest)
          utility: generateFormException Create a form exception, by looking up the exception code in a resource file identified by the RESOURCE_BUNDLE constant (defined above).
protected  atg.repository.Query generateSearchQuery(atg.servlet.DynamoHttpServletRequest request, atg.servlet.DynamoHttpServletResponse response)
          generate the search Query
 boolean getAllowOpenEndedSearch()
          Returns property AllowOpenEndedSearch
 java.lang.String getCancelURL()
          Returns the cancelURL
 int getCurrentResultPageNum()
          Returns property CurrentResultPageNum
protected  java.sql.Date getDateConstant(java.lang.String pDate)
          Convert string to java.sql.Date
 int getEndIndex()
          Returns the property EndIndex.
 java.lang.String getErrorURL()
          Returns where to go upon a failed search
protected  java.util.Locale getLocale(atg.servlet.DynamoHttpServletRequest pRequest)
          ------------------------------------- utility: getLocale Determine the user's current locale, if available
 int getMaxResultNum()
          Returns property mMaxResultNum
 int getMaxResultsPerPage()
          Returns property maxResultsPerPage
 atg.repository.Query getQuery()
          Returns Query to be built and executed
 atg.repository.QueryOptions getQueryOptions()
          Returns property QueryOptions
 atg.repository.Repository getRepository()
          Returns Repository which is being queried
 RepositorySearcher getRepositorySearcher()
          Returns Tool which encapsulates the searching functionality
 java.lang.String getResultNumGreaterThanMax()
          Returns property ResultNumGreaterThanMax
 int getResultPageCount()
          Returns the number of results pages which is calculated as the resultSetSize / maxResultsPerPage + 1 if any remainder exists.
 int getResultSetSize()
          Returns property ResultSetSize
 int getResultsNextPage()
          Returns the no of records to be displayed for next page
 int getSearchableAttributeNum()
          Returns property mSearchableAttributeNum
 SearchAttribute getSearchAttribute(int pIndex)
          Returns SearchAttribute by which the search is done
 SearchAttribute[] getSearchAttributes()
          Returns SearchAttributes by which the search is done
 java.util.Collection getSearchResults()
          Returns property SearchResults
 javax.servlet.ServletConfig getServletConfig()
           
 java.lang.String getServletInfo()
           
 java.lang.String getSortDirection()
           
protected  int getSortDirectionInt()
           
 java.lang.String getSortProperty()
           
 int getStartIndex()
          Returns the property startIndex.
 java.lang.String getSuccessURL()
          Returns where to go upon successful search
 boolean getUseLocaleRepository()
          Returns UseLocaleRepository
 boolean handleCancelSearch(atg.servlet.DynamoHttpServletRequest request, atg.servlet.DynamoHttpServletResponse response)
          Handles the cancel search.
 boolean handleContinueSearch(atg.servlet.DynamoHttpServletRequest request, atg.servlet.DynamoHttpServletResponse response)
          Handles the continue search if the search result set number is greater than the specified maximum value
 boolean handleNextResultPageNum(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Handles the search for the next page
 boolean handlePreviousResultPageNum(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Handles the search for the previous page.
 boolean handleSearch(atg.servlet.DynamoHttpServletRequest request, atg.servlet.DynamoHttpServletResponse response)
          Handles the search.
 boolean handleSearchQuery(atg.servlet.DynamoHttpServletRequest request, atg.servlet.DynamoHttpServletResponse response)
          Handles the search
 void init(javax.servlet.ServletConfig config)
           
 boolean isEnableCountQuery()
          Returns property enableCountQuery
 void service(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This methods lets this FormHandler to be used as a droplet.
 void service(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res)
          The service method - go directly from a Servlet to a DynamoHttpServlet for efficiency.
 void setAllowOpenEndedSearch(boolean pAllowOpenEndedSearch)
          Sets property AllowOpenEndedSearch
 void setCancelURL(java.lang.String pCancelURL)
          Sets the cancelURL
 void setCurrentResultPageNum(int pCurrentResultPageNum)
          Sets the property currentResultPageNum.
 void setEnableCountQuery(boolean pEnableCountQuery)
          Sets the property enableCountQuery.
 void setErrorURL(java.lang.String pErrorURL)
          Sets where to go upon a failed search
 void setMaxResultNum(int pMaxResultNum)
          Sets the property mMaxResultNum.
 void setMaxResultsPerPage(int pMaxResultsPerPage)
          Sets the property maxResultsPerPage.
 void setQuery(atg.repository.Query pQuery)
          Sets Query to be built and executed
 void setQueryOptions(atg.repository.QueryOptions pQueryOptions)
          Sets property QueryOptions
 void setRepository(atg.repository.Repository pRepository)
          Sets Repository which is being queried
 void setRepositorySearcher(RepositorySearcher pRepositorySearcher)
          Sets Tool which encapsulates the searching functionality
 void setRepositoryViewName(java.lang.String pRepositoryViewName)
          Sets Repository view name which is being queried
 void setResultNumGreaterThanMax(java.lang.String pResultNumGreaterThanMax)
          Sets the property ResultNumGreaterThanMax.
 void setResultSetSize(int pResultSetSize)
           
 void setSearchableAttributeNum(int pSearchableAttributeNum)
          Sets property mSearchableAttributeNum
 void setSearchAttribute(int pIndex, SearchAttribute pSearchAttribute)
          Sets SearchAttribute by which the search is done
 void setSearchAttributes(SearchAttribute[] pSearchAttributes)
          Sets SearchAttributes by which the search is done
 void setSearchResults(java.util.Collection results)
           
 void setSortDirection(java.lang.String direction)
           
 void setSortProperty(java.lang.String property)
           
 void setSuccessURL(java.lang.String pSuccessURL)
          Sets where to go upon successful search
 void setUseLocaleRepository(boolean pUseLocaleRepository)
          Sets UseLocaleRepository
 void setUserName(java.lang.String pUserName)
           
protected  boolean validateSearchCriteria(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          validateSearchCriteria
protected  int validateSearchCriteria(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse, SearchAttribute[] pSearchAttributes)
          validateSearchCriteria
protected  boolean validateSearchValue(java.lang.String pValue, java.lang.String pDataType, atg.servlet.DynamoHttpServletRequest request)
           
 
Methods inherited from class atg.droplet.GenericFormHandler
addFormException, addUncheckedFormException, afterSet, beforeSet, checkFormRedirect, createFormSubmissionMessage, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleCancel, handleFormException, handleUncheckedFormException, hasUncheckedFormExceptions, isDeferForwardsAndRedirects, isRestorableForm, isUseForwards, isValidSession, redirectOrForward, resetFormExceptions, 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 string

See Also:
Constant Field Values

DIR_DESCENDING_STRING

protected static final java.lang.String DIR_DESCENDING_STRING
See Also:
Constant Field Values

DIR_ASCENDING_STRING

protected static final java.lang.String DIR_ASCENDING_STRING
See Also:
Constant Field Values

SEARCHFORMRESOURCES

protected static final java.lang.String SEARCHFORMRESOURCES
resources file

See Also:
Constant Field Values

sResourceBundle

protected static java.util.ResourceBundle sResourceBundle
resources bundle


OUTPUT

public static final java.lang.String OUTPUT
output oparam

See Also:
Constant Field Values
Constructor Detail

SearchFormHandler

public SearchFormHandler()
empty constructor

Method Detail

setUserName

public void setUserName(java.lang.String pUserName)

setRepositorySearcher

public void setRepositorySearcher(RepositorySearcher pRepositorySearcher)
Sets Tool which encapsulates the searching functionality

Parameters:
pRepositorySearcher - the Tool which encapsulates the searching functionality.

getRepositorySearcher

public RepositorySearcher getRepositorySearcher()
Returns Tool which encapsulates the searching functionality


setQuery

public void setQuery(atg.repository.Query pQuery)
Sets Query to be built and executed

Parameters:
pQuery - the Query to be built and executed.

getQuery

public atg.repository.Query getQuery()
Returns Query to be built and executed


setRepository

public void setRepository(atg.repository.Repository pRepository)
Sets Repository which is being queried

Parameters:
pRepository - the Repository which is being queried.

getRepository

public atg.repository.Repository getRepository()
Returns Repository which is being queried


setUseLocaleRepository

public void setUseLocaleRepository(boolean pUseLocaleRepository)
Sets UseLocaleRepository

Parameters:
pUseLocaleRepository - the property that determines if the repository to be searched should be based on the user's locale.

getUseLocaleRepository

public boolean getUseLocaleRepository()
Returns UseLocaleRepository


setRepositoryViewName

public void setRepositoryViewName(java.lang.String pRepositoryViewName)
Sets Repository view name which is being queried

Parameters:
pRepositoryViewName - the Repository view name which is being queried

setSearchAttributes

public void setSearchAttributes(SearchAttribute[] pSearchAttributes)
Sets SearchAttributes by which the search is done

Parameters:
pSearchAttributes - the SearchAttributes by which the search is done

getSearchAttributes

public SearchAttribute[] getSearchAttributes()
Returns SearchAttributes by which the search is done


setSearchAttribute

public void setSearchAttribute(int pIndex,
                               SearchAttribute pSearchAttribute)
Sets SearchAttribute by which the search is done


getSearchAttribute

public SearchAttribute getSearchAttribute(int pIndex)
Returns SearchAttribute by which the search is done


setQueryOptions

public void setQueryOptions(atg.repository.QueryOptions pQueryOptions)
Sets property QueryOptions

Parameters:
pQueryOptions - the property to store specific query options to used when generating the search string.

getQueryOptions

public atg.repository.QueryOptions getQueryOptions()
Returns property QueryOptions

Returns:
The value of the property queryOptions

setSearchableAttributeNum

public void setSearchableAttributeNum(int pSearchableAttributeNum)
Sets property mSearchableAttributeNum

Parameters:
pSearchableAttributeNum - the property to store

getSearchableAttributeNum

public int getSearchableAttributeNum()
Returns property mSearchableAttributeNum

Returns:
The value of the property mSearchableAttributeNum

setMaxResultsPerPage

public void setMaxResultsPerPage(int pMaxResultsPerPage)
Sets the property maxResultsPerPage. This property represents the maximum number of search results to present on a page. If there are more than maxResultsPerPage that fit the search query, the next set of maxResultsPerPage can be displayed upon the user hitting the next button. Default value is -1 which indicates that no maximum.

Parameters:
pMaxResultsPerPage - the property to store the maximum number of results to be displayed per page.

getMaxResultsPerPage

public int getMaxResultsPerPage()
Returns property maxResultsPerPage

Returns:
The maximum number of results to be displayed per page.

setMaxResultNum

public void setMaxResultNum(int pMaxResultNum)
Sets the property mMaxResultNum. This property represents the maximum number of search results to return. Default value is -1 which indicates that no maximum.

Parameters:
pMaxResultNum - the property to store the maximum number of results to be returned.

getMaxResultNum

public int getMaxResultNum()
Returns property mMaxResultNum

Returns:
The maximum number of results to be returned.

setResultNumGreaterThanMax

public void setResultNumGreaterThanMax(java.lang.String pResultNumGreaterThanMax)
Sets the property ResultNumGreaterThanMax.

Parameters:
pResultNumGreaterThanMax -

getResultNumGreaterThanMax

public java.lang.String getResultNumGreaterThanMax()
Returns property ResultNumGreaterThanMax

Returns:
The ResultNumGreaterThanMax string

setCurrentResultPageNum

public void setCurrentResultPageNum(int pCurrentResultPageNum)
Sets the property currentResultPageNum. This property tells which page of the result set is currently being viewed. The default value is 1, so be aware that this is a 1 based number so it is easy to display to the end user.

Parameters:
pCurrentResultPageNum - the property to tell which page of the result set is currently being viewed.

getCurrentResultPageNum

public int getCurrentResultPageNum()
Returns property CurrentResultPageNum

Returns:
The current result page being viewed.

setResultSetSize

public void setResultSetSize(int pResultSetSize)
Parameters:
pResultSetSize - the property that represents the number of items that match the query.

getResultSetSize

public int getResultSetSize()
Returns property ResultSetSize

Returns:
The number of items that match the query.

getResultsNextPage

public int getResultsNextPage()
Returns the no of records to be displayed for next page


getAllowOpenEndedSearch

public boolean getAllowOpenEndedSearch()
Returns property AllowOpenEndedSearch


setAllowOpenEndedSearch

public void setAllowOpenEndedSearch(boolean pAllowOpenEndedSearch)
Sets property AllowOpenEndedSearch

Parameters:
pAllowOpenEndedSearch - the property that determines whether to do open ended search or not

setEnableCountQuery

public void setEnableCountQuery(boolean pEnableCountQuery)
Sets the property enableCountQuery. If enable CountQuery is true, then we will fill in properties that allow the jhtml programmer to provide next, previous buttons to iterate over the result set. Default is false. Because enableCountQuery=true will cause an additional countQuery to be submitted to the db, there is a slight performance cost associated with using this functionality.

Parameters:
pEnableCountQuery - the property to enable the jhtml programmer to provide next and prev buttons to iterate over a result set.

isEnableCountQuery

public boolean isEnableCountQuery()
Returns property enableCountQuery

Returns:
The property enableCountQuery

getResultPageCount

public int getResultPageCount()
Returns the number of results pages which is calculated as the resultSetSize / maxResultsPerPage + 1 if any remainder exists.

Returns:
the number of results pages which is calculated as the resultSetSize/maxResultsPerPage + 1.

getStartIndex

public int getStartIndex()
Returns the property startIndex. This is the index into the full result set which is displayed on the current page.

Returns:
the start index into the full result set which is displayed on the current page.

getEndIndex

public int getEndIndex()
Returns the property EndIndex. This is the index into the full result set which is displayed on the current page.

Returns:
the end index into the full result set which is displayed on the current page.

getSortProperty

public java.lang.String getSortProperty()

setSortProperty

public void setSortProperty(java.lang.String property)

getSortDirection

public java.lang.String getSortDirection()

getSortDirectionInt

protected int getSortDirectionInt()

setSortDirection

public void setSortDirection(java.lang.String direction)

setSuccessURL

public void setSuccessURL(java.lang.String pSuccessURL)
Sets where to go upon successful search

Parameters:
pSuccessURL - where to go upon successful search

getSuccessURL

public java.lang.String getSuccessURL()
Returns where to go upon successful search


setErrorURL

public void setErrorURL(java.lang.String pErrorURL)
Sets where to go upon a failed search

Parameters:
pErrorURL - where to go upon failed search

getErrorURL

public java.lang.String getErrorURL()
Returns where to go upon a failed search


getCancelURL

public java.lang.String getCancelURL()
Returns the cancelURL

Overrides:
getCancelURL in class atg.droplet.GenericFormHandler

setCancelURL

public void setCancelURL(java.lang.String pCancelURL)
Sets the cancelURL

Overrides:
setCancelURL in class atg.droplet.GenericFormHandler
Parameters:
pCancelURL - where to go upon canceled search

getSearchResults

public java.util.Collection getSearchResults()
Returns property SearchResults

Returns:
The value of the property SearchResults

setSearchResults

public void setSearchResults(java.util.Collection results)

generateSearchQuery

protected atg.repository.Query generateSearchQuery(atg.servlet.DynamoHttpServletRequest request,
                                                   atg.servlet.DynamoHttpServletResponse response)
                                            throws javax.servlet.ServletException,
                                                   java.io.IOException
generate the search Query

Parameters:
request -
response -
Returns:
success of the execution
Throws:
javax.servlet.ServletException
java.io.IOException

handleSearchQuery

public boolean handleSearchQuery(atg.servlet.DynamoHttpServletRequest request,
                                 atg.servlet.DynamoHttpServletResponse response)
                          throws javax.servlet.ServletException,
                                 java.io.IOException
Handles the search

Parameters:
request -
response -
Returns:
success of the execution
Throws:
javax.servlet.ServletException
java.io.IOException

validateSearchCriteria

protected boolean validateSearchCriteria(atg.servlet.DynamoHttpServletRequest pRequest,
                                         atg.servlet.DynamoHttpServletResponse pResponse)
                                  throws javax.servlet.ServletException,
                                         java.io.IOException
validateSearchCriteria

Parameters:
pRequest -
pResponse -
Returns:
success of the execution
Throws:
javax.servlet.ServletException
java.io.IOException

validateSearchCriteria

protected int validateSearchCriteria(atg.servlet.DynamoHttpServletRequest pRequest,
                                     atg.servlet.DynamoHttpServletResponse pResponse,
                                     SearchAttribute[] pSearchAttributes)
                              throws javax.servlet.ServletException,
                                     java.io.IOException
validateSearchCriteria

Parameters:
pRequest -
pResponse -
pSearchAttributes -
Returns:
success of the execution
Throws:
javax.servlet.ServletException
java.io.IOException

validateSearchValue

protected boolean validateSearchValue(java.lang.String pValue,
                                      java.lang.String pDataType,
                                      atg.servlet.DynamoHttpServletRequest request)

handleSearch

public boolean handleSearch(atg.servlet.DynamoHttpServletRequest request,
                            atg.servlet.DynamoHttpServletResponse response)
                     throws javax.servlet.ServletException,
                            java.io.IOException
Handles the search. Build repository search query based on mSearchAttributes. excecute query and set query result set.

Parameters:
request -
response -
Returns:
success of the execution
Throws:
javax.servlet.ServletException
java.io.IOException

handleContinueSearch

public boolean handleContinueSearch(atg.servlet.DynamoHttpServletRequest request,
                                    atg.servlet.DynamoHttpServletResponse response)
                             throws javax.servlet.ServletException,
                                    java.io.IOException
Handles the continue search if the search result set number is greater than the specified maximum value

Parameters:
request -
response -
Returns:
success of the execution
Throws:
javax.servlet.ServletException
java.io.IOException

handleNextResultPageNum

public boolean handleNextResultPageNum(atg.servlet.DynamoHttpServletRequest pRequest,
                                       atg.servlet.DynamoHttpServletResponse pResponse)
                                throws javax.servlet.ServletException,
                                       java.io.IOException
Handles the search for the next page

Parameters:
pRequest -
pResponse -
Returns:
success of the execution
Throws:
javax.servlet.ServletException
java.io.IOException

handlePreviousResultPageNum

public boolean handlePreviousResultPageNum(atg.servlet.DynamoHttpServletRequest pRequest,
                                           atg.servlet.DynamoHttpServletResponse pResponse)
                                    throws javax.servlet.ServletException,
                                           java.io.IOException
Handles the search for the previous page.

Parameters:
pRequest -
pResponse -
Returns:
success of the execution
Throws:
javax.servlet.ServletException
java.io.IOException

handleCancelSearch

public boolean handleCancelSearch(atg.servlet.DynamoHttpServletRequest request,
                                  atg.servlet.DynamoHttpServletResponse response)
                           throws javax.servlet.ServletException,
                                  java.io.IOException
Handles the cancel search.

Parameters:
request -
response -
Returns:
success of the execution
Throws:
javax.servlet.ServletException
java.io.IOException

generateFormException

protected void generateFormException(java.lang.String whatException,
                                     java.lang.String substitutionText,
                                     atg.servlet.DynamoHttpServletRequest pRequest)
utility: generateFormException Create a form exception, by looking up the exception code in a resource file identified by the RESOURCE_BUNDLE constant (defined above). Substitute the provided string in the exception text.

Parameters:
whatException -
substitutionText -
pRequest -

getLocale

protected java.util.Locale getLocale(atg.servlet.DynamoHttpServletRequest pRequest)
------------------------------------- utility: getLocale Determine the user's current locale, if available

Parameters:
pRequest - DynamoHttpServletRequest
Returns:
Locale user's current locale

findLocaleRepository

protected atg.repository.Repository findLocaleRepository(atg.servlet.DynamoHttpServletRequest request)
------------------------------------- findLocaleRepository Use user's current locale to find the right repository to search

Parameters:
request - DynamoHttpServletRequest
Returns:
Repository

checkFormError

protected boolean checkFormError(java.lang.String pErrorURL,
                                 java.lang.String pSuccessURL,
                                 atg.servlet.DynamoHttpServletRequest pRequest,
                                 atg.servlet.DynamoHttpServletResponse pResponse)
                          throws javax.servlet.ServletException,
                                 java.io.IOException
Check to see if there were errors during the submit operation. If so, redirect to the supplied error url if possible.

Parameters:
pErrorURL - the URL to redirect to if there are any form errors
pSuccessURL -
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
the status of the form
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

getDateConstant

protected java.sql.Date getDateConstant(java.lang.String pDate)
Convert string to java.sql.Date

Parameters:
pDate - String object
Returns:
java.sql.Date

service

public void service(javax.servlet.ServletRequest req,
                    javax.servlet.ServletResponse res)
             throws javax.servlet.ServletException,
                    java.io.IOException
The service method - go directly from a Servlet to a DynamoHttpServlet for efficiency.

Specified by:
service in interface javax.servlet.Servlet
Throws:
javax.servlet.ServletException - if an error occurred while processing the servlet request
java.io.IOException - if an error occurred while reading or writing the servlet request

service

public void service(atg.servlet.DynamoHttpServletRequest pRequest,
                    atg.servlet.DynamoHttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
This methods lets this FormHandler to be used as a droplet.

Parameters:
pRequest -
pResponse -
Throws:
javax.servlet.ServletException - an application specific error occurred processing this request
java.io.IOException - an error occurred reading data from the request or writing data to the response.

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Servlet

getServletConfig

public javax.servlet.ServletConfig getServletConfig()
Specified by:
getServletConfig in interface javax.servlet.Servlet

getServletInfo

public java.lang.String getServletInfo()
Specified by:
getServletInfo in interface javax.servlet.Servlet

init

public void init(javax.servlet.ServletConfig config)
Specified by:
init in interface javax.servlet.Servlet