Wiki

Clone wiki

jummp / contexthelp

Context specific help can be included in every GSP using a content element with the tag as contexthelp. A string should be defined in this element, which helps in locating the relevant help page. Several components work together to achieve the help functionality, as described below.

The Config File

The configuration file needs to specify (either in the externalised properties file, or in Config.groovy) a root for the help files, and additionally defined locations for specific pages. A complete URL is generated by appending the defined location to the root of the help. An example is shown below:

jummp.context.help.root=https://bitbucket.org/jummp/jummp/wiki/
jummp.context.help.main=manuals
jummp.context.help.browse=model_browsing
jummp.context.help.search=model_search

Here the help for the 'browse' location is intended to be https://bitbucket.org/jummp/jummp/wiki/model_browsing. This is computed by the ContextHelpTagLib.

ContextHelpTagLib

The ContextHelpTagLib defines the getLink tag, which expects as an argument a location. This location is expected to be defined in the config, as jummp.context.help."location". The tag generates a link by appending the value defined for the location to the help root, according to the example above.

main.gsp

If a content element with the tag contexthelp is present in a gsp which uses the main.gsp layout the getLink function of ContextHelpTagLib is invoked, with the string contained in the content element passed as an argument. Additionally, main.gsp defines a UI for the help, which includes a button on the left to load/hide the help, and a draggable and resizable panel which loads the help page in an iframe. The functionality is achieved using the jquery-ui api.

Usage

The author of list.gsp would like to load the page defined with 'browse' in the config file. All that is required is the following code (by convention at the end of the page).

<content tag="contexthelp">
         browse
</content>

This would lead to the url computed using jummp.context.help.browse and the help root to be loaded, as shown below (with the biomodels support page loaded as an example). The help is initially hidden, and is displayed when the user clicks the floating help button on the left.

help.png

Updated