atg.agent
Class AgentTools

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.agent.AgentTools
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class AgentTools
extends GenericService


Field Summary
protected static java.lang.String AGENTRESOURCES
           
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String COMMENT_AGENT_PROPERTY_NAME
          The name for the agent property on a comment item
static java.lang.String COMMENT_COMMENT_PROPERTY_NAME
          The name for the comment property on a comment item
static java.lang.String COMMENT_CREATIONDATE_PROPERTY_NAME
          The name for the creationDate property on a comment item
static java.lang.String COMMENT_OWNER_PROPERTY_NAME
          The name for the owner property on a comment item
static java.lang.String NEW_PASSWORD_PARAM_NAME
          The name of the new passord parameter that is used to attach the new password to the notification email.
protected  java.util.ResourceBundle sBundle
           
 
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
AgentTools()
           
 
Method Summary
 void assignUserToCurrentOrganization(RepositoryItem pProfile)
          Assigns an external profile to the organization that is currently set in the parent organization property.
 void assignUserToOrganization(RepositoryItem pProfile, java.lang.String pOrganizationId)
          Adds an external user to an organization
 MutableRepositoryItem createNewAgentProfileCommentItem()
          Creates a new transient comment item in the profile repository
 RepositoryItem createProfileComment(java.lang.String pProfileId, RepositoryItem pAgentProfile, java.lang.String pComment)
          Creates a new comment item for the given profile.
 java.lang.String generateNewAccountPasswordAndNotification(MutableRepositoryItem pNewProfile, boolean pSendEmail, TemplateEmailSender pTemplateEmailSender, TemplateEmailInfo pTemplateEmailInfo, java.util.Map pTemplateEmailParams, boolean pSendEmailInDifferentThread, boolean pPersistEmail)
          Generates a password for a new external account and sends a notification email to the user.
 java.util.Map generateNewAccountTemplateDefaultParams(RepositoryItem pProfile, java.lang.String pPassword)
          Generates a parameters map that are made available to all new account email tempaltes.
 AgentMessagingTools getAgentMessagingTools()
          Returns component for sending agent messages
 RepositoryItem getAgentProfile(java.lang.String pProfileId)
           
 RepositoryItem getCustomerProfile(java.lang.String pProfileId)
           
 ProfileTools getInternalProfileTools()
          Returns the internalProfileTools.
 java.lang.String getProfileCommentItemDescriptorName()
           
 ProfileTools getProfileTools()
          The ProfileTools component
 UserDirectoryTools getUserDirectoryTools()
           
 java.lang.String getUserViewName()
          Returns the userViewName.
 void initializeRegistrationDate(MutableRepositoryItem pProfile)
          Initializes the registration date to the current time.
 void setAgentMessagingTools(AgentMessagingTools pAgentMessagingTools)
          Sets the component for sending agent messages
 void setInternalProfileTools(ProfileTools pInternalProfileTools)
          Sets the internalProfileTools.
 void setProfileCommentItemDescriptorName(java.lang.String pProfileCommentItemDescriptorName)
          Sets the name of the "comment" item descriptor in the external profile repository
 void setProfileTools(ProfileTools pProfileTools)
          Sets the ProfileTools component
protected  void setPropertiesOfComment(MutableRepositoryItem pComment, java.lang.String pCommentData, java.util.Date pCreationDate, java.lang.String pOwnerId, RepositoryItem pAgent)
          Sets the properties of a comment item
 void setUserDirectoryTools(UserDirectoryTools pUserDirectoryTools)
          Sets tools component used to add an external user to an organization
 void setUserViewName(java.lang.String pUserViewName)
          Sets the userViewName.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, 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, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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

AGENTRESOURCES

protected static final java.lang.String AGENTRESOURCES
See Also:
Constant Field Values

sBundle

protected final java.util.ResourceBundle sBundle

NEW_PASSWORD_PARAM_NAME

public static final java.lang.String NEW_PASSWORD_PARAM_NAME
The name of the new passord parameter that is used to attach the new password to the notification email.

See Also:
Constant Field Values

COMMENT_COMMENT_PROPERTY_NAME

public static final java.lang.String COMMENT_COMMENT_PROPERTY_NAME
The name for the comment property on a comment item

See Also:
Constant Field Values

COMMENT_CREATIONDATE_PROPERTY_NAME

public static final java.lang.String COMMENT_CREATIONDATE_PROPERTY_NAME
The name for the creationDate property on a comment item

See Also:
Constant Field Values

COMMENT_OWNER_PROPERTY_NAME

public static final java.lang.String COMMENT_OWNER_PROPERTY_NAME
The name for the owner property on a comment item

See Also:
Constant Field Values

COMMENT_AGENT_PROPERTY_NAME

public static final java.lang.String COMMENT_AGENT_PROPERTY_NAME
The name for the agent property on a comment item

See Also:
Constant Field Values

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Constructor Detail

AgentTools

public AgentTools()
Method Detail

setAgentMessagingTools

public void setAgentMessagingTools(AgentMessagingTools pAgentMessagingTools)
Sets the component for sending agent messages

Parameters:
pAgentMessagingTools -

getAgentMessagingTools

public AgentMessagingTools getAgentMessagingTools()
Returns component for sending agent messages

Returns:
AgentMessagingTools

setUserDirectoryTools

public void setUserDirectoryTools(UserDirectoryTools pUserDirectoryTools)
Sets tools component used to add an external user to an organization

