|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.droplet.EmptyFormHandler atg.droplet.GenericFormHandler atg.userprofiling.ProfileForm atg.userprofiling.ProfileFormHandler
public class ProfileFormHandler
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.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.droplet.EmptyFormHandler |
---|
afterGet, beforeGet |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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 |
---|
public static java.lang.String CLASS_VERSION
public boolean mClearValuesOnUpdate
public boolean mClearValuesOnCreate
public boolean mClearValuesOnLogin
Constructor Detail |
---|
public ProfileFormHandler()
Method Detail |
---|
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 response
javax.servlet.ServletException
- if there was an error while executing the code
java.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 response
javax.servlet.ServletException
- if there was an error while executing the code
java.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 response
javax.servlet.ServletException
- if there was an error while executing the code
java.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 response
javax.servlet.ServletException
- if there was an error while executing the code
java.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 response
javax.servlet.ServletException
- if there was an error while executing the code
java.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 response
javax.servlet.ServletException
- if there was an error while executing the code
java.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 response
javax.servlet.ServletException
- if there was an error while executing the code
java.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
set
postLogoutUser
in class ProfileForm
pRequest
- the current requestpResponse
- the current response
javax.servlet.ServletException
- if an error in the code execution occurs
java.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 response
javax.servlet.ServletException
- if there was an error while executing the code
java.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 response
javax.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 response
javax.servlet.ServletException
- if there was an error while executing the code
java.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 response
javax.servlet.ServletException
- if there was an error while executing the code
java.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 response
javax.servlet.ServletException
- if there was an error while executing the code
java.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 examine
protected boolean shouldCreateNewUser(MutableRepository pProfileRepository, RepositoryItem pCurrentUser) throws RepositoryException
pProfileRepository
- the profile repository that would create
the new profilepCurrentUser
- the current profile in the session
RepositoryException
- if there's an error determining if
a new user should be created
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |