nl.gx.webmanager.springmvc
Interface DelegatedController

All Known Implementing Classes:
AuthorizationCommandObject, AuthorizationMaintenancePanel, AuthorizationMaintenancePanelController, nl.gx.webmanager.cms.core.implementation.CmsItemBase, ComponentController, ElementBase, ElementComponentController, ExtensionSubTabController, ExtensionSubTabFBO, FormBindableBase, ImportUsersCommandObject, nl.gx.webmanager.cms.element.implementation.JcrElementBase, nl.gx.webmanager.cms.core.implementation.JcrPageMetaDataBase, MediaItemBase, MediaItemComponentController, PageMetaDataBase, PageMetaDataComponentController, PanelBase, PanelComponentController, PanelTabFBO, PanelTabset, RoleCommandObject, TreeActionPanel, TreeActionPanelController, TreeActionTabController, UserCommandObject

public interface DelegatedController

This class holds the interface for a class to which controller logic will be delegated. The platform controllers, running within the Spring application context and registered in the springmvc-servlet.xml will delegate the methods contained by this interface to the class implementing the interface. A class implementing this interface will never run inside the Spring application context but controller methods will be delegated by the platform controllers that do.

Author:
ivol

Method Summary
 void addValidator(org.springframework.validation.Validator validator)
          Set the Validators for this controller.
 java.lang.Object formBackingObject(javax.servlet.http.HttpServletRequest request)
          Returns the form backing object to be used for this controller
 java.util.LinkedHashMap<DelegatedController,FormBackingObject> getControllerDelegationMap()
          Return the map of delegated controllers of this controller.
 EditView getEditView()
          Returns the default EditView that should be used for form display.
 EditView getEditViewByValue(java.lang.String value)
          Returns the indicated EditView that should be used for form(part) display.
 java.util.ArrayList<java.lang.String> getResourceBaseNames()
          Return the resource base names for this controller
 org.springframework.validation.Validator[] getValidators()
          Return the Validators for this controller.
 void initBinder(javax.servlet.http.HttpServletRequest request, org.springframework.web.bind.ServletRequestDataBinder binder)
          Callback for additional binder initialisations.
 void initialize(javax.servlet.http.HttpServletRequest request)
          Called by the framework to initialize the controller
 void onBind(javax.servlet.http.HttpServletRequest request, java.lang.Object command, org.springframework.validation.BindException errors)
          Callback for custom post-processing in terms of binding.
 void onBindAndValidate(javax.servlet.http.HttpServletRequest request, java.lang.Object command, org.springframework.validation.BindException errors)
          Callback for custom post-processing in terms of binding and validation.
 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)
          Callback for the data processing of the form submissed data.
 java.util.Map<java.lang.String,java.lang.Object> referenceData(javax.servlet.http.HttpServletRequest request, java.lang.Object command, org.springframework.validation.Errors errors)
          Callback to createa a reference data map for the given request and command.
 org.springframework.web.servlet.ModelAndView showForm(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.validation.BindException errors, java.util.Map controlModel)
          Callback for returning the model and view for a GET request.
 

Method Detail

initialize

void initialize(javax.servlet.http.HttpServletRequest request)
Called by the framework to initialize the controller

Parameters:
request -

formBackingObject

java.lang.Object formBackingObject(javax.servlet.http.HttpServletRequest request)
                                   throws javax.servlet.ServletException
Returns the form backing object to be used for this controller

Parameters:
request - current http request
Returns:
The form backing object to be used for this controller
Throws:
javax.servlet.ServletException - in case of errors

initBinder

void initBinder(javax.servlet.http.HttpServletRequest request,
                org.springframework.web.bind.ServletRequestDataBinder binder)
                throws java.lang.Exception
Callback for additional binder initialisations. called by the WebmanagerController at form submission equivalent to org.springframework.web.servlet.mvc.SimpleFormController.initBinder(); called before the databinding to the commandobject.

Parameters:
request - current HTTP request
binder - binder instance
Throws:
java.lang.Exception - in case of invalid state or arguments

onBind

