nl.gx.webmanager.springmvc.panel
Class PanelBase

java.lang.Object
  extended by nl.gx.webmanager.springmvc.FormBindableBase
      extended by nl.gx.webmanager.cms.core.implementation.CmsItemBase
          extended by nl.gx.webmanager.springmvc.panel.PanelBase
All Implemented Interfaces:
DelegatedController, DelegatedControllerAware, FormBackingObject
Direct Known Subclasses:
AuthorizationMaintenancePanel, TreeActionPanel

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
PanelBase()
          default constructor.
 
Method Summary
 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(java.lang.String tabId, java.lang.String titleKey, java.lang.String viewFileName, DelegatedController controller, javax.servlet.http.HttpServletRequest request)
          Adds a main tab to the panel navigation.
 PanelTab addTab(java.lang.String tabId, java.lang.String titleKey, java.lang.String titleImage, java.lang.String viewFileName, DelegatedController controller, java.lang.String presentationName, 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.
 java.util.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(java.lang.String value)
          Returns the EditView identified by the given value.
 java.lang.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.
 java.lang.String getTitleMessageKey()
          get the resourcebundle ket for the panel title message.
 java.lang.String getUUID()
          UUID of the form backing object
 javax.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, java.lang.Object command, org.springframework.validation.BindException errors)
          Delegates onBind to all registered components.
 void onBindAndValidate(javax.servlet.http.HttpServletRequest request, java.lang.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, java.lang.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.
 java.util.Map referenceData(javax.servlet.http.HttpServletRequest request, java.lang.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 definition
 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
 void 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(java.lang.String panelMainView)
          Sets the default editview for the panel (if not set the defulat is panel.jsp).
 void setPanelViewCommand(java.lang.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(java.lang.String selectedTabId)
          sets the selected tab by its Id.
 void setTabset(PanelTabset panelTabset)
          Sets and registrates the root tabset for this panel.
 void setTitleMessageKey(java.lang.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)
           
 java.lang.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PanelBase

public PanelBase()
default constructor.

Method Detail

getUUID

public java.lang.String getUUID()
Description copied from interface: FormBackingObject
UUID of the form backing object

Specified by:
getUUID in interface FormBackingObject
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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
panelname as String

setPanelViewCommand

public void setPanelViewCommand(java.lang.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(java.lang.String tabId,
                       java.lang.String titleKey,
                       java.lang.String viewFileName,
                       DelegatedController controller,
                       javax.servlet.http.HttpServletRequest request)
Adds a main tab to the panel navigation.

Parameters:
tabId - unique tabId within this panel
titleKey - resourcebundle key for the tab title, not shown if empty
viewFileName - view file form this tab, may be null in the tab holds only subtabs
panelViewCommandClass - 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(java.lang.String tabId,
                       java.lang.String titleKey,
                       java.lang.String titleImage,
                       java.lang.String viewFileName,
                       DelegatedController controller,
                       java.lang.String presentationName,
                       javax.servlet.http.HttpServletRequest request)
Adds a main tab to the panel navigation.

Parameters:
tabId - unique tabId within this panel
titleKey - resourcebundle key for the tab title, not shown if empty
titleImage - image shown as title, not shown if empty
viewFileName - view file form this tab, may be null in the tab holds only subtabs
panelViewCommandClass - 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(java.lang.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(java.lang.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 interface DelegatedController
Overrides:
getEditView in class FormBindableBase
Returns:
the default EditView of the Panel.

getEditViewByValue

public WmEditView getEditViewByValue(java.lang.String value)
Returns the EditView identified by the given value.

Specified by:
getEditViewByValue in interface DelegatedController
Overrides:
getEditViewByValue in class FormBindableBase
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 class FormBindableBase
Parameters:
editViews - EditView[] holding the editViews for this component

getButtonList

public java.util.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 java.lang.String getTitleMessageKey()
get the resourcebundle ket for the panel title message. default set to panel.title

Returns:
titleMessageKey

setTitleMessageKey

public void setTitleMessageKey(java.lang.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 class nl.gx.webmanager.cms.core.implementation.CmsItemBase
Parameters:
cmsItemPrivateSession - cmsItemPrivateSessionImpl instance

onBind

public void onBind(javax.servlet.http.HttpServletRequest request,
                   java.lang.Object command,
                   org.springframework.validation.BindException errors)
            throws java.lang.Exception
Delegates onBind to all registered components.

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

onBindAndValidate

public void onBindAndValidate(javax.servlet.http.HttpServletRequest request,
                              java.lang.Object command,
                              org.springframework.validation.BindException errors)
                       throws java.lang.Exception
Delegates onBindAndValidate to all registered components.

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

onSubmit

public 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
Delegates onSubmit to all registered components.

Specified by:
onSubmit in interface DelegatedController
Overrides:
onSubmit in class FormBindableBase
Parameters:
request - current servlet request
response - current servlet response
command - form object with request parameters bound onto it
errors - Errors instance without errors (subclass can add errors if it wants to)
modelAndView - The prepared model and view
Throws:
java.lang.Exception - in case of errors

referenceData

public java.util.Map referenceData(javax.servlet.http.HttpServletRequest request,
                                   java.lang.Object command,
                                   org.springframework.validation.Errors errors)
                            throws java.lang.Exception
Delegates referenceData to all registered components.

Specified by:
referenceData in interface DelegatedController
Overrides:
referenceData in class FormBindableBase
Parameters:
request - current HTTP request
command - form object with request parameters bound onto it
errors - validation 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

getNestedPath

public java.lang.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 interface FormBackingObject
Returns:
Nested path to this form backing object used for Spring binding


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