public class ProfileFormHandler extends ProfileForm
ProfileForm.ProfileFormHashtableWrapper
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
boolean |
mClearValuesOnCreate |
boolean |
mClearValuesOnLogin |
boolean |
mClearValuesOnUpdate |
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, mAuthenticationMessageTrigger, 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
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
ProfileFormHandler()
Constructs a new ProfileFormHandler.
|
Modifier and Type | Method and Description |
---|---|
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
|
addMulti, addPropertiesOnLogin, addProperty, addSwapEventListener, addUser, changePassword, checkFormSuccess, checkForRequiredParameters, checkForRequiredProperties, checkForRequiredProperties, commitTransaction, copyPropertiesOnLogin, copyProperty, copyPropertyValue, createUser, doStartService, ensureTransaction, findUser, findUser, formatUserMessage, formatUserMessage, formatUserMessage, formatUserMessage, generatePropertyPath, getAddMultiPropertyName, getAddMultiPropertyValue, getAuthenticationMessageTrigger, getBadPasswordDelay, getChangePasswordErrorURL, getChangePasswordSuccessURL, getCheckForRequiredParameters, getCheckForRequiredProperties, getCheckForRequiredPropertiesAfterUpdate, getCreateErrorURL, getCreateProfileType, getCreateSuccessURL, getDeleteErrorURL, getDeleteSuccessURL, getDescriptor, getExpireSessionOnLogout, getLoginErrorURL, getLoginProfileType, getLoginSuccessURL, getLogoutErrorURL, getLogoutProfileType, getLogoutSuccessURL, getProcessPropertyNames, getProfileItem, getProfileRealmManager, getProfileTools, getPropertiesToAddOnLogin, getPropertiesToCopyOnLogin, getRealmSessionTracker, getRealmSessionTrackerName, 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, isInvalidateAllChildSessions, isTrimProperty, isUsingLdapProfile, postAddMulti, postChangePassword, postDeleteUser, postValueDictionaryByParameters, preAddMulti, preChangePassword, preCreateUser, preDeleteUser, preValueDictionaryByParameters, removeSwapEventListener, removeUser, sendProfileSwapEvent, setAuthenticationMessageTrigger, setBadPasswordDelay, setChangePasswordErrorURL, setChangePasswordSuccessURL, setCheckForRequiredParameters, setCheckForRequiredProperties, setCheckForRequiredPropertiesAfterUpdate, setCompareValueInCopyPropertiesOnLogin, setConfirmOldPassword, setConfirmPassword, setCreateErrorURL, setCreateProfileType, setCreateSuccessURL, setDeleteErrorURL, setDeleteSuccessURL, setExpireSessionOnLogout, setExtractDefaultValuesFromProfile, setInvalidateAllChildSessions, setLoginErrorURL, setLoginProfileType, setLoginSuccessURL, setLogoutErrorURL, setLogoutProfileType, setLogoutSuccessURL, setProfileTools, setPropertiesToAddOnLogin, setPropertiesToCopyOnLogin, setRealmSessionTrackerName, setTrimProperties, setUpdateErrorURL, setUpdateSuccessURL, setUserLoginManager, setUsingLdapProfile, setValueDictionaryByParameters, setValueProperty, updateLDAPProfileAttributes, updatePasswordValue, updateProfileAttributes, updateProfileAttributes, updateUser, updateUser, userAlreadyExists, valueIsEmpty
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
afterGet, beforeGet
addLogListener, createAdminServlet, 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 java.lang.String CLASS_VERSION
public boolean mClearValuesOnUpdate
public boolean mClearValuesOnCreate
public boolean mClearValuesOnLogin
public ProfileFormHandler()
public void setProfile(Profile pProfile)
public Profile getProfile()
getProfile
in class ProfileForm
public java.lang.String getRepositoryId()
getRepositoryId
in class ProfileForm
public void setVerifyPasswordSuccessURL(java.lang.String pVerifyPasswordSuccessURL)
public java.lang.String getVerifyPasswordSuccessURL()
public void setTestPassword(java.lang.String pTestPassword)
public java.lang.String getTestPassword()
public void setClearValuesOnUpdate(boolean pClearValuesOnUpdate)
public boolean getClearValuesOnUpdate()
public void setClearValuesOnCreate(boolean pClearValuesOnCreate)
public boolean getClearValuesOnCreate()
public void setClearValuesOnLogin(boolean pClearValuesOnLogin)
public boolean getClearValuesOnLogin()
public void setRepositoryId(java.lang.String pId)
setRepositoryId
in class ProfileForm
pId
- the id of the user that the Profile should becomepublic void setUpdateRepositoryId(java.lang.String pUpdateRepositoryId)
Your input tag should look like: <input type="hidden" bean="ProfileFormHandler.updateRepositoryId" value="bean:ProfileFormHandler.repositoryId>
public java.lang.String getUpdateRepositoryId()
public void setCreateNewUser(boolean pCreateNewUser)
public boolean isCreateNewUser()
public void setProfileUpdateEvent(atg.userprofiling.ProfileUpdateEvent pProfileUpdateEvent)
public atg.userprofiling.ProfileUpdateEvent getProfileUpdateEvent()
public atg.userprofiling.ProfileUpdateTrigger getProfileUpdateTrigger()
public void setProfileUpdateTrigger(atg.userprofiling.ProfileUpdateTrigger pProfileUpdateTrigger)
public void setGenerateProfileUpdateEvents(boolean pGenerateProfileUpdateEvents)
pGenerateProfileUpdateEvents
- new value to setpublic boolean isGenerateProfileUpdateEvents()
public void setExpiredPasswordService(atg.userprofiling.ExpiredPasswordService pExpiredPasswordService)
public atg.userprofiling.ExpiredPasswordService getExpiredPasswordService()
public boolean handleCreate(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
public boolean ProfileForm.handleCreate(DynamoHttpServletRequest,DynamoHttpServletResponse pResponse)
handleCreate
in class ProfileForm
pRequest
- the servlet's requestpResponse
- the servlet's responsejavax.servlet.ServletException
- if there was an error while executing the codejava.io.IOException
- if there was an error with servlet iopublic boolean handleUpdate(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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.
handleUpdate
in class ProfileForm
pRequest
- the servlet's requestpResponse
- the servlet's responsejavax.servlet.ServletException
- if there was an error while executing the codejava.io.IOException
- if there was an error with servlet ioprotected MutableRepositoryItem createProfileItem(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
createProfileItem
in class ProfileForm
pRequest
- the servlet's requestpResponse
- the servlet's responsejavax.servlet.ServletException
- if there was an error while executing the codejava.io.IOException
- if there was an error with servlet ioprotected void postCreateUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
postCreateUser
in class ProfileForm
pRequest
- the servlet's requestpResponse
- the servlet's responsejavax.servlet.ServletException
- if there was an error while executing the codejava.io.IOException
- if there was an error with servlet ioprotected void preLoginUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
preLoginUser
in class ProfileForm
pRequest
- the servlet's requestpResponse
- the servlet's responsejavax.servlet.ServletException
- if there was an error while executing the codejava.io.IOException
- if there was an error with servlet ioprotected void postLoginUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
postLoginUser
in class ProfileForm
pRequest
- the servlet's requestpResponse
- the servlet's responsejavax.servlet.ServletException
- if there was an error while executing the codejava.io.IOException
- if there was an error with servlet ioprotected void preLogoutUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
preLogoutUser
in class ProfileForm
pRequest
- the servlet's requestpResponse
- the servlet's responsejavax.servlet.ServletException
- if there was an error while executing the codejava.io.IOException
- if there was an error with servlet iopublic void postLogoutUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
logoutProfileId
property is
setpostLogoutUser
in class ProfileForm
pRequest
- the current requestpResponse
- the current responsejavax.servlet.ServletException
- if an error in the code execution occursjava.io.IOException
- if there was an error with servlet IOprotected int checkFormError(java.lang.String pSpecificURL, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
checkFormError
in class ProfileForm
pErrorURL
- the URL to redirect to if there are any form errorspRequest
- the servlet's requestpResponse
- the servlet's responsejavax.servlet.ServletException
- if there was an error while executing the codejava.io.IOException
- if there was an error with servlet ioSTATUS_SUCCESS
,
STATUS_ERROR_STAY
,
STATUS_ERROR_REDIRECT
protected void propagateLocale(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- the current requestpResponse
- the current responsejavax.servlet.ServletException
java.io.IOException
public void setRequestLocale(atg.servlet.RequestLocale pRequestLocale)
public atg.servlet.RequestLocale getRequestLocale()
public boolean handleClear(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
value
that hasn't been
submitted yet. Especially useful when using a session scoped form handler.pRequest
- the servlet's requestpResponse
- the servlet's responsejavax.servlet.ServletException
- if there was an error while executing the codejava.io.IOException
- if there was an error with servlet ioprotected void preUpdateUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
preUpdateUser
in class ProfileForm
pRequest
- the servlet's requestpResponse
- the servlet's responsejavax.servlet.ServletException
- if there was an error while executing the codejava.io.IOException
- if there was an error with servlet ioprotected void postUpdateUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
postUpdateUser
in class ProfileForm
pRequest
- the servlet's requestpResponse
- the servlet's responsejavax.servlet.ServletException
- if there was an error while executing the codejava.io.IOException
- if there was an error with servlet iopublic void sendProfileUpdateEvent(atg.userprofiling.ProfileUpdateEvent pEvent)
pEvent
- the ProfileUpdateEvent object containing the list of profile updatespublic boolean handleVerifyPassword(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public boolean handleCancel(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
handleCancel
in class GenericFormHandler
javax.servlet.ServletException
java.io.IOException
public void addProfileUpdateListener(atg.userprofiling.ProfileUpdateListener pListener)
public void removeProfileUpdateListener(atg.userprofiling.ProfileUpdateListener pListener)
public boolean isSendCookie(Profile pProfile)
pProfile
- the profile to examineprotected boolean shouldCreateNewUser(MutableRepository pProfileRepository, RepositoryItem pCurrentUser) throws RepositoryException
pProfileRepository
- the profile repository that would create
the new profilepCurrentUser
- the current profile in the sessionRepositoryException
- if there's an error determining if
a new user should be created