|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.commerce.csr.approvals.GenericApprovalsHandler
atg.commerce.csr.approvals.order.OrderApprovalsHandler
public class OrderApprovalsHandler
Order Approvals Handler. This handler is responsible for dealing with approvals relating to orders. It is called from the Approvals Manager to determine if an approval is required for an order, to save and load the approval's order specific information from the ApprovalRepository, and also to perform order specific operations during the approval and rejection process.
Field Summary | |
---|---|
static double |
APPROVAL_NOT_REQUIRED
Approval not required constant |
static java.lang.String |
ATTRIBUTE_APPROVER_LOCALE
The attribute name used to store the locale of the user doing the approval |
static java.lang.String |
ATTRIBUTE_CUSTOMER_EMAIL
the attribute name used to store the customers email address in the Approval object's attributes. |
static java.lang.String |
ATTRIBUTE_ORDER
the attribute name used to store the Order in the Approval object's attributes. |
static java.lang.String |
ATTRIBUTE_ORDER_TOTAL
the attribute name used to store the Order's total in the Approval object's attributes. |
static java.lang.String |
ATTRIBUTE_TOTAL_APPEASEMENTS
the attribute name used to store the total appeasement amount in the Approval object's attributes. |
static java.lang.String |
CLASS_VERSION
|
protected atg.security.UserAuthority |
mAuthority
|
protected CSRAgentTools |
mCSRAgentTools
|
protected OrderApprovalTools |
mOrderApprovalTools
|
protected java.lang.String |
mOrderApproverAccessRight
|
protected atg.commerce.order.OrderManager |
mOrderManager
|
protected atg.commerce.payment.PaymentManager |
mPaymentManager
|
protected atg.security.GenericSecurityDomain |
mSecurityDomain
|
protected javax.transaction.TransactionManager |
mTransactionManager
|
Fields inherited from class atg.commerce.csr.approvals.GenericApprovalsHandler |
---|
mApprovalAcceptedJMSType, mApprovalCreatedJMSType, mApprovalItemDescriptorName, mApprovalRejectedJMSType, mCSRAgentMessagingTools |
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 | |
---|---|
OrderApprovalsHandler()
|
Method Summary | |
---|---|
void |
approve(Approval pApproval)
processes the order supplied as an attribute on the pApproval |
protected boolean |
doesAgentHaveAppeasmentLimit(Approval pApproval)
checks if the agent has an unlimited appeasement limit, and returns false not |
protected boolean |
doesAgentRequireApproval(Approval pApproval)
checks if the Agent has an approvers role, and return false if it is present |
protected boolean |
doesAppeasementsExceedLimit(Approval pApproval)
checks if the total appeasements on the orders exceed the agent's appeasement limit |
protected void |
doPaymentGroupAuthorizations(atg.commerce.order.Order pOrder,
Approval pApproval,
atg.repository.MutableRepositoryItem pItem)
This method is called when saving the approval and executes the initial payment group authorization for payment groups that have no authorization status yet. |
protected java.util.Map |
generateOrderApprovalParameters(Approval pApproval)
Generates the extra parameter map that is passed to processOrder when approving an Order. |
protected double |
getAgentAppeasementLimit(Approval pApproval)
get the agent's appeasement limit |
atg.commerce.csr.events.ApprovalEvent |
getApprovalAcceptedEvent(Approval pApproval)
creates and populates an OrderApprovalEvent |
atg.commerce.csr.events.ApprovalEvent |
getApprovalCreatedEvent(Approval pApproval)
creates and populates an OrderApprovalEvent |
atg.commerce.csr.events.ApprovalEvent |
getApprovalRejectedEvent(Approval pApproval)
creates and populates an OrderApprovalEvent |
CSRAgentTools |
getCSRAgentTools()
Returns the CSR Agent Tools Component |
OrderApprovalTools |
getOrderApprovalTools()
Returns a reference to the OrderApprovalTools component that provides order approval helper methods and property definitions. |
java.lang.String |
getOrderApproverAccessRight()
Returns the name of the access right that permits agents to complete order approvals. |
atg.commerce.order.OrderManager |
getOrderManager()
Returns a reference to the Order Manager conmponent |
atg.commerce.payment.PaymentManager |
getPaymentManager()
Returns a reference to the Payement Manager conmponent |
atg.security.GenericSecurityDomain |
getSecurityDomain()
Return the security domain currently in use for checking order approval access rights. |
double |
getTotalAppeasementsForOrder(atg.commerce.order.Order pOrder)
calculates the total appeasements for the specified order |
javax.transaction.TransactionManager |
getTransactionManager()
Returns the Transaction manager component |
atg.security.UserAuthority |
getUserAuthority()
Returns an reference to the InternalUserProfileAuthority that's used to check access rights for the agent identified in the Approval object. |
boolean |
isApprovalRequired(Approval pApproval)
Determines if an order approval is required for the specified approval object. |
void |
loadApproval(Approval pApproval)
Loads the order associated with the approval and also the order specific properties for the approval |
void |
reject(Approval pApproval)
Executes the process of rejecting an order that is pending approval. |
void |
saveApproval(Approval pApproval,
atg.repository.MutableRepositoryItem pItem)
This method saves the application specific data for an Order approval. |
void |
setCSRAgentTools(CSRAgentTools pCSRAgentTools)
Sets the CSR Agent Tools component |
void |
setOrderApprovalTools(OrderApprovalTools pOrderApprovalTools)
Sets a reference to the OrderApprovalTools component that provides order approval helper methods and property definitions. |
void |
setOrderApproverAccessRight(java.lang.String pOrderApproverAccessRight)
Sets the Order Approver Access Right that permits agents to complete order approvals. |
void |
setOrderManager(atg.commerce.order.OrderManager pOrderManager)
Sets the Order Manager conmponent |
protected void |
setOrderStateToPendingApproval(atg.commerce.order.Order pOrder,
Approval pApproval)
This method is called when saving the approval and sets the Order to the appropriate pending approval state. |
protected void |
setOrderStateToRejected(atg.commerce.order.Order pOrder,
Approval pApproval)
This method is called when an approval is rejected to set the order's state. |
void |
setPaymentManager(atg.commerce.payment.PaymentManager pPaymentManager)
Sets the Payement Manager conmponent |
void |
setSecurityDomain(atg.security.GenericSecurityDomain pSecurityDomain)
Set the security domain currently in use for checking order approval access rights. |
void |
setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Sets the Transaction manager component |
void |
setUserAuthority(atg.security.UserAuthority pAuthority)
Sets the user Authority. |
Methods inherited from class atg.commerce.csr.approvals.GenericApprovalsHandler |
---|
getApprovalAcceptedJMSType, getApprovalCreatedJMSType, getApprovalItemDescriptorName, getApprovalRejectedJMSType, getCSRAgentMessagingTools, setApprovalAcceptedJMSType, setApprovalCreatedJMSType, setApprovalItemDescriptorName, setApprovalRejectedJMSType, setCSRAgentMessagingTools |
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 |
---|
public static final java.lang.String CLASS_VERSION
public static final double APPROVAL_NOT_REQUIRED
public static final java.lang.String ATTRIBUTE_ORDER
public static final java.lang.String ATTRIBUTE_TOTAL_APPEASEMENTS
public static final java.lang.String ATTRIBUTE_CUSTOMER_EMAIL
public static final java.lang.String ATTRIBUTE_ORDER_TOTAL
public static final java.lang.String ATTRIBUTE_APPROVER_LOCALE
protected atg.security.GenericSecurityDomain mSecurityDomain
protected java.lang.String mOrderApproverAccessRight
protected atg.security.UserAuthority mAuthority
protected OrderApprovalTools mOrderApprovalTools
protected atg.commerce.payment.PaymentManager mPaymentManager
protected atg.commerce.order.OrderManager mOrderManager
protected CSRAgentTools mCSRAgentTools
protected javax.transaction.TransactionManager mTransactionManager
Constructor Detail |
---|
public OrderApprovalsHandler()
Method Detail |
---|
public atg.security.GenericSecurityDomain getSecurityDomain()
public void setSecurityDomain(atg.security.GenericSecurityDomain pSecurityDomain)
pSecurityDomain
- The security domain to setpublic java.lang.String getOrderApproverAccessRight()
public void setOrderApproverAccessRight(java.lang.String pOrderApproverAccessRight)
public atg.security.UserAuthority getUserAuthority()
public void setUserAuthority(atg.security.UserAuthority pAuthority)
public OrderApprovalTools getOrderApprovalTools()
public void setOrderApprovalTools(OrderApprovalTools pOrderApprovalTools)
public atg.commerce.payment.PaymentManager getPaymentManager()
public void setPaymentManager(atg.commerce.payment.PaymentManager pPaymentManager)
public atg.commerce.order.OrderManager getOrderManager()
public void setOrderManager(atg.commerce.order.OrderManager pOrderManager)
public void setCSRAgentTools(CSRAgentTools pCSRAgentTools)
mCSRAgentTools
- the mCSRAgentTools to setpublic CSRAgentTools getCSRAgentTools()
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
pTransactionManager
- the TransactionManager to setpublic javax.transaction.TransactionManager getTransactionManager()
public boolean isApprovalRequired(Approval pApproval) throws ApprovalsException
- the agent does not have the 'cmcApproval' role
- the agent has an appeasement limit
- the appeasements applied to the order exceed the agents appeasement limit
isApprovalRequired
in class GenericApprovalsHandler
pApproval
- the Approval upon which a decision is made
ApprovalsException
public void saveApproval(Approval pApproval, atg.repository.MutableRepositoryItem pItem) throws ApprovalsException
It sets the
orderId
property of the approval item and updates
the Order to the appropriate pending approval state; adds the Order to the
repository, if transient and performs the initial
authorizations on the Order's payment groups.
saveApproval
in class GenericApprovalsHandler
pApproval
- the Approval to savepApproval
- the Approval object being savedpItem
- the associated approval repository itempApproval
- the Approval to save
ApprovalsException
setOrderStateToPendingApproval(Order, Approval)
,
doPaymentGroupAuthorizations(Order, Approval, MutableRepositoryItem)
protected void setOrderStateToPendingApproval(atg.commerce.order.Order pOrder, Approval pApproval) throws ApprovalsException
pOrder
- pApproval
-
ApprovalsException
protected void setOrderStateToRejected(atg.commerce.order.Order pOrder, Approval pApproval) throws ApprovalsException
pOrder
- pApproval
-
ApprovalsException
protected void doPaymentGroupAuthorizations(atg.commerce.order.Order pOrder, Approval pApproval, atg.repository.MutableRepositoryItem pItem) throws ApprovalsException
This method is intended to handle initial authorizations when the Order is first submitted and requires approval. Authorizations done on subsequent attempts to submit the same Order that still needs approval are handled in the clone edit reconciliation process.
pOrder
- the OrderpApproval
- the current approval objectspItem
- the approval repository item
ApprovalsException
protected boolean doesAgentRequireApproval(Approval pApproval) throws ApprovalsException
pApproval
-
ApprovalsException
protected boolean doesAgentHaveAppeasmentLimit(Approval pApproval) throws ApprovalsException
pApproval
-
ApprovalsException
protected boolean doesAppeasementsExceedLimit(Approval pApproval) throws ApprovalsException
pApproval
-
ApprovalsException
protected double getAgentAppeasementLimit(Approval pApproval) throws ApprovalsException
pApproval
-
ApprovalsException
public double getTotalAppeasementsForOrder(atg.commerce.order.Order pOrder) throws ApprovalsException
pOrder
-
ApprovalsException
public void loadApproval(Approval pApproval) throws ApprovalsException
loadApproval
in class GenericApprovalsHandler
pApproval
-
ApprovalsException
public void approve(Approval pApproval) throws ApprovalsException
approve
in class GenericApprovalsHandler
pApproval
- - the approval to approve
ApprovalsException
protected java.util.Map generateOrderApprovalParameters(Approval pApproval) throws ApprovalsException
pApproval
-
ApprovalsException
public void reject(Approval pApproval) throws ApprovalsException
The payment group authorizations are reverted and the order's state is changed to a failed approval state.
reject
in class GenericApprovalsHandler
pApproval
- approval to reject
ApprovalsException
public atg.commerce.csr.events.ApprovalEvent getApprovalAcceptedEvent(Approval pApproval)
getApprovalAcceptedEvent
in class GenericApprovalsHandler
pApproval
- - the approval
public atg.commerce.csr.events.ApprovalEvent getApprovalCreatedEvent(Approval pApproval)
getApprovalCreatedEvent
in class GenericApprovalsHandler
pApproval
- - the approval
public atg.commerce.csr.events.ApprovalEvent getApprovalRejectedEvent(Approval pApproval)
getApprovalRejectedEvent
in class GenericApprovalsHandler
pApproval
- - the approval
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |