Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Add the following dependencies in the pom.xml file :

    Code Block
    languagexml
    <dependency>           
        <groupId>org.netbeans.api</groupId>
        <artifactId>org-netbeans-api-annotations-common</artifactId>
        <version>RELEASE80</version>
    </dependency>
    <dependency>
        <groupId>org.netbeans.api</groupId>
        <artifactId>org-netbeans-modules-javahelp</artifactId>
        <version>RELEASE80</version>
    </dependency>
  2. Rename the classspath doc.help

    If you want to reference one page on a module from an other module you have to use the classpath. This supposes the class-paths are different between modules, which is the correct way to have class-paths in general. By example for the SNAP Graph Builder project, move the help files in the ressources folder form docs.help to org.esa.snap.gpf.ui.docs. With the change of path the indexer "maven-javahelp-plugin" is not working anymore, but NetBeans takes care of this.

     

    Add a « package-info.java » file in the docs source folder, by example for the SNAP Graph Builder project:
    Create the org.esa.snap.gpf.ui.docs source package and add the package-info.java file with the following content:

    Code Block
    languagejava
    @HelpSetRegistration(helpSet = "help.hs", position = 3633)
    package org.esa.snap.gpf.ui.docs;
    
    import org.netbeans.api.javahelp.HelpSetRegistration;

    Remarks: org.esa.snap.gpf.ui.docs is the path in the ressource folder where HelpSet file can be found. As convention we want to name the HelpSet file always "help.hs".

    Warning

    The position must be unique

Tips and Tricks

It is possible to open external web help in the default web browser instead of the javahelp window. For this the extenal links need to be change, by example for the BeamDataSources.html page, change

Code Block
languagexml
<a href="https://earth.esa.int/web/guest/pi-community/apply-for-data">https://earth.esa.int/web/guest/pi-community/apply-for-data</a>

to

Code Block
languagexml
 <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
    <param name="content" value="https://earth.esa.int/web/guest/pi-community/apply-for-data">
    <param name="text" value="<html>apply for data</html>">
 </object>
Info
titleRemark
  • The dependency org-netbeans-modules-extbrowser must be added to the Platform application.
  • Unfortunately repeating the link as fall back within the object tag is not working in NetBeans. Actually it should be used as alternative if the BrowserDisplayer is not available, e.g. the page is displayed in normal web browser.
    Using a URL in the alternative link seems to break the javahelp. When running the jhindexer an exception is thrown like java.lang.ArrayIndexOutOfBoundsException: -845100606

Creating link between pages of different modules

It is possible to create link between pages of different modules, for this it is necessary to specify the full path to the module. One common example is the "BeamOverview".

Code Block
languagexml
<a href="../general/BeamOverview.html">

should be replaced by

Code Block
languagexml
<a href="nbdocs://org.esa.snap.help/org/esa/snap/help/docs/general/overview/BeamOverview.html">

 

Resources

...