Class ComponentController
- java.lang.Object
-
- org.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
-
- nl.gx.webmanager.springmvc.controller.component.ComponentController
-
- All Implemented Interfaces:
DelegatedController
,ComponentAware
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.web.context.ServletContextAware
,org.springframework.web.servlet.mvc.Controller
- Direct Known Subclasses:
ElementComponentController
,ExtensionSubTabController
,MediaItemComponentController
,PageMetaDataComponentController
,PanelComponentController
public abstract class ComponentController extends BaseWebmanagerController implements ComponentAware, DelegatedController
This class is the base class for component controllers. Component controllers are controllers that are registered by a component. These controllers are not running in the Spring application context but controller methods are delegated to it by a MainSpringController which does run inside the Spring application context.- Since:
- WebManager 9.0.8
- Author:
- ivol
-
-
Field Summary
-
Fields inherited from class nl.gx.webmanager.springmvc.controller.BaseWebmanagerController
formBackingObject, PROTOCOL_PROCESSED_KEY
-
Fields inherited from class org.springframework.web.servlet.mvc.BaseCommandController
DEFAULT_COMMAND_NAME
-
-
Constructor Summary
Constructors Constructor Description ComponentController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEditView(String jspLocation, String viewName)
Adds an edit view to the registered edit views of this controller.void
addEditView(String jspLocation, String viewName, Component component)
protected void
createResourceBaseNames(Object command)
Callback to add resource base names.Object
formBackingObject(javax.servlet.http.HttpServletRequest request)
Retrieve a form backing object for the current form from the given request.String
getBundleDefinitionId()
Return the configured bundleId for this controllerprotected Component
getComponent()
Return the component to which this controller belongs.DelegatedController
getParentController()
protected org.springframework.web.servlet.ModelAndView
onSubmit(Object command)
Marked final to prevent developers from trying to overrule the method which wouldn't work since this is a delegated controller not running inside the spring application context.protected org.springframework.web.servlet.ModelAndView
onSubmit(Object command, org.springframework.validation.BindException errors)
Marked final to prevent developers from trying to overrule the method which wouldn't work since this is a delegated controller not running inside the spring application context.protected org.springframework.web.servlet.ModelAndView
onSubmit(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object command, org.springframework.validation.BindException errors)
Marked final to prevent developers from trying to overrule the method which wouldn't work since this is a delegated controller not running inside the spring application context.protected Map<String,Object>
referenceData(javax.servlet.http.HttpServletRequest request)
void
setBundleDefinitionId(String bundleDefinitionId)
Set the bundleId for this controllervoid
setComponent(Component component)
Sets the component to which this controller belongs, called by the component manager when the controller is created.void
setDelegatedControllers(Object formbackingObject, javax.servlet.http.HttpServletRequest request)
Called by extension consumer in formBackingObject(...) method of controllervoid
setParentController(DelegatedController parentController)
org.springframework.web.servlet.ModelAndView
showForm(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.validation.BindException errors, Map controlModel)
Returns the Model and view to be used when rendering the form backing object that is returned by this controller-
Methods inherited from class nl.gx.webmanager.springmvc.controller.BaseWebmanagerController
addControllerDelegation, addDisallowedField, addEditView, addEditView, addEditViews, addResourceBaseName, addValidator, createEditViews, getControllerDelegationMap, getEditContext, getEditLanguageLabel, getEditView, getEditViewByValue, getEditViews, getPresentationContext, getResourceBaseNames, getServletContextHack, getVersion, getWebsite, getWebsiteByRequest, getWmSession, initBinder, initialize, isReloadWebManager, onBind, onBindAndValidate, onSubmit, popNestedPath, pushNestedPath, referenceData, removeControllerDelegation, setReloadWebManager, showForm
-
Methods inherited from class org.springframework.web.servlet.mvc.SimpleFormController
doSubmitAction, getFormView, getSuccessView, isFormChangeRequest, isFormChangeRequest, onFormChange, onFormChange, processFormSubmission, setFormView, setSuccessView, 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, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setAlwaysMustRevalidate, 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
-
Methods inherited from interface nl.gx.webmanager.springmvc.DelegatedController
addValidator, getControllerDelegationMap, getEditView, getEditViewByValue, getResourceBaseNames, getValidators, initBinder, initialize, onBind, onBindAndValidate, onSubmit, referenceData
-
-
-
-
Method Detail
-
getBundleDefinitionId
public String getBundleDefinitionId()
Return the configured bundleId for this controller- Returns:
- the bundleId
-
setBundleDefinitionId
public void setBundleDefinitionId(String bundleDefinitionId)
Set the bundleId for this controller- Parameters:
bundleDefinitionId
-
-
onSubmit
protected final org.springframework.web.servlet.ModelAndView onSubmit(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object command, org.springframework.validation.BindException errors) throws Exception
Marked final to prevent developers from trying to overrule the method which wouldn't work since this is a delegated controller not running inside the spring application context.- Overrides:
onSubmit
in classorg.springframework.web.servlet.mvc.SimpleFormController
- Throws:
Exception
-
onSubmit
protected final org.springframework.web.servlet.ModelAndView onSubmit(Object command) throws Exception
Marked final to prevent developers from trying to overrule the method which wouldn't work since this is a delegated controller not running inside the spring application context.- Overrides:
onSubmit
in classorg.springframework.web.servlet.mvc.SimpleFormController
- Throws:
Exception
-
onSubmit
protected final org.springframework.web.servlet.ModelAndView onSubmit(Object command, org.springframework.validation.BindException errors) throws Exception
Marked final to prevent developers from trying to overrule the method which wouldn't work since this is a delegated controller not running inside the spring application context.- Overrides:
onSubmit
in classorg.springframework.web.servlet.mvc.SimpleFormController
- Throws:
Exception
-
showForm
public org.springframework.web.servlet.ModelAndView showForm(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.validation.BindException errors, Map controlModel) throws Exception
Returns the Model and view to be used when rendering the form backing object that is returned by this controller- Specified by:
showForm
in interfaceDelegatedController
- Overrides:
showForm
in classorg.springframework.web.servlet.mvc.SimpleFormController
- Parameters:
request
- current servlet requestresponse
- current servlet responseerrors
- Errors instance without errors (subclass can add errors if it wants to)controlModel
- The model- Returns:
- The model and view to be used when rendering the form backing object
- Throws:
Exception
- in case of errors
-
referenceData
protected final Map<String,Object> referenceData(javax.servlet.http.HttpServletRequest request) throws Exception
- Overrides:
referenceData
in classorg.springframework.web.servlet.mvc.SimpleFormController
- Throws:
Exception
-
addEditView
public void addEditView(String jspLocation, String viewName)
Adds an edit view to the registered edit views of this controller. If an edit view is added with a viewName that already exists the existing edit view will be replaced with the new edit view- Parameters:
jspLocation
- JSP location of the view to addviewName
- Logical name of the view to add editViews Array of EditView object to set
-
setComponent
public void setComponent(Component component)
Sets the component to which this controller belongs, called by the component manager when the controller is created.- Specified by:
setComponent
in interfaceComponentAware
- Parameters:
component
- component to set
-
getComponent
protected Component getComponent()
Return the component to which this controller belongs.- Returns:
- the component to which this controller belongs
-
formBackingObject
public Object formBackingObject(javax.servlet.http.HttpServletRequest request) throws javax.servlet.ServletException
Retrieve a form backing object for the current form from the given request. Override this method to return the form backing object- Specified by:
formBackingObject
in interfaceDelegatedController
- Overrides:
formBackingObject
in classBaseWebmanagerController
- Parameters:
request
- current HTTP request- Returns:
- the FormBackingObject
- Throws:
Exception
- in case of invalid state or argumentsjavax.servlet.ServletException
- in case of errors
-
getParentController
public DelegatedController getParentController()
-
setParentController
public void setParentController(DelegatedController parentController)
-
setDelegatedControllers
public void setDelegatedControllers(Object formbackingObject, javax.servlet.http.HttpServletRequest request) throws javax.servlet.ServletException
Called by extension consumer in formBackingObject(...) method of controller- Parameters:
formbackingObject
-request
-- Throws:
javax.servlet.ServletException
-
createResourceBaseNames
protected void createResourceBaseNames(Object command)
Description copied from class:BaseWebmanagerController
Callback to add resource base names. Sub classes should implement this method, call the super and invoke addResourceBaseNames to add its own resource base names to the controller.- Specified by:
createResourceBaseNames
in classBaseWebmanagerController
-
-