org.opencms.workplace.tools
Class CmsToolDialog

java.lang.Object
  extended by org.opencms.workplace.CmsWorkplace
      extended by org.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.32 $
Author:
Michael Moossen

Field Summary
static String PARAM_PATH
          Request parameter name for the tool path.
static String PARAM_ROOT
          Request parameter name for the root tool path.
static String PARAM_STYLE
          Request parameter name for the style type.
static 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
 String dialogScriptSubmit()
          Builds the standard javascript for submitting the dialog.
 String dialogTitle()
          Generates the standard new style dialog title row, and tool grouping.
 CmsTool getAdminTool()
          Returns the admin tool.
 String getCurrentToolPath()
          Returns the current tool path.
 String getParamPath()
          Returns the path parameter value.
 String getParamRoot()
          Returns the root parameter value.
 String getParamStyle()
          Returns the style parameter value.
 String getParentPath()
          Returns the path to the parent tool.
 CmsToolManager getToolManager()
          Returns the tool manager.
 String iconsBlockArea(int segment, String headline)
          Builds an block area for icons.
 String iconsBlockAreaEnd()
          Builds the end HTML for a block area with border in the dialog content area.
 String iconsBlockAreaStart(String headline)
          Builds the start HTML for a block area with border and optional subheadline in the dialog content area.
 Map initAdminTool()
          Initializes the admin tool main view.
protected  void initWorkplaceRequestValues(CmsWorkplaceSettings settings, HttpServletRequest request)
          Analyzes the request for workplace parameters and adjusts the workplace settings accordingly.
 String pageBody(int segment, String className, String parameters)
          Builds the html of the body.
 String pageHtmlStyle(int segment, String title, 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 setParamPath(String paramPath)
          Sets the path parameter value.
 void setParamRoot(String paramRoot)
          Sets the root parameter value.
 void setParamStyle(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, allParamsAsHidden, allParamsAsRequest, allParamValues, bodyEnd, bodyStart, bodyStart, buildSelect, buildSelect, button, button, buttonBar, buttonBar, buttonBarHorizontalLine, buttonBarLabel, buttonBarLabel, buttonBarLine, buttonBarLineSpacer, buttonBarSeparator, buttonBarSpacer, buttonBarStartTab, calendarIncludes, calendarIncludes, calendarInit, calendarInit, checkLock, checkLock, decodeParamValue, fillParamValues, fillParamValues, getBroadcastMessageString, getCalendarDate, getCalendarJavaDateFormat, getCalendarLocalizedTime, getCms, getEncoding, getExplorerFileListFullUri, getFrameSource, getJsp, getLocale, getMacroResolver, getMessages, getMultiPartFileItems, getParameterMap, getResourceUri, getResourceUri, getSession, getSettings, getSkinUri, getStyleUri, getStyleUri, getStyleUri, htmlEnd, htmlStart, initMessages, initSettings, initUserSettings, initWorkplaceMembers, initWorkplaceSettings, isForwarded, isHelpEnabled, isSubElement, key, key, key, 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_PATH

public static final String PARAM_PATH
Request parameter name for the tool path.

See Also:
Constant Field Values

PARAM_ROOT

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

See Also:
Constant Field Values

PARAM_STYLE

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

See Also:
Constant Field Values

STYLE_NEW

public static final 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 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 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 String getCurrentToolPath()
Returns the current tool path.

Returns:
the current tool path

getParamPath

public String getParamPath()
Returns the path parameter value.

Returns:
the path parameter value

getParamRoot

public String getParamRoot()
Returns the root parameter value.

Returns:
the root parameter value

getParamStyle

public String getParamStyle()
Returns the style parameter value.

Returns:
the style parameter value

getParentPath

public 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 String iconsBlockArea(int segment,
                             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 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 String iconsBlockAreaStart(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 Map initAdminTool()
Initializes the admin tool main view.

Returns:
the new modified params array

pageBody

public String pageBody(int segment,
                       String className,
                       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 String pageHtmlStyle(int segment,
                            String title,
                            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)

setParamPath

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

Parameters:
paramPath - the path parameter value to set

setParamRoot

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

Parameters:
paramRoot - the root parameter value to set

setParamStyle

public void setParamStyle(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 param is not intented for external use.

Returns:
true if using the new style

initWorkplaceRequestValues

protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings,
                                          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)