org.opencms.workplace.help
Class CmsHelpTemplateBean

java.lang.Object
  extended by org.opencms.workplace.CmsWorkplace
      extended by org.opencms.workplace.tools.CmsToolDialog
          extended by org.opencms.workplace.CmsDialog
              extended by org.opencms.workplace.help.CmsHelpTemplateBean

public class CmsHelpTemplateBean
extends CmsDialog

The bean that provides methods to build the HTML for the single online help frames.

Things to know

Since:
6.0.0
Version:
$Revision: 1.28 $
Author:
Andreas Zahner, Achim Westermann

Field Summary
static java.lang.String DEFAULT_HELPFILE
          File name of the default help file to load.
static java.lang.String HELPMAPPINGS_FILENAME
          File name of the help mappings properties file(s).
static java.lang.String MODULE_NAME
          The name of the help module.
static java.lang.String PARAM_BUILDFRAME
          Request parameter name for the buildframe flag parameter.
static java.lang.String PARAM_HELPRESOURCE
          Request parameter name for the helpresource uri.
static java.lang.String PARAM_HOMELINK
          Request parameter name for the homelink in head frame.
static java.lang.String PARAM_WORKPLACERESOURCE
          Request parameter name for the workplaceresource uri.
static java.lang.String PATH_HELP
          VFS path to the help folder, contains a macro for the Locale which has to be resolved.
static java.lang.String PROPERTY_VALUE_HELPSTART
          Value of the NavInfo property indicating the start folder of the help.
static java.lang.String RFS_HELPMAPPINGS
          Relative RFS path of the help mappings property file(s).
static java.lang.String TEMPLATEPATH
          Absolute path to used JSP templates.
 
Fields inherited from class org.opencms.workplace.CmsDialog
ACTION_CANCEL, ACTION_CLOSEPOPUP, ACTION_CLOSEPOPUP_SAVE, ACTION_CONFIRMED, ACTION_CONTINUE, ACTION_DEFAULT, ACTION_LOCKS_CONFIRMED, ACTION_OK, ACTION_REPORT_BEGIN, ACTION_REPORT_END, ACTION_REPORT_UPDATE, ACTION_SET, ACTION_WAIT, ATTRIBUTE_THROWABLE, BUTTON_ADVANCED, BUTTON_BACK, BUTTON_CANCEL, BUTTON_CLOSE, BUTTON_CONTINUE, BUTTON_DETAILS, BUTTON_DISCARD, BUTTON_EDIT, BUTTON_OK, BUTTON_OK_NO_SUBMIT, BUTTON_SET, DIALOG_BACK, DIALOG_CANCEL, DIALOG_CONFIRMED, DIALOG_CONTINUE, DIALOG_INITIAL, DIALOG_LOCKS_CONFIRMED, DIALOG_OK, DIALOG_SET, DIALOG_WAIT, PARAM_ACTION, PARAM_CLOSELINK, PARAM_DIALOGTYPE, PARAM_ERRORSTACK, PARAM_FILE, PARAM_FRAMENAME, PARAM_ISPOPUP, PARAM_LOCK, PARAM_MESSAGE, PARAM_ORIGINALPARAMS, PARAM_PREACTIONDONE, PARAM_REDIRECT, PARAM_RESOURCE, PARAM_TARGET, PARAM_THREAD, PARAM_THREAD_HASNEXT, PARAM_TITLE, REPORT_BEGIN, REPORT_END, REPORT_UPDATE
 
Fields inherited from class org.opencms.workplace.tools.CmsToolDialog
PARAM_BASE, PARAM_FORCE, PARAM_PATH, PARAM_ROOT, PARAM_STYLE, STYLE_NEW
 
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
CmsHelpTemplateBean(CmsJspActionElement jsp)
          Public constructor with JSP action element.
