atg.remote.promotion.template.service
Class PromotionTemplateTools

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.remote.promotion.template.service.PromotionTemplateTools
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, java.util.EventListener

public class PromotionTemplateTools
extends GenericService

Service that provides some general purpose Promotion Template functionality.


Field Summary
static java.lang.String BULK_CALCULATOR_TYPE
           
static java.lang.String CALCULATOR_TYPE_ATTRIBUTE
           
static java.lang.String CLASS_VERSION
           
static java.lang.String DISCOUNT_TYPE_ATTRIBUTE
           
static java.lang.String PROMOTION_TYPE_ATTRIBUTE
           
static java.lang.String PROMOTION_TYPE_IDENTIFIER
           
static java.lang.String STANDARD_CALCULATOR_TYPE
           
 
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
PromotionTemplateTools()
           
 
Method Summary
 java.lang.String getAdjusterAttribute()
           
 java.lang.String getBandingAttribute()
           
 CalculatorInfo getCalculatorInfo(java.lang.String pPromotionType, java.lang.String pCalculatorType)
          Retrieves a CalculatorInfo from the PricingEngineService for the given pPromotionType + pCalculatorType combination.
 CalculatorInfo getCalculatorInfo(java.lang.String pPromotionType, java.lang.String pDiscountType, java.lang.String pCalculatorType)
          Retrieves a CalculatorInfo from the PricingEngineService for the given pPromotionType + pDiscountType + pCalculatorType combination.
 CalculatorInfo[] getCalculatorInfos(java.lang.String pPromotionType)
          Retrieves all CalculatorInfo's from the PricingEngineService for the given pPromotionType
 ServiceMap getPricingEngineMap()
           
 PricingEngineService getPricingEngineService(java.lang.String pPromoType)
          Retrieves the PricingEngineService from mPricingEngineMap for a given promotion type
 java.lang.String getPromotionIdFromDisplayName(java.lang.String pPromoName)
          Retrieves promotion type id from display name.
 java.lang.String retrieveAndFormatResourceBundleString(java.lang.String pKey, java.lang.Object[] pArgs)
           
 void setPricingEngineMap(ServiceMap pPricingEngineMap)
           
static java.lang.String[] splitOutEndTag(java.lang.String pXML)
          Method to split out the end tag from an XML string.
 
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
See Also:
Constant Field Values

PROMOTION_TYPE_IDENTIFIER

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

BULK_CALCULATOR_TYPE

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

STANDARD_CALCULATOR_TYPE

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

PROMOTION_TYPE_ATTRIBUTE

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

DISCOUNT_TYPE_ATTRIBUTE

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

CALCULATOR_TYPE_ATTRIBUTE

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

PromotionTemplateTools

public PromotionTemplateTools()
Method Detail

getPricingEngineMap

public ServiceMap getPricingEngineMap()

setPricingEngineMap

public void setPricingEngineMap(ServiceMap pPricingEngineMap)

getCalculatorInfo

public CalculatorInfo getCalculatorInfo(java.lang.String pPromotionType,
                                        java.lang.String pDiscountType,
                                        java.lang.String pCalculatorType)
                                 throws atg.repository.editingtemplate.TemplateException
Retrieves a CalculatorInfo from the PricingEngineService for the given pPromotionType + pDiscountType + pCalculatorType combination.

Parameters:
pPromotionType -
pDiscountType -
pCalculatorType -
Returns:
Throws:
atg.repository.editingtemplate.TemplateException

getCalculatorInfo

public CalculatorInfo getCalculatorInfo(java.lang.String pPromotionType,
                                        java.lang.String pCalculatorType)
                                 throws atg.repository.editingtemplate.TemplateException
Retrieves a CalculatorInfo from the PricingEngineService for the given pPromotionType + pCalculatorType combination.

Parameters:
pPromotionType -
pCalculatorType -
Returns:
Throws:
atg.repository.editingtemplate.TemplateException

getCalculatorInfos

public CalculatorInfo[] getCalculatorInfos(java.lang.String pPromotionType)
                                    throws atg.repository.editingtemplate.TemplateException
Retrieves all CalculatorInfo's from the PricingEngineService for the given pPromotionType

Parameters:
pPromotionType -
Returns:
Throws:
PromotionTemplateException
atg.repository.editingtemplate.TemplateException

retrieveAndFormatResourceBundleString

public java.lang.String retrieveAndFormatResourceBundleString(java.lang.String pKey,
                                                              java.lang.Object[] pArgs)
Parameters:
pKey -
pArgs -
Returns:

getPromotionIdFromDisplayName

public java.lang.String getPromotionIdFromDisplayName(java.lang.String pPromoName)
Retrieves promotion type id from display name. Expects a display name like "Item Discount" from which it will return the identifier "item".

Parameters:
pPromoName -
Returns:

getBandingAttribute

public java.lang.String getBandingAttribute()
Returns:

getAdjusterAttribute

public java.lang.String getAdjusterAttribute()
Returns:

getPricingEngineService

public PricingEngineService getPricingEngineService(java.lang.String pPromoType)
Retrieves the PricingEngineService from mPricingEngineMap for a given promotion type

Parameters:
pPromoType - the promotion type
Returns:
PricingEngineService map entry for promotion type parameter

splitOutEndTag

public static java.lang.String[] splitOutEndTag(java.lang.String pXML)
                                         throws atg.repository.editingtemplate.TemplateException
Method to split out the end tag from an XML string. e.g. or blah would both split to be [0]= [1]=

Parameters:
pXML - String XML
Returns:
String array length 2 where the second element is the end tag
Throws:
atg.repository.editingtemplate.TemplateException