|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.commerce.promotion.PromotionTools
public class PromotionTools
Utility service with methods to help process promotions.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
static java.lang.String |
COPIED_DURING_LOGIN
|
static java.lang.String |
EXTRA_PARAM_QUALIFIERSERVICE
Key into extra parameters map to an optional Qualifier service reference |
protected Qualifier |
mQualifierService
|
protected java.util.Map<java.lang.String,Qualifier> |
mQualifierServices
Cache of qualifier service path names to service instances |
protected ComponentName |
mUserPricingModelHolderPath
|
static java.lang.String |
REVOKED_DURING_LOGIN
|
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 | |
---|---|
PromotionTools()
|
Method Summary | |
---|---|
void |
addAllPromotions(MutableRepositoryItem pProfile,
java.util.Collection pPromotions)
Adds all of the promotions in the collection to the user's activePromotion attribute value. |
void |
addAllPromotions(MutableRepositoryItem pProfile,
java.util.Collection pPromotions,
java.lang.String pComment)
Adds all of the promotions in the collection to the user's activePromotion attribute value. |
void |
addCouponToExistingPromoStatus(java.util.Collection<RepositoryItem> pPromotionStatuses,
RepositoryItem pPromotion,
RepositoryItem pCoupon)
This method adds a coupon to an existing promostatus if it is not already in the list. |
boolean |
addPromotion(MutableRepositoryItem pProfile,
RepositoryItem pPromotion)
Adds the promotion to the user's activePromotion attribute value. |
boolean |
addPromotion(MutableRepositoryItem pProfile,
RepositoryItem pPromotion,
java.lang.String pComment)
Adds the promotion to the user's activePromotion attribute value. |
boolean |
addPromotion(MutableRepositoryItem pProfile,
RepositoryItem pPromotion,
java.lang.String pComment,
java.lang.String pSiteId)
Adds the promotion to the user's activePromotion attribute value. |
java.util.Map |
calculatePromotionsForOrder(Order pOrder)
This method will return a map containing the count of promotions contained in the given order, and the total value of those promotions |
boolean |
checkPromotionExpiration(RepositoryItem pPromotion,
java.util.Date pNow)
Return true if the promotion or the promotionStatus has expired and should not be used in pricing. |
boolean |
checkPromotionGrant(RepositoryItem pProfile,
RepositoryItem pPromotion)
Will throw appropriate exception or return true if it's OK to grant the promotion to the passed in profile |
boolean |
checkPromotionGrant(RepositoryItem pProfile,
RepositoryItem pPromotion,
RepositoryItem pCoupon,
java.lang.String[] pCheckProps)
Will throw appropriate exception or return true if it's OK to grant the promotion to the passed in profile |
boolean |
checkPromotionGrant(RepositoryItem pProfile,
RepositoryItem pPromotion,
java.lang.String[] pCheckProps)
Will throw appropriate exception or return true if it's OK to grant the promotion to the passed in profile |
boolean |
consumePromotion(MutableRepositoryItem pProfile,
RepositoryItem pPromotion)
This method moves a promotion from the user's activePromotions list to their usedPromotions list. |
java.util.Collection |
convertPromoStatusToPromo(java.util.Collection pPromoStatuses)
This method returns a collection of propmotions from the passed in collection of promotion statuses. |
RepositoryItem |
convertSinglePromoStatusToPromo(RepositoryItem pPromoStatus)
This method returns the single promotion from a promotion status |
java.util.Map |
createPromotionCountMap(Order pOrder)
Creates a Map of promotion id to the use count in the order. |
RepositoryItem |
createPromotionStatus(RepositoryItem pProfile,
RepositoryItem pPromotion,
java.lang.Integer pNumUses)
This method calls createTransientPromotionStatus to create and return a PromotionStatus repository item. |
RepositoryItem |
createPromotionStatus(RepositoryItem pProfile,
RepositoryItem pPromotion,
java.lang.Integer pNumUses,
RepositoryItem pCoupon)
This method calls createTransientPromotionStatus to create and return a PromotionStatus repository item. |
MutableRepositoryItem |
createTransientPromotionStatus(RepositoryItem pProfile,
RepositoryItem pPromotion,
java.lang.Integer pNumUses)
This method creates a PromotionStatus repository item and returns it without saving it. |
MutableRepositoryItem |
createTransientPromotionStatus(RepositoryItem pProfile,
RepositoryItem pPromotion,
java.lang.Integer pNumUses,
RepositoryItem pCoupon)
This method creates a PromotionStatus repository item and returns it without saving it. |
void |
expirePromotion(RepositoryItem pPromotion,
RepositoryItem pProfile)
This method will remove the passed in promotion from the Profile. |
java.lang.String |
getActivePromotionsProperty()
Property of the profile to which we add new promotions |
java.lang.String |
getAddItemEventPipeline()
The name of the pipeline used to send the ScenarioAddedItemToOrder event Defaults to PipelineConstants.SENDSCENARIOEVENT |
java.lang.String |
getAllowMultipleProperty()
Property name of the 'allowMultiple' property in the promotion |
java.lang.String[] |
getAlternateUserPricingModelHolderPaths()
Returns property AlternateUserPricingModelHolderPaths |
java.lang.String |
getBaseClosenessQualifierItemType()
Returns property BaseClosenessQualifierItemType |
java.lang.String |
getBasePromotionItemType()
Returns property BasePromotionItemType |
CurrentDate |
getCurrentDate()
The name of the current date component used to get the current date. |
GetService |
getGetService()
The tool used to convert promotions to xml in getPromotionsAsXML |
java.lang.String |
getGiveToAnonymousProfilesProperty()
Property name of the 'giveToAnonymousProfiles' property in the promotion |
void |
getItemPromotions(CommerceItem pItem,
java.util.Collection pPromotions)
Returns the promotions used in the CommerceItem. |
void |
getItemPromotions(CommerceItem pItem,
java.util.Collection pPromotions,
boolean pGetAdjustments)
Returns the promotions used in the CommerceItem. |
java.lang.String |
getMappingFileName()
The name of the mapping file that describes the XML format for getPromotionsAsXML |
void |
getOrderPromotions(Order pOrder,
java.util.Collection pPromotions)
Returns the promotions used in the order. |
void |
getOrderPromotions(Order pOrder,
java.util.Collection pPromotions,
boolean pGetAdjustments)
Returns the promotions used in the order. |
void |
getOrderPromotions(Order pOrder,
java.util.Collection pOrderPromotions,
java.util.Collection pTaxPromotions,
java.util.Collection pItemPromotions,
java.util.Collection pShippingPromotions)
This method retrieves all the promotions in an order and adds them to their respective collection. |
void |
getOrderPromotions(Order pOrder,
java.util.Collection pOrderPromotions,
java.util.Collection pTaxPromotions,
java.util.Collection pItemPromotions,
java.util.Collection pShippingPromotions,
boolean pGetAdjustments)
This method retrieves all the promotions in an order and adds them to their respective collection. |
PipelineManager |
getPipelineManager()
The PipelineManager is used to run the pipeline process that sends scenario events |
int |
getPMDLVersion(RepositoryItem pPricingModel)
Utility method to get the pmdl version for a given promotion. |
PricingModelProperties |
getPricingModelProperties()
Returns a bean that contains properties for a PricingModel |
PricingTools |
getPricingTools()
Return the PricingTools component |
RepositoryItem |
getProfile(java.lang.String pProfileId)
Gets the profile repository item with the given id |
java.lang.String |
getProfileItemType()
|
MutableRepository |
getProfileRepository()
Return the editable profile repository |
java.lang.String |
getPromoStatusCouponsPropertyName()
Returns the descriptor name for the Coupons property |
java.lang.String |
getPromoStatusDescriptorName()
Returns the descriptor name for the promoStatus descriptor |
java.util.Collection |
getPromoStatuses(RepositoryItem pProfile,
java.lang.String[] pCheckProps)
Get all of the promoStatuses for the profile |
java.lang.String |
getPromoStatusNumUsesProperty()
Returns the promoStatus num_uses property name |
java.lang.String |
getPromoStatusProfileIdProperty()
Returns the promoStatus profile id property name |
java.lang.String |
getPromoStatusPromoProperty()
Returns the promoStatus promo property name |
int |
getPromotionCount(Order pOrder,
RepositoryItem pPromotion)
Returns the number of times a promotion appears in the order. |
RepositoryItem |
getPromotionFromComposite(RepositoryItem pPromotion)
For composite promotion items we need to get the item from the promotions repository since for example the promotion may have come from the profile repository which could be composite. |
MessageSender |
getPromotionGrantedMessageSender()
Gets property MessageSender. |
MessageSender |
getPromotionRevokedMessageSender()
Gets property PromotionRevokedMessageSender. |
Repository |
getPromotions()
Returns property Promotions |
java.util.Collection |
getPromotions(java.lang.String pProfileId)
This method will look up the given profile and return all of the available promotions for that user. |
java.lang.String[] |
getPromotionsAsXML(java.lang.String pProfileId)
This method will look up the given profile, and for each available promotion, will return an xml representation of it using the GetService and the mappingFileName . |
Qualifier |
getQualifierService()
Gets the default Qualifier service to use. |
Qualifier |
getQualifierService(RepositoryItem pPricingModel,
java.util.Map pExtraParameters,
Qualifier pDefaultQualifier)
Gets the Qualifier service to use for the given promotion item. |
void |
getShippingPromotions(ShippingGroup pGroup,
java.util.Collection pPromotions)
Returns the promotions used in the ShippingGroup. |
void |
getShippingPromotions(ShippingGroup pGroup,
java.util.Collection pPromotions,
boolean pGetAdjustments)
Returns the promotions used in the ShippingGroup. |
java.lang.String |
getSiteGroupPropertyName()
Return the SiteGroupPropertyName property. |
java.lang.String |
getSiteGroupsPropertyName()
Return the SiteGroupsPropertyName property. |
java.lang.String |
getSiteIdPropertyName()
Return the SiteIdPropertyName property. |
java.lang.String |
getSitesPropertyName()
Return the SitesPropertyName property. |
void |
getTaxPromotions(Order pOrder,
java.util.Collection pPromotions)
Returns the promotions used in the tax calculation. |
void |
getTaxPromotions(Order pOrder,
java.util.Collection pPromotions,
boolean pGetAdjustments)
Returns the promotions used in the tax calculation. |
java.lang.String |
getUsedPromotionsProperty()
Property of the profile to which we add consumed promotions |
java.lang.String |
getUserPricingModelHolderPath()
Returns property UserPricingModelHolderPath |
java.lang.String |
getUsesProperty()
Returns the usesProperty |
void |
grantPromotion(MutableRepositoryItem pProfile,
RepositoryItem pPromotion)
Adds the given promotion to the user's "activePromotions" list. |
void |
grantPromotion(MutableRepositoryItem pProfile,
RepositoryItem pPromotion,
java.lang.String pComment)
Adds the given promotion to the user's "activePromotions" list. |
void |
grantPromotion(MutableRepositoryItem pProfile,
RepositoryItem pPromotion,
java.lang.String pComment,
java.lang.String pSiteId)
Adds the given promotion to the user's "activePromotions" list. |
void |
grantPromotion(MutableRepositoryItem pProfile,
RepositoryItem pPromotion,
java.lang.String pComment,
java.lang.String pSiteId,
RepositoryItem pCoupon)
Adds the given promotion to the user's "activePromotions" list. |
void |
grantPromotion(java.lang.String pProfileId,
java.lang.String pPromotionId)
Adds the given promotion to the user's "activePromotions" list. |
void |
grantPromotion(java.lang.String pProfileId,
java.lang.String pPromotionId,
java.lang.String pComment)
Adds the given promotion to the user's "activePromotions" list. |
void |
grantPromotion(java.lang.String pProfileId,
java.lang.String pPromotionId,
java.lang.String pComment,
java.lang.String pSiteId)
Adds the given promotion to the user's "activePromotions" list. |
void |
initializePricingModels()
Initialize the set of pricing models/promotions that a user currently holds while having an active session. |
void |
initializePricingModels(boolean pRemoveExpiredGlobalPromotions)
Initialize the set of pricing models/promotions that a user currently holds while having an active session. |
void |
initializePricingModels(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Initialize the set of pricing models/promotions that a user currently holds while having an active session. |
boolean |
isClosenessQualifierItem(java.lang.Object pObj)
Method to determine if a passed in repository item or item descriptor is from a closeness qualifier. |
boolean |
isFirePromotionGrantedEvent()
Gets property FirePromotionGrantedEvent |
boolean |
isFirePromotionRevokedEvent()
Gets property FirePromotionRevokedEvent |
boolean |
isItemOfType(java.lang.Object pObj,
RepositoryItemDescriptor pBaseType)
Method to determine if a passed in repository item or item descriptor is of a base type. |
boolean |
isPromotionInPromotionStatuses(RepositoryItem pPromotion,
java.util.Collection pPromotionStatuses)
This method takes a promotion and a collection of promotion statuses, and returns a boolean indicating if the given promotion is represented in the status collection. |
boolean |
isPromotionItem(java.lang.Object pObj)
Method to determine if a passed in repository item or item descriptor is from a promotion. |
boolean |
isRemoveExpiredGlobalPromotions()
Indicates if expired global promotions should be removed. |
boolean |
isSendEventOnAddItem()
If this is true, then the ScenarioAddedItemToCart event will be sent If this is false, then the ScenarioAddedItemToCart event will not be sent. |
boolean |
isUsable(RepositoryItem pPromotion)
This method determines if the given promotion is usable based on the date allowed on the promotion compared to the current date. |
boolean |
isUsable(RepositoryItem pPromotion,
java.util.Date pNow)
This method determines if the given promotion is usable based on the date allowed on the promotion compared to the passed in date. |
RepositoryItem |
lookupPromotion(java.lang.String pPromotionId)
Does a simple lookup to return the promotion repository item for the given id from the repository. |
boolean |
removePromotion(MutableRepositoryItem pProfile,
RepositoryItem pPromotion,
boolean pRemoveAll)
Removes the passed in promotion pPromotion from the pProfile's list of active promotions. |
protected Qualifier |
resolveQualifierService(java.lang.String pQualifierPath)
Resolves the given String nucleus path to a Qualifier service object reference. |
boolean |
revokePromotion(MutableRepositoryItem pProfile,
RepositoryItem pPromotion,
boolean pRemoveAll)
Removes the passed in promotion pPromotion from the pProfile's list of active promotions. |
boolean |
revokePromotion(java.lang.String pProfileId,
java.lang.String pPromotionId,
boolean pRemoveAllInstances)
Removes the passed in promotion pPromotion from the pProfile's list of active promotions. |
boolean |
scenarioAddedItemToOrder(Order pOrder,
CommerceItem pItem,
long pQuantity)
This method is called by the AddItemToOrder scenario action. |
boolean |
scenarioAddedItemToOrder(Order pOrder,
CommerceItem pItem,
long pQuantity,
java.lang.String pSiteId)
This method is called by the AddItemToOrder scenario action. |
void |
sendPromotionGrantedEvent(MutableRepositoryItem pProfile,
RepositoryItem pPromotion)
Sends an PromotionGranted Event through the PromotionGrantedMessageSender if FirePromotionGrantedEvent is set to true. |
void |
sendPromotionGrantedEvent(MutableRepositoryItem pProfile,
RepositoryItem pPromotion,
java.lang.String pComment)
Sends an PromotionGranted Event through the PromotionGrantedMessageSender if FirePromotionGrantedEvent is set to true. |
void |
sendPromotionGrantedEvent(MutableRepositoryItem pProfile,
RepositoryItem pPromotion,
java.lang.String pComment,
java.lang.String pSiteId)
Sends an PromotionGranted Event through the PromotionGrantedMessageSender if FirePromotionGrantedEvent is set to true. |
void |
sendPromotionRevokedEvent(RepositoryItem pProfile,
RepositoryItem pPromotion)
Sends a PromotionRevoked Event through the PromotionRevokedMessageSender if FirePromotionRevokedEvent is set to true. |
void |
sendPromotionRevokedEvent(RepositoryItem pProfile,
RepositoryItem pPromotion,
java.lang.String pComment)
Sends a PromotionRevoked Event through the PromotionRevokedMessageSender if FirePromotionRevokedEvent is set to true. |
void |
sendPromotionRevokedEvent(RepositoryItem pProfile,
RepositoryItem pPromotion,
java.lang.String pComment,
java.lang.String pSiteId)
Sends a PromotionRevoked Event through the PromotionRevokedMessageSender if FirePromotionRevokedEvent is set to true. |
void |
setActivePromotionsProperty(java.lang.String pActivePromotionsProperty)
|
void |
setAddItemEventPipeline(java.lang.String pAddItemEventPipeline)
|
void |
setAllowMultipleProperty(java.lang.String pAllowMultipleProperty)
|
void |
setAlternateUserPricingModelHolderPaths(java.lang.String[] pAlternateUserPricingModelHolderPaths)
Sets property AlternateUserPricingModelHolderPaths |
void |
setBaseClosenessQualifierItemType(java.lang.String pBaseClosenessQualifierItemType)
Sets property BaseClosenessQualifierItemType |
void |
setBasePromotionItemType(java.lang.String pBasePromotionItemType)
Sets property BasePromotionItemType |
void |
setCurrentDate(CurrentDate pCurrentDate)
|
void |
setFirePromotionGrantedEvent(boolean pFirePromotionGrantedEvent)
Sets property FirePromotionGrantedEvent |
void |
setFirePromotionRevokedEvent(boolean pFirePromotionRevokedEvent)
Sets property FirePromotionRevokedEvent |
void |
setGetService(GetService pGetService)
|
void |
setGiveToAnonymousProfilesProperty(java.lang.String pGiveToAnonymousProfilesProperty)
|
void |
setMappingFileName(java.lang.String pMappingFileName)
|
void |
setPipelineManager(PipelineManager pPipelineManager)
|
void |
setPricingModelProperties(PricingModelProperties pPricingModelProperties)
|
void |
setPricingTools(PricingTools pPricingTools)
|
void |
setProfileItemType(java.lang.String pProfileItemType)
|
void |
setProfileRepository(MutableRepository pProfileRepository)
|
void |
setPromoStatusCouponsPropertyName(java.lang.String pPromoStatusCouponsPropertyName)
|
void |
setPromoStatusDescriptorName(java.lang.String pPromoStatusDescriptorName)
|
void |
setPromoStatusNumUsesProperty(java.lang.String pPromoStatusNumUsesProperty)
|
void |
setPromoStatusProfileIdProperty(java.lang.String pPromoStatusProfileIdProperty)
|
void |
setPromoStatusPromoProperty(java.lang.String pPromoStatusPromoProperty)
|
void |
setPromotionGrantedMessageSender(MessageSender pPromotionGrantedMessageSender)
Sets property PromotionGrantedMessageSender. |
void |
setPromotionRevokedMessageSender(MessageSender pPromotionRevokedMessageSender)
Sets property PromotionRevokedMessageSender. |
void |
setPromotions(Repository pPromotions)
Sets property Promotions |
void |
setQualifierService(Qualifier pQualifierService)
Sets the default Qualifier service to use. |
void |
setRemoveExpiredGlobalPromotions(boolean pRemoveExpiredGlobalPromotions)
|
void |
setSendEventOnAddItem(boolean pSendEventOnAddItem)
|
void |
setSiteGroupPropertyName(java.lang.String pSiteGroupPropertyName)
Set the SiteGroupPropertyName property. |
void |
setSiteGroupsPropertyName(java.lang.String pSiteGroupsPropertyName)
Set the SiteGroupsPropertyName property. |
void |
setSiteIdPropertyName(java.lang.String pSiteIdPropertyName)
Set the SiteIdPropertyName property. |
void |
setSitesPropertyName(java.lang.String pSitesPropertyName)
Set the SitesPropertyName property. |
void |
setUsedPromotionsProperty(java.lang.String pUsedPromotionsProperty)
|
void |
setUserPricingModelHolderPath(java.lang.String pUserPricingModelHolderPath)
Sets property UserPricingModelHolderPath |
void |
setUsesProperty(java.lang.String pUsesProperty)
Sets the usesProperty |
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 |
---|
public static final java.lang.String CLASS_VERSION
public static final java.lang.String COPIED_DURING_LOGIN
public static final java.lang.String REVOKED_DURING_LOGIN
public static final java.lang.String EXTRA_PARAM_QUALIFIERSERVICE
protected Qualifier mQualifierService
protected ComponentName mUserPricingModelHolderPath
protected java.util.Map<java.lang.String,Qualifier> mQualifierServices
Constructor Detail |
---|
public PromotionTools()
Method Detail |
---|
public Qualifier getQualifierService()
public void setQualifierService(Qualifier pQualifierService)
pQualifierService
- Qualifier service referencepublic void setSiteGroupsPropertyName(java.lang.String pSiteGroupsPropertyName)
public java.lang.String getSiteGroupsPropertyName()
public void setSiteGroupPropertyName(java.lang.String pSiteGroupPropertyName)
public java.lang.String getSiteGroupPropertyName()
public void setSiteIdPropertyName(java.lang.String pSiteIdPropertyName)
public java.lang.String getSiteIdPropertyName()
public void setSitesPropertyName(java.lang.String pSitesPropertyName)
public java.lang.String getSitesPropertyName()
public void setFirePromotionGrantedEvent(boolean pFirePromotionGrantedEvent)
public boolean isFirePromotionGrantedEvent()
public void setFirePromotionRevokedEvent(boolean pFirePromotionRevokedEvent)
public boolean isFirePromotionRevokedEvent()
public void setPromotionGrantedMessageSender(MessageSender pPromotionGrantedMessageSender)
public MessageSender getPromotionGrantedMessageSender()
public void setPromotionRevokedMessageSender(MessageSender pPromotionRevokedMessageSender)
public MessageSender getPromotionRevokedMessageSender()
public void setPipelineManager(PipelineManager pPipelineManager)
public PipelineManager getPipelineManager()
public void setSendEventOnAddItem(boolean pSendEventOnAddItem)
public boolean isSendEventOnAddItem()
public void setAddItemEventPipeline(java.lang.String pAddItemEventPipeline)
public java.lang.String getAddItemEventPipeline()
public void setPricingModelProperties(PricingModelProperties pPricingModelProperties)
public PricingModelProperties getPricingModelProperties()
public void setActivePromotionsProperty(java.lang.String pActivePromotionsProperty)
public java.lang.String getActivePromotionsProperty()
public void setUsedPromotionsProperty(java.lang.String pUsedPromotionsProperty)
public java.lang.String getUsedPromotionsProperty()
public void setAllowMultipleProperty(java.lang.String pAllowMultipleProperty)
public java.lang.String getAllowMultipleProperty()
public void setGiveToAnonymousProfilesProperty(java.lang.String pGiveToAnonymousProfilesProperty)
public java.lang.String getGiveToAnonymousProfilesProperty()
public void setUsesProperty(java.lang.String pUsesProperty)
public java.lang.String getUsesProperty()
public void setPromoStatusDescriptorName(java.lang.String pPromoStatusDescriptorName)
public java.lang.String getPromoStatusDescriptorName()
public void setPromoStatusCouponsPropertyName(java.lang.String pPromoStatusCouponsPropertyName)
public java.lang.String getPromoStatusCouponsPropertyName()
public void setPromoStatusProfileIdProperty(java.lang.String pPromoStatusProfileIdProperty)
public java.lang.String getPromoStatusProfileIdProperty()
public void setPromoStatusNumUsesProperty(java.lang.String pPromoStatusNumUsesProperty)
public java.lang.String getPromoStatusNumUsesProperty()
public void setPromoStatusPromoProperty(java.lang.String pPromoStatusPromoProperty)
public java.lang.String getPromoStatusPromoProperty()
public void setProfileRepository(MutableRepository pProfileRepository)
public MutableRepository getProfileRepository()
public void setProfileItemType(java.lang.String pProfileItemType)
public java.lang.String getProfileItemType()
public void setPricingTools(PricingTools pPricingTools)
public PricingTools getPricingTools()
public void setPromotions(Repository pPromotions)
public Repository getPromotions()
public void setBasePromotionItemType(java.lang.String pBasePromotionItemType)
public java.lang.String getBasePromotionItemType()
public void setBaseClosenessQualifierItemType(java.lang.String pBaseClosenessQualifierItemType)
public java.lang.String getBaseClosenessQualifierItemType()
public void setUserPricingModelHolderPath(java.lang.String pUserPricingModelHolderPath)
public java.lang.String getUserPricingModelHolderPath()
public void setAlternateUserPricingModelHolderPaths(java.lang.String[] pAlternateUserPricingModelHolderPaths)
public java.lang.String[] getAlternateUserPricingModelHolderPaths()
public void setGetService(GetService pGetService)
public GetService getGetService()
getPromotionsAsXML
public void setMappingFileName(java.lang.String pMappingFileName)
public java.lang.String getMappingFileName()
getPromotionsAsXML
public void setCurrentDate(CurrentDate pCurrentDate)
public CurrentDate getCurrentDate()
public void setRemoveExpiredGlobalPromotions(boolean pRemoveExpiredGlobalPromotions)
public boolean isRemoveExpiredGlobalPromotions()
true
if expired global promotions should
be removed, false
otherwise.public RepositoryItem createPromotionStatus(RepositoryItem pProfile, RepositoryItem pPromotion, java.lang.Integer pNumUses) throws RepositoryException
pProfile
- - the profile of the user for whom the promotion status is being
created.pPromotion
- - the promotion to be added.pNumUses
- - the number of uses that this promotion can have.
RepositoryException
public RepositoryItem createPromotionStatus(RepositoryItem pProfile, RepositoryItem pPromotion, java.lang.Integer pNumUses, RepositoryItem pCoupon) throws RepositoryException
pProfile
- - the profile of the user for whom the promotion status is being
created.pPromotion
- - the promotion to be added.pNumUses
- - the number of uses that this promotion can have.pCoupon
- the coupon that the promotion was claimed from
RepositoryException
public MutableRepositoryItem createTransientPromotionStatus(RepositoryItem pProfile, RepositoryItem pPromotion, java.lang.Integer pNumUses) throws RepositoryException
pProfile
- - the profile of the user for whom the promotion status is being
created.pPromotion
- - the promotion to be added.pNumUses
- - the number of uses that this promotion can have.
RepositoryException
public MutableRepositoryItem createTransientPromotionStatus(RepositoryItem pProfile, RepositoryItem pPromotion, java.lang.Integer pNumUses, RepositoryItem pCoupon) throws RepositoryException
pProfile
- - the profile of the user for whom the promotion status is being
created.pPromotion
- - the promotion to be added.pNumUses
- - the number of uses that this promotion can have.
RepositoryException
public void initializePricingModels() throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public void initializePricingModels(boolean pRemoveExpiredGlobalPromotions) throws javax.servlet.ServletException, java.io.IOException
pRemoveExpiredGlobalPromotions
- indicator as to whether the removeExpiredGlobalPromotions
should be set or not
javax.servlet.ServletException
java.io.IOException
public void initializePricingModels(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public RepositoryItem getPromotionFromComposite(RepositoryItem pPromotion)
See bugs COMMERCE-168557, COMMERCE-168558, COMMERCE-126830, COMMERCE-168127
pPromotion
- RepositoryItem which may be a CompositeItem
public boolean isPromotionItem(java.lang.Object pObj) throws java.lang.IllegalArgumentException, RepositoryException
pObj
- Object to check, RepositoryItem or RepositoryItemDescriptor
java.lang.IllegalArgumentException
- if pObj is null or not a RepositoryItem or a
RepositoryItemDescriptor
RepositoryException
- if pObj is a RepositoryItem and it's type could not be accessed
or the base promotion type could not be determined.public boolean isClosenessQualifierItem(java.lang.Object pObj) throws java.lang.IllegalArgumentException, RepositoryException
pObj
- Object to check, RepositoryItem or RepositoryItemDescriptor
java.lang.IllegalArgumentException
- if pObj is null or not a RepositoryItem or a
RepositoryItemDescriptor
RepositoryException
- if pObj is a RepositoryItem and it's type could not be accessed
or the base closeness qualifier type could not be determined.public boolean isItemOfType(java.lang.Object pObj, RepositoryItemDescriptor pBaseType) throws java.lang.IllegalArgumentException, RepositoryException
pObj
- Object to check, RepositoryItem or RepositoryItemDescriptorpBaseType
- RepositoryItemDescriptor for the base type
java.lang.IllegalArgumentException
- if pBaseType is null or pObj is null or not a RepositoryItem or a
RepositoryItemDescriptor
RepositoryException
- if pObj is a RepositoryItem and it's type could not be determinedpublic boolean checkPromotionExpiration(RepositoryItem pPromotion, java.util.Date pNow)
pPromotion
- the promotion that should be verifiedpNow
- the current date
public void addAllPromotions(MutableRepositoryItem pProfile, java.util.Collection pPromotions)
public void addAllPromotions(MutableRepositoryItem pProfile, java.util.Collection pPromotions, java.lang.String pComment)
pProfile
- The profile being modifiedpPromotion
- The promotion being addedpComment
- And extra string describe this event.public boolean addPromotion(MutableRepositoryItem pProfile, RepositoryItem pPromotion)
pProfile
- The profile being modifiedpPromotion
- The promotion being added
public boolean addPromotion(MutableRepositoryItem pProfile, RepositoryItem pPromotion, java.lang.String pComment)
pProfile
- The profile being modifiedpPromotion
- The promotion being addedpComment
- And extra string describe this event.
public boolean addPromotion(MutableRepositoryItem pProfile, RepositoryItem pPromotion, java.lang.String pComment, java.lang.String pSiteId)
pProfile
- The profile being modifiedpPromotion
- The promotion being addedpComment
- And extra string describe this event.pSiteId
- site with which the promotion is associated
public RepositoryItem lookupPromotion(java.lang.String pPromotionId) throws RepositoryException
pPromotionId
- String repository id
RepositoryException
- if the id is not found in the promotion repositorypublic void grantPromotion(java.lang.String pProfileId, java.lang.String pPromotionId) throws atg.commerce.promotion.PromotionException
pProfileId
- pPromotionId
-
PromotionException
- Thrown if the promotion can't be added for some reason (e.g. the
promotion is expired, the user already had the promotion)public void grantPromotion(java.lang.String pProfileId, java.lang.String pPromotionId, java.lang.String pComment) throws atg.commerce.promotion.PromotionException
pProfileId
- The profile gaining the promotionpPromotionId
- The promotion being addedpComment
- And extra string describe this event.
PromotionException
- Thrown if the promotion can't be added for some reason (e.g. the
promotion is expired, the user already had the promotion)public void grantPromotion(java.lang.String pProfileId, java.lang.String pPromotionId, java.lang.String pComment, java.lang.String pSiteId) throws atg.commerce.promotion.PromotionException
pProfileId
- The profile gaining the promotionpPromotionId
- The promotion being addedpComment
- And extra string describe this event.pSiteId
- The site with which the promotion is associated
PromotionException
- Thrown if the promotion can't be added for some reason (e.g. the
promotion is expired, the user already had the promotion)public void grantPromotion(MutableRepositoryItem pProfile, RepositoryItem pPromotion) throws atg.commerce.promotion.PromotionException
pProfile
- pPromotion
-
PromotionException
- Thrown if the promotion can't be added for some reason (e.g. the
promotion is expired, the user already had the promotion)public void grantPromotion(MutableRepositoryItem pProfile, RepositoryItem pPromotion, java.lang.String pComment) throws atg.commerce.promotion.PromotionException
pProfile
- The profile gaining the promotionpPromotion
- The promotion being addedpComment
- And extra string describe this event.
PromotionException
- Thrown if the promotion can't be added for some reason (e.g. the
promotion is expired, the user already had the promotion)public void grantPromotion(MutableRepositoryItem pProfile, RepositoryItem pPromotion, java.lang.String pComment, java.lang.String pSiteId) throws atg.commerce.promotion.PromotionException
pProfile
- The profile gaining the promotionpPromotion
- The promotion being addedpComment
- And extra string describe this event.pSiteId
- The site with which the promotion is associated
PromotionException
- Thrown if the promotion can't be added for some reason (e.g. the
promotion is expired, the user already had the promotion)public void grantPromotion(MutableRepositoryItem pProfile, RepositoryItem pPromotion, java.lang.String pComment, java.lang.String pSiteId, RepositoryItem pCoupon) throws atg.commerce.promotion.PromotionException
pProfile
- The profile gaining the promotionpPromotion
- The promotion being addedpComment
- And extra string describe this event.pSiteId
- The site with which the promotion is associatedpCoupon
- the coupon that was claimed that contained the promotion to be
granted
PromotionException
- Thrown if the promotion can't be added for some reason (e.g. the
promotion is expired, the user already had the promotion)public boolean checkPromotionGrant(RepositoryItem pProfile, RepositoryItem pPromotion) throws atg.commerce.promotion.PromotionException
pProfile
- The profile gaining the promotionpPromotion
- The promotion being added
PromotionException
public boolean checkPromotionGrant(RepositoryItem pProfile, RepositoryItem pPromotion, java.lang.String[] pCheckProps) throws atg.commerce.promotion.PromotionException
pProfile
- The profile gaining the promotionpPromotion
- The promotion being addedpCheckProps
- Array of property names in which to look for granted promotions in
the profile
PromotionException
public boolean checkPromotionGrant(RepositoryItem pProfile, RepositoryItem pPromotion, RepositoryItem pCoupon, java.lang.String[] pCheckProps) throws atg.commerce.promotion.PromotionException
pProfile
- The profile gaining the promotionpPromotion
- The promotion being addedpCoupon
- The coupon that caused the promotion grantpCheckProps
- Array of property names in which to look for granted promotions in
the profile
PromotionException
public java.util.Collection getPromoStatuses(RepositoryItem pProfile, java.lang.String[] pCheckProps)
pProfile
- pCheckProps
-
public void sendPromotionGrantedEvent(MutableRepositoryItem pProfile, RepositoryItem pPromotion)
pProfile
- the user's profile to record with the eventpPromotion
- pPromotion the promotion to record with the eventpublic void sendPromotionGrantedEvent(MutableRepositoryItem pProfile, RepositoryItem pPromotion, java.lang.String pComment)
pProfile
- the user's profile to record with the eventpPromotion
- pPromotion the promotion to record with the eventpComment
- An extra comment describing the evengpublic void sendPromotionGrantedEvent(MutableRepositoryItem pProfile, RepositoryItem pPromotion, java.lang.String pComment, java.lang.String pSiteId)
pProfile
- the user's profile to record with the eventpPromotion
- pPromotion the promotion to record with the eventpComment
- An extra comment describing the eventpSiteId
- site id associated with the eventpublic void sendPromotionRevokedEvent(RepositoryItem pProfile, RepositoryItem pPromotion)
pProfile
- the user's profile to record with the eventpPromotion
- pPromotion the promotion to record with the eventpublic void sendPromotionRevokedEvent(RepositoryItem pProfile, RepositoryItem pPromotion, java.lang.String pComment)
pProfile
- the user's profile to record with the eventpPromotion
- pPromotion the promotion to record with the eventpComment
- An extra comment describing the eventpublic void sendPromotionRevokedEvent(RepositoryItem pProfile, RepositoryItem pPromotion, java.lang.String pComment, java.lang.String pSiteId)
pProfile
- the user's profile to record with the eventpPromotion
- pPromotion the promotion to record with the eventpComment
- An extra comment describing the eventpSiteId
- site id associated with the eventpublic boolean isPromotionInPromotionStatuses(RepositoryItem pPromotion, java.util.Collection pPromotionStatuses)
public void addCouponToExistingPromoStatus(java.util.Collection<RepositoryItem> pPromotionStatuses, RepositoryItem pPromotion, RepositoryItem pCoupon)
pPromotion
- promotion that is being grantedpCoupon
- coupon that caused the promotion grantpPromotionStatuses
- collection of promo statuses to check for promotionpublic boolean consumePromotion(MutableRepositoryItem pProfile, RepositoryItem pPromotion)
pProfile
- the user's profilepPromotion
- the promotion to consume
public boolean removePromotion(MutableRepositoryItem pProfile, RepositoryItem pPromotion, boolean pRemoveAll)
pProfile
- - the profile of the user from whom the promotion will be taken
outpPromotion
- - the promotion to be removedpRemoveAll
- - true if all instances of this promotion should be removed, false
otherwise
public boolean revokePromotion(java.lang.String pProfileId, java.lang.String pPromotionId, boolean pRemoveAllInstances) throws atg.commerce.promotion.PromotionException
pProfileId
- - the profile of the user from whom the promotion will be taken
outpPromotionId
- - the promotion to be removedpRemoveAll
- - true if all instances of this promotion should be removed, false
otherwise
PromotionException
- if the promotion could not be removed.public boolean revokePromotion(MutableRepositoryItem pProfile, RepositoryItem pPromotion, boolean pRemoveAll) throws atg.commerce.promotion.PromotionException
pProfile
- - the profile of the user from whom the promotion will be taken
outpPromotion
- - the promotion to be removedpRemoveAll
- - true if all instances of this promotion should be removed, false
otherwise
PromotionException
- if the promotion could not be removed.public void getOrderPromotions(Order pOrder, java.util.Collection pPromotions)
pOrder
- the order that the promotions are inpPromotions
- a collection that the promotions are to be added topublic void getTaxPromotions(Order pOrder, java.util.Collection pPromotions)
pOrder
- the order that the promotions are inpPromotions
- a collection that the promotions are to be added topublic void getItemPromotions(CommerceItem pItem, java.util.Collection pPromotions)
pItem
- the CommerceItem that the promotions are inpPromotions
- a collection that the promotions are to be added topublic void getShippingPromotions(ShippingGroup pGroup, java.util.Collection pPromotions)
pGroup
- the ShippingGroup that the promotions are inpPromotions
- a collection that the promotions are to be added topublic void getOrderPromotions(Order pOrder, java.util.Collection pOrderPromotions, java.util.Collection pTaxPromotions, java.util.Collection pItemPromotions, java.util.Collection pShippingPromotions)
pOrder
- the order to retrieve the promotions frompOrderPromotions
- the collection to add the order level promotions topTaxPromotions
- the collection to add the tax level promotions topItemPromotions
- the collection to add the item level promotions topShippingPromotions
- the collection to add the shipping level promotions topublic void getOrderPromotions(Order pOrder, java.util.Collection pPromotions, boolean pGetAdjustments)
pGetAdjustments
is true then pPromotions
is populated with each
PricingAdjustment associated with a promotion. If it is false, then
pPromotions
is populated with the actual pricing model
repository items.
pOrder
- the order that the promotions are inpPromotions
- a collection that the promotions are to be added topGetAdjustments
- If true, get the PricingAdjustments, if false get the promotionspublic void getTaxPromotions(Order pOrder, java.util.Collection pPromotions, boolean pGetAdjustments)
pGetAdjustments
is true then pPromotions
is
populated with each PricingAdjustment associated with a promotion. If it is
false, then pPromotions
is populated with the actual pricing
model repository items.
pOrder
- the order that the promotions are inpPromotions
- a collection that the promotions are to be added topGetAdjustments
- If true, get the PricingAdjustments, if false get the promotionspublic void getItemPromotions(CommerceItem pItem, java.util.Collection pPromotions, boolean pGetAdjustments)
pGetAdjustments
is true then pPromotions
is
populated with each PricingAdjustment associated with a promotion. If it is
false, then pPromotions
is populated with the actual pricing
model repository items.
pItem
- the CommerceItem that the promotions are inpPromotions
- a collection that the promotions are to be added topGetAdjustments
- If true, get the PricingAdjustments, if false get the promotionspublic void getShippingPromotions(ShippingGroup pGroup, java.util.Collection pPromotions, boolean pGetAdjustments)
pGetAdjustments
is true then pPromotions
is
populated with each PricingAdjustment associated with a promotion. If it is
false, then pPromotions
is populated with the actual pricing
model repository items.
pGroup
- the ShippingGroup that the promotions are inpPromotions
- a collection that the promotions are to be added topGetAdjustments
- If true, get the PricingAdjustments, if false get the promotionspublic void getOrderPromotions(Order pOrder, java.util.Collection pOrderPromotions, java.util.Collection pTaxPromotions, java.util.Collection pItemPromotions, java.util.Collection pShippingPromotions, boolean pGetAdjustments)
pGetAdjustments
is true then each
promotion collection is populated with each PricingAdjustment associated
with a promotion. If it is false, then each promotion collection is
populated with the actual pricing model repository items.
pOrder
- the order to retrieve the promotions frompOrderPromotions
- the collection to add the order level promotions topTaxPromotions
- the collection to add the tax level promotions topItemPromotions
- the collection to add the item level promotions topShippingPromotions
- the collection to add the shipping level promotions topGetAdjustments
- If true, get the PricingAdjustments, if false get the promotionspublic void expirePromotion(RepositoryItem pPromotion, RepositoryItem pProfile)
pPromotion
- the promotion which has expiredpProfile
- the profile for which a promotion has expiredpublic java.util.Collection convertPromoStatusToPromo(java.util.Collection pPromoStatuses)
pPromoStatuses
-
public RepositoryItem convertSinglePromoStatusToPromo(RepositoryItem pPromoStatus)
pPromoStatus
- - promoStatus to get the promotion from
public boolean scenarioAddedItemToOrder(Order pOrder, CommerceItem pItem, long pQuantity)
sendEventOnAddItem
is false, then nothing happens and true is
returned.
pOrder
- The order that was modifiedpItem
- The item that was addedpQuantity
- The quantity of pItem added to pOrder
public boolean scenarioAddedItemToOrder(Order pOrder, CommerceItem pItem, long pQuantity, java.lang.String pSiteId)
sendEventOnAddItem
is false, then nothing happens and true is
returned.
pOrder
- The order that was modifiedpItem
- The item that was addedpQuantity
- The quantity of pItem added to pOrderpSiteId
- The site ID associated with a scenario event
public RepositoryItem getProfile(java.lang.String pProfileId) throws RepositoryException
pProfileId
- the id of the profile to retrieve
RepositoryException
- if there was an error while retrieving the profilepublic java.lang.String[] getPromotionsAsXML(java.lang.String pProfileId) throws atg.commerce.promotion.PromotionException
mappingFileName
. Both active promotions in the profile and
global promotions are returned.
pProfileId
- The id of the user whose promotions are returned
PromotionException
public java.util.Collection getPromotions(java.lang.String pProfileId) throws atg.commerce.promotion.PromotionException
pProfileId
- The id of the user whose promotions are returned
PromotionException
public java.util.Map calculatePromotionsForOrder(Order pOrder)
pOrder
- the order whose promotions we would like to calculate.public int getPromotionCount(Order pOrder, RepositoryItem pPromotion)
pOrder
- the orderpPromotion
- the promotion
public java.util.Map createPromotionCountMap(Order pOrder)
pOrder
- public boolean isUsable(RepositoryItem pPromotion)
pPromotion
- the promotion that should be verified
public boolean isUsable(RepositoryItem pPromotion, java.util.Date pNow)
pPromotion
- the promotion that should be verifiedpNow
- the current date
public int getPMDLVersion(RepositoryItem pPricingModel)
pPricingModel
- Promotion RepositoryItem to check
public Qualifier getQualifierService(RepositoryItem pPricingModel, java.util.Map pExtraParameters, Qualifier pDefaultQualifier)
pPricingModel
- RepositoryItem of the promotion. May be null.pExtraParameters
- Map of optional extra parameters. May be null.pDefaultQualifier
- Qualifier to use if promotion item 'qualifierService' property is
null. May be null.
protected Qualifier resolveQualifierService(java.lang.String pQualifierPath) throws PricingException
pQualifierPath
- String nucleus path to resolve.
PricingException
- if the qualifier service could not be resolved
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |