atg.userprofiling
Class MultiProfileForm

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.droplet.EmptyFormHandler
              extended by atg.droplet.GenericFormHandler
                  extended by atg.repository.servlet.RepositoryFormHandler
                      extended by atg.userprofiling.MultiProfileForm
All Implemented Interfaces:
DropletFormHandler, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, RepositoryFormConstants, RepositoryFormData, java.util.EventListener
Direct Known Subclasses:
MultiProfileAddFormHandler, MultiProfileUpdateFormHandler

public class MultiProfileForm
extends RepositoryFormHandler

This is the base class for a form handler for updating one or more user profiles with a single request.

This bean contains all the code shared by the add and the update multiple profile form handlers.

See Also:
RepositoryFormHandler, MultiProfileUpdateFormHandler, MultiProfileAddFormHandler

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String CONFIRMPASSWORD_PARAM
          Name of the confirmation password form parameter
static java.lang.String OLDPASSWORD_PARAM
          Name of the old password form parameter
 
Fields inherited from class atg.repository.servlet.RepositoryFormHandler
STATUS_ERROR_REDIRECT, STATUS_ERROR_STAY, STATUS_SUCCESS
 
Fields inherited from class atg.droplet.GenericFormHandler
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.repository.servlet.RepositoryFormConstants
NULL_SENTINEL, REPOSITORY_ID_PROPERTY_NAME, UPDATE_APPEND, UPDATE_PREPEND, UPDATE_REMOVE, UPDATE_REPLACE
 
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
MultiProfileForm()
           
 
Method Summary
 boolean afterSet(DynamoHttpServletRequest request, DynamoHttpServletResponse response)
          Clear out the current request we are processing.
 boolean beforeSet(DynamoHttpServletRequest request, DynamoHttpServletResponse response)
          Called before any setX methods on this form are set when a form that modifies properties of this form handler is submitted.
 boolean confirmPasswordValue(java.lang.String pPasswordPropertyName, java.lang.String pOldPassword, RepositoryFormHandler pFormHandler, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Verifies the oldPassword if necesary and generates an exception if passwords don't match.
 java.lang.String formatUserMessage(java.lang.String pKey, DynamoHttpServletRequest pRequest)
          Utility method to format a message with no arguments using the Locale of the user
 java.lang.String formatUserMessage(java.lang.String pKey, java.lang.Object[] pParams, DynamoHttpServletRequest pRequest)
          Utility method to format a message with two arguments using our resource bundle.
 java.lang.String formatUserMessage(java.lang.String pKey, java.lang.Object pParam, DynamoHttpServletRequest pRequest)
          Utility method to format a message with one argument using the Locale of the user
 java.lang.String formatUserMessage(java.lang.String pKey, java.lang.Object pParam1, java.lang.Object pParam2, DynamoHttpServletRequest pRequest)
          Utility method to format a message with two arguments using our resource bundle.
 Profile getProfile()
          Returns the value of the property Profile.
 ProfileTools getProfileTools()
           
 javax.transaction.TransactionManager getTransactionManager()
          Get property transactionManager
protected  java.util.Locale getUserLocale(DynamoHttpServletRequest pRequest)
          Returns the Locale for the user given the request
protected  java.lang.Object getValueProperty(java.util.Dictionary pValueDictionary, java.lang.String pName)
          Returns the value of a property from the given value Dictionary.
 boolean handleClear(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
           
 boolean isConfirmOldPassword()
          Returns property ConfirmPassword
 boolean isConfirmPassword()
          Returns property ConfirmPassword
 void setConfirmOldPassword(boolean pConfirmOldPassword)
          Sets property ConfirmPassword
 void setConfirmPassword(boolean pConfirmPassword)
          Sets property ConfirmPassword
 void setProfile(Profile pProfile)
          Sets the property Profile.
 void setProfileTools(ProfileTools pProfileTools)
          Sets the property ProfileTools.
 void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
          Set property transactionManager
 boolean updatePasswordValue(java.lang.String pPasswordPropertyName, RepositoryFormHandler pFormHandler, int pUserIndex, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Takes the value of the form inputed password attribute confirms it if nescessary and finally generates a new encrypted password as a function of the PropertyManager.generatePassword() method.
 
Methods inherited from class atg.repository.servlet.RepositoryFormHandler
checkFormError, checkFormSuccess, checkForRequiredProperties, deleteItem, getCheckForReadOnlyProperties, getCheckForRequiredProperties, getContentItemDescriptor, getContentNameProperty, getContentPathProperty, getCreateErrorURL, getCreateSuccessURL, getDeleteErrorURL, getDeleteSuccessURL, getEditMapsAsLists, getErrorHandler, getExtractDefaultValuesFromItem, getFolderIdProperty, getItemDescriptor, getItemDescriptorName, getItemProperty, getLogger, getMapKeyValueSeparator, getRemoveReferencesToDeletedItems, getRepository, getRepositoryId, getRepositoryItem, getRepositoryItemEditor, getRepositoryPathName, getRequireIdOnCreate, getSpecifiedIdPropertyValue, getTransactionDemarcation, getTrimProperties, getUpdateErrorURL, getUpdateSuccessURL, getValue, getValueProperty, handleCreate, handleDelete, handleUpdate, isClearValueOnSet, isCreateTransientItems, isRequireMapKeys, isSortRepositoryItemSets, isTrimProperty, postCreateItem, postDeleteItem, postUpdateItem, postUpdateItemProperties, preCreateItem, preDeleteItem, preUpdateItem, setCheckForReadOnlyProperties, setCheckForRequiredProperties, setClearValueOnSet, setContentNameProperty, setContentPathProperty, setCreateErrorURL, setCreateSuccessURL, setCreateTransientItems, setDeleteErrorURL, setDeleteSuccessURL, setEditMapsAsLists, setExtractDefaultValuesFromItem, setFolderIdProperty, setItemDescriptorName, setMapKeyValueSeparator, setRemoveReferencesToDeletedItems, setRepository, setRepositoryId, setRepositoryItemEditor, setRepositoryPathName, setRequireIdOnCreate, setRequireMapKeys, setSortRepositoryItemSets, setTrimProperties, setUpdateErrorURL, setUpdateSuccessURL, setValueProperty, testPropertyAttribute, updateChildItemProperty, updateContentItemValues, updateItem, updateItemProperties, updateListProperty, updateMapProperty
 
Methods inherited from class atg.droplet.GenericFormHandler
addFormException, addUncheckedFormException, checkFormRedirect, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleCancel, handleFormException, handleUncheckedFormException, hasUncheckedFormExceptions, isDeferForwardsAndRedirects, isRestorableForm, isUseForwards, isValidSession, redirectOrForward, resetFormExceptions, setCancelURL, setCheckForValidSession, setDeferForwardsAndRedirects, setFormName, setMessagePort, setMessageSource, setMessageType, setRestorableForm, setSendMessages, setUseForwards
 
Methods inherited from class atg.droplet.EmptyFormHandler
afterGet, beforeGet
 
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, 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

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


CONFIRMPASSWORD_PARAM

public static final java.lang.String CONFIRMPASSWORD_PARAM
Name of the confirmation password form parameter

See Also:
Constant Field Values

OLDPASSWORD_PARAM

public static final java.lang.String OLDPASSWORD_PARAM
Name of the old password form parameter

See Also:
Constant Field Values
Constructor Detail

MultiProfileForm

public MultiProfileForm()
Method Detail

setProfile

public void setProfile(Profile pProfile)
Sets the property Profile. This is set to the user Profile associated with the current session/request.


getProfile

public Profile getProfile()
Returns the value of the property Profile.


setProfileTools

public void setProfileTools(ProfileTools pProfileTools)
Sets the property ProfileTools.


getProfileTools

public ProfileTools getProfileTools()
Returns:
The value of the property ProfileTools.

setConfirmPassword

public void setConfirmPassword(boolean pConfirmPassword)
Sets property ConfirmPassword


isConfirmPassword

public boolean isConfirmPassword()
Returns property ConfirmPassword


setConfirmOldPassword

public void setConfirmOldPassword(boolean pConfirmOldPassword)
Sets property ConfirmPassword


isConfirmOldPassword

public boolean isConfirmOldPassword()
Returns property ConfirmPassword


setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Set property transactionManager

Parameters:
pTransactionManager - new value to set

getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()
Get property transactionManager

Overrides:
getTransactionManager in class RepositoryFormHandler
Returns:
transactionManager

handleClear

public boolean handleClear(DynamoHttpServletRequest pRequest,
                           DynamoHttpServletResponse pResponse)
                    throws javax.servlet.ServletException,
                           java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

beforeSet

public boolean beforeSet(DynamoHttpServletRequest request,
                         DynamoHttpServletResponse response)
                  throws DropletFormException
Description copied from class: GenericFormHandler
Called before any setX methods on this form are set when a form that modifies properties of this form handler is submitted.

Specified by:
beforeSet in interface DropletFormHandler
Overrides:
beforeSet in class GenericFormHandler
Returns:
true if form processing should continue, false if it should be aborted
Throws:
DropletFormException

afterSet

public boolean afterSet(DynamoHttpServletRequest request,
                        DynamoHttpServletResponse response)
                 throws DropletFormException
Description copied from class: GenericFormHandler
Clear out the current request we are processing.

Specified by:
afterSet in interface DropletFormHandler
Overrides:
afterSet in class GenericFormHandler
Returns:
true if request processing should continue and the requested URL should be served, false if it should be aborted. If false is returned, you typically have already completed the request with a redirect or by sending output to the output stream.
Throws:
DropletFormException

getUserLocale

protected java.util.Locale getUserLocale(DynamoHttpServletRequest pRequest)
Returns the Locale for the user given the request

Parameters:
pRequest - the request object which can be used to extract the user's locale

formatUserMessage

public java.lang.String formatUserMessage(java.lang.String pKey,
                                          DynamoHttpServletRequest pRequest)
Utility method to format a message with no arguments using the Locale of the user

Parameters:
pKey - the identifier for the message to retrieve out of the ResourceBundle
pRequest - the request object which can be used to extract the user's locale
Returns:
the formatted message
See Also:
ProfileUserMessage

formatUserMessage

public java.lang.String formatUserMessage(java.lang.String pKey,
                                          java.lang.Object pParam,
                                          DynamoHttpServletRequest pRequest)
Utility method to format a message with one argument using the Locale of the user

Parameters:
pKey - the identifier for the message to retrieve out of the ResourceBundle
pParam - the first (and only argument) in the message
Returns:
the formatted message
See Also:
ProfileUserMessage

formatUserMessage

public java.lang.String formatUserMessage(java.lang.String pKey,
                                          java.lang.Object pParam1,
                                          java.lang.Object pParam2,
                                          DynamoHttpServletRequest pRequest)
Utility method to format a message with two arguments using our resource bundle.

Parameters:
pKey - the identifier for the message to retrieve out of the ResourceBundle
pParam1 - the first parameter in the message
pParam2 - the second parameter in the message
Returns:
the formatted message
See Also:
ProfileUserMessage

formatUserMessage

public java.lang.String formatUserMessage(java.lang.String pKey,
                                          java.lang.Object[] pParams,
                                          DynamoHttpServletRequest pRequest)
Utility method to format a message with two arguments using our resource bundle.

Parameters:
pKey - the identifier for the message to retrieve out of the ResourceBundle
pParams - a set of parameters to use in the formatting.
Returns:
the formatted message
See Also:
ProfileUserMessage

updatePasswordValue

public boolean updatePasswordValue(java.lang.String pPasswordPropertyName,
                                   RepositoryFormHandler pFormHandler,
                                   int pUserIndex,
                                   DynamoHttpServletRequest pRequest,
                                   DynamoHttpServletResponse pResponse)
                            throws PropertyNotFoundException,
                                   javax.servlet.ServletException,
                                   java.io.IOException
Takes the value of the form inputed password attribute confirms it if nescessary and finally generates a new encrypted password as a function of the PropertyManager.generatePassword() method. This password then replaces the password value in the dictionary provided.

Parameters:
pPasswordPropertyName - the name of the password property from property manager
pFormHandler - the user-specific form handler, or this for common properties
pUserIndex - the index to the user we're processing or -1 for common properties
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
boolean indicating success or failure (true=success)
Throws:
PropertyNotFoundException
javax.servlet.ServletException
java.io.IOException

confirmPasswordValue

public boolean confirmPasswordValue(java.lang.String pPasswordPropertyName,
                                    java.lang.String pOldPassword,
                                    RepositoryFormHandler pFormHandler,
                                    DynamoHttpServletRequest pRequest,
                                    DynamoHttpServletResponse pResponse)
                             throws PropertyNotFoundException,
                                    RepositoryException,
                                    javax.servlet.ServletException,
                                    java.io.IOException
Verifies the oldPassword if necesary and generates an exception if passwords don't match.

Parameters:
pPasswordPropertyName - - the name of the password property from property manager
pOldPassword - - the value entered in the form for old password verification
pFormHandler - the user-specific form handler, or this for common properties
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
boolean indicating success or failure (true=success)
Throws:
PropertyNotFoundException
RepositoryException
javax.servlet.ServletException
java.io.IOException

getValueProperty

protected java.lang.Object getValueProperty(java.util.Dictionary pValueDictionary,
                                            java.lang.String pName)
Returns the value of a property from the given value Dictionary.