org.opencms.workplace.tools
Class CmsToolDialog

java.lang.Object
  extended byorg.opencms.workplace.CmsWorkplace
      extended byorg.opencms.workplace.tools.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
Version:
$Revision: 1.40 $
Author:
Michael Moossen

Field Summary
static java.lang.String PARAM_BASE
          Request parameter name for the base tool path in the navigation, should be a parent tool of path.
static java.lang.String PARAM_PATH
          Request parameter name for the tool path, should be an accessible tool under the given root.
static java.lang.String PARAM_ROOT
          Request parameter name for the root tool path.
static java.lang.String PARAM_STYLE
          Request parameter name for the style type.
static java.lang.String STYLE_NEW
          Request parameter value for the 'new' dialog style.
 
Fields inherited from class org.opencms.workplace.CmsWorkplace
DEBUG, DEFAULT_LANGUAGE, DEFAULT_LOCALE, DIALOG_PATH_COMMON, FILE_DIALOG_CLOSE, FILE_DIALOG_SCREEN_CONFIRM, FILE_DIALOG_SCREEN_ERROR, FILE_DIALOG_SCREEN_ERRORPAGE, FILE_DIALOG_SCREEN_WAIT, FILE_EXPLORER_FILELIST, FILE_REPORT_OUTPUT, HTML_END, HTML_START, PARAM_WP_EXPLORER_RESOURCE, PARAM_WP_PROJECT, PARAM_WP_SITE, PATH_DIALOGS, PATH_WORKPLACE, REQUEST_ATTRIBUTE_MULTIPART, REQUEST_ATTRIBUTE_RELOADTREE, RFS_PATH_RESOURCES, SESSION_WORKPLACE_CLASS, TEMP_FILE_PREFIX, VFS_DIR_DEFAULTBODIES, VFS_DIR_TEMPLATES, VFS_PATH_COMMONS, VFS_PATH_EDITORS, VFS_PATH_GALLERIES, VFS_PATH_LOCALES, VFS_PATH_MODULES, VFS_PATH_RESOURCES, VFS_PATH_SYSTEM, VFS_PATH_VIEWS, VFS_PATH_WORKPLACE
 
Constructor Summary
CmsToolDialog(CmsJspActionElement jsp)
          Default Constructor.
 
Method Summary
 java.lang.String dialogScriptSubmit()
          Builds the standard javascript for submitting the dialog.
 java.lang.String dialogTitle()
          Generates the standard new style dialog title row, and tool grouping.
 CmsTool getAdminTool()
          Returns the admin tool.
 java.lang.String getCurrentToolPath()
          Returns the current tool path.
 java.lang.String getParamBase()
          Returns the value for the base parameter.
 java.lang.String getParamPath()
          Returns the path parameter value.
 java.lang.String getParamRoot()
          Returns the root parameter value.
 java.lang.String getParamStyle()
          Returns the style parameter value.
 java.lang.String getParentPath()
          Returns the path to the parent tool.
 CmsToolManager getToolManager()
          Returns the tool manager.
 java.lang.String iconsBlockArea(int segment, java.lang.String headline)
          Builds an block area for icons.
 java.lang.String iconsBlockAreaEnd()
          Builds the end HTML for a block area with border in the dialog content area.
 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.
 java.util.Map initAdminTool()
          Initializes the admin tool main view.
protected  void initWorkplaceRequestValues(CmsWorkplaceSettings settings, javax.servlet.http.HttpServletRequest request)
          Analyzes the request for workplace parameters and adjusts the workplace settings accordingly.
 java.lang.String pageBody(int segment, java.lang.String className, java.lang.String parameters)
          Builds the html of the body.
 java.lang.String pageHtmlStyle(int segment, java.lang.String title, java.lang.String stylesheet)
          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.
 void setParamBase(java.lang.String paramBase)
          Sets the value of the base parameter.
 void setParamPath(java.lang.String paramPath)
          Sets the path parameter value.
 void setParamRoot(java.lang.String paramRoot)
          Sets the root parameter value.
 void setParamStyle(java.lang.String paramStyle)
          Sets the style parameter value.
 boolean useNewStyle()
          Tests if we are working with the new administration dialog style.
 
Methods inherited from class org.opencms.workplace.CmsWorkplace
addMessages, addMessages, allParamsAsHidden, allParamsAsRequest, allParamValues, bodyEnd, bodyStart, bodyStart, buildSelect, buildSelect, button, button, buttonBar, buttonBar, buttonBarHorizontalLine, buttonBarLabel, buttonBarLabel, buttonBarLine, buttonBarLineSpacer, buttonBarSeparator, buttonBarSpacer, buttonBarStartTab, checkLock, checkLock, checkRole, decodeParamValue, fillParamValues, fillParamValues, getBroadcastMessageString, getCms, getEncoding, getExplorerFileListFullUri, getFrameSource, getJsp, getLocale, getMacroResolver, getMessages, getMultiPartFileItems, getParameterMap, getResourceUri, getResourceUri, getSession, getSettings, getSkinUri, getStyleUri, getStyleUri, getStyleUri, getTemporaryFileName, htmlEnd, htmlStart, initMessages, initSettings, initTimeWarp, initUserSettings, initWorkplaceMembers, initWorkplaceSettings, isForwarded, isHelpEnabled, isSubElement, isTemporaryFile, isTemporaryFileName, key, key, keyDefault, nullToEmpty, pageHtml, paramsAsHidden, paramsAsHidden, paramsAsParameterMap, paramsAsRequest, paramValues, resolveMacros, sendCmsRedirect, sendForward, setForwarded, shortKey, switchToCurrentProject, switchToTempProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_BASE

public static final java.lang.String PARAM_BASE
Request parameter name for the base tool path in the navigation, should be a parent tool of path.

See Also:
Constant Field Values

PARAM_PATH

public static final java.lang.String PARAM_PATH
Request parameter name for the tool path, should be an accessible tool under the given root.

See Also:
Constant Field Values

PARAM_ROOT

public static final java.lang.String PARAM_ROOT
Request parameter name for the root tool path.

See Also:
Constant Field Values

PARAM_STYLE

public static final java.lang.String PARAM_STYLE
Request parameter name for the style type.

See Also:
Constant Field Values

STYLE_NEW

public static final java.lang.String STYLE_NEW
Request parameter value for the 'new' dialog style.

See Also:
Constant Field Values
Constructor Detail

CmsToolDialog

public CmsToolDialog(CmsJspActionElement jsp)
Default Constructor.

Parameters:
jsp - the jsp action element
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

getAdminTool

public CmsTool getAdminTool()
Returns the admin tool.

Returns:
the admin tool

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

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

getToolManager

public CmsToolManager getToolManager()
Returns the tool manager.

Returns:
the tool manager

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)

iconsBlockAreaEnd

public java.lang.String iconsBlockAreaEnd()
Builds the end HTML for a block area with border in the dialog content area.

Returns:
block area end segment
See Also:
CmsDialog.dialogBlockEnd()

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 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

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

initWorkplaceRequestValues

protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings,
                                          javax.servlet.http.HttpServletRequest request)
Description copied from class: CmsWorkplace
Analyzes the request for workplace parameters and adjusts the workplace settings accordingly.

Specified by:
initWorkplaceRequestValues in class CmsWorkplace
Parameters:
settings - the workplace settings
request - the current request
See Also:
CmsWorkplace.initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)