nl.gx.webmanager.springmvc.element
Class ElementBase

java.lang.Object
  extended by nl.gx.webmanager.springmvc.FormBindableBase
      extended by nl.gx.webmanager.cms.core.implementation.CmsItemBase
          extended by nl.gx.webmanager.cms.element.implementation.JcrElementBase
              extended by nl.gx.webmanager.springmvc.element.ElementBase
All Implemented Interfaces:
Presentable, Element, DelegatedController, DelegatedControllerAware, Wrapper

public abstract class ElementBase
extends nl.gx.webmanager.cms.element.implementation.JcrElementBase

This class is the base class for all element components.

Author:
Simon Edwards

Field Summary
 
Fields inherited from class nl.gx.webmanager.springmvc.FormBindableBase
editViews
 
Constructor Summary
protected ElementBase()
          Default constructor.
  ElementBase(javax.servlet.http.HttpServletRequest request, javax.jcr.Node node)
          Constructor for an element.
 
Method Summary
 DelegatedController getDelegatedController()
          Returns the Spring controller to be used for this formbindable
 java.lang.String getEditElementHeader()
          By default return the menu item text as edit element header.
 EditView getEditViewByValue(java.lang.String value)
          Returns the indicated EditView that should be used for form(part) display.
 java.lang.String getIcon()
          Default implementation of the getIcon for an element is to return the small icon name as defined in the element component definition
 java.lang.String getNestedPath()
           
 void setComponent(Component component)
           
 void setDefaultPresentation()
          Sets a default presentation for the element.
 void setDelegatedController(DelegatedController formController)
          Sets the Spring controller to be used for this formbindable
 void setEditViews(WmEditView[] editViewSet)
          Setter for the editViews attribute.
 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
 
Methods inherited from class nl.gx.webmanager.cms.element.implementation.JcrElementBase
cleanup, copy, getElementHolder, getHeader, getId, getMailing, getMediaItemVersion, getNode, getPageModel, getPageModelElement, getPageVersion, getPersonalization, getPresentation, getPresentationContext, getRequest, getUUID, getWebsite, getWrapper, getWrapper, isAuthorized, render, render, setAuthorized, setEditElementHeader, setHeader, setIcon, setId, setNode, setPersonalization, setPresentation, setRequest, setUUID
 
Methods inherited from class nl.gx.webmanager.cms.core.implementation.CmsItemBase
getComponent, getComponentFileId, getComponentId, getLanguageResourceMessage, getLanguageResourceMessage, getPrivateSession, getStaticResourceDir, setPrivateSession
 
Methods inherited from class nl.gx.webmanager.springmvc.FormBindableBase
addDisallowedField, addEditView, addValidator, formBackingObject, getControllerDelegationMap, getEditView, getParentController, getResourceBaseNames, getValidators, initBinder, initialize, onBind, onBindAndValidate, onSubmit, referenceData, setParentController, setValidators
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementBase

protected ElementBase()
Default constructor.


ElementBase

public ElementBase(javax.servlet.http.HttpServletRequest request,
                   javax.jcr.Node node)
Constructor for an element.

Parameters:
request - The hhttp servlet request
node - The injected node
Method Detail

showForm

public 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
Description copied from class: FormBindableBase
Callback for returning the model and view for a GET request

Specified by:
showForm in interface DelegatedController
Overrides:
showForm in class FormBindableBase
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

getEditViewByValue

public EditView getEditViewByValue(java.lang.String value)
Description copied from interface: DelegatedController
Returns the indicated EditView that should be used for form(part) display.

Specified by:
getEditViewByValue in interface DelegatedController
Overrides:
getEditViewByValue in class FormBindableBase
Parameters:
value - Value of the view that should be used
Returns:
the indicated view that should be used for form display.

setEditViews

public void setEditViews(WmEditView[] editViewSet)
Setter for the editViews attribute. jsp editviews are automatic prefixed whith the component own directory prefix for edit presentations

Overrides:
setEditViews in class FormBindableBase
Parameters:
editViews - Array of EditView object to set

getDelegatedController

public DelegatedController getDelegatedController()
Description copied from class: FormBindableBase
Returns the Spring controller to be used for this formbindable

Specified by:
getDelegatedController in interface DelegatedControllerAware
Overrides:
getDelegatedController in class FormBindableBase
Returns:
Spring controller for this formbindable

setDelegatedController

public void setDelegatedController(DelegatedController formController)
Description copied from class: FormBindableBase
Sets the Spring controller to be used for this formbindable

Specified by:
setDelegatedController in interface DelegatedControllerAware
Overrides:
setDelegatedController in class FormBindableBase
Parameters:
formController - Spring controller to set for this formbindable

setComponent

public void setComponent(Component component)
Overrides:
setComponent in class nl.gx.webmanager.cms.core.implementation.CmsItemBase

getIcon

public java.lang.String getIcon()
Default implementation of the getIcon for an element is to return the small icon name as defined in the element component definition

Specified by:
getIcon in interface Element
Overrides:
getIcon in class nl.gx.webmanager.cms.element.implementation.JcrElementBase
Returns:
the name of the icon on disk

getEditElementHeader

public java.lang.String getEditElementHeader()
By default return the menu item text as edit element header. If it was not defined in the element component definition, the name defined in the element component definition is used instead.

Specified by:
getEditElementHeader in interface Element
Overrides:
getEditElementHeader in class nl.gx.webmanager.cms.element.implementation.JcrElementBase
Returns:
Header text to be displayed in the header of the element in the edit environment of WebManager

getNestedPath

public java.lang.String getNestedPath()

setDefaultPresentation

public void setDefaultPresentation()
Description copied from interface: Element
Sets a default presentation for the element.



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