atg.userprofiling
Class ProfileFormHandler

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.userprofiling.ProfileForm
                      extended by atg.userprofiling.ProfileFormHandler
All Implemented Interfaces:
DropletFormHandler, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener
Direct Known Subclasses:
ScenarioProfileFormHandler

public class ProfileFormHandler
extends ProfileForm

This class provides a convenient form handler for operating on the current user's profile. It can be used to add new profiles, edit the current profile, login (switch profiles based on login name and password) and logout.


Nested Class Summary
 
Nested classes/interfaces inherited from class atg.userprofiling.ProfileForm
ProfileForm.ProfileFormHashtableWrapper
 
Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 boolean mClearValuesOnCreate
           
 boolean mClearValuesOnLogin
           
 boolean mClearValuesOnUpdate
           
 
Fields inherited from class atg.userprofiling.ProfileForm
CONFIRMPASSWORD_PARAM, DEFAULT_CREATE_PROFILE_TYPE, DEFAULT_LOGIN_PROFILE_TYPE, DEFAULT_LOGOUT_PROFILE_TYPE, HANDLE_CREATE, HANDLE_CREATE_PARAM, HANDLE_FAILURE, HANDLE_LOGIN, HANDLE_LOGIN_PARAM, HANDLE_SUCCESS, ID_NAME, mBadPasswordDelay, mChangePasswordErrorURL, mChangePasswordSuccessURL, mCheckForRequiredParameters, mCheckForRequiredProperties, mCheckForRequiredPropertiesAfterUpdate, mCompareValueInCopyPropertiesOnLogin, mConfirmOldPassword, mConfirmPassword, mCreateErrorURL, mCreateProfileType, mCreateSuccessURL, mDeleteErrorURL, mDeleteSuccessURL, mExpireSessionOnLogout, mExtractDefaultValuesFromProfile, mLoginErrorURL, mLoginProfileType, mLoginSuccessURL, mLogoutErrorURL, mLogoutProfileType, mLogoutSuccessURL, mProfileTools, mPropertiesToAddOnLogin, mPropertiesToCopyOnLogin, mRepositoryId, MSG_ERR_CREATING_PROFILE, MSG_ERR_DELETING_PROFILE, MSG_ERR_UPDATING_PROFILE, MSG_ILLEGAL_ARGUMENT, MSG_INVALID_ADD_PROPERTY, MSG_INVALID_LOGIN, MSG_INVALID_PASSWORD, MSG_MISSING_LOGIN, MSG_MISSING_OLD_PASSWORD, MSG_MISSING_PASSWORD, MSG_MISSING_PROFILE, MSG_MISSING_PROFILE_TOOLS, MSG_MISSING_REQUIRED_PROPERTY, MSG_NO_SUCH_PROFILE_PROPERTY, MSG_NO_TYPE_CONVERTER, MSG_PASSWORD_SAME_AS_OLD_PASSWORD, MSG_PASSWORDS_DO_NOT_MATCH, MSG_PERMISSION_DEFINED_PASSWORD_CHANGE, MSG_READ_ONLY_PROFILE_PROPERTY, MSG_TYPE_CONVERSION_ERR, MSG_USER_ALREADY_EXISTS, MSG_WARNING_PROFILE_TOOLS, mSwapEventListeners, mTrimProperties, mUpdateErrorURL, mUpdateSuccessURL, mUserLoginManager, mUsingLdapProfile, mValue, NULL_SENTINEL, OLDPASSWORD_PARAM, REPOSITORY_ID_PROPERTY_NAME, RESOURCE_BUNDLE_NAME, sResourceBundle, 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.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
ProfileFormHandler()
          Constructs a new ProfileFormHandler.
 
Method Summary
 void addProfileUpdateListener(atg.userprofiling.ProfileUpdateListener pListener)
          Adds a listener to the list of "profile update" listeners.
