Class PanelBase

    • Constructor Detail

      • PanelBase

        public PanelBase()
        default constructor.
    • Method Detail

      • 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 String toString()
        Overrides:
        toString in class Object
        Returns:
        panelname as String
      • 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 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​(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 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 -
      • 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)
      • 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 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 class nl.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 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:
        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 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:
        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 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:
        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 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:
        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 interface FormBackingObject
        Returns:
        Nested path to this form backing object used for Spring binding