atg.commerce.search.web.assetmanager
Class CommerceSearchTestingFormHandler

java.lang.Object
  extended by SearchTestingFormHandler
      extended by atg.commerce.search.web.assetmanager.CommerceSearchTestingFormHandler

public class CommerceSearchTestingFormHandler
extends SearchTestingFormHandler

This class is a SearchTestingFormHandler extension to handle commerce-specific search parameters (categoryName) and commerce-specific facets handling for the search testing


Field Summary
static java.lang.String CLASS_VERSION
           
protected  java.lang.String mCategoryName
          Property categoryName
protected  Repository mMerchandisingProductCatalogRepository
          Property merchandisingProductCatalogRepository
 
Constructor Summary
CommerceSearchTestingFormHandler()
           
 
Method Summary
protected  void clear()
          In addition to superclass, clears category name
 java.lang.String getCategoryName()
           
 java.util.List getFacetSources()
          Uses CommerceFacetSearchTools to get a list of facet sources parsed from the search response
 Repository getMerchandisingProductCatalogRepository()
           
 boolean handleClear(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Handler for "Clear" button.
 boolean handleSelectCategory(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Handles category selection via picker, calls prepareCategoryName to display name instead of Id.
protected  void preApplyFacetChanges(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pRespons)
          Called when user clicks "apply facet changes" link.
protected  void preSearch(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called before QueryFormHandler.handleSearch, and it sets all the search request parameters This particular method only sets categoryId in CommerceFacetSearchTools, everything else is set in superclass.
 void setMerchandisingProductCatalogRepository(Repository pMerchandisingProductCatalogRepository)
           
 void setPreloadedCategoryId(java.lang.String pId)
           
 void setRepositoryId(java.lang.String pId)
          Sets the repository id of the item to be manipulated.
 
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
See Also:
Constant Field Values

mCategoryName

protected java.lang.String mCategoryName
Property categoryName


mMerchandisingProductCatalogRepository

protected Repository mMerchandisingProductCatalogRepository
Property merchandisingProductCatalogRepository

Constructor Detail

CommerceSearchTestingFormHandler

public CommerceSearchTestingFormHandler()
Method Detail

getCategoryName

public java.lang.String getCategoryName()
Returns:
category name

getMerchandisingProductCatalogRepository

public Repository getMerchandisingProductCatalogRepository()
Returns:
product catalog

setMerchandisingProductCatalogRepository

public void setMerchandisingProductCatalogRepository(Repository pMerchandisingProductCatalogRepository)
Parameters:
pMerchandisingProductCatalogRepository - product catalog

setPreloadedCategoryId

public void setPreloadedCategoryId(java.lang.String pId)

setRepositoryId

public void setRepositoryId(java.lang.String pId)
Sets the repository id of the item to be manipulated. This also clears the value dictionary, since the property values in it correspond to the item with the old repository id. In addition calls prepareCategoryName.


preSearch

protected void preSearch(DynamoHttpServletRequest pRequest,
                         DynamoHttpServletResponse pResponse)
                  throws javax.servlet.ServletException,
                         java.io.IOException
This method is called before QueryFormHandler.handleSearch, and it sets all the search request parameters This particular method only sets categoryId in CommerceFacetSearchTools, everything else is set in superclass.

Parameters:
pRequest - Dynamo http request
pResponse - Dynamo http response
Throws:
javax.servlet.ServletException
java.io.IOException

clear

protected void clear()
In addition to superclass, clears category name


handleSelectCategory

public boolean handleSelectCategory(DynamoHttpServletRequest pRequest,
                                    DynamoHttpServletResponse pResponse)
                             throws javax.servlet.ServletException,
                                    java.io.IOException
Handles category selection via picker, calls prepareCategoryName to display name instead of Id.

Parameters:
pRequest - Dynamo http request
pResponse - Dynamo http response
Returns:
true
Throws:
javax.servlet.ServletException - if error occurs
java.io.IOException - if error occurs

handleClear

public boolean handleClear(DynamoHttpServletRequest pRequest,
                           DynamoHttpServletResponse pResponse)
                    throws javax.servlet.ServletException,
                           java.io.IOException
Handler for "Clear" button. Removes category selection.

Parameters:
pRequest - Dynamo http request
pResponse - Dynamo http response
Returns:
true
Throws:
javax.servlet.ServletException - if error occurs
java.io.IOException - if error occurs

getFacetSources

public java.util.List getFacetSources()
                               throws javax.xml.transform.TransformerException
Uses CommerceFacetSearchTools to get a list of facet sources parsed from the search response

Returns:
parsed facet sources
Throws:
javax.xml.transform.TransformerException - incase of error

preApplyFacetChanges

protected void preApplyFacetChanges(DynamoHttpServletRequest pRequest,
                                    DynamoHttpServletResponse pRespons)
Called when user clicks "apply facet changes" link. Does some preparations before applying facet changes.

Parameters:
pRequest - dynamo request
pRespons - dynamo response
See Also:
atg.search.web.assetmanager.SearchTestingFormHandler#preApplyFacetChanges(atg.servlet.DynamoHttpServletRequest, atg.servlet.DynamoHttpServletResponse)