public class ApprovalsManager
extends atg.nucleus.GenericService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APPROVED
the state when an approval has been approved
|
static java.lang.String |
CLASS_VERSION |
protected atg.nucleus.ServiceMap |
mApprovalHandlers |
protected ApprovalsPropertyManager |
mApprovalsPropertyManager |
protected atg.repository.MutableRepository |
mApprovalsRepository |
protected java.lang.String |
mBaseApprovalItemDescriptorName |
protected CSRAgentMessagingTools |
mCSRAgentMessagingTools |
protected atg.repository.Repository |
mInternalProfileRepository |
protected atg.svc.agent.ticketing.TicketingTools |
mTicketingTools |
static java.lang.String |
PENDING
the state when an approval is pending approval
|
static java.lang.String |
REJECTED
the state when an approval has been rejected
|
static java.lang.String |
SERVER_LOCALIZED_RESOURCE_NAME
Resource bundle name for server localized resources.
|
protected static java.util.ResourceBundle |
sServerLocalizedResourceBundle
Resource bundle for servlet localized resources.
|
static java.lang.String |
USER_LOCALIZED_RESOURCE_NAME
Resource bundle name for user localized resources.
|
Constructor and Description |
---|
ApprovalsManager() |
Modifier and Type | Method and Description |
---|---|
void |
approve(Approval pApproval,
atg.repository.RepositoryItem pApprovingAgentProfile)
Approves the Approval object provided by calling approve() on the appropriate
Approval Handler.
|
Approval |
createApproval(java.lang.String pApprovalType,
atg.repository.RepositoryItem pAgentProfile,
atg.repository.RepositoryItem pTicket,
java.lang.String pSiteId,
java.lang.String pCustomerProfileId)
Creates a new Approval Object
|
atg.repository.Query |
createApprovalsQuery(java.lang.String[] pStates,
atg.repository.QueryBuilder pQueryBuilder)
Create a Query object for approval states and approval type.
|
atg.repository.RepositoryItem[] |
findAllApprovals(java.lang.String[] pStates,
java.lang.String pApprovalType)
Returns all the approval RepositoryItems for given state and approval
types.
|
atg.repository.RepositoryItem[] |
findAllPendingApprovalsByType(java.lang.String pApprovalType)
Returns all Pending approvals for a supplied type
If pApprovalType is empty or null, all types will be returned
|
GenericApprovalsHandler |
getApprovalHandler(java.lang.String pApprovalType)
Returns the handler for an approval type
|
atg.nucleus.ServiceMap |
getApprovalHandlers()
Returns the collection of approvals handlers with corresponding keys as a ServiceMap.
|
ApprovalsPropertyManager |
getApprovalsPropertyManager()
Returns the ApprovalsPropertyManager.
|
atg.repository.MutableRepository |
getApprovalsRepository()
Returns the approvals repository.
|
java.lang.String |
getBaseApprovalItemDescriptorName() |
CSRAgentMessagingTools |
getCSRAgentMessagingTools()
Returns the CSR Agent Messaging Tools.
|
atg.repository.Repository |
getInternalProfileRepository()
Returns the internal profile repository used to load
agent profiles.
|
protected atg.repository.RepositoryView |
getRepositoryViewForItemDescriptor(java.lang.String pApprovalType)
returns the RepositoryView based on the approval type
|
java.lang.String |
getServerLocalizedResource(java.lang.String pKey,
java.lang.Object[] pMessageArgs)
Returns the message string from the exception resource library.
|
atg.svc.agent.ticketing.TicketingTools |
getTicketingTools()
Returns the Ticketing Tools.
|
java.lang.String |
getUserLocalizedResource(java.lang.String pKey,
java.lang.Object[] pMsgArgs,
java.util.Locale pLocale)
Returns a resource from the user resource bundle
|
boolean |
isApprovalRequired(Approval pApproval)
Determines if an approval is required for the specified approval object
by calling isApprovalRequired() on the appropraite Approval Handler.
|
Approval |
loadApproval(java.lang.String pApprovalId)
Loads the approval item from the repository, and sets it on a newly created
Approval object
|
protected void |
loadBaseApprovalProperties(Approval pApproval,
atg.repository.RepositoryItem pApprovalItem)
loads the common approval properties
|
void |
logApprovalAcceptedEvent(Approval pApproval)
logs an agent event when an approval is accepted
|
void |
logApprovalCreatedEvent(Approval pApproval)
logs an agent event when an approval is created
|
void |
logApprovalRejectedEvent(Approval pApproval)
logs an agent event when an approval is rejected
|
protected void |
processApproveException(Approval pApproval,
java.lang.Exception pException)
This method is called to process any exception that occurs in the approval process.
|
protected void |
processRejectException(Approval pApproval,
java.lang.Exception pException)
This method is called to process any exception that occurs in the rejection process.
|
void |
reject(Approval pApproval,
atg.repository.RepositoryItem pApprovingAgentProfile)
Rejects the Approval object provided by calling reject() on the appropriate
Approval Handler.
|
void |
saveApproval(Approval pApproval)
Saves the approval to the approval repository.
|
protected void |
saveBaseApprovalProperties(Approval pApproval,
atg.repository.MutableRepositoryItem pItem)
saves the common approval properties
|
void |
setApprovalHandlers(atg.nucleus.ServiceMap mApprovalHandlers)
Sets the collection of approvals handlers with corresponding keys as a ServiceMap.
|
void |
setApprovalsPropertyManager(ApprovalsPropertyManager mApprovalsPropertyManager)
Sets the ApprovalsPropertyManager.
|
void |
setApprovalsRepository(atg.repository.MutableRepository mApprovalsRepository)
Sets the approvals repository.
|
void |
setBaseApprovalItemDescriptorName(java.lang.String pBaseApprovalItemDescriptorName) |
void |
setCSRAgentMessagingTools(CSRAgentMessagingTools pCSRAgentMessagingTools)
Sets the CSR Agent Messaging Tools.
|
void |
setInternalProfileRepository(atg.repository.Repository pInternalProfileRepository)
Sets the internal profile repository used to load agent profiles
|
void |
setTicketingTools(atg.svc.agent.ticketing.TicketingTools pTicketingTools)
Sets the Ticketing Tools.
|
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
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static final java.lang.String CLASS_VERSION
public static final java.lang.String SERVER_LOCALIZED_RESOURCE_NAME
getServerLocalizedResource
method to get resources from this
bundle.protected static java.util.ResourceBundle sServerLocalizedResourceBundle
getServerLocalizedResource
method
to get resources from this bundle.public static final java.lang.String USER_LOCALIZED_RESOURCE_NAME
getUserLocalizedResource
method
to get resources from this bundle.public static final java.lang.String PENDING
public static final java.lang.String APPROVED
public static final java.lang.String REJECTED
protected atg.repository.Repository mInternalProfileRepository
protected java.lang.String mBaseApprovalItemDescriptorName
protected atg.nucleus.ServiceMap mApprovalHandlers
protected ApprovalsPropertyManager mApprovalsPropertyManager
protected atg.repository.MutableRepository mApprovalsRepository
protected atg.svc.agent.ticketing.TicketingTools mTicketingTools
protected CSRAgentMessagingTools mCSRAgentMessagingTools
public atg.repository.Repository getInternalProfileRepository()
public void setInternalProfileRepository(atg.repository.Repository pInternalProfileRepository)
public java.lang.String getBaseApprovalItemDescriptorName()
public void setBaseApprovalItemDescriptorName(java.lang.String pBaseApprovalItemDescriptorName)
public void setApprovalHandlers(atg.nucleus.ServiceMap mApprovalHandlers)
mApprovalHandlers
- the mApprovalHandlers to setpublic atg.nucleus.ServiceMap getApprovalHandlers()
public void setApprovalsPropertyManager(ApprovalsPropertyManager mApprovalsPropertyManager)
mApprovalsPropertyManager
- the mApprovalsPropertyManager to setpublic ApprovalsPropertyManager getApprovalsPropertyManager()
public GenericApprovalsHandler getApprovalHandler(java.lang.String pApprovalType) throws ApprovalsException
pApprovalType
- ApprovalsException
public void setApprovalsRepository(atg.repository.MutableRepository mApprovalsRepository)
mApprovalsRepository
- the mApprovalsRepository to setpublic atg.repository.MutableRepository getApprovalsRepository()
public void setTicketingTools(atg.svc.agent.ticketing.TicketingTools pTicketingTools)
pTicketingTools
- the TicketingTools to setpublic atg.svc.agent.ticketing.TicketingTools getTicketingTools()
public void setCSRAgentMessagingTools(CSRAgentMessagingTools pCSRAgentMessagingTools)
pCSRAgentMessagingTools
- the CSRAgentMessagingTools to setpublic CSRAgentMessagingTools getCSRAgentMessagingTools()
public Approval createApproval(java.lang.String pApprovalType, atg.repository.RepositoryItem pAgentProfile, atg.repository.RepositoryItem pTicket, java.lang.String pSiteId, java.lang.String pCustomerProfileId)
pApprovalType
- - Corresponds to the type of ApprovalHandler which will deal with the approvalpAgentProfile
- - The profile of the agent who submitted the orderpTicket
- - The current ticketpSite
- - The current Site IdpCustomerProfileId
- - The customer profile associated with the orderpublic Approval loadApproval(java.lang.String pApprovalId) throws ApprovalsException
pApprovalId
- - the ID of the approval item to loadApprovalsException
public void approve(Approval pApproval, atg.repository.RepositoryItem pApprovingAgentProfile) throws ApprovalsException
The approvals repository item is then updated and an Event is sent.
pApproval
- - the approval to approvepApprovingAgentProfile
- - the agent who is approving the approvalApprovalsException
protected void processApproveException(Approval pApproval, java.lang.Exception pException) throws ApprovalsException
This implementation will log a generic error along with the exception.
If the given exception was an ApprovalsException it is thrown. All other exceptions are wrapped in an ApprovalsException and thrown.
pApproval
- the approval objectpException
- the exception that occurred during the approval process.ApprovalsException
protected void processRejectException(Approval pApproval, java.lang.Exception pException) throws ApprovalsException
This implementation will log an generic error along with the exception.
If the given exception was an ApprovalsException it is thrown. All other exceptions are wrapped in an ApprovalsException and thrown.
pApproval
- the approval objectpException
- the exception that occurred during the rejection process.ApprovalsException
public void reject(Approval pApproval, atg.repository.RepositoryItem pApprovingAgentProfile) throws ApprovalsException
The approvals repository item is then updated and an Event is sent.
pApproval
- - the approval to be rejectedpApprovingAgentProfile
- - the rejecting agent's profileApprovalsException
public boolean isApprovalRequired(Approval pApproval) throws ApprovalsException
pApproval
- the Approval objectApprovalsException
public void saveApproval(Approval pApproval) throws ApprovalsException
pApproval
- the Approval to saveApprovalsException
protected void loadBaseApprovalProperties(Approval pApproval, atg.repository.RepositoryItem pApprovalItem) throws ApprovalsException
pApproval
- the Approval to loadpApprovalItem
- the associated approval item from which to load the base propertiesApprovalsException
protected void saveBaseApprovalProperties(Approval pApproval, atg.repository.MutableRepositoryItem pItem)
pApproval
- the Approval to savepItem
- the associated approval item upon which to save the base propertiespublic java.lang.String getServerLocalizedResource(java.lang.String pKey, java.lang.Object[] pMessageArgs)
pKey
- pMessageArgs
- public java.lang.String getUserLocalizedResource(java.lang.String pKey, java.lang.Object[] pMsgArgs, java.util.Locale pLocale)
pKey
- pMsgArgs
- msg argumentspLocale
- the localepublic atg.repository.RepositoryItem[] findAllApprovals(java.lang.String[] pStates, java.lang.String pApprovalType) throws ApprovalsException
pStates
- pApprovalType
- ApprovalsException
protected atg.repository.RepositoryView getRepositoryViewForItemDescriptor(java.lang.String pApprovalType) throws atg.repository.RepositoryException
pApprovalType
- atg.repository.RepositoryException
public atg.repository.Query createApprovalsQuery(java.lang.String[] pStates, atg.repository.QueryBuilder pQueryBuilder) throws atg.repository.RepositoryException
pStates
- - the states requiredpApprovalType
- - the approval type requiredatg.repository.RepositoryException
public atg.repository.RepositoryItem[] findAllPendingApprovalsByType(java.lang.String pApprovalType) throws ApprovalsException
ApprovalsException
public void logApprovalCreatedEvent(Approval pApproval) throws ApprovalsException
pApproval
- - the approval to create the event forApprovalsException
public void logApprovalAcceptedEvent(Approval pApproval) throws ApprovalsException
pApproval
- - the approval to create the event forApprovalsException
public void logApprovalRejectedEvent(Approval pApproval) throws ApprovalsException
pApproval
- - the approval to create the event forApprovalsException