When the JavaHelp system is activated by your application, the first thing it does is read the helpset file specified by the application. The helpset file defines the helpset for that application. A helpset is the set of data that comprises your help system. The helpset file includes the following information:
Map file | The map file is used to associate topic IDs with the URL or path name of HTML topic files. |
View information | Information that describes the navigators being used in the helpset. The standard navigators are: table of contents, index, and full-text search. Additional navigators are the glossary and the favorites navigators. Information about custom navigators is included here as well. |
Helpset title | The <title> defined in the helpset
(.hs ) file. This title appears at the top of the main window
and any secondary windows defined in your helpset file. |
Home ID | The name of the (default) ID that is displayed when the help viewer is called without specifying an ID. |
Presentation | The windows in which to display the help topics. This is a new feature
of the JavaHelp 2 software that is described in more detail below under
<presentation> . |
Sub-helpsets | This optional section statically includes other helpsets by using the
<subhelpset> tag. The helpsets indicated by this tag
are merged automatically into the helpset that contains the tag. More details
about merging can be found in Merging Helpsets.
|
Implementation | This optional section creates a registry that provides key data mapping
to define the HelpBroker class to use in the HelpSet.createHelpBroker
method. The registry also determines the content viewer to user for a given
MIME type. See <impl> below. |
After your product is installed on your user's system, your Java program must
be able to find the helpset file. The application specifies the path to the
helpset file when it starts the JavaHelp system. By convention, the name of
the helpset file ends with the .hs
extension.
The format of the helpset file is based on the World Wide Web Consortium Extended Markup Language (XML 1.0) proposed recommendation:
http://www.w3.org/TR/PR-xml-971208The following is an example of a helpset file (description follows):
<?xml version='1.0' encoding='ISO-8859-1' ?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0"> <!-- title --> <title>Java Development Environment - Help</title> <!-- maps --> <maps> <homeID>top </homeID> <mapref location="Map.jhm" /> </maps> <!-- views --> <view xml:lang="en" mergetype="javax.help.UniteAppendMerge
"> <name>TOC</name> <label>Table Of Contents</label> <type>javax.help.TOCView</type> <data>IdeHelpTOC.xml</data> </view> <view xml:lang="en" mergetype="javax.help.SortMerge
"> <name>Index</name> <label>Index</label> <type>javax.help.IndexView</type> <data>IdeHelpIndex.xml</data> </view> <view xml:lang="en"> <name>Search</name> <label>Search</label> <type>javax.help.SearchView</type> <data engine="com.sun.java.help.search.DefaultSearchEngine"> JavaHelpSearch </data> </view> <!-- A glossary navigator --> <view mergetype="javax.help.SortMerge
"> <name>glossary</name> <label>Glossary</label> <type>javax.help.GlossaryView</type> <data>glossary.xml</data> </view> <!-- A favorites navigator --> <view> <name>favorites</name> <label>Favorites</label> <type>javax.help.FavoritesView</type> </view><!-- presentation windows --> <!-- This window is the default one for the helpset. * Its title bar says "Project X Help". It * is a tri-paned window because displayviews, not * defined, defaults to true and because a toolbar is defined. * The toolbar has a back arrow, a forward arrow, and * a home button that has a user-defined image. --> <presentation default=true> <name>main window</name> <size width="400" height="400" /> <location x="200" y="200" /> <title>Project X Help</title> <toolbar> <helpaction>javax.help.BackAction</helpaction> <helpaction>javax.help.ForwardAction</helpaction> <helpaction image="homeicon">javax.help.HomeAction</helpaction> </toolbar> </presentation> <!-- This window is simpler than the main window. * It's intended to be used a secondary window. * It has no navigation pane or toolbar. --> <presentation displayviews=false> <name>secondary window</name> <size width="200" height="200" /> <location x="200" y="200" /> </presentation> <!-- subhelpsets --> <subhelpset location="file:/c:/Foobar/HelpSet2.hs" /> <!-- implementation section --> <impl> <helpsetregistry helpbrokerclass="javax.help.DefaultHelpBroker" /> <viewerregistry viewertype="text/html" viewerclass="com.sun.java.help.impl.CustomKit /> <viewerregistry viewertype="text/xml" viewerclass="com.sun.java.help.impl.CustomXMLKit /> </impl> </helpset>
The following table describes the helpset tags:
<helpset> |
Defines the helpset. It can contain all the following tags. | |
<title> |
Names the helpset. This string can be accessed by the application and used in the presentation (for example, in the viewer header stripe). | |
<maps> |
Specifies the default topic and URL of the map file used in the helpset. <maps> Tags
|
|
<view> |
Defines the navigators used in the helpset. Each navigator is defined
by its own <view>. <view> Attributes
Specifies the path to the data used by the navigator. When used with the search navigator, this tag contains the following attribute:
|
|
<presentation>
|
Defines the windows used in the helpset. Each window is defined by its
own <presentation> tag. See the helpset
example above for sample code for this tag and its attributes. <presentation> Attributes
Specifies the image displayed on the left side of the help window's
title bar. The argument to this attribute is an ID defined in the map
file. The ID must be associated with a GIF or JPEG file. If this
attribute is not specified, the default JavaHelp image is displayed.
|
|
<subhelpset>
|
This optional tag can be used to specify helpsets you want merged with
the helpset that contains the tag. See Merging Helpsets
for more information. Contains the following attribute: location URL of the helpset file to be
merged. |
|
<impl> |
The implementation section creates a registry that provides key data
mapping to define the HelpBroker class to use in the
|
See also: