public class MultiProfileAddFormHandler extends MultiProfileForm
This bean has a count
property which
determines the number of user profiles being created by the form
handler. count
must be set in order for this bean to function
properly. The count
value is used to determine the number of
users
allocated in the array of UserListItem
objects.
Each UserListItem
object contains a value
dictionary of properties for the given user. To refer to these properties
you simply set the "FormHandler.users[index].value.propertyName" to set
individual per-user property values.
This bean also has a value
property which is a
dictionary of properties of the current repository item. This set of properties
is applied to every user profile created by this form handler.
For example, if you want to get or set the "userType" property of a
repository item you would set the "FormHanlder.value.userType" bean property.
This form handler supports the following submit methods:
value
with the UserListItem.value
settings. Each profile is created with an auto-generated repositoryId
unless
the individual user.repositoryId
has been set.
value
dictionary
and reinitializing the per-user users
array.
The following properties of the MultiProfileAddFormHandler will typically be set in a properties file for this component:
count
to.
Default is 0 which indicates that there is no maximum applied.
count
to.
The default is 1.
defaultPassword
property.
Default is false.
RepositoryFormHandler
,
UserListItem
,
MultiProfileUpdateFormHandler
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
CONFIRMPASSWORD_PARAM, OLDPASSWORD_PARAM
STATUS_ERROR_REDIRECT, STATUS_ERROR_STAY, STATUS_SUCCESS
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
SERVICE_INFO_KEY
NULL_SENTINEL, REPOSITORY_ID_PROPERTY_NAME, UPDATE_APPEND, UPDATE_PREPEND, UPDATE_REMOVE, UPDATE_REPLACE
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
MultiProfileAddFormHandler() |
Modifier and Type | Method and Description |
---|---|
void |
addFormException(DropletException exc)
Adds a new exception to the list of FormExceptions.
|
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.
|
protected void |
createUser(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
This method handles the creation of an individual user.
|
protected atg.userprofiling.UserListItem |
createUserListItemObject()
This method acts as a factory method for creating
the result object that will be used by this processor.
|
boolean |
getClearValuesOnCreate() |
boolean |
getCommonFormError()
Returns true if an error common to all users occurred while
processing the form.
|
java.util.Vector |
getCommonFormExceptions()
Returns the array of common exceptions that occurred.
|
int |
getCount()
Returns the count of users being created by this form handler
|
atg.userprofiling.UserListItem |
getCurrentUser()
Get the object representing the user currently being added
|
java.lang.String |
getDefaultPassword() |
java.lang.String |
getItemDescriptorName()
Get the value of itemDescriptorName.
|
int |
getMaxCount()
Returns the max count of users that can be created by this form handler
|
int |
getMinCount()
Returns the minumum count of users that can be created by this form handler
|
java.lang.String |
getUserListItemClass()
Get the name of the class to be used for the users array
|
java.util.List |
getUsers()
Allocates if necessary and Returns the list of user profiles being created by this form handler
|
boolean |
handleCancel(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Resets the current list of users in the
users to initialize them
to null to clear out the form data that hasn't been submitted yet. |
boolean |
handleClear(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Resets the current list of users in the
users to initialize them
to null to clear out the form data that hasn't been submitted yet. |
boolean |
handleCreate(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Takes the current list of users in the
users and
for each one, replicates the set of common property values set
as members of the value property and,
if there were no errors in submitting the form,
creates a new repository item, sets these
property values in the new item, and adds the item persistently
to the repository. |
protected void |
initUsers()
Allocates the list of user profiles being created by this form handler
|
boolean |
isGeneratePassword()
Returns the passwordGenerator to be used by this form handler
|
boolean |
isGenerateRegisterEvents()
Get property GenerateRegisterEvents
|
protected boolean |
mergeValueDictionaries(java.util.Dictionary pCommonValues,
java.util.Dictionary pUserValues,
RepositoryFormHandler pFormHandler,
int pUserIndex,
DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse,
java.lang.String pPropertyPathPrefix)
Merges the common value dictionary into the user-specific value
dictionary.
|
protected void |
postCreate(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
This method is called just after the creation process is
finished.
|
protected void |
postCreateUser(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
This method is called just after an individual user is created.
|
protected void |
preCreate(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
This method is called at the beginning of the creation process
prior to creating the individual users.
|
protected void |
preCreateUser(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
This method is called just before an individual user is created.
|
void |
resetFormExceptions()
Clears out all form exceptions
|
void |
setClearValuesOnCreate(boolean pClearValuesOnCreate)
Sets the property clearValuesOnCreate.
|
void |
setCount(int pCount)
Validates and Sets the count of users being created by this form handler.
|
void |
setCurrentUser(atg.userprofiling.UserListItem pCurrentUser)
Sets the object representing the user currently being added
|
void |
setDefaultPassword(java.lang.String pDefaultPassword)
Sets the property defaultPassword.
|
void |
setGeneratePassword(boolean pGeneratePassword)
Sets the password generator used by this form handler.
|
void |
setGenerateRegisterEvents(boolean pGenerateRegisterEvents)
Set property GenerateRegisterEvents
|
void |
setItemDescriptorName(java.lang.String pItemDescriptorName)
Set the value of itemDescriptorName.
|
void |
setMaxCount(int pMaxCount)
Sets the maximum count of users that can be created by this form handler.
|
void |
setMinCount(int pMinCount)
Sets the minumum count of users that can be created by this form handler.
|
void |
setUserListItemClass(java.lang.String pUserListItemClass)
Sets the list of user profiles being created
|
void |
setUsers(java.util.List pUsers)
Sets the list of user profiles being created
|
protected boolean |
userAlreadyExists(Repository pProfileRepository,
RepositoryFormHandler pFormHandler,
int pUserIndex,
DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Returns true if a user already exists with the given login name
|
afterSet, confirmPasswordValue, formatUserMessage, formatUserMessage, formatUserMessage, formatUserMessage, getProfile, getProfileTools, getTransactionManager, getUserLocale, getValueProperty, isConfirmOldPassword, isConfirmPassword, setConfirmOldPassword, setConfirmPassword, setProfile, setProfileTools, setTransactionManager, updatePasswordValue
checkFormError, checkFormSuccess, checkForRequiredProperties, deleteItem, getCheckForReadOnlyProperties, getCheckForRequiredProperties, getContentItemDescriptor, getContentNameProperty, getContentPathProperty, getCreateErrorURL, getCreateSuccessURL, getDeleteErrorURL, getDeleteSuccessURL, getEditMapsAsLists, getErrorHandler, getExtractDefaultValuesFromItem, getFolderIdProperty, getItemDescriptor, getItemProperty, getLogger, getMapKeyValueSeparator, getRemoveReferencesToDeletedItems, getRepository, getRepositoryId, getRepositoryItem, getRepositoryItemEditor, getRepositoryPathName, getRequireIdOnCreate, getSpecifiedIdPropertyValue, getTransactionDemarcation, getTrimProperties, getUpdateErrorURL, getUpdateSuccessURL, getValue, getValueProperty, handleDelete, handleUpdate, isClearValueOnSet, isCreateTransientItems, isRequireMapKeys, isSortRepositoryItemSets, isTrimProperty, isUpdateItemsInCollection, postCreateItem, postDeleteItem, postUpdateItem, postUpdateItemProperties, preCreateItem, preDeleteItem, preUpdateItem, setCheckForReadOnlyProperties, setCheckForRequiredProperties, setClearValueOnSet, setContentNameProperty, setContentPathProperty, setCreateErrorURL, setCreateSuccessURL, setCreateTransientItems, setDeleteErrorURL, setDeleteSuccessURL, setEditMapsAsLists, setExtractDefaultValuesFromItem, setFolderIdProperty, setMapKeyValueSeparator, setRemoveReferencesToDeletedItems, setRepository, setRepositoryId, setRepositoryItemEditor, setRepositoryPathName, setRequireIdOnCreate, setRequireMapKeys, setSortRepositoryItemSets, setTrimProperties, setUpdateErrorURL, setUpdateItemsInCollection, setUpdateSuccessURL, setValueProperty, testPropertyAttribute, updateChildItemProperty, updateContentItemValues, updateItem, updateItemProperties, updateListProperty, updateMapProperty
addUncheckedFormException, checkFormRedirect, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleFormException, handleUncheckedFormException, hasUncheckedFormExceptions, isDeferForwardsAndRedirects, isRestorableForm, isUseForwards, isValidSession, redirectOrForward, setCancelURL, setCheckForValidSession, setDeferForwardsAndRedirects, setFormName, setMessagePort, setMessageSource, setMessageType, setRestorableForm, setSendMessages, setUseForwards
afterGet, beforeGet
addLogListener, createAdminServlet, doStartService, 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 int getCount()
public void setCount(int pCount)
public int getMaxCount()
public void setMaxCount(int pMaxCount)
public int getMinCount()
public void setMinCount(int pMinCount)
public boolean isGeneratePassword()
public void setGeneratePassword(boolean pGeneratePassword)
public java.util.List getUsers()
public void setUsers(java.util.List pUsers)
public java.lang.String getUserListItemClass()
public void setUserListItemClass(java.lang.String pUserListItemClass)
public atg.userprofiling.UserListItem getCurrentUser()
public void setCurrentUser(atg.userprofiling.UserListItem pCurrentUser)
public void setGenerateRegisterEvents(boolean pGenerateRegisterEvents)
pGenerateRegisterEvents
- new value to setpublic boolean isGenerateRegisterEvents()
public void setDefaultPassword(java.lang.String pDefaultPassword)
public java.lang.String getDefaultPassword()
public void setClearValuesOnCreate(boolean pClearValuesOnCreate)
public boolean getClearValuesOnCreate()
public void addFormException(DropletException exc)
addFormException
in class GenericFormHandler
public void resetFormExceptions()
resetFormExceptions
in class GenericFormHandler
public boolean getCommonFormError()
public java.util.Vector getCommonFormExceptions()
public java.lang.String getItemDescriptorName()
getItemDescriptorName
in class RepositoryFormHandler
public void setItemDescriptorName(java.lang.String pItemDescriptorName)
setItemDescriptorName
in class RepositoryFormHandler
pItemDescriptorName
- Value to assign to mItemDescriptorName.protected void initUsers()
public boolean beforeSet(DynamoHttpServletRequest request, DynamoHttpServletResponse response) throws DropletFormException
GenericFormHandler
beforeSet
in interface DropletFormHandler
beforeSet
in class MultiProfileForm
DropletFormException
protected atg.userprofiling.UserListItem createUserListItemObject() throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
getUserListItemObject
method.UserListItem
valuejava.lang.ClassNotFoundException
- if an error occursjava.lang.InstantiationException
- if an error occursjava.lang.IllegalAccessException
- if an error occurspublic boolean handleCreate(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
users
and
for each one, replicates the set of common property values set
as members of the value
property and,
if there were no errors in submitting the form,
creates a new repository item, sets these
property values in the new item, and adds the item persistently
to the repository. An auto-generated unique id is used as the repositoryId unless
the user.repositoryId
has been set.
The repositoryId
is set to point to the repository
id of the newly created item.
Prior to creating the list of users, preCreate is called and following the create of the list of users, postCreate is called.
Prior to creating an individual user, preCreateUser is called and following the create of each user, postCreateUser is called.
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 createSuccessURL. Otherwise, we optionally redirect to createErrorURL.
handleCreate
in class RepositoryFormHandler
javax.servlet.ServletException
java.io.IOException
protected boolean userAlreadyExists(Repository pProfileRepository, RepositoryFormHandler pFormHandler, int pUserIndex, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws RepositoryException, javax.servlet.ServletException, java.io.IOException
pProfileRepository
- the repository to search for the pre-existing userpRequest
- the servlet's requestpResponse
- the servlet's responseRepositoryException
- if there was an error while accessing the Profile Repositoryjavax.servlet.ServletException
- if there was an error while executing the codejava.io.IOException
- if there was an error with servlet ioprotected boolean mergeValueDictionaries(java.util.Dictionary pCommonValues, java.util.Dictionary pUserValues, RepositoryFormHandler pFormHandler, int pUserIndex, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, java.lang.String pPropertyPathPrefix)
public boolean handleCancel(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
users
to initialize them
to null to clear out the form data that hasn't been submitted yet.handleCancel
in class GenericFormHandler
javax.servlet.ServletException
java.io.IOException
public boolean handleClear(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
users
to initialize them
to null to clear out the form data that hasn't been submitted yet. This is identical
to the Cancel submit method - to be used in beginning of form to clear out
the leftover data in session scoped form handler objects.handleClear
in class MultiProfileForm
javax.servlet.ServletException
java.io.IOException
protected void preCreate(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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 postCreate(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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 preCreateUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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 createUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- the request associated with this form submissionpResponse
- the response associated with this form submissionjavax.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
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 io