Geertjan is a DZone Zone Leader and has posted 468 posts at DZone. You can read more from them at their website. View Full User Profile

How to Create JavaHelp in a Mavenized NetBeans Platform Application

09.25.2010
| 9092 views |
  • submit to reddit

There isn't a JavaHelp template for Maven-based NetBeans Platform modules, hence you need to set up JavaHelp yourself. It's a bit tricky, involving several different parts that can go wrong easily (which is why a JavaHelp template is so handy). Here's instructions on how to set up JavaHelp in your Maven-based NetBeans Platform modules.

Do the following:

  1. In each module that needs to provide a JavaHelp set, add this line to the manifest:
    OpenIDE-Module-Requires: org.netbeans.api.javahelp.Help
  2. In the POM of the container project (i.e., NOT the application project and NOT a functionality module project), add the "dependencies" section in the definition of the "org.codehaus.mojo", while setting the "version" to 3.0:
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>nbm-maven-plugin</artifactId>
        <version>3.0</version>
        <extensions>true</extensions>
        <dependencies>
            <dependency>
                <groupId>javax.help</groupId>
                <artifactId>javahelp</artifactId>
                <version>2.0.02</version>
            </dependency>
        </dependencies>
        <configuration>
            <brandingToken>${brandingToken}</brandingToken>
            <cluster>foobar</cluster>
        </configuration>
    </plugin>

    Note that the "version" is set to 3.0. I could not get JavaHelp to work for 3.1 or 3.2 (the default in 6.9+) and had to revert to 3.0. Maybe someone can correct me on this point somehow.

    Make sure that the POMs in the other projects (i.e., application project and functionality module projects) do not have their own definition of "org.codehaus.mojo". I.e., the container project should handle this definition for the whole application.

  3. You have now configured the application to use JavaHelp and have indicated each module that will provide JavaHelp. In each of those modules, you now need to provide JavaHelp content. The simplest approach for this is to create an Ant-based NetBeans Platform module. Then, use the wizard available for Ant-based NetBeans Platform projects for the creation of JavaHelp sets. Then copy the files that are generated into your Maven-based NetBeans Platform project:

    Note the following in the screenshot above. The "resources" folder contains the "module1-helpset.xml" file, which references the files in the "src/main/javahelp" folder by means of having the following content:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE helpsetref PUBLIC "-//NetBeans//DTD JavaHelp Help Set Reference 1.0//EN" "http://www.netbeans.org/dtds/helpsetref-1_0.dtd">
    <helpsetref url="nbdocs:/org/demoapp/demomodule1/docs/module1-hs.xml"/>

    And note that the "layer.xml" file above has this folder added:

    <folder name="Services">
        <folder name="JavaHelp">
            <file name="module1-helpset.xml" url="module1-helpset.xml">
                <attr name="position" intvalue="3818"/>
            </file>
        </folder>
    </folder>

    The folder "src/main/javahelp" is new, I created that myself, by copying that folder from the Ant-based NetBeans Platform module. That's the place where you will now create all your help topics within the Mavenized application. The Map file lists the identifying keys of the help topics, the TOC lists those keys that define the table of contents, and the Index does the same to define the index of the helpset.

That's all you need. Now you have JavaHelp working in your Mavenized NetBeans Platform application:

 

Published at DZone with permission of its author, Geertjan Wielenga.

Comments

Rafiq Doun-naah replied on Mon, 2011/06/27 - 3:35am

Hi All,

I have a maven based desktop client and I need to add javahelp system to it. I also need to add context sensitive help so that the help topic that is displayed will be related to the particular window the user is at when he/she activated the help system. The help will be activated from the help menu item and from various help buttons in various windows. Besides the main help window, I also want it to be displayed in an imbedded window in some windows that have enough space. I am using netbeans 7 and will be grateful if someone could give me a step by step approach.

Kind Regards,

Rafiq

Matt Coleman replied on Fri, 2012/11/30 - 2:40am

JavaHelp is great for Mavenized NB platforms...we tried it..it workS!

buffalo search engine optimization 

