atg.commerce.adc.processor
Class ProcAddProductViewed

java.lang.Object
  extended by ADCEventPipelineProcessor
      extended by atg.commerce.adc.processor.ProcAddProductViewed
Direct Known Subclasses:
ProcScenarioAddedItemToOrder

public abstract class ProcAddProductViewed
extends ADCEventPipelineProcessor

This class contains the addProductViewedObject method, which will add a ProductViewed object to the ProductsViewed hashtable associated with the session data. If a ProductViewed object already exists for the given product, the object is updated as necessary. This class also contains the getProductCategoryId method, which determines the category to associate with the product in the ProductViewed object.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
ProcAddProductViewed()
           
 
Method Summary
 ProductViewed addProductViewedObject(ADCPipelineArgs pArgs, RepositoryItem pProduct, boolean pInCart)
          This method will determine the category for the given product and then add or update a ProductViewed object in the session data.
 ProductViewed addProductViewedObject(ADCPipelineArgs pArgs, java.lang.String pProductId, java.lang.String pCategoryId, boolean pInCart)
          This method will see if a ProductViewed object for the given product Id exists in the session data.
 void clearProductsViewedFromCart(java.util.Hashtable pProductsViewed)
          This method sets inCart=false for all items in the ProductsViewed Hashtable
 java.lang.String getDefaultCategory()
           
 java.lang.String getParentCategoryPropertyName()
           
 java.lang.String getProductCategoryId(ADCPipelineArgs pArgs, RepositoryItem pProduct)
          This method will get the category id to be associated with this product in its ProductViewed object.
 boolean isUseParentCategory()
           
 boolean isUsePreviousRequestCategoryId()
           
 void setDefaultCategory(java.lang.String pDefaultCategory)
          The default page category.
 void setParentCategoryPropertyName(java.lang.String pParentCategoryPropertyName)
          The name of the property in the product item descriptor to use for the category to be associated with the product view.
 void setUseParentCategory(boolean pUseParentCategory)
          Boolean indicating if the product's parentCategory property should be used to get the category parameter value if the category was not set by a droplet, JSP tag, query string parameter, or the previous request's category.
 void setUsePreviousRequestCategoryId(boolean pUsePreviousRequestCategoryId)
          Boolean indicating if the category associated with the previous request should be used to get the category parameter value if the category was not set by a droplet, JSP tag, or query string parameter.
 
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
Constructor Detail

ProcAddProductViewed

public ProcAddProductViewed()
Method Detail

setDefaultCategory

public void setDefaultCategory(java.lang.String pDefaultCategory)
The default page category. If the category in the request data is the same as this, we use the previous request's category or the product's parent category as the category associated with the product.

Parameters:
pDefaultCategory - The default page category

getDefaultCategory

public java.lang.String getDefaultCategory()
Returns:
The default page category. If the category in the request data is the same as this, we use the previous request's category or the product's parent category as the category associated with the product.

setParentCategoryPropertyName

public void setParentCategoryPropertyName(java.lang.String pParentCategoryPropertyName)
The name of the property in the product item descriptor to use for the category to be associated with the product view.

Parameters:
pParentCategoryPropertyName - The name of the property in the product item descriptor to use for the category to be associated with the product view.

getParentCategoryPropertyName

public java.lang.String getParentCategoryPropertyName()
Returns:
The name of the property in the product item descriptor to use for the category to be associated with the product view.

setUseParentCategory

public void setUseParentCategory(boolean pUseParentCategory)
Boolean indicating if the product's parentCategory property should be used to get the category parameter value if the category was not set by a droplet, JSP tag, query string parameter, or the previous request's category.

Parameters:
pUseParentCategory - Boolean indicating if the product's parentCategory property should be used to get the category parameter value if the category was not set by a droplet, JSP tag, query string parameter, or the previous request's category.

isUseParentCategory

public boolean isUseParentCategory()
Returns:
Boolean indicating if the product's parentCategory property should be used to get the category parameter value if the category was not set by a droplet, JSP tag, query string parameter, or the previous request's category.

setUsePreviousRequestCategoryId

public void setUsePreviousRequestCategoryId(boolean pUsePreviousRequestCategoryId)
Boolean indicating if the category associated with the previous request should be used to get the category parameter value if the category was not set by a droplet, JSP tag, or query string parameter.

Parameters:
pUseParentCategory - Boolean indicating if the category associated with the previous request should be used to get the category parameter value if the category was not set by a droplet, JSP tag, or query string parameter.

isUsePreviousRequestCategoryId

public boolean isUsePreviousRequestCategoryId()
Returns:
Boolean indicating if the category associated with the previous request should be used to get the category parameter value if the category was not set by a droplet, JSP tag, or query string parameter.

addProductViewedObject

public ProductViewed addProductViewedObject(ADCPipelineArgs pArgs,
                                            RepositoryItem pProduct,
                                            boolean pInCart)
This method will determine the category for the given product and then add or update a ProductViewed object in the session data.

Parameters:
pArgs - the ADC pipeline arguments.
pProduct - the product that has been viewed.
pInCart - boolean indicating if the product is in the current order.

addProductViewedObject

public ProductViewed addProductViewedObject(ADCPipelineArgs pArgs,
                                            java.lang.String pProductId,
                                            java.lang.String pCategoryId,
                                            boolean pInCart)
This method will see if a ProductViewed object for the given product Id exists in the session data. If so, it will update it as appropriate. If not, a ProductViewed object will be created and added to the ProductsViewed Hashtable in the session data

Parameters:
pArgs - the ADC pipeline arguments.
pProductId - the ID of the product that has been viewed.
pCategoryId - the ID of the category that the product was viewed in.
pInCart - boolean indicating if the product is in the current order.

getProductCategoryId

public java.lang.String getProductCategoryId(ADCPipelineArgs pArgs,
                                             RepositoryItem pProduct)
This method will get the category id to be associated with this product in its ProductViewed object. We first check to see if the category was specified in a query parameter. If not, we use the previous request's category or the product's parentCategory, depending on the settings of the usePreviousRequestCategoryId and useParentCategory properties.

Parameters:
pArgs - the pipeline arguments
pProduct - the product repository item
Returns:
the appropriate category Id

clearProductsViewedFromCart

public void clearProductsViewedFromCart(java.util.Hashtable pProductsViewed)
This method sets inCart=false for all items in the ProductsViewed Hashtable

Parameters:
pProductsViewed - the Hashtable mapping productIds to ProductViewed objects