Package nl.gx.webmanager.springmvc.panel
Class PanelBase
- java.lang.Object
-
- nl.gx.webmanager.springmvc.FormBindableBase
-
- nl.gx.webmanager.cms.core.implementation.CmsItemBase
-
- nl.gx.webmanager.springmvc.panel.PanelBase
-
- All Implemented Interfaces:
DelegatedController
,DelegatedControllerAware
,FormBackingObject
public abstract class PanelBase extends nl.gx.webmanager.cms.core.implementation.CmsItemBase implements FormBackingObject
Base class to be extended for partner panel development.- Author:
- johntd
-
-
Field Summary
-
Fields inherited from class nl.gx.webmanager.springmvc.FormBindableBase
editViews
-
-
Constructor Summary
Constructors Constructor Description PanelBase()
default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addComponent(DelegatedController components)
adds a formbindable component to this panel so the bindable methods are autonmaticaly deligated to that component by the panel.PanelTab
addTab(String tabId, String titleKey, String titleImage, String viewFileName, DelegatedController controller, String presentationName, javax.servlet.http.HttpServletRequest request)
Adds a main tab to the panel navigation.PanelTab
addTab(String tabId, String titleKey, String viewFileName, DelegatedController controller, javax.servlet.http.HttpServletRequest request)
Adds a main tab to the panel navigation.void
configurePanel()
must be implemented by the panel developer to configure the panel (f.e.List<PanelButton>
getButtonList()
get the current panelbuttons for this panel as a list.PanelButton[]
getButtons()
get the current panelbuttons for this panel.ComponentDefinition
getComponentDefinition()
WmEditView
getEditView()
Returns the default EditView of the Panel.WmEditView
getEditViewByValue(String value)
Returns the EditView identified by the given value.String
getNestedPath()
The nested path to be used by Spring to bind the form backing object relative to the base object.javax.jcr.Node
getNode()
get the JCR rootnode form this panel.PanelTabFBO
getPanelViewCommandForSelectedTab()
- gets the panelViewCommand for the selected tab.PanelTabset
getTabset()
gets the root tabset for this panel.String
getTitleMessageKey()
get the resourcebundle ket for the panel title message.String
getUUID()
UUID of the form backing objectjavax.jcr.Node
getWebContainerNode()
get the JCR Web rootnode form this panel.boolean
getWizardType()
get the wizardType value.void
initialStart(javax.servlet.http.HttpServletRequest request)
method is called when the panel is initialy started f.e.void
onBind(javax.servlet.http.HttpServletRequest request, Object command, org.springframework.validation.BindException errors)
Delegates onBind to all registered components.void
onBindAndValidate(javax.servlet.http.HttpServletRequest request, Object command, org.springframework.validation.BindException errors)
Delegates onBindAndValidate to all registered components.void
onSubmit(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object command, org.springframework.validation.BindException errors, org.springframework.web.servlet.ModelAndView modelAndView)
Delegates onSubmit to all registered components.void
postNodeInjection(javax.jcr.Node node)
empty method to be overwritten by the panel developer for to implement default handling after node injection.void
postWebContainerNodeInjection(javax.jcr.Node node)
empty method to be overwritten by the panel developer for to implement default handling after node injection.javax.jcr.Node
preNodeInjection(javax.jcr.Node node)
empty method to be overwritten.javax.jcr.Node
preWebContainerNodeInjection(javax.jcr.Node node)
empty method to be overwritten.Map
referenceData(javax.servlet.http.HttpServletRequest request, Object command, org.springframework.validation.Errors errors)
Delegates referenceData to all registered components.void
setActivePanelViewCommand(PanelTabFBO panelViewCommand)
- injects the rootnode in the panelViewCommand.void
setButtons(PanelButton[] panelButtons)
set the panel buttons for this panel.void
setComponentDefinition(ComponentDefinition compDef)
Sets the component definitionvoid
setEditViews(WmEditView[] editViews)
editview are managed by the panelBase default implementtion by CmsItem (FormBindableBase) fully disabled therefor thei metod is overwritten with an empty implementationvoid
setNode(javax.jcr.Node node)
overwrites the Panel.setNode method to allow the panel developer to implenment pre- and post-node injection methods.void
setPanelMainView(String panelMainView)
Sets the default editview for the panel (if not set the defulat is panel.jsp).void
setPanelViewCommand(String viewFileName, DelegatedController controller, javax.servlet.http.HttpServletRequest request)
Set the panel view and command for a panel that holds no tabs (convenience method, adding a single tab has the same result).void
setPrivateSession(CmsItemPrivateSession cmsItemPrivateSession)
extends the default setPrivateSession() from CmsItemBase.java.void
setSelectedTabById(String selectedTabId)
sets the selected tab by its Id.void
setTabset(PanelTabset panelTabset)
Sets and registrates the root tabset for this panel.void
setTitleMessageKey(String titleMessageKey)
set the resourcebundle ket for the panel title message.void
setWebContainerNode(javax.jcr.Node node)
overwrites the Panel.setWebContainerNode method to allow the panel developer to implenment pre- and post-node injection methods.void
setWizardType(boolean wizardType)
String
toString()
-
Methods inherited from class nl.gx.webmanager.cms.core.implementation.CmsItemBase
getComponent, getComponentFileId, getComponentId, getLanguageResourceMessage, getLanguageResourceMessage, getPrivateSession, getStaticResourceDir, setComponent
-
Methods inherited from class nl.gx.webmanager.springmvc.FormBindableBase
addDisallowedField, addEditView, addValidator, formBackingObject, getControllerDelegationMap, getDelegatedController, getParentController, getResourceBaseNames, getValidators, initBinder, initialize, setDelegatedController, setParentController, setValidators, showForm
-
-
-
-
Method Detail
-
getUUID
public String getUUID()
Description copied from interface:FormBackingObject
UUID of the form backing object- Specified by:
getUUID
in interfaceFormBackingObject
- Returns:
- The UUID of the form backing object
-
configurePanel
public void configurePanel()
must be implemented by the panel developer to configure the panel (f.e. .jsp and tabs).
-
initialStart
public void initialStart(javax.servlet.http.HttpServletRequest request)
method is called when the panel is initialy started f.e. from the menu. override this method when f.e. one time initialisation for the whole panel or httpSsession preparation is required.- Parameters:
request
- HttpServletRequest
-
setPanelViewCommand
public void setPanelViewCommand(String viewFileName, DelegatedController controller, javax.servlet.http.HttpServletRequest request)
Set the panel view and command for a panel that holds no tabs (convenience method, adding a single tab has the same result).- Parameters:
viewFileName
- viewFileName (.jspf file)panelViewCommandClass
- to in instantiated when this tab is opened used as commandobject
-
addTab
public PanelTab addTab(String tabId, String titleKey, String viewFileName, DelegatedController controller, javax.servlet.http.HttpServletRequest request)
Adds a main tab to the panel navigation.- Parameters:
tabId
- unique tabId within this paneltitleKey
- resourcebundle key for the tab title, not shown if emptyviewFileName
- view file form this tab, may be null in the tab holds only subtabspanelViewCommandClass
- command class for this tab, may be null in the tab holds only subtabs if this is a maintab that holds only subtabs which operates as differant views on the same command, set this command here.- Returns:
- PanelTab the added panelTab for adding Sub Tabs ( level 2) if required null in case of configuration exceptions
-
addTab
public PanelTab addTab(String tabId, String titleKey, String titleImage, String viewFileName, DelegatedController controller, String presentationName, javax.servlet.http.HttpServletRequest request)
Adds a main tab to the panel navigation.- Parameters:
tabId
- unique tabId within this paneltitleKey
- resourcebundle key for the tab title, not shown if emptytitleImage
- image shown as title, not shown if emptyviewFileName
- view file form this tab, may be null in the tab holds only subtabspanelViewCommandClass
- command class for this tab, may be null in the tab holds only subtabs if this is a maintab that holds only subtabs which operates as differant views on the same command, set this command here.presentationName
- may be either PanelTabset.LEVEL1_HORIZONTAL, PanelTabset.LEVEL1_VERTICAL, PanelTabset.LEVEL2_HORIZONTAL, PanelTabset.LEVEL2_VERTICAL or null if the presentationName should not changed or the default should be set in case none is set.- Returns:
- PanelTab the added panelTab for adding Sub Tabs ( level 2) if required null in case of configuration exceptions
-
getNode
public javax.jcr.Node getNode()
get the JCR rootnode form this panel.- Returns:
- node JCR rootnode for this panel
-
setNode
public final void setNode(javax.jcr.Node node)
overwrites the Panel.setNode method to allow the panel developer to implenment pre- and post-node injection methods.- Parameters:
node
- Jct Rootnode for this panel
-
preNodeInjection
public javax.jcr.Node preNodeInjection(javax.jcr.Node node)
empty method to be overwritten. if the default JCR node for this panel, must be differant than the default injected by the framework.- Parameters:
node
- default JCR rootnode provided by the framework- Returns:
- node new default JCR node for this panel
-
postNodeInjection
public void postNodeInjection(javax.jcr.Node node)
empty method to be overwritten by the panel developer for to implement default handling after node injection.- Parameters:
node
- node
-
getWebContainerNode
public javax.jcr.Node getWebContainerNode()
get the JCR Web rootnode form this panel.- Returns:
- node Web JCR rootnode for this panel
-
setWebContainerNode
public final void setWebContainerNode(javax.jcr.Node node)
overwrites the Panel.setWebContainerNode method to allow the panel developer to implenment pre- and post-node injection methods.- Parameters:
node
- Jct Rootnode for this panel
-
preWebContainerNodeInjection
public javax.jcr.Node preWebContainerNodeInjection(javax.jcr.Node node)
empty method to be overwritten. if the default JCR node for this panel, must be differant than the default injected by the framework.- Parameters:
node
- default JCR Web rootnode provided by the framework- Returns:
- node new default JCR Web node for this panel
-
postWebContainerNodeInjection
public void postWebContainerNodeInjection(javax.jcr.Node node)
empty method to be overwritten by the panel developer for to implement default handling after node injection.- Parameters:
node
- node
-
setComponentDefinition
public void setComponentDefinition(ComponentDefinition compDef)
Sets the component definition- Parameters:
compDef
-
-
getComponentDefinition
public ComponentDefinition getComponentDefinition()
-
addComponent
public void addComponent(DelegatedController components)
adds a formbindable component to this panel so the bindable methods are autonmaticaly deligated to that component by the panel.- Parameters:
components
- formbindable components on this panel
-
setTabset
public void setTabset(PanelTabset panelTabset)
Sets and registrates the root tabset for this panel. An panel always has a root tabset. In case a tabset halds a single tab, it is shown as a single page (no tab leaves)- Parameters:
panelTabset
- panelTabset
-
getTabset
public PanelTabset getTabset()
gets the root tabset for this panel. An panel always as a root tabset. In case a tabset halds a single tab, it is shown as a single page (no tab leaves)- Returns:
- PanelTabset tabset for this panel
-
setSelectedTabById
public void setSelectedTabById(String selectedTabId)
sets the selected tab by its Id.- Parameters:
selectedTabId
- selectedTabId
-
setActivePanelViewCommand
public void setActivePanelViewCommand(PanelTabFBO panelViewCommand)
- injects the rootnode in the panelViewCommand. - registers the formbindable component(s) on the panel.- Parameters:
panelViewCommand
- the panelViewCommand to activate
-
getPanelViewCommandForSelectedTab
public PanelTabFBO getPanelViewCommandForSelectedTab()
- gets the panelViewCommand for the selected tab. if the selectedTabId doesn't exist the first tab of the tabset is assumed to be selected - setActivePanelViewCommand() must be performed to bind this panelViewCommand.- Returns:
- PanelViewCommand
-
setPanelMainView
public void setPanelMainView(String panelMainView)
Sets the default editview for the panel (if not set the defulat is panel.jsp). In principle noet needed anymore.Overwrite the default webmanager panel.jsp by creating your own panel.jsp in your component resource jsp directory- Parameters:
panelMainView
- main vies for this panel (default panal)
-
getEditView
public WmEditView getEditView()
Returns the default EditView of the Panel. Prefixed by the componentId.- Specified by:
getEditView
in interfaceDelegatedController
- Overrides:
getEditView
in classFormBindableBase
- Returns:
- the default EditView of the Panel.
-
getEditViewByValue
public WmEditView getEditViewByValue(String value)
Returns the EditView identified by the given value.- Specified by:
getEditViewByValue
in interfaceDelegatedController
- Overrides:
getEditViewByValue
in classFormBindableBase
- Parameters:
value
- editviewname- Returns:
- the EditView identified by the given value.
-
setEditViews
public void setEditViews(WmEditView[] editViews)
editview are managed by the panelBase default implementtion by CmsItem (FormBindableBase) fully disabled therefor thei metod is overwritten with an empty implementation- Overrides:
setEditViews
in classFormBindableBase
- Parameters:
editViews
- EditView[] holding the editViews for this component
-
getButtonList
public List<PanelButton> getButtonList()
get the current panelbuttons for this panel as a list.- Returns:
- list of panelButtons
- See Also:
getButtons()
-
getButtons
public PanelButton[] getButtons()
get the current panelbuttons for this panel. if not set explisit, default values are returned. Default for normal panel is : APPLY, OK default form wizard (first page), CLOSE, PREVIOUS (disabled), NEXT (middle page), CLOSE, PREVIOUS , NEXT (last page), CLOSE, PREVIOUS , OK- Returns:
- panelButtons
-
setButtons
public void setButtons(PanelButton[] panelButtons)
set the panel buttons for this panel.- Parameters:
panelButtons
- panelButtons
-
setWizardType
public void setWizardType(boolean wizardType)
- Parameters:
wizardType
- wizardType
-
getWizardType
public boolean getWizardType()
get the wizardType value.- Returns:
- wizardType
-
getTitleMessageKey
public String getTitleMessageKey()
get the resourcebundle ket for the panel title message. default set to panel.title- Returns:
- titleMessageKey
-
setTitleMessageKey
public void setTitleMessageKey(String titleMessageKey)
set the resourcebundle ket for the panel title message. default set to panel.title- Parameters:
titleMessageKey
- titleMessageKey
-
setPrivateSession
public void setPrivateSession(CmsItemPrivateSession cmsItemPrivateSession)
extends the default setPrivateSession() from CmsItemBase.java. adds functionality for retrieving the ast selected tab after the super implementation- Overrides:
setPrivateSession
in classnl.gx.webmanager.cms.core.implementation.CmsItemBase
- Parameters:
cmsItemPrivateSession
- cmsItemPrivateSessionImpl instance
-
onBind
public void onBind(javax.servlet.http.HttpServletRequest request, Object command, org.springframework.validation.BindException errors) throws Exception
Delegates onBind to all registered components.- Specified by:
onBind
in interfaceDelegatedController
- Overrides:
onBind
in classFormBindableBase
- Parameters:
request
- current HTTP requestcommand
- the command object, still allowing for further bindingerrors
- validation errors holder, allowing for additional custom validation- Throws:
Exception
- in case of invalid state or arguments
-
onBindAndValidate
public void onBindAndValidate(javax.servlet.http.HttpServletRequest request, Object command, org.springframework.validation.BindException errors) throws Exception
Delegates onBindAndValidate to all registered components.- Specified by:
onBindAndValidate
in interfaceDelegatedController
- Overrides:
onBindAndValidate
in classFormBindableBase
- Parameters:
request
- current HTTP requestcommand
- the command object, still allowing for further bindingerrors
- validation errors holder, allowing for additional custom validation- Throws:
Exception
- in case of invalid state or arguments
-
onSubmit
public void onSubmit(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object command, org.springframework.validation.BindException errors, org.springframework.web.servlet.ModelAndView modelAndView) throws Exception
Delegates onSubmit to all registered components.- Specified by:
onSubmit
in interfaceDelegatedController
- Overrides:
onSubmit
in classFormBindableBase
- Parameters:
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 prepared model and view- Throws:
Exception
- in case of errors
-
referenceData
public Map referenceData(javax.servlet.http.HttpServletRequest request, Object command, org.springframework.validation.Errors errors) throws Exception
Delegates referenceData to all registered components.- Specified by:
referenceData
in interfaceDelegatedController
- Overrides:
referenceData
in classFormBindableBase
- Parameters:
request
- current HTTP requestcommand
- form object with request parameters bound onto iterrors
- validation errors holder- Returns:
- a Map with reference data entries, or
null
if none - Throws:
Exception
- in case of invalid state or arguments- See Also:
ModelAndView
-
getNestedPath
public String getNestedPath()
Description copied from interface:FormBackingObject
The nested path to be used by Spring to bind the form backing object relative to the base object. For example; for elements the nested path will be FBOMap[element.uuid] which is relative to the page version or media item version. For custom metadata in a media item it will be empty.- Specified by:
getNestedPath
in interfaceFormBackingObject
- Returns:
- Nested path to this form backing object used for Spring binding
-
-