protected  int checkFormError(java.lang.String pSpecificURL, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Make sure we have a Profile object, then check to see if there were errors during the submit operation.
protected  MutableRepositoryItem createProfileItem(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called from createUser to create the MutableRepositoryItem to use in the creation of a user.
 boolean getClearValuesOnCreate()
           
 boolean getClearValuesOnLogin()
           
 boolean getClearValuesOnUpdate()
           
 atg.userprofiling.ExpiredPasswordService getExpiredPasswordService()
          Returns the ExpiredPasswordService component
 Profile getProfile()
          Returns the value of the property Profile.
 atg.userprofiling.ProfileUpdateEvent getProfileUpdateEvent()
          Returns the value of the property ProfileUpdateEvent.
 atg.userprofiling.ProfileUpdateTrigger getProfileUpdateTrigger()
          Returns the ProfileUpdateTrigger property
 java.lang.String getRepositoryId()
          Returns the RepositoryId from the current Profile property
 atg.servlet.RequestLocale getRequestLocale()
           
 java.lang.String getTestPassword()
           
 java.lang.String getUpdateRepositoryId()
           
 java.lang.String getVerifyPasswordSuccessURL()
           
 boolean handleCancel(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method redirects to the value of the cancelURL property, if that property is set to a non-null value.
 boolean handleClear(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Resets the current form data contained in value that hasn't been submitted yet.
 boolean handleCreate(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Syncronize on the current Profile.
 boolean handleUpdate(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Takes the current set of values set as members of the value property and, if there were no errors in submitting the form, modifies the profile described by the RepositoryId property with these values.
 boolean handleVerifyPassword(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Compares the value of testPassword to the profile's password and redirects to the successUrl on success and gives messages on failure.
 boolean isCreateNewUser()
          Returns property CreateNewUser
 boolean isGenerateProfileUpdateEvents()
          Get property GenerateProfileUpdateEvents
 boolean isSendCookie(Profile pProfile)
          Returns the value of the profile's autoLogin property
protected  void postCreateUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Profile Cookies are rebroadcast as necessary and a Profile Event is fired to indicate a user was created.
protected  void postLoginUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Profile Cookies are rebroadcast as necessary and a Profile Event is fired to indicate a user was logged in.
 void postLogoutUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called after a user successfully logs out.
protected  void postUpdateUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just after the user's profile is updated
protected  void preLoginUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just before the user is found to be logged in
protected  void preLogoutUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          A Profile Event is fired to indicate a user logged out.
protected  void preUpdateUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just before the user's profile is updated which will do the following: Create a new ProfileUpdateEvent object stored in mProfileUpdateEvent property Collect the old values from the current repository before update occurs Collect the new values from the form submitted Go through each property and if value changed, save old/new values for use in ProfileUpdateEvent
protected  void propagateLocale(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Propagate any change in the locale property to the RequestLocale component.
 void removeProfileUpdateListener(atg.userprofiling.ProfileUpdateListener pListener)
          Removes a listener from the list of "profile update" listeners.
 void sendProfileUpdateEvent(atg.userprofiling.ProfileUpdateEvent pEvent)
          Sends a Profile Update event to each of the current listeners passing the pEvent.
 void setClearValuesOnCreate(boolean pClearValuesOnCreate)
           
 void setClearValuesOnLogin(boolean pClearValuesOnLogin)
           
 void setClearValuesOnUpdate(boolean pClearValuesOnUpdate)
          Sets the property clearValuesOnUpdate
 void setCreateNewUser(boolean pCreateNewUser)
          Sets property CreateNewUser.
 void setExpiredPasswordService(atg.userprofiling.ExpiredPasswordService pExpiredPasswordService)
          Sets the ExpiredPasswordService component
 void setGenerateProfileUpdateEvents(boolean pGenerateProfileUpdateEvents)
          Set property GenerateProfileUpdateEvents
 void setProfile(Profile pProfile)
          Sets the property Profile.
 void setProfileUpdateEvent(atg.userprofiling.ProfileUpdateEvent pProfileUpdateEvent)
          Sets the property ProfileUpdateEvent.
 void setProfileUpdateTrigger(atg.userprofiling.ProfileUpdateTrigger pProfileUpdateTrigger)
          Set the ProfileUpdateTrigger property
 void setRepositoryId(java.lang.String pId)
          With the given id find the associated user and set the Profile's datasource to that person.
 void setRequestLocale(atg.servlet.RequestLocale pRequestLocale)
           
 void setTestPassword(java.lang.String pTestPassword)
           
 void setUpdateRepositoryId(java.lang.String pUpdateRepositoryId)
          Sets the property UpdateRepositoryId.
 void setVerifyPasswordSuccessURL(java.lang.String pVerifyPasswordSuccessURL)
           
protected  boolean shouldCreateNewUser(MutableRepository pProfileRepository, RepositoryItem pCurrentUser)
          Method that determines if a new profile should be created
 
Methods inherited from class atg.userprofiling.ProfileForm
addMulti, addPropertiesOnLogin, addProperty, addSwapEventListener, addUser, changePassword, checkFormSuccess, checkForRequiredParameters, checkForRequiredProperties, checkForRequiredProperties, commitTransaction, copyPropertiesOnLogin, createUser, doStartService, ensureTransaction, findUser, findUser, formatUserMessage, formatUserMessage, formatUserMessage, formatUserMessage, generatePropertyPath, getAddMultiPropertyName, getAddMultiPropertyValue, getBadPasswordDelay, getChangePasswordErrorURL, getChangePasswordSuccessURL, getCheckForRequiredParameters, getCheckForRequiredProperties, getCheckForRequiredPropertiesAfterUpdate, getCreateErrorURL, getCreateProfileType, getCreateSuccessURL, getDeleteErrorURL, getDeleteSuccessURL, getDescriptor, getExpireSessionOnLogout, getLoginErrorURL, getLoginProfileType, getLoginSuccessURL, getLogoutErrorURL, getLogoutProfileType, getLogoutSuccessURL, getProcessPropertyNames, getProfileItem, getProfileTools, getPropertiesToAddOnLogin, getPropertiesToCopyOnLogin, getStringValueProperty, getTransactionDemarcation, getTransactionManager, getTrimProperties, getUpdateErrorURL, getUpdateSuccessURL, getUserLocale, getUserLoginManager, getValue, getValueFromArrayString, getValueFromObject, getValueFromObjectArray, getValueFromString, getValueFromStringArray, getValueMap, getValueProperty, handleAddMulti, handleChangePassword, handleDelete, handleLogin, handleLogout, handleValueDictionaryByParameters, isCompareValueInCopyPropertiesOnLogin, isConfirmOldPassword, isConfirmPassword, isExtractDefaultValuesFromProfile, isTrimProperty, isUsingLdapProfile, postAddMulti, postChangePassword, postDeleteUser, postValueDictionaryByParameters, preAddMulti, preChangePassword, preCreateUser, preDeleteUser, preValueDictionaryByParameters, removeSwapEventListener, removeUser, sendProfileSwapEvent, setBadPasswordDelay, setChangePasswordErrorURL, setChangePasswordSuccessURL, setCheckForRequiredParameters, setCheckForRequiredProperties, setCheckForRequiredPropertiesAfterUpdate, setCompareValueInCopyPropertiesOnLogin, setConfirmOldPassword, setConfirmPassword, setCreateErrorURL, setCreateProfileType, setCreateSuccessURL, setDeleteErrorURL, setDeleteSuccessURL, setExpireSessionOnLogout, setExtractDefaultValuesFromProfile, setLoginErrorURL, setLoginProfileType, setLoginSuccessURL, setLogoutErrorURL, setLogoutProfileType, setLogoutSuccessURL, setProfileTools, setPropertiesToAddOnLogin, setPropertiesToCopyOnLogin, setTrimProperties, setUpdateErrorURL, setUpdateSuccessURL, setUserLoginManager, setUsingLdapProfile, setValueDictionaryByParameters, setValueProperty, updateLDAPProfileAttributes, updatePasswordValue, updateProfileAttributes, updateProfileAttributes, updateUser, userAlreadyExists, valueIsEmpty
 
Methods inherited from class atg.droplet.GenericFormHandler
addFormException, addUncheckedFormException, afterSet, beforeSet, checkFormRedirect, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, 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, 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

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


mClearValuesOnUpdate

public boolean mClearValuesOnUpdate

mClearValuesOnCreate

public boolean mClearValuesOnCreate

mClearValuesOnLogin

public boolean mClearValuesOnLogin
Constructor Detail

ProfileFormHandler

public ProfileFormHandler()
Constructs a new ProfileFormHandler. This class is typically constructed as a nucleus component using a .properties file. It can be a request scoped or session scoped component. Use session scope if you have a form that is split across several pages.

Method Detail

setProfile

public void setProfile(Profile pProfile)
Sets the property Profile. This is set to the user Profile to edit.


getProfile

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

Overrides:
getProfile in class ProfileForm

getRepositoryId

public java.lang.String getRepositoryId()
Returns the RepositoryId from the current Profile property

Overrides:
getRepositoryId in class ProfileForm
Returns:
The value of the property RepositoryId.

setVerifyPasswordSuccessURL

public void setVerifyPasswordSuccessURL(java.lang.String pVerifyPasswordSuccessURL)

getVerifyPasswordSuccessURL

public java.lang.String getVerifyPasswordSuccessURL()

setTestPassword

public void setTestPassword(java.lang.String pTestPassword)

getTestPassword

public java.lang.String getTestPassword()

setClearValuesOnUpdate

public void setClearValuesOnUpdate(boolean pClearValuesOnUpdate)
Sets the property clearValuesOnUpdate


getClearValuesOnUpdate

public boolean getClearValuesOnUpdate()

setClearValuesOnCreate

public void setClearValuesOnCreate(boolean pClearValuesOnCreate)

getClearValuesOnCreate

public boolean getClearValuesOnCreate()

setClearValuesOnLogin

public void setClearValuesOnLogin(boolean pClearValuesOnLogin)

getClearValuesOnLogin

public boolean getClearValuesOnLogin()

setRepositoryId

public void setRepositoryId(java.lang.String pId)
With the given id find the associated user and set the Profile's datasource to that person. Warning: You should not set this property from a dynamo server page since it will allow users to arbitrarily modify their profile id by modifying the state of the request.

Overrides:
setRepositoryId in class ProfileForm
Parameters:
pId - the id of the user that the Profile should become

setUpdateRepositoryId

public void setUpdateRepositoryId(java.lang.String pUpdateRepositoryId)
Sets the property UpdateRepositoryId. If this property is set, the handleUpdate method will only update the repository id specified here. When writing a profile update form, you should attach a hidden tag to this property so that you end up saving the current profile id when the form is rendered, and then set that profile id as this property when the form is submitted. If the ids don't match, then the user has changed the current profile id either because the session expired, or they went off and logged out/in in a different window in the same session.

Your input tag should look like: <input type="hidden" bean="ProfileFormHandler.updateRepositoryId" value="bean:ProfileFormHandler.repositoryId>


getUpdateRepositoryId

public java.lang.String getUpdateRepositoryId()
Returns:
The value of the property UpdateRepositoryId.

setCreateNewUser

public void setCreateNewUser(boolean pCreateNewUser)
Sets property CreateNewUser. If this property is true then a new profile is created when the user registers.


isCreateNewUser

public boolean isCreateNewUser()
Returns property CreateNewUser


setProfileUpdateEvent

public void setProfileUpdateEvent(atg.userprofiling.ProfileUpdateEvent pProfileUpdateEvent)
Sets the property ProfileUpdateEvent.


getProfileUpdateEvent

public atg.userprofiling.ProfileUpdateEvent getProfileUpdateEvent()
Returns the value of the property ProfileUpdateEvent.


getProfileUpdateTrigger

public atg.userprofiling.ProfileUpdateTrigger getProfileUpdateTrigger()
Returns the ProfileUpdateTrigger property


setProfileUpdateTrigger

public void setProfileUpdateTrigger(atg.userprofiling.ProfileUpdateTrigger pProfileUpdateTrigger)
Set the ProfileUpdateTrigger property


setGenerateProfileUpdateEvents

public void setGenerateProfileUpdateEvents(boolean pGenerateProfileUpdateEvents)
Set property GenerateProfileUpdateEvents

Parameters:
pGenerateProfileUpdateEvents - new value to set

isGenerateProfileUpdateEvents

public boolean isGenerateProfileUpdateEvents()
Get property GenerateProfileUpdateEvents

Returns:
GenerateProfileUpdateEvents

setExpiredPasswordService

public void setExpiredPasswordService(atg.userprofiling.ExpiredPasswordService pExpiredPasswordService)
Sets the ExpiredPasswordService component


getExpiredPasswordService

public atg.userprofiling.ExpiredPasswordService getExpiredPasswordService()
Returns the ExpiredPasswordService component


handleCreate

public boolean handleCreate(DynamoHttpServletRequest pRequest,
                            DynamoHttpServletResponse pResponse)
                     throws javax.servlet.ServletException,
                            java.io.IOException
Syncronize on the current Profile. See public boolean ProfileForm.handleCreate(DynamoHttpServletRequest,DynamoHttpServletResponse pResponse)

Overrides:
handleCreate in class ProfileForm
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

handleUpdate

public boolean handleUpdate(DynamoHttpServletRequest pRequest,
                            DynamoHttpServletResponse pResponse)
                     throws javax.servlet.ServletException,
                            java.io.IOException
Takes the current set of values set as members of the value property and, if there were no errors in submitting the form, modifies the profile described by the RepositoryId property with these values.

This version of this method adds an optional consistency check to make sure that the current users's profile matches the updateRepositoryId property (if that property is set to a non-null value).

If any errors occur in the process, form errors will be added. If there were no errors encountered while submitting the form, we optionally redirect to the value of the property updateSuccessURL. Otherwise, we optionally redirect to updateErrorURL.

Overrides:
handleUpdate in class ProfileForm
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

createProfileItem

protected MutableRepositoryItem createProfileItem(DynamoHttpServletRequest pRequest,
                                                  DynamoHttpServletResponse pResponse)
                                           throws javax.servlet.ServletException,
                                                  java.io.IOException
This method is called from createUser to create the MutableRepositoryItem to use in the creation of a user. If the property createNewUser is true we instantiate a new profile else we use the current profile.

Overrides:
createProfileItem in class ProfileForm
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
a MutableRepositoryItem used when creating the profile
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

postCreateUser

protected void postCreateUser(DynamoHttpServletRequest pRequest,
                              DynamoHttpServletResponse pResponse)
                       throws javax.servlet.ServletException,
                              java.io.IOException
Profile Cookies are rebroadcast as necessary and a Profile Event is fired to indicate a user was created. Also, the securityStatus property gets set. Operation called just after the user creation process is finished

Overrides:
postCreateUser in class ProfileForm
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

preLoginUser

protected void preLoginUser(DynamoHttpServletRequest pRequest,
                            DynamoHttpServletResponse pResponse)
                     throws javax.servlet.ServletException,
                            java.io.IOException
Operation called just before the user is found to be logged in

Overrides:
preLoginUser in class ProfileForm
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

postLoginUser

protected void postLoginUser(DynamoHttpServletRequest pRequest,
                             DynamoHttpServletResponse pResponse)
                      throws javax.servlet.ServletException,
                             java.io.IOException
Profile Cookies are rebroadcast as necessary and a Profile Event is fired to indicate a user was logged in. Also, the securityStatus property gets set. Operation called just after the user is found to be logged in

Overrides:
postLoginUser in class ProfileForm
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

preLogoutUser

protected void preLogoutUser(DynamoHttpServletRequest pRequest,
                             DynamoHttpServletResponse pResponse)
                      throws javax.servlet.ServletException,
                             java.io.IOException
A Profile Event is fired to indicate a user logged out.

Overrides:
preLogoutUser in class ProfileForm
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

postLogoutUser

public void postLogoutUser(DynamoHttpServletRequest pRequest,
                           DynamoHttpServletResponse pResponse)
                    throws javax.servlet.ServletException,
                           java.io.IOException
Called after a user successfully logs out. This fires a logout event if the logoutProfileId property is set

Overrides:
postLogoutUser in class ProfileForm
Parameters:
pRequest - the current request
pResponse - the current response
Throws:
javax.servlet.ServletException - if an error in the code execution occurs
java.io.IOException - if there was an error with servlet IO

checkFormError

protected int checkFormError(java.lang.String pSpecificURL,
                             DynamoHttpServletRequest pRequest,
                             DynamoHttpServletResponse pResponse)
                      throws javax.servlet.ServletException,
                             java.io.IOException
Make sure we have a Profile object, then check to see if there were errors during the submit operation. If so, redirect to the supplied error url if possible.

Overrides:
checkFormError in class ProfileForm
Parameters:
pErrorURL - the URL to redirect to if there are any form errors
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
the status of the form
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io
See Also:
STATUS_SUCCESS, STATUS_ERROR_STAY, STATUS_ERROR_REDIRECT

propagateLocale

protected void propagateLocale(DynamoHttpServletRequest pRequest,
                               DynamoHttpServletResponse pResponse)
                        throws javax.servlet.ServletException,
                               java.io.IOException
Propagate any change in the locale property to the RequestLocale component.

Parameters:
pRequest - the current request
pResponse - the current response
Throws:
javax.servlet.ServletException
java.io.IOException

setRequestLocale

public void setRequestLocale(atg.servlet.RequestLocale pRequestLocale)

getRequestLocale

public atg.servlet.RequestLocale getRequestLocale()

handleClear

public boolean handleClear(DynamoHttpServletRequest pRequest,
                           DynamoHttpServletResponse pResponse)
                    throws javax.servlet.ServletException,
                           java.io.IOException
Resets the current form data contained in value that hasn't been submitted yet. Especially useful when using a session scoped form handler.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

preUpdateUser

protected void preUpdateUser(DynamoHttpServletRequest pRequest,
                             DynamoHttpServletResponse pResponse)
                      throws javax.servlet.ServletException,
                             java.io.IOException
Operation called just before the user's profile is updated which will do the following: Create a new ProfileUpdateEvent object stored in mProfileUpdateEvent property Collect the old values from the current repository before update occurs Collect the new values from the form submitted Go through each property and if value changed, save old/new values for use in ProfileUpdateEvent

Overrides:
preUpdateUser in class ProfileForm
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

postUpdateUser

protected void postUpdateUser(DynamoHttpServletRequest pRequest,
                              DynamoHttpServletResponse pResponse)
                       throws javax.servlet.ServletException,
                              java.io.IOException
Operation called just after the user's profile is updated

Overrides:
postUpdateUser in class ProfileForm
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

sendProfileUpdateEvent

public void sendProfileUpdateEvent(atg.userprofiling.ProfileUpdateEvent pEvent)
Sends a Profile Update event to each of the current listeners passing the pEvent.

Parameters:
pEvent - the ProfileUpdateEvent object containing the list of profile updates

handleVerifyPassword

public boolean handleVerifyPassword(DynamoHttpServletRequest pRequest,
                                    DynamoHttpServletResponse pResponse)
                             throws javax.servlet.ServletException,
                                    java.io.IOException
Compares the value of testPassword to the profile's password and redirects to the successUrl on success and gives messages on failure.

Throws:
javax.servlet.ServletException
java.io.IOException

handleCancel

public boolean handleCancel(DynamoHttpServletRequest pRequest,
                            DynamoHttpServletResponse pResponse)
                     throws javax.servlet.ServletException,
                            java.io.IOException
This method redirects to the value of the cancelURL property, if that property is set to a non-null value. You should override this if you want to clear the form values when the form is cancelled for a session scoped form handler.

Overrides:
handleCancel in class GenericFormHandler
Throws:
javax.servlet.ServletException
java.io.IOException

addProfileUpdateListener

public void addProfileUpdateListener(atg.userprofiling.ProfileUpdateListener pListener)
Adds a listener to the list of "profile update" listeners.


removeProfileUpdateListener

public void removeProfileUpdateListener(atg.userprofiling.ProfileUpdateListener pListener)
Removes a listener from the list of "profile update" listeners.


isSendCookie

public boolean isSendCookie(Profile pProfile)
Returns the value of the profile's autoLogin property

Parameters:
pProfile - the profile to examine
Returns:
true if the Profile should auto login, false otherwise

shouldCreateNewUser

protected boolean shouldCreateNewUser(MutableRepository pProfileRepository,
                                      RepositoryItem pCurrentUser)
                               throws RepositoryException
Method that determines if a new profile should be created

Parameters:
pProfileRepository - the profile repository that would create the new profile
pCurrentUser - the current profile in the session
Returns:
true if a new profile item should be created, false otherwise
Throws:
RepositoryException - if there's an error determining if a new user should be created