|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.support.WebContentGenerator
org.springframework.web.servlet.mvc.AbstractController
org.springframework.web.servlet.mvc.BaseCommandController
org.springframework.web.servlet.mvc.AbstractFormController
org.springframework.web.servlet.mvc.SimpleFormController
nl.gx.webmanager.springmvc.controller.BaseWebmanagerController
public abstract class BaseWebmanagerController
This class is the base class for all WebManager Spring controllers. It contains controller logic for controllers running inside the Spring application context as well as controllers to which controller callback methods are delegated by these application context controllers, used in case of component composition. This class is typically extended by custom controllers contained by WCBs but also by the main controllers of each component (like the PanelController, MediaItemVersionController and PageVersionController), running inside the Spring application context.
| Field Summary | |
|---|---|
protected java.lang.Object |
formBackingObject
|
static java.lang.String |
PROTOCOL_PROCESSED_KEY
Key for the request attribute that indicates if the old fashioned siteworks protocol has been invoked. |
| Fields inherited from class org.springframework.web.servlet.mvc.BaseCommandController |
|---|
DEFAULT_COMMAND_NAME |
| Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator |
|---|
METHOD_GET, METHOD_HEAD, METHOD_POST |
| Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
|---|
logger |
| Constructor Summary | |
|---|---|
BaseWebmanagerController()
|
|
| Method Summary | |
|---|---|
protected void |
addControllerDelegation(DelegatedController controller,
FormBackingObject formBackingObject,
javax.servlet.http.HttpServletRequest request)
Adds a sub controller and corresponding form backing object to the local controller delegation map. |
void |
addDisallowedField(org.springframework.web.bind.ServletRequestDataBinder binder,
java.lang.String field)
Adds ad disallowed field to the list of allowed fields contained by the binder |
void |
addEditView(WmEditView editView)
Adds an edit view to this controller and removes any edit view that already exists and has the same value. |
void |
addEditViews(WmEditView[] editViews)
Adds an array of edit views to this controller and removes any edit view that already exists and has the same value. |
void |
addResourceBaseName(java.lang.String resourceBaseName)
Adds a single resource base name to the list of resource base names for this controller. |
void |
addValidator(org.springframework.validation.Validator validator)
Helper method to add a validator the the list of validators |
protected abstract void |
createEditViews()
Callback to add edit views. |
protected abstract void |
createResourceBaseNames(java.lang.Object command)
Callback to add resource base names. |
java.lang.Object |
formBackingObject(javax.servlet.http.HttpServletRequest request)
Retrieve a form backing object for the current form from the given request. |
java.util.LinkedHashMap<DelegatedController,FormBackingObject> |
getControllerDelegationMap()
Return the sub controller and corresponding form backing objects stored on the local controller delegation map. |
EditContext |
getEditContext()
|
protected java.lang.String |
getEditLanguageLabel(java.lang.String label)
Deprecated. It should not be necessary to retrieve a language specific text within the scope of a controller. |
EditView |
getEditView()
get the default editview; the edit view with empty value |
EditView |
getEditViewByValue(java.lang.String value)
Get the editview with the given value. |
protected java.util.ArrayList<WmEditView> |
getEditViews()
Return the array list with all edit views on the current stack |
PresentationContext |
getPresentationContext()
|
java.util.ArrayList<java.lang.String> |
getResourceBaseNames()
Return the resource base names for this controller |
javax.servlet.ServletContext |
getServletContextHack()
|
protected java.lang.Integer |
getVersion(javax.servlet.http.HttpServletRequest request)
Returns the value of the id parameter in the request as the id of the current version. |
static Website |
getWebsite(nl.gx.webmanager.foundation.Session wmSession)
|
Website |
getWebsiteByRequest(javax.servlet.http.HttpServletRequest request)
Get the website according to the webid in the qs. |
nl.gx.webmanager.foundation.Session |
getWmSession(javax.servlet.http.HttpServletRequest request)
Returns the webmanager session that the controller uses for handling the request. |
void |
initBinder(javax.servlet.http.HttpServletRequest request,
org.springframework.web.bind.ServletRequestDataBinder binder)
Initialize the given binder with custom editors for the Date class. |
void |
initialize(javax.servlet.http.HttpServletRequest request)
Initialize the controller |
boolean |
isReloadWebManager(javax.servlet.http.HttpServletRequest request)
Returns true if WebManager should be reloaded after completing the request. |
void |
onBind(javax.servlet.http.HttpServletRequest request,
java.lang.Object command,
org.springframework.validation.BindException errors)
This is method is called by the Spring framework just after binding posted form values onto the form backing object. |
void |
onBindAndValidate(javax.servlet.http.HttpServletRequest request,
java.lang.Object command,
org.springframework.validation.BindException errors)
This is method is called by the Spring framework just after binding posted form values onto the form backing object and calling the onBind. |
void |
onSubmit(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object command,
org.springframework.validation.BindException errors,
org.springframework.web.servlet.ModelAndView modelAndView)
Methods that override this method MUST call super.onSubmit in order to function properly. |
protected void |
popNestedPath(org.springframework.validation.BindException errors,
FormBackingObject formBackingObject)
Pops a nested path from the stack for spring binding. |
protected void |
pushNestedPath(org.springframework.validation.BindException errors,
FormBackingObject formBackingObject)
Pushes the nested path onto the stack for spring binding. |
java.util.Map<java.lang.String,java.lang.Object> |
referenceData(javax.servlet.http.HttpServletRequest request,
java.lang.Object command,
org.springframework.validation.Errors errors)
Methods that override this method MUST call super.referenceData in order to function properly. |
protected void |
removeControllerDelegation(DelegatedController controller)
Removes a sub controller and corresponding form backing object to the local controller delegation map. |
void |
setReloadWebManager(boolean reloadWebManager,
javax.servlet.http.HttpServletRequest request)
Set if WebManager should be reloaded after completing the request. |
org.springframework.web.servlet.ModelAndView |
showForm(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.validation.BindException errors)
Default implementation of showForm. |
| Methods inherited from class org.springframework.web.servlet.mvc.SimpleFormController |
|---|
doSubmitAction, getFormView, getSuccessView, isFormChangeRequest, isFormChangeRequest, onFormChange, onFormChange, onSubmit, onSubmit, onSubmit, processFormSubmission, referenceData, setFormView, setSuccessView, showForm, suppressValidation |
| Methods inherited from class org.springframework.web.servlet.mvc.AbstractFormController |
|---|
currentFormObject, getCommand, getErrorsForNewForm, getFormSessionAttributeName, getFormSessionAttributeName, handleInvalidSubmit, handleRequestInternal, isBindOnNewForm, isFormSubmission, isSessionForm, onBindOnNewForm, onBindOnNewForm, setBindOnNewForm, setSessionForm, showForm, showForm, showNewForm |
| Methods inherited from class org.springframework.web.servlet.mvc.BaseCommandController |
|---|
bindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, isValidateOnBinding, onBind, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, suppressValidation, suppressValidation, useDirectFieldAccess |
| Methods inherited from class org.springframework.web.servlet.mvc.AbstractController |
|---|
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession |
| Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator |
|---|
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader |
| Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
|---|
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext |
| Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
|---|
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROTOCOL_PROCESSED_KEY
protected java.lang.Object formBackingObject
| Constructor Detail |
|---|
public BaseWebmanagerController()
| Method Detail |
|---|
public void initialize(javax.servlet.http.HttpServletRequest request)
request -
public java.lang.Object formBackingObject(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
formBackingObject in class org.springframework.web.servlet.mvc.AbstractFormControllerrequest - current HTTP request
java.lang.Exception - in case of invalid state or arguments
javax.servlet.ServletException
public void initBinder(javax.servlet.http.HttpServletRequest request,
org.springframework.web.bind.ServletRequestDataBinder binder)
throws java.lang.Exception
initBinder in class org.springframework.web.servlet.mvc.BaseCommandControllerrequest - current HTTP requestbinder - new binder instance
java.lang.Exception - in case of invalid state or arguments
public void onBind(javax.servlet.http.HttpServletRequest request,
java.lang.Object command,
org.springframework.validation.BindException errors)
throws java.lang.Exception
onBind in class org.springframework.web.servlet.mvc.BaseCommandControllerrequest - current HTTP requestcommand - the command object to perform further binding onerrors - validation errors holder, allowing for additional custom registration of binding errors
java.lang.Exception - in case of invalid state or arguments
public void onBindAndValidate(javax.servlet.http.HttpServletRequest request,
java.lang.Object command,
org.springframework.validation.BindException errors)
throws java.lang.Exception
onBindAndValidate in class org.springframework.web.servlet.mvc.BaseCommandControllerrequest - current HTTP requestcommand - the command object, still allowing for further bindingerrors - validation errors holder, allowing for additional custom validation
java.lang.Exception - in case of invalid state or arguments
public void onSubmit(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object command,
org.springframework.validation.BindException errors,
org.springframework.web.servlet.ModelAndView modelAndView)
throws java.lang.Exception
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)modelAndView - the model and view prepared by the main spring controller
java.lang.Exception - in case of errors
public org.springframework.web.servlet.ModelAndView showForm(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.validation.BindException errors)
throws java.lang.Exception
showForm in class org.springframework.web.servlet.mvc.SimpleFormControllerrequest - current http requestresponse - current http responseerrors - Errors instance without errors (subclass can add errors if it wants to)
java.lang.Exception
public java.util.Map<java.lang.String,java.lang.Object> referenceData(javax.servlet.http.HttpServletRequest request,
java.lang.Object command,
org.springframework.validation.Errors errors)
throws java.lang.Exception
referenceData in class org.springframework.web.servlet.mvc.SimpleFormControllerrequest - current HTTP requestcommand - the command object to perform further binding onerrors - validation errors holder, allowing for additional custom registration of binding errors
null if none
java.lang.Exception - in case of invalid state or arguments
public void addDisallowedField(org.springframework.web.bind.ServletRequestDataBinder binder,
java.lang.String field)
binder - The binder to which the disallowed field should be addedfield - The field that should be disallowedprotected abstract void createEditViews()
protected abstract void createResourceBaseNames(java.lang.Object command)
public void addEditView(WmEditView editView)
editView - Edit view to add to this controllerpublic void addEditViews(WmEditView[] editViews)
editViews - Edit views to add to this controllerpublic void addResourceBaseName(java.lang.String resourceBaseName)
resourceBaseName - Resource base name to add to this controllerpublic java.util.ArrayList<java.lang.String> getResourceBaseNames()
public EditView getEditViewByValue(java.lang.String value)
value - the value to retrieve the edit view from
protected java.util.ArrayList<WmEditView> getEditViews()
public EditView getEditView()
protected void addControllerDelegation(DelegatedController controller,
FormBackingObject formBackingObject,
javax.servlet.http.HttpServletRequest request)
controller - Sub controller to delegate controller logic toformBackingObject - Form backing object to be invoked onto the controller callback methodsprotected void removeControllerDelegation(DelegatedController controller)
controller - Controller to remove from the mappublic java.util.LinkedHashMap<DelegatedController,FormBackingObject> getControllerDelegationMap()
public void addValidator(org.springframework.validation.Validator validator)
validator - Validator to add
protected void pushNestedPath(org.springframework.validation.BindException errors,
FormBackingObject formBackingObject)
errors - BindException to push nested path ontoformBackingObject - Form backing object to push the nested path for
protected void popNestedPath(org.springframework.validation.BindException errors,
FormBackingObject formBackingObject)
errors - BindException to pop nested path fromformBackingObject - Form backing object to push the nested path forpublic nl.gx.webmanager.foundation.Session getWmSession(javax.servlet.http.HttpServletRequest request)
request - The request
public Website getWebsiteByRequest(javax.servlet.http.HttpServletRequest request)
request - current HTTP request
@Deprecated protected java.lang.String getEditLanguageLabel(java.lang.String label)
label - Label used to retrieve the language specific text.
protected java.lang.Integer getVersion(javax.servlet.http.HttpServletRequest request)
request - current HTTP request
public boolean isReloadWebManager(javax.servlet.http.HttpServletRequest request)
request - The http servlet request
public void setReloadWebManager(boolean reloadWebManager,
javax.servlet.http.HttpServletRequest request)
reloadWebManager - Set to true when WebManager should be reloaded after completing the request.request - The http servlet requestpublic static Website getWebsite(nl.gx.webmanager.foundation.Session wmSession)
public EditContext getEditContext()
public PresentationContext getPresentationContext()
public javax.servlet.ServletContext getServletContextHack()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||