atg.commerce.catalog
Class DisplaySkuProperties

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.TimedOperationService
              extended by atg.nucleus.servlet.ServletService
                  extended by atg.nucleus.servlet.HttpServletService
                      extended by atg.servlet.DynamoServlet
                          extended by atg.commerce.catalog.DisplaySkuProperties
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, ParameterServlet, java.util.EventListener, javax.servlet.Servlet

public class DisplaySkuProperties
extends DynamoServlet

This droplet is capable of returning a string which is the concatentation of all the displayable properties for a sku. By default the properties for a particular Sku are defined on a product level, since this allows saving storage space. The droplet obtains all the necessary information via parameters and then renders the output parameter after setting the displayElement parameter. This droplet can take the following parameters.

The following output parameters can be set:

Alternatively, the list of properties to extract from a sku can be obtained by setting the propertyList parameter to a comma separated list. The list should be in the form of size,color etc. If this parameter is set, then there is no need to set the product property.

If an error is encountered while obtaining either a property from the sku object, or a necessary parameter is not supplied (sku object etc.) then the output parameter will be set to null and the output parameter will be renedered


Field Summary
static java.lang.String CLASS_VERSION
           
static java.lang.String DISPLAY_ELEMENT
           
static java.lang.String SPACE_CHARACTER
           
static java.lang.String TOKENIZER_CHARACTER
           
 
Fields inherited from class atg.servlet.DynamoServlet
mAllowCleanupRequest, mParameters
 
Fields inherited from class atg.nucleus.servlet.ServletService
SERVLET_INFO_KEY
 
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
DisplaySkuProperties()
           
 
Method Summary
 java.lang.String getDisplayableSkuAttributesProperty()
          Return the name of the property in the product from which Sku properties for display are obtained.
 RepositoryItem getProduct(DynamoHttpServletRequest pRequest)
          This method obtains the Product object from the DynamoHttpServletResponse object.
 RepositoryItem getSku(DynamoHttpServletRequest pRequest)
          This method obtains the Sku object from the DynamoHttpServletRequest object.
protected  java.lang.String getSkuPropertyValues(RepositoryItem pSku, java.util.List pProperties, java.lang.String pDelimiter)
          This method is actually responsible for obtaining the values and concatenating the string together that will be rendered on output.
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is responsible for determining the concatenation of a group of strings from a particular Sku object.
 void setDisplayableSkuAttributesProperty(java.lang.String pDisplayableSkuAttributesProperty)
          Set the property in the product that contains a list of properties to extract from the sku.
 
Methods inherited from class atg.servlet.DynamoServlet
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, init, service, service, setParameter
 
Methods inherited from class atg.nucleus.servlet.ServletService
destroy, getServletConfig, getServletInfo, setServletInfo
 
Methods inherited from class atg.nucleus.TimedOperationService
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
 
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 java.lang.String CLASS_VERSION

DISPLAY_ELEMENT

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

SPACE_CHARACTER

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

TOKENIZER_CHARACTER

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

DisplaySkuProperties

public DisplaySkuProperties()
Method Detail

setDisplayableSkuAttributesProperty

public void setDisplayableSkuAttributesProperty(java.lang.String pDisplayableSkuAttributesProperty)
Set the property in the product that contains a list of properties to extract from the sku.

Parameters:
pDisplayableSkuAttributesProperty - the property name

getDisplayableSkuAttributesProperty

public java.lang.String getDisplayableSkuAttributesProperty()
Return the name of the property in the product from which Sku properties for display are obtained.

Returns:
the property name

getSku

public RepositoryItem getSku(DynamoHttpServletRequest pRequest)
This method obtains the Sku object from the DynamoHttpServletRequest object. If the user needs to override where the sku object is obtained this should can be done here.

Parameters:
pRequest - a value of type 'DynamoHttpServletRequest'
Returns:
the sku object

getProduct

public RepositoryItem getProduct(DynamoHttpServletRequest pRequest)
This method obtains the Product object from the DynamoHttpServletResponse object. If the user needs to override where the product object is obtained this should be done here.

Parameters:
pRequest - a value of type 'DynamoHttpServletRequest'
Returns:
the product object

getSkuPropertyValues

protected java.lang.String getSkuPropertyValues(RepositoryItem pSku,
                                                java.util.List pProperties,
                                                java.lang.String pDelimiter)
This method is actually responsible for obtaining the values and concatenating the string together that will be rendered on output. A List is obtained from the product property that contains displayableSkuAttributes and then is iterated through obtaining values for each named property. These values are then appended onto each other, using the delimiter as the separating token.

Parameters:
pProduct - the product object which contains the properties to obtain from the sku
pDelimiter - token to separate the values from the sku
Returns:
the string that will be rendered on output

service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
This method is responsible for determining the concatenation of a group of strings from a particular Sku object. These strings are the various properties that are associated with a sku. One example of this might be obtaining the color, size and display name for a Sku and showing this to the user in a drop down menu. This string is then set to the parameter as named by the displayElementName. The user then has the ability to render this as need be.

The order that the properties are displayed in equates to the order of the properties that are obtained from the displayableSkuAttributes property in the product.

Overrides:
service in class DynamoServlet
Parameters:
pRequest - a value of type 'DynamoHttpServletRequest'
pResponse - a value of type 'DynamoHttpServletResponse'
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs