org.opencms.workplace.help
Class CmsHelpTemplateBean

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

public class CmsHelpTemplateBean
extends CmsDialog

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

Since:
6.0.0
Version:
$Revision: 1.10 $
Author:
Andreas Zahner

Field Summary
static String DEFAULT_HELPFILE
          File name of the default help file to load.
static String HELPMAPPINGS_FILENAME
          File name of the help mappings properties file(s).
static String MODULE_NAME
          The name of the help module.
static String PARAM_BUILDFRAME
          Request parameter name for the buildframe flag parameter.
static String PARAM_HELPRESOURCE
          Request parameter name for the helpresource uri.
static String PARAM_HOMELINK
          Request parameter name for the homelink in head frame.
static String PARAM_WORKPLACERESOURCE
          Request parameter name for the workplaceresource uri.
static String PATH_HELP
          VFS path to the help folder, contains a macro for the Locale which has to be resolved.
static String PROPERTY_VALUE_HELPSTART
          Value of the NavInfo property indicating the start folder of the help.
static String RFS_HELPMAPPINGS
          Relative RFS path of the help mappings property file(s).
static 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_DEFAULT, 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_OK, DIALOG_SET, DIALOG_WAIT, PARAM_ACTION, PARAM_CLOSELINK, PARAM_DIALOGTYPE, PARAM_ERRORSTACK, PARAM_FILE, PARAM_FRAMENAME, PARAM_ISPOPUP, PARAM_LOCK, PARAM_MESSAGE, 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_PATH, PARAM_ROOT, PARAM_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, 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_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(PageContext context, HttpServletRequest req, HttpServletResponse res)
          Public constructor with JSP variables.
 
Method Summary
protected  String buildHtmlHelpEnd()
          Returns the HTML for the end of the page.
protected  String buildHtmlHelpNavigation()
          Returns the HTML to build the navigation of the online help folder.
protected  String buildHtmlHelpStart(String cssFile, boolean transitional)
          Returns the HTML for the start of the page.
static String buildOnlineHelpJavaScript(Locale locale)
          Returns the java script method to open the online help popup window.
 String displayBody()
          Returns the HTML for the body frame of the online help.
protected  String displayFrameset()
          Returns the HTML to build the frameset for the online help popup window.
 String displayHead()
          Returns the HTML for the head frame of the online help.
 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.
 String getParamBuildframe()
          Returns the buildframe parameter indicating if the frameset should be generated.
 String getParamHelpresource()
          Returns the helpresource parameter value.
 String getParamHomelink()
          Returns the homelink parameter value.
 String getParamWorkplaceresource()
          Returns the workplaceresource parameter value.
protected  void initMessages()
          Initializes the message object.
protected  void initWorkplaceRequestValues(CmsWorkplaceSettings settings, 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(String buildframe)
          Sets the buildframe parameter indicating if the frameset should be generated.
 void setParamHelpresource(String helpresource)
          Sets the helpresource parameter value.
 void setParamHomelink(String homelink)
          Sets the homelink parameter value.
 void setParamWorkplaceresource(String workplaceresource)
          Sets the workplaceresource parameter value.
 
Methods inherited from class org.opencms.workplace.CmsDialog
actionCloseDialog, appendDelimiter, checkResourcePermissions, checkResourcePermissions, dialog, dialogBlock, dialogBlockEnd, dialogBlockStart, dialogButtonRow, dialogButtonRowEnd, dialogButtonRowStart, dialogButtons, dialogButtonsClose, dialogButtonsClose, dialogButtonsCloseDetails, dialogButtonsHtml, dialogButtonsOk, dialogButtonsOk, dialogButtonsOkCancel, dialogButtonsOkCancel, dialogButtonsOkCancelAdvanced, dialogButtonsSetOkCancel, dialogContent, dialogContentEnd, dialogContentStart, dialogEnd, dialogHead, dialogHorizontalSpacer, dialogRow, dialogRowEnd, dialogRowStart, dialogScriptSubmit, dialogSeparator, dialogSpacer, dialogStart, dialogStart, dialogSubheadline, dialogWhiteBox, dialogWhiteBoxEnd, dialogWhiteBoxStart, getAction, getAdministrationBackLink, getCancelAction, getDialogRealUri, getDialogUri, getParamAction, getParamCloseLink, getParamDialogtype, getParamFramename, getParamIsPopup, getParamMessage, getParamRedirect, getParamResource, getParamTitle, getState, htmlStart, htmlStart, htmlStart, htmlStartStyle, includeErrorpage, initCmsDialog, isPopup, pageHtml, pageHtml, setAction, setParamAction, setParamCloseLink, setParamDialogtype, setParamFramename, setParamIsPopup, setParamMessage, setParamRedirect, setParamResource, setParamTitle
 
Methods inherited from class org.opencms.workplace.tools.CmsToolDialog
dialogTitle, getAdminTool, getCurrentToolPath, getParamPath, getParamRoot, getParamStyle, getParentPath, getToolManager, iconsBlockArea, iconsBlockAreaEnd, iconsBlockAreaStart, initAdminTool, pageBody, pageHtmlStyle, setParamPath, setParamRoot, setParamStyle, useNewStyle
 
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, getBroadcastMessageString, getCalendarDate, getCalendarJavaDateFormat, getCalendarLocalizedTime, getCms, getEncoding, getExplorerFileListFullUri, getFrameSource, getJsp, getLocale, getMacroResolver, getMessages, getMultiPartFileItems, getParameterMap, getResourceUri, getResourceUri, getSession, getSettings, getSkinUri, getStyleUri, getStyleUri, getStyleUri, htmlEnd, initUserSettings, initWorkplaceMembers, initWorkplaceSettings, isForwarded, isHelpEnabled, isSubElement, key, key, key, nullToEmpty, paramsAsHidden, paramsAsHidden, paramsAsParameterMap, paramsAsRequest, paramValues, resolveMacros, sendCmsRedirect, 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 String DEFAULT_HELPFILE
File name of the default help file to load.

See Also:
Constant Field Values

HELPMAPPINGS_FILENAME

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

See Also:
Constant Field Values

MODULE_NAME

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

See Also:
Constant Field Values

PARAM_BUILDFRAME

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

See Also:
Constant Field Values

PARAM_HELPRESOURCE

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

See Also:
Constant Field Values

PARAM_HOMELINK

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

See Also:
Constant Field Values

PARAM_WORKPLACERESOURCE

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

See Also:
Constant Field Values

PATH_HELP

public static final 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 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 String RFS_HELPMAPPINGS
Relative RFS path of the help mappings property file(s).


TEMPLATEPATH

public static final 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(PageContext context,
                           HttpServletRequest req,
                           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 String buildOnlineHelpJavaScript(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

displayBody

public 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 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 String displayHelp()
                   throws 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:
IOException - if redirection fails

getParamBuildframe

public 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 String getParamHelpresource()
Returns the helpresource parameter value.

Returns:
the helpresource parameter value

getParamHomelink

public String getParamHomelink()
Returns the homelink parameter value.

Returns:
the homelink parameter value

getParamWorkplaceresource

public String getParamWorkplaceresource()
Returns the workplaceresource parameter value.

Returns:
the workplaceresource parameter value

setParamBuildframe

public void setParamBuildframe(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(String helpresource)
Sets the helpresource parameter value.

Parameters:
helpresource - the helpresource parameter value

setParamHomelink

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

Parameters:
homelink - the homelink parameter value

setParamWorkplaceresource

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

Parameters:
workplaceresource - the workplaceresource parameter value

buildHtmlHelpEnd

protected String buildHtmlHelpEnd()
Returns the HTML for the end of the page.

Returns:
the HTML for the end of the page

buildHtmlHelpNavigation

protected 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

buildHtmlHelpStart

protected String buildHtmlHelpStart(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

displayFrameset

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


initMessages

protected void initMessages()
Description copied from class: CmsWorkplace
Initializes the message object.

By default the workplace messages object is used.

You SHOULD override this method for setting the bundles you really need, using the CmsWorkplace.addMessages(String) method.

Overrides:
initMessages in class CmsWorkplace
See Also:
CmsWorkplace.initMessages()

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.

Overrides:
initWorkplaceRequestValues in class CmsDialog
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