Parameters:
pUserDirectoryTools - tools component used to add an external user to an organization

getUserDirectoryTools

public UserDirectoryTools getUserDirectoryTools()
Returns:
tools component used to add a user to an organization

setProfileTools

public void setProfileTools(ProfileTools pProfileTools)
Sets the ProfileTools component

Parameters:
pProfileTools - the ProfileTools component

getProfileTools

public ProfileTools getProfileTools()
The ProfileTools component

Returns:
the ProfileTools component

setProfileCommentItemDescriptorName

public void setProfileCommentItemDescriptorName(java.lang.String pProfileCommentItemDescriptorName)
Sets the name of the "comment" item descriptor in the external profile repository

Parameters:
pProfileCommentItemDescriptorName - the name of the "comment" item descriptor in the profile repository

getProfileCommentItemDescriptorName

public java.lang.String getProfileCommentItemDescriptorName()
Returns:
the name of the "comment" item descriptor in the profile repository

createProfileComment

public RepositoryItem createProfileComment(java.lang.String pProfileId,
                                           RepositoryItem pAgentProfile,
                                           java.lang.String pComment)
                                    throws RepositoryException
Creates a new comment item for the given profile.

Parameters:
pProfile - the profile that will own the comment
pAgentProfile - the agent profile that made the comment
pComment - the comment data
Returns:
the comment repository item.
Throws:
RepositoryException
See Also:
setPropertiesOfComment(MutableRepositoryItem, String, java.util.Date, String, RepositoryItem)

setPropertiesOfComment

protected void setPropertiesOfComment(MutableRepositoryItem pComment,
                                      java.lang.String pCommentData,
                                      java.util.Date pCreationDate,
                                      java.lang.String pOwnerId,
                                      RepositoryItem pAgent)
Sets the properties of a comment item

Parameters:
pComment - the mutable comment item
pCommentData - the comment data
pCreationDate - the creation date
pOwnerId - the owner of the comment item
pAgent - the agent that created the comment

createNewAgentProfileCommentItem

public MutableRepositoryItem createNewAgentProfileCommentItem()
                                                       throws RepositoryException
Creates a new transient comment item in the profile repository

Returns:
the new transient comment item
Throws:
RepositoryException

generateNewAccountPasswordAndNotification

public java.lang.String generateNewAccountPasswordAndNotification(MutableRepositoryItem pNewProfile,
                                                                  boolean pSendEmail,
                                                                  TemplateEmailSender pTemplateEmailSender,
                                                                  TemplateEmailInfo pTemplateEmailInfo,
                                                                  java.util.Map pTemplateEmailParams,
                                                                  boolean pSendEmailInDifferentThread,
                                                                  boolean pPersistEmail)
                                                           throws TemplateEmailException,
                                                                  RepositoryException
Generates a password for a new external account and sends a notification email to the user.

Parameters:
pNewProfile - the affected profile
pSendEmail - determines if the notification email is sent
pTemplateEmailSender - The sender used to send the templated email.
pTemplateEmailInfo - The email template.
pTemplateEmailParams - the template parameters. This method also adds the new password as a parameter
pSendEmailInDifferentThread - determines if the email is sent in a new thread
pPersistEmail - determines if email is persisted before it is sent.
Returns:
the new account password.
Throws:
TemplateEmailException
RepositoryException
See Also:
ProfileTools.generateNewPasswordForProfile(RepositoryItem), ProfileTools#sendEmailToUser(MutableRepositoryItem, boolean, boolean, TemplateEmailInfo, Map), #generateNewAccountTemplateParams(RepositoryItem, String)

generateNewAccountTemplateDefaultParams

public java.util.Map generateNewAccountTemplateDefaultParams(RepositoryItem pProfile,
                                                             java.lang.String pPassword)
Generates a parameters map that are made available to all new account email tempaltes.

By default, this method adds the parameter for the new password using the name defined by the NEW_PASSWORD_PARAM_NAME constant.

Extend this method to add additional parameters to the email template.

Parameters:
pProfile - the profile that had the new password generated.
pPassword - the new account password in clear text
Returns:
Map of template parameters
See Also:
NEW_PASSWORD_PARAM_NAME

initializeRegistrationDate

public void initializeRegistrationDate(MutableRepositoryItem pProfile)
Initializes the registration date to the current time.

Parameters:
pProfile -

assignUserToCurrentOrganization

public void assignUserToCurrentOrganization(RepositoryItem pProfile)
Assigns an external profile to the organization that is currently set in the parent organization property.

Parameters:
pProfile -

assignUserToOrganization

public void assignUserToOrganization(RepositoryItem pProfile,
                                     java.lang.String pOrganizationId)
Adds an external user to an organization

Parameters:
pProfile -
pOrganizationId -

getCustomerProfile

public RepositoryItem getCustomerProfile(java.lang.String pProfileId)

getAgentProfile

public RepositoryItem getAgentProfile(java.lang.String pProfileId)

getUserViewName

public java.lang.String getUserViewName()
Returns the userViewName.

Returns:
userViewName

setUserViewName

public void setUserViewName(java.lang.String pUserViewName)
Sets the userViewName.

Parameters:
pUserViewName -

getInternalProfileTools

public ProfileTools getInternalProfileTools()
Returns the internalProfileTools.

Returns:
internalProfileTools

setInternalProfileTools

public void setInternalProfileTools(ProfileTools pInternalProfileTools)
Sets the internalProfileTools.

Parameters:
pInternalProfileTools -