Cata Nic replied on Fri, 2013/09/06 - 3:23am

This trick can improve the overall effectiveness of this script. I will download the code and I will use it on my platform.

Muhammad Danial replied on Mon, 2014/03/31 - 9:50am

Here's instructions on how to set up JavaHelp in your Maven-based NetBeans Platform modules.
Maytag fridge freezer repairs (london)

Black Men replied on Fri, 2014/04/18 - 2:33am

 Here's instructions on how to set up JavaHelp in your Maven-based NetBeans Platform modules. 

what is a yeast infection

Samad Khatri replied on Sat, 2014/04/19 - 6:07am in response to: Matt Coleman

JavaHelp is great for Mavenized NB platforms...we tried it..it workS! https://www.rebelmouse.com/undeniablepassionsystemreview/ 

Black Men replied on Tue, 2014/04/22 - 3:19am

 Here's instructions on how to set up JavaHelp in your Maven-based NetBeans Platform modules.

bunches promotional code

Samad Khatri replied on Sun, 2014/04/27 - 9:30am in response to: Matt Coleman

 avaHelp is great for Mavenized NB platforms...we tried it..it workS! www.tapes.com.pl

Samad Khatri replied on Thu, 2014/05/15 - 9:16am in response to: Matt Coleman

 avaHelp is great for Mavenized NB platforms...we tried it..it workS!

przewozyzholandii.eu

Yogesh Kumawat replied on Wed, 2014/06/04 - 12:46am

 The actual response may acquire, approach, absent just by complications may well it will be possible achieved end up being just about just about all chosen substantive folks typically in terms of in essence make it possible for five-paragraph dissertation given that in essence communicates it will be possible method of wheresoever sooner or later a while further describes method established employing this type of dissertation replicated replicated method along with rapid with all the current outcome situation as well as incontestable incontestable indisputable indisputable proven fact that may well it will be possible honestly complete model's brand-new author’s thesis buyer services concerns all the same concerns.   Commemorative Thimbles 

Yogesh Kumawat replied on Wed, 2014/06/04 - 1:47am

 You experience forthwith configured the employ to use JavaHelp besides own indicated every module that testament give JavaHelp. FreeDebtConsolidationQuotes.com

Yogesh Kumawat replied on Sat, 2014/07/05 - 5:25am

 Discipline path engines your removed noggin for producing your flog mandates. By merely finding sooner picks similarly gropes, you are skill to number outer barely what by aloof the most effective fashion made to be ready to stir are at unquestionable necessitys. Coaching deliverys males boost to be skillful to construct your go perspectives spine that longs your stays to be worthy to crowd upwards venomous scholars. hid conversion kit


Jonathan Carry replied on Tue, 2014/10/07 - 11:40am

 I’ve a undertaking that I am simply now operating on, and I have been at the look out for such info... https://archive.org/details/PregnancyMiracleBookByLisaOlson_2014

Jonathan Carry replied on Fri, 2014/10/10 - 12:02pm

  This is a very good tips especially to those new to blogosphere, brief and accurate information… Thanks for sharing this one. A must read article. https://archive.org/details/TedsWoodworking_2014

Ray Naa replied on Mon, 2014/10/27 - 6:47am

 

This is highly informatics, crisp and clear. I think that everything has been described in systematic manner so that reader could get maximum information and learn many things.
 
DNA TEST HOUSTON

Ray Naa replied on Mon, 2014/10/27 - 7:51am

 

Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts.
 
DENTAL IMPLANTS HOUSTON

Ray Naa replied on Mon, 2014/10/27 - 10:05am

 

I admit, I have not been on this web page in a long time... however it was another joy to see It is such an important topic and ignored by so many, even professionals. professionals. I thank you to help making people more aware of possible issues.
LOS ANGELES MOVING SERVICE

Ray Naa replied on Thu, 2014/10/30 - 8:46am in response to: Yogesh Kumawat

 

Wonderful article, thanks for putting this together! This is obviously one great post. Thanks for the valuable information and insights you have so provided here.
 
Darnleivy Blueprint

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.