This section attempts to explain how the Help system ties in with the JMeter GUI and resources.
Hooks in JMeter code
All the Help processing is carried out in Help.java. This is able to load an HTML file (docs/component_reference.html) and scroll to the appropriate section, based on the parameter passed to it.
There are two methods of passing in the information
- the calling GUI object "label", or
- a String array, containing a URL and anchor
[I'm not sure where the String array gets set up].
In the case of the GUI object label, this is the fixed text that appears in the top left hand corner of the main panel. When the panel is created, the factory method calls the getStaticLabel() method of the GUI instance. The getStaticLabel() method normally looks like:
public String getStaticLabel()
TODO - this has now changed
[Most of the resource names used for static labels end with the _title suffix]
Before the label is used to look up an entry in component_reference.html, any spaces are converted to underscores.
So to make sure that the Help system works, all that is needed is to ensure that the value of the title resource property is used as the anchor in the HTML page.
The Velocity script that is used to process the raw XML help files into HTML takes the subsection "name" attribute and replaces spaces by underscores. In the case of section names, it uses the "anchor" tag. The anchor tag appears to be ignored for subsections - don't know why.
To sum up: make sure the component_reference.xml file uses exactly the same text as appears on the GUI panel, and the help system will display the correct page.
When translating the page into another language, the subsection names and section anchors need to be changed to reflect the new values in the properties file.
A Junit test has been written to extract the anchors from the relevant xml files and compare them with the static labels.