Class CmsToolDialog

  • Direct Known Subclasses:
    CmsDialog

    public class CmsToolDialog
    extends CmsWorkplace
    Helper class that encapsulates all the code for the "new" style of the administration dialogs.

    Since:
    6.0.0
    • Method Detail

      • dialogScriptSubmit

        public java.lang.String dialogScriptSubmit()
        Builds the standard javascript for submitting the dialog.

        Should only be used by the CmsDialog.dialogScriptSubmit() method.

        Returns:
        the standard javascript for submitting the dialog
      • dialogTitle

        public java.lang.String dialogTitle()
        Generates the standard new style dialog title row, and tool grouping.

        It is called by the CmsDialog.dialog(int, String) method.

        Returns:
        a dialog window start / end segment
      • getCurrentToolPath

        public java.lang.String getCurrentToolPath()
        Returns the current tool path.

        Returns:
        the current tool path
      • getParamBase

        public java.lang.String getParamBase()
        Returns the value for the base parameter.

        Returns:
        the value for the base parameter
      • getParamForce

        public java.lang.String getParamForce()
        Returns the value for the force parameter.

        Returns:
        the value for the force parameter
      • getParamPath

        public java.lang.String getParamPath()
        Returns the path parameter value.

        Returns:
        the path parameter value
      • getParamRoot

        public java.lang.String getParamRoot()
        Returns the root parameter value.

        Returns:
        the root parameter value
      • getParamStyle

        public java.lang.String getParamStyle()
        Returns the style parameter value.

        Returns:
        the style parameter value
      • getParentPath

        public java.lang.String getParentPath()
        Returns the path to the parent tool.

        Returns:
        tha path to the parent tool
      • iconsBlockArea

        public java.lang.String iconsBlockArea​(int segment,
                                               java.lang.String headline)
        Builds an block area for icons.

        Parameters:
        segment - the HTML segment (START / END)
        headline - the headline String for the block
        Returns:
        block area start / end segment
        See Also:
        CmsDialog.dialogBlock(int, String, boolean)
      • iconsBlockAreaStart

        public java.lang.String iconsBlockAreaStart​(java.lang.String headline)
        Builds the start HTML for a block area with border and optional subheadline in the dialog content area.

        Parameters:
        headline - the headline String for the block
        Returns:
        block area start segment
        See Also:
        CmsDialog.dialogBlockStart(String)
      • initAdminTool

        public java.util.Map<java.lang.String,​java.lang.String[]> initAdminTool()
                                                                               throws CmsRoleViolationException
        Initializes the admin tool main view.

        Returns:
        the new modified parameters array
        Throws:
        CmsRoleViolationException - in case the dialog is opened by a user without the necessary privileges
      • pageBody

        public java.lang.String pageBody​(int segment,
                                         java.lang.String className,
                                         java.lang.String parameters)
        Description copied from class: CmsWorkplace
        Builds the html of the body.

        Overrides:
        pageBody in class CmsWorkplace
        Parameters:
        segment - the HTML segment (START / END)
        className - optional class attribute to add to the body tag
        parameters - optional parameters to add to the body tag
        Returns:
        the html of the body
        See Also:
        CmsWorkplace.pageBody(int, java.lang.String, java.lang.String)
      • pageHtmlStyle

        public java.lang.String pageHtmlStyle​(int segment,
                                              java.lang.String title,
                                              java.lang.String stylesheet)
        Description copied from class: CmsWorkplace
        Returns the default html for a workplace page, including setting of DOCTYPE and inserting a header with the content-type, allowing the selection of an individual style sheet.

        Overrides:
        pageHtmlStyle in class CmsWorkplace
        Parameters:
        segment - the HTML segment (START / END)
        title - the title of the page, if null no title tag is inserted
        stylesheet - the used style sheet, if null the default stylesheet 'workplace.css' is inserted
        Returns:
        the default html for a workplace page
        See Also:
        CmsWorkplace.pageHtmlStyle(int, java.lang.String, java.lang.String)
      • setParamBase

        public void setParamBase​(java.lang.String paramBase)
        Sets the value of the base parameter.

        Parameters:
        paramBase - the value of the base parameter to set
      • setParamForce

        public void setParamForce​(java.lang.String paramForce)
        Sets the value of the force parameter.

        Parameters:
        paramForce - the value of the force parameter to set
      • setParamPath

        public void setParamPath​(java.lang.String paramPath)
        Sets the path parameter value.

        Parameters:
        paramPath - the path parameter value to set
      • setParamRoot

        public void setParamRoot​(java.lang.String paramRoot)
        Sets the root parameter value.

        Parameters:
        paramRoot - the root parameter value to set
      • setParamStyle

        public void setParamStyle​(java.lang.String paramStyle)
        Sets the style parameter value.

        Parameters:
        paramStyle - the style parameter value to set
      • useNewStyle

        public boolean useNewStyle()
        Tests if we are working with the new administration dialog style.

        The default is the new style, this parameter is not intended for external use.

        Returns:
        true if using the new style
      • computeUpLevelLink

        protected java.lang.String computeUpLevelLink()
        Creates the link for the 'up' button.

        Returns:
        the link for the 'up' button