public abstract class AbstractUserInviteController extends BaseFormController
Modifier and Type | Field and Description |
---|---|
static String |
ATTR_INVITATION_FIELDS
request attribute for the invitation fields.
|
DEFAULT_COMMAND_NAME
Constructor and Description |
---|
AbstractUserInviteController() |
Modifier and Type | Method and Description |
---|---|
protected Object |
formBackingObject(javax.servlet.http.HttpServletRequest request) |
protected String |
getAliasErrorField(List<String> availableFields) |
protected String |
getEmailErrorField(List<String> availableFields) |
protected List<String> |
getErrorFields(String invitationProvider) |
protected String |
getExternalUsernameErrorField(List<String> availableFields) |
protected org.springframework.web.servlet.ModelAndView |
getModelAndView(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object command,
org.springframework.validation.BindException errors)
Get the model and view to show.
|
protected UserManagement |
getUserManagement()
returns the user management service
|
protected org.springframework.web.servlet.ModelAndView |
handleOnSubmit(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object command,
org.springframework.validation.BindException errors)
Is called by
BaseFormController.onSubmit(HttpServletRequest, HttpServletResponse, Object, BindException)
Submit callback with all parameters. |
protected abstract InviteUserForm |
internalFormBackingObject(javax.servlet.http.HttpServletRequest request)
|
protected abstract boolean |
inviteUser(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
InviteUserForm abstractForm,
org.springframework.validation.BindException errors,
UserVO userToInvite)
Invite the given user.
|
protected void |
validateForm(InviteUserForm form,
org.springframework.validation.Errors errors)
Validate the given form based on the expected invitation fields.
|
getLocale, initBinder, isRefuseOnExternalAuthentication, onSubmit, onSubmit, onSubmit, setRefuseOnExternalAuthentication, showForm
doSubmitAction, getFormView, getSuccessView, isFormChangeRequest, isFormChangeRequest, onFormChange, onFormChange, processFormSubmission, referenceData, referenceData, setFormView, setSuccessView, showForm, suppressValidation
currentFormObject, getCommand, getErrorsForNewForm, getFormSessionAttributeName, getFormSessionAttributeName, handleInvalidSubmit, handleRequestInternal, isBindOnNewForm, isFormSubmission, isSessionForm, onBindOnNewForm, onBindOnNewForm, setBindOnNewForm, setSessionForm, showForm, showForm, showNewForm
bindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, isValidateOnBinding, onBind, onBind, onBindAndValidate, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, suppressValidation, suppressValidation, useDirectFieldAccess
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setAlwaysMustRevalidate, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
public static final String ATTR_INVITATION_FIELDS
InvitationField
protected Object formBackingObject(javax.servlet.http.HttpServletRequest request) throws Exception
formBackingObject
in class org.springframework.web.servlet.mvc.AbstractFormController
Exception
protected String getAliasErrorField(List<String> availableFields)
availableFields
- all error fieldsprotected String getEmailErrorField(List<String> availableFields)
availableFields
- all error fieldsprotected List<String> getErrorFields(String invitationProvider)
invitationProvider
- Identifier of the invitation provider.protected String getExternalUsernameErrorField(List<String> availableFields)
availableFields
- all error fieldsprotected org.springframework.web.servlet.ModelAndView getModelAndView(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object command, org.springframework.validation.BindException errors) throws Exception
request
- the requestresponse
- the responsecommand
- the commanderrors
- the errorModelAndView
to showException
- in case of an errorprotected UserManagement getUserManagement()
protected org.springframework.web.servlet.ModelAndView handleOnSubmit(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object command, org.springframework.validation.BindException errors) throws Exception
BaseFormController.onSubmit(HttpServletRequest, HttpServletResponse, Object, BindException)
The default implementation delegates to BaseFormController.onSubmit(Object, BindException)
. For simply
performing a submit action and rendering the specified success view, consider implementing
SimpleFormController.doSubmitAction(java.lang.Object)
rather than an onSubmit
variant.
Subclasses can override this to provide custom submission handling like storing the object to the database. Implementations can also perform custom validation and call showForm to return to the form. Do not implement multiple onSubmit methods: In that case, just this method will be called by the controller.
Call errors.getModel()
to populate the ModelAndView model with the command and
the Errors instance, under the specified command name, as expected by the "spring:bind" tag.
handleOnSubmit
in class BaseFormController
request
- current servlet requestresponse
- current servlet responsecommand
- form object with request parameters bound onto iterrors
- Errors instance without errors (subclass can add errors if it wants to)null
Exception
com.communote.server.web.commons.controller.BaseFormController#handleOnSubmit(javax.servlet
.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, Object,
org.springframework.validation.BindException)
protected abstract InviteUserForm internalFormBackingObject(javax.servlet.http.HttpServletRequest request) throws Exception
request
- the requestException
- in case of an errorprotected abstract boolean inviteUser(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, InviteUserForm abstractForm, org.springframework.validation.BindException errors, UserVO userToInvite) throws Exception
request
- the requestresponse
- the responseabstractForm
- the invite formerrors
- the binding errorsuserToInvite
- the user that should be invitedException
- in case of an errorprotected void validateForm(InviteUserForm form, org.springframework.validation.Errors errors)
form
- the form to validateerrors
- the errorsCopyright © 2019 Communote team. All rights reserved.