Class ElementBase
- java.lang.Object
-
- nl.gx.webmanager.springmvc.FormBindableBase
-
- nl.gx.webmanager.cms.core.implementation.CmsItemBase
-
- nl.gx.webmanager.cms.element.implementation.JcrElementBase
-
- 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.
-
-
Field Summary
-
Fields inherited from class nl.gx.webmanager.springmvc.FormBindableBase
editViews
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ElementBase()
Default constructor.ElementBase(javax.servlet.http.HttpServletRequest request, javax.jcr.Node node)
Constructor for an element.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DelegatedController
getDelegatedController()
Returns the Spring controller to be used for this formbindable.String
getEditElementHeader()
By default return the menu item text as edit element header.EditView
getEditViewByValue(String value)
Returns the indicated EditView that should be used for form(part) display.String
getIcon()
Returns the name of the icon on disk.javax.servlet.jsp.PageContext
getJspPageContext(javax.servlet.http.HttpServletRequest request)
Get the JSP PageContext which is active for the current HTTP request.String
getNestedPath()
Deprecated.String
getTitle()
By default return the menu item text as title.String
getTypeIdentifier()
Returns the identifier for the element type (eg.void
render(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, Presentation presentation, boolean ignoreServerSideIncludeLocation)
Render the object taking into account if it is a serverside include or not.void
render(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, Presentation presentation, boolean ignoreServerSideIncludeLocation, Presentable baseObject)
Render the object taking into account if it is a serverside include or not and add the baseObject to the presentationContext.void
setComponent(Component component)
set the componentBase.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)
set all editViews for this component.org.springframework.web.servlet.ModelAndView
showForm(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.validation.BindException errors, 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, getAnchorElement, getElementHolder, getHeader, getId, getIdentity, getLastModifiedDate, getMailing, getMediaItemVersion, getNode, getPageModel, getPageModelElement, getPageVersion, getPersonalizationAttributes, getPersonalizationItems, getPersonalizationOperator, getPresentation, getPresentationContext, getPresentationVariant, getReferencedContentItems, getRequest, getUUID, getWebsite, getWrapper, getWrapper, isAuthorized, setAuthorized, setEditElementHeader, setHeader, setIcon, setId, setIdentity, setLastModifiedDate, setNode, setPersonalizationAttributes, setPersonalizationItems, setPersonalizationOperator, setPresentation, setPresentationVariant, setRequest, setTitle, 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
-
-
-
-
Method Detail
-
render
public void render(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, Presentation presentation, boolean ignoreServerSideIncludeLocation) throws IOException, javax.servlet.ServletException
Description copied from interface:Presentable
Render the object taking into account if it is a serverside include or not.- Specified by:
render
in interfacePresentable
- Overrides:
render
in classnl.gx.webmanager.cms.element.implementation.JcrElementBase
- Throws:
IOException
javax.servlet.ServletException
-
render
public void render(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, Presentation presentation, boolean ignoreServerSideIncludeLocation, Presentable baseObject) throws IOException, javax.servlet.ServletException
Description copied from interface:Presentable
Render the object taking into account if it is a serverside include or not and add the baseObject to the presentationContext.- Specified by:
render
in interfacePresentable
- Overrides:
render
in classnl.gx.webmanager.cms.element.implementation.JcrElementBase
- Throws:
IOException
javax.servlet.ServletException
-
getJspPageContext
public javax.servlet.jsp.PageContext getJspPageContext(javax.servlet.http.HttpServletRequest request)
Get the JSP PageContext which is active for the current HTTP request.- Parameters:
request
-- Returns:
- The JSP PageContext or null if none is available.
-
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
Description copied from class:FormBindableBase
Callback for returning the model and view for a GET request.- Specified by:
showForm
in interfaceDelegatedController
- Overrides:
showForm
in classFormBindableBase
- Parameters:
request
- current servlet requestresponse
- current servlet responseerrors
- 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:
Exception
- in case of errors
-
getEditViewByValue
public EditView getEditViewByValue(String value)
Description copied from interface:DelegatedController
Returns the indicated EditView that should be used for form(part) display.- Specified by:
getEditViewByValue
in interfaceDelegatedController
- Overrides:
getEditViewByValue
in classFormBindableBase
- 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)
Description copied from class:FormBindableBase
set all editViews for this component.- Overrides:
setEditViews
in classFormBindableBase
- Parameters:
editViewSet
- EditView[] holding the editViews for this component
-
getDelegatedController
public DelegatedController getDelegatedController()
Description copied from class:FormBindableBase
Returns the Spring controller to be used for this formbindable.- Specified by:
getDelegatedController
in interfaceDelegatedControllerAware
- Overrides:
getDelegatedController
in classFormBindableBase
- Returns:
- Spring controller for this formbindable
-
getTypeIdentifier
public String getTypeIdentifier()
Description copied from interface:Element
Returns the identifier for the element type (eg.ImageElement
). This type is configured in the activator.- Returns:
- identifier of the element type
-
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 interfaceDelegatedControllerAware
- Overrides:
setDelegatedController
in classFormBindableBase
- Parameters:
formController
- Spring controller to set for this formbindable
-
setComponent
public void setComponent(Component component)
Description copied from class:nl.gx.webmanager.cms.core.implementation.CmsItemBase
set the componentBase. Will be injected by the framework. componentBase is used internal for read acces to the component environment- Overrides:
setComponent
in classnl.gx.webmanager.cms.core.implementation.CmsItemBase
-
getIcon
public String getIcon()
Description copied from interface:Element
Returns the name of the icon on disk.
-
getEditElementHeader
public 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 interfaceElement
- Overrides:
getEditElementHeader
in classnl.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
@Deprecated public String getNestedPath()
Deprecated.
-
setDefaultPresentation
public void setDefaultPresentation()
Description copied from interface:Element
Sets a default presentation for the element.
-
getTitle
public String getTitle()
By default return the menu item text as title. If it was not defined in the element component definition, the name defined in the element component definition is used instead.
-
-