atg.commerce.adc.processor
Class ProcSetPageName

java.lang.Object
  extended by PageNameProcessor
      extended by atg.commerce.adc.processor.ProcSetPageName

public class ProcSetPageName
extends PageNameProcessor

This processor will determine the page name and category that will be stored in the ADCRequestData for use in the remaining pipeline processors. The url of the requested page is used to look up the page name in the configured pageNames property. If the request page includes the <adc:setPageName pageName="something"/> tag, then that value is always used instead.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String PRODUCT_CATEGORY_ID
           
static java.lang.String PRODUCT_CATEGORY_NAME
           
static java.lang.String PRODUCT_ID
           
static java.lang.String PRODUCT_NAME
           
 
Constructor Summary
ProcSetPageName()
           
 
Method Summary
protected  java.lang.String findCategoryName(ADCPipelineArgs pArgs, java.lang.String pCategoryId)
          For the given category id, return the products categoryNameProperty
protected  java.lang.String findProductId(ADCPipelineArgs pArgs)
          Finds the product id from the query arguments in the request.
protected  java.lang.String findProductName(ADCPipelineArgs pArgs, java.lang.String pProductId)
          For the given product id, return the products productNameProperty
protected  java.lang.String findQueryArgument(DynamoHttpServletRequest pRequest, java.lang.String[] pQueryArgs)
          Return the first pQueryArgs that is found in the request.
 java.lang.String getCategoryItemType()
          The category item descriptor name
 java.lang.String getCategoryNameProperty()
          The property of each category that is used as the name Defaults to "displayName"
 Repository getProductCatalog()
          The product catalog repository used to find products and categories
 java.lang.String[] getProductIdQueryArgs()
          The list of query arguments that specify which product is being viewed
 java.lang.String getProductItemType()
          The product item descriptor name
 java.lang.String getProductNameProperty()
          The property of each product that is used as the name Defaults to "displayName"
protected  java.lang.String replaceVariables(ADCPipelineArgs pArgs, java.lang.String pTemplate)
          Replaces all of the variables in pTemplate with the correct value.
 void setCategoryItemType(java.lang.String pCategoryItemType)
           
 void setCategoryNameProperty(java.lang.String pCategoryNameProperty)
           
 void setProductCatalog(Repository pProductCatalog)
           
 void setProductIdQueryArgs(java.lang.String[] pProductIdQueryArgs)
           
 void setProductItemType(java.lang.String pProductItemType)
           
 void setProductNameProperty(java.lang.String pProductNameProperty)
           
 
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

PRODUCT_ID

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

PRODUCT_NAME

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

PRODUCT_CATEGORY_ID

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

PRODUCT_CATEGORY_NAME

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

ProcSetPageName

public ProcSetPageName()
Method Detail

setCategoryItemType

public void setCategoryItemType(java.lang.String pCategoryItemType)

getCategoryItemType

public java.lang.String getCategoryItemType()
The category item descriptor name


setCategoryNameProperty

public void setCategoryNameProperty(java.lang.String pCategoryNameProperty)

getCategoryNameProperty

public java.lang.String getCategoryNameProperty()
The property of each category that is used as the name Defaults to "displayName"


setProductCatalog

public void setProductCatalog(Repository pProductCatalog)

getProductCatalog

public Repository getProductCatalog()
The product catalog repository used to find products and categories


setProductIdQueryArgs

public void setProductIdQueryArgs(java.lang.String[] pProductIdQueryArgs)

getProductIdQueryArgs

public java.lang.String[] getProductIdQueryArgs()
The list of query arguments that specify which product is being viewed


setProductItemType

public void setProductItemType(java.lang.String pProductItemType)

getProductItemType

public java.lang.String getProductItemType()
The product item descriptor name


setProductNameProperty

public void setProductNameProperty(java.lang.String pProductNameProperty)

getProductNameProperty

public java.lang.String getProductNameProperty()
The property of each product that is used as the name Defaults to "displayName"


replaceVariables

protected java.lang.String replaceVariables(ADCPipelineArgs pArgs,
                                            java.lang.String pTemplate)
Replaces all of the variables in pTemplate with the correct value. For example, if pTemplate is "Product {PRODUCT_NAME} Page" then the result might be "Product Green Sweater Page". In addition to the variables available in PageNameProcessor, these are the additional variables: PRODUCT_ID PRODUCT_NAME PRODUCT_CATEGORY_ID PRODUCT_CATEGORY_NAME

Parameters:
pArgs - The pipeline arguments
pTemplate - The page name template
Returns:
The real page name
See Also:
atg.adc.pipeline.PageNameProcessor

findProductId

protected java.lang.String findProductId(ADCPipelineArgs pArgs)
Finds the product id from the query arguments in the request. Each arugment name in productQueryArgs is checked until something is found.

Parameters:
pArgs - The pipeline arguments
Returns:
The product id, or null if not found

findProductName

protected java.lang.String findProductName(ADCPipelineArgs pArgs,
                                           java.lang.String pProductId)
For the given product id, return the products productNameProperty

Parameters:
pArgs - The pipeline arguments
pProductId - The id of the product whose name is returned
Returns:
The value of the product's productNameProperty property. null if not found

findCategoryName

protected java.lang.String findCategoryName(ADCPipelineArgs pArgs,
                                            java.lang.String pCategoryId)
For the given category id, return the products categoryNameProperty

Parameters:
pArgs - The pipeline arguments
pProductId - The id of the category whose name is returned
Returns:
The value of the category's categoryNameProperty property. null if not found

findQueryArgument

protected java.lang.String findQueryArgument(DynamoHttpServletRequest pRequest,
                                             java.lang.String[] pQueryArgs)
Return the first pQueryArgs that is found in the request. Return null if none of them are found.