CmsHelpTemplateBean(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Public constructor with JSP variables.
 
Method Summary
 java.lang.String buildHtmlHelpEnd()
          Returns the HTML for the end of the page.
protected  java.lang.String buildHtmlHelpNavigation()
          Returns the HTML to build the navigation of the online help folder.
 java.lang.String buildHtmlHelpStart(java.lang.String cssFile, boolean transitional)
          Returns the HTML for the start of the page.
static java.lang.String buildOnlineHelpJavaScript(java.util.Locale locale)
          Returns the java script method to open the online help popup window.
protected  void checkRole()
          Checks that the current user is a workplace user.
 java.lang.String displayBody()
          Returns the HTML for the body frame of the online help.
protected  java.lang.String displayFrameset()
          Returns the HTML to build the frameset for the online help popup window.
 java.lang.String displayHead()
          Returns the HTML for the head frame of the online help.
 java.lang.String displayHelp()
          Generates the HTML for the online help frameset or redirects to the help body, depending on the build frameset flag.
protected  void getMappedHelpUri()
          Determines the mapped help page for a given workplace resource URI.
 java.lang.String getParamBuildframe()
          Returns the buildframe parameter indicating if the frameset should be generated.
 java.lang.String getParamHelpresource()
          Returns the helpresource parameter value.
 java.lang.String getParamHomelink()
          Returns the homelink parameter value.
 java.lang.String getParamWorkplaceresource()
          Returns the workplaceresource parameter value.
protected  void initWorkplaceRequestValues(CmsWorkplaceSettings settings, javax.servlet.http.HttpServletRequest request)
          Analyzes the request for workplace parameters and adjusts the workplace settings accordingly.
protected  boolean isBuildFrameset()
          Returns true if the online help frameset has to be generated.
 void setParamBuildframe(java.lang.String buildframe)
          Sets the buildframe parameter indicating if the frameset should be generated.
 void setParamHelpresource(java.lang.String helpresource)
          Sets the helpresource parameter value.
 void setParamHomelink(java.lang.String homelink)
          Sets the homelink parameter value.
 void setParamWorkplaceresource(java.lang.String workplaceresource)
          Sets the workplaceresource parameter value.
 
Methods inherited from class org.opencms.workplace.CmsDialog
actionCloseDialog, appendDelimiter, buildAjaxResultContainer, buildAjaxWaitMessage, buildLockAdditionalOptions, buildLockConfirmationMessageJS, buildLockDialog, buildLockDialog, buildLockHeaderBox, checkResourcePermissions, checkResourcePermissions, computeCurrentFolder, dialog, dialogBlock, dialogBlockEnd, dialogBlockStart, dialogButtonRow, dialogButtonRowEnd, dialogButtonRowStart, dialogButtons, dialogButtonsClose, dialogButtonsClose, dialogButtonsCloseDetails, dialogButtonsHtml, dialogButtonsOk, dialogButtonsOk, dialogButtonsOkCancel, dialogButtonsOkCancel, dialogButtonsOkCancelAdvanced, dialogButtonsSetOkCancel, dialogContent, dialogContentEnd, dialogContentStart, dialogEnd, dialogHead, dialogHorizontalSpacer, dialogLockButtons, dialogRow, dialogRowEnd, dialogRowStart, dialogScriptSubmit, dialogSeparator, dialogSpacer, dialogStart, dialogStart, dialogSubheadline, dialogToggleStart, dialogWhiteBox, dialogWhiteBoxEnd, dialogWhiteBoxStart, getAction, getAdministrationBackLink, getCancelAction, getDialogRealUri, getDialogUri, getOnlineHelpUriCustom, getParamAction, getParamCloseLink, getParamDialogtype, getParamFramename, getParamIsPopup, getParamMessage, getParamOriginalParams, getParamPreActionDone, getParamRedirect, getParamResource, getParamTitle, getState, hasCorrectLockstate, hasSiblings, htmlStart, htmlStart, htmlStart, htmlStartStyle, includeErrorpage, initCmsDialog, isPopup, isPreEditor, pageHtml, pageHtml, setAction, setOnlineHelpUriCustom, setParamAction, setParamCloseLink, setParamDialogtype, setParamFramename, setParamIsPopup, setParamMessage, setParamOriginalParams, setParamPreActionDone, setParamRedirect, setParamResource, setParamTitle
 
Methods inherited from class org.opencms.workplace.tools.CmsToolDialog
dialogTitle, getAdminTool, getCurrentToolPath, getParamBase, getParamForce, getParamPath, getParamRoot, getParamStyle, getParentPath, getToolManager, iconsBlockArea, iconsBlockAreaEnd, iconsBlockAreaStart, initAdminTool, pageBody, pageHtmlStyle, setParamBase, setParamForce, setParamPath, setParamRoot, setParamStyle, useNewStyle
 
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, decodeParamValue, fillParamValues, fillParamValues, getBroadcastMessageString, getCms, getEncoding, getExplorerFileListFullUri, getFrameSource, getJsp, getLocale, getMacroResolver, getMessages, getMultiPartFileItems, getParameterMap, getResourceUri, getResourceUri, getSession, getSettings, getSkinUri, getStyleUri, getStyleUri, getStyleUri, getTemporaryFileName, htmlEnd, initMessages, initSettings, initTimeWarp, initUserSettings, initWorkplaceMembers, initWorkplaceSettings, isForwarded, isHelpEnabled, isSubElement, isTemporaryFile, isTemporaryFileName, key, key, keyDefault, nullToEmpty, 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

DEFAULT_HELPFILE

public static final java.lang.String DEFAULT_HELPFILE
File name of the default help file to load.

See Also:
Constant Field Values

HELPMAPPINGS_FILENAME

public static final java.lang.String HELPMAPPINGS_FILENAME
File name of the help mappings properties file(s).

See Also:
Constant Field Values

MODULE_NAME

public static final java.lang.String MODULE_NAME
The name of the help module.

See Also:
Constant Field Values

PARAM_BUILDFRAME

public static final java.lang.String PARAM_BUILDFRAME
Request parameter name for the buildframe flag parameter.

See Also:
Constant Field Values

PARAM_HELPRESOURCE

public static final java.lang.String PARAM_HELPRESOURCE
Request parameter name for the helpresource uri.

See Also:
Constant Field Values

PARAM_HOMELINK

public static final java.lang.String PARAM_HOMELINK
Request parameter name for the homelink in head frame.

See Also:
Constant Field Values

PARAM_WORKPLACERESOURCE

public static final java.lang.String PARAM_WORKPLACERESOURCE
Request parameter name for the workplaceresource uri.

See Also:
Constant Field Values

PATH_HELP

public static final java.lang.String PATH_HELP
VFS path to the help folder, contains a macro for the Locale which has to be resolved.

See Also:
Constant Field Values

PROPERTY_VALUE_HELPSTART

public static final java.lang.String PROPERTY_VALUE_HELPSTART
Value of the NavInfo property indicating the start folder of the help.

See Also:
Constant Field Values

RFS_HELPMAPPINGS

public static final java.lang.String RFS_HELPMAPPINGS
Relative RFS path of the help mappings property file(s).


TEMPLATEPATH

public static final java.lang.String TEMPLATEPATH
Absolute path to used JSP templates.

See Also:
Constant Field Values
Constructor Detail

CmsHelpTemplateBean

public CmsHelpTemplateBean(CmsJspActionElement jsp)
Public constructor with JSP action element.

Parameters:
jsp - an initialized JSP action element

CmsHelpTemplateBean

public CmsHelpTemplateBean(javax.servlet.jsp.PageContext context,
                           javax.servlet.http.HttpServletRequest req,
                           javax.servlet.http.HttpServletResponse res)
Public constructor with JSP variables.

Parameters:
context - the JSP page context
req - the JSP request
res - the JSP response
Method Detail

buildOnlineHelpJavaScript

public static java.lang.String buildOnlineHelpJavaScript(java.util.Locale locale)
Returns the java script method to open the online help popup window.

Parameters:
locale - the current users workplace Locale
Returns:
the java script method to open the online help popup window

buildHtmlHelpEnd

public java.lang.String buildHtmlHelpEnd()
Returns the HTML for the end of the page.

Returns:
the HTML for the end of the page

buildHtmlHelpStart

public java.lang.String buildHtmlHelpStart(java.lang.String cssFile,
                                           boolean transitional)
Returns the HTML for the start of the page.

Parameters:
cssFile - the CSS file name to use
transitional - if true, transitional doctype is used
Returns:
the HTML for the start of the page

displayBody

public java.lang.String displayBody()
Returns the HTML for the body frame of the online help.

Returns:
the HTML for the body frame of the online help

displayHead

public java.lang.String displayHead()
Returns the HTML for the head frame of the online help.

Returns:
the HTML for the head frame of the online help

displayHelp

public java.lang.String displayHelp()
                             throws java.io.IOException
Generates the HTML for the online help frameset or redirects to the help body, depending on the build frameset flag.

Returns:
the HTML for the online help frameset or an empty String (redirect)
Throws:
java.io.IOException - if redirection fails

getParamBuildframe

public java.lang.String getParamBuildframe()
Returns the buildframe parameter indicating if the frameset should be generated.

Returns:
the buildframe parameter indicating if the frameset should be generated

getParamHelpresource

public java.lang.String getParamHelpresource()
Returns the helpresource parameter value.

Returns:
the helpresource parameter value

getParamHomelink

public java.lang.String getParamHomelink()
Returns the homelink parameter value.

Returns:
the homelink parameter value

getParamWorkplaceresource

public java.lang.String getParamWorkplaceresource()
Returns the workplaceresource parameter value.

Returns:
the workplaceresource parameter value

setParamBuildframe

public void setParamBuildframe(java.lang.String buildframe)
Sets the buildframe parameter indicating if the frameset should be generated.

Parameters:
buildframe - the buildframe parameter indicating if the frameset should be generated

setParamHelpresource

public void setParamHelpresource(java.lang.String helpresource)
Sets the helpresource parameter value.

Parameters:
helpresource - the helpresource parameter value

setParamHomelink

public void setParamHomelink(java.lang.String homelink)
Sets the homelink parameter value.

Parameters:
homelink - the homelink parameter value

setParamWorkplaceresource

public void setParamWorkplaceresource(java.lang.String workplaceresource)
Sets the workplaceresource parameter value.

Parameters:
workplaceresource - the workplaceresource parameter value

buildHtmlHelpNavigation

protected java.lang.String buildHtmlHelpNavigation()
Returns the HTML to build the navigation of the online help folder.

Returns:
the HTML to build the navigation of the online help folder

checkRole

protected void checkRole()
                  throws CmsRoleViolationException
Description copied from class: CmsWorkplace
Checks that the current user is a workplace user.

Overrides:
checkRole in class CmsWorkplace
Throws:
CmsRoleViolationException - if the user does not have the required role
See Also:
CmsWorkplace.checkRole()

displayFrameset

protected java.lang.String displayFrameset()
Returns the HTML to build the frameset for the online help popup window.

Returns:
the HTML to build the frameset for the online help popup window

getMappedHelpUri

protected void getMappedHelpUri()
Determines the mapped help page for a given workplace resource URI.

If a mapping information is found, the requested URI is set to the found value.

If no workplace resource URI is given, nothing is changed.


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.

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

isBuildFrameset

protected boolean isBuildFrameset()
Returns true if the online help frameset has to be generated.

Returns:
true if the online help frameset has to be generated, otherwise false