void onBind(javax.servlet.http.HttpServletRequest request,
            java.lang.Object command,
            org.springframework.validation.BindException errors)
            throws java.lang.Exception
Callback for custom post-processing in terms of binding. called by the WebmanagerController at form submission equivalent to org.springframework.web.servlet.mvc.SimpleFormController.onBind(); called after the databinding to the commandobject.

Parameters:
request - current HTTP request
command - the command object to perform further binding on
errors - validation and binder errors holder, allowing for additional custom registration of binding errors
Throws:
java.lang.Exception - in case of invalid state or arguments

onBindAndValidate

void onBindAndValidate(javax.servlet.http.HttpServletRequest request,
                       java.lang.Object command,
                       org.springframework.validation.BindException errors)
                       throws java.lang.Exception
Callback for custom post-processing in terms of binding and validation. called by the WebmanagerController at form submission equivalent to org.springframework.web.servlet.mvc.SimpleFormController.onBindAndValidate(); called after the validate(), also in case of validation and/or bind errors

Parameters:
request - current HTTP request
command - the command object, still allowing for further binding
errors - errors holder, allowing for additional custom validation errors
Throws:
java.lang.Exception - in case of invalid state or arguments

onSubmit

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
Callback for the data processing of the form submissed data. called by the framework at form submission. Note that it is called only if NO ERRORS are raised during binding and validation of ALL components called after onBindAndValidate() The callback provides the ModelAndView of the main spring controller, running inside the Spring application context.

Parameters:
request - current servlet request
response - current servlet response
command - command object with request parameters bound onto it
errors - errors holder without errors (subclass can add errors if it wants to)
modelAndView - model and view of the original main spring controller which handles the request
Throws:
java.lang.Exception - in case of errors

showForm

org.springframework.web.servlet.ModelAndView showForm(javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response,
                                                      org.springframework.validation.BindException errors,
                                                      java.util.Map controlModel)
                                                      throws java.lang.Exception
Callback for returning the model and view for a GET request. The model of the main spring controller is passed such that properties can also be added to the main model. The returned ModelAndView is added to the edit context for the form backing object of the controller.

Parameters:
request - current servlet request
response - current servlet response
errors - errors holder without errors (subclass can add errors if it wants to)
controlModel - Current model of the controller
Returns:
The model and view to be rendered by this controller
Throws:
java.lang.Exception - in case of errors

referenceData

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
Callback to createa a reference data map for the given request and command. consisting of bean name/bean instance pairs as expected by ModelAndView. called by the WebmanagerController at a GET equivalent to org.springframework.web.servlet.mvc.SimpleFormController.referenceData();

Parameters:
request - current HTTP request
command - command object
errors - Errors holder
Returns:
a Map with reference data entries, or null if none
Throws:
java.lang.Exception - in case of invalid state or arguments
See Also:
ModelAndView

getEditView

EditView getEditView()
Returns the default EditView that should be used for form display.

Returns:
the default EditView that should be used for form display.

getEditViewByValue

EditView getEditViewByValue(java.lang.String value)
Returns the indicated EditView that should be used for form(part) display.

Parameters:
value - Value of the view that should be used
Returns:
the indicated view that should be used for form display.

addValidator

void addValidator(org.springframework.validation.Validator validator)
Set the Validators for this controller. The Validator must support the specified command class.

Parameters:
validators - Array of validators to set

getValidators

org.springframework.validation.Validator[] getValidators()
Return the Validators for this controller.

Returns:
Array of validators set on this controller

getResourceBaseNames

java.util.ArrayList<java.lang.String> getResourceBaseNames()
Return the resource base names for this controller

Returns:
the resource base names for this controller

getControllerDelegationMap

java.util.LinkedHashMap<DelegatedController,FormBackingObject> getControllerDelegationMap()
Return the map of delegated controllers of this controller. This means controller delegation works recursively; a delegated controller itself in his turn can delegate to its own delegated controller

Returns:
The map of delegated controllers to their form backing objects of this controller


Copyright © 2007-2011 GX Software BV. All Rights Reserved.