NetBeans provides ability to supplies online help for plugins packaged as a plugin, so the entire help files are stored inside of a plugin.
However, it is not sufficient is some cases. E.g. it is often required to provide online help published on the web. This approach allows following benefits:
1. Tech writers can update online help after the release of corresponding product independently (without updating corresponding plugins).
2. Online help published on the web can be indexed by different search engines like Google.
With the current NetBeans Help system this alternative approach is almost possible. Plugin can register its own custom HelpSet as a service (e.g., via @ServiceProvider(service = HelpSet.class) annotation). This custom help set can take help files from the web and NetBeans already correctly handles such helpsets.
There is only one problem: there is no correct possibility to merge this custom helpset into master helpset.
To merge helpset into master one we have to set corresponding attribute to this helpset. It can be done using following code:
customHelpSet.setKeyData(HelpConstants.HELPSET_MERGE_CONTEXT, HelpConstants.HELPSET_MERGE_ATTR, true);
Unfortunately, this way does not work since interface org.netbeans.modules.javahelp.HelpConstants is not a part of public API (it is the part of internal NB Help System package) and it is not visible to plugins.
Of course, it is possible to just hardcode these constants values and use following code:
customHelpSet.setKeyData("OpenIDE", "mergeIntoMaster", true);
But there is no guarantee that this will work in the future NetBeans versions, since these constants are NB internal and can be changed in the future.
So, we need some extension of public NetBeans Help API to mark the custom helpset as to be merged into master helpset. It can be done via some new API method, or these two constants just can be moved to public API.
Created attachment 138873 [details]
Please check the attached patch.
Would method HelpUtils.mergeCustomHelpset work fine for you?
Patch looks OK and it should work fine for me. Please, specify a nightly build where it can be verified.
Note, that attached patch contains a fix for another issue, so it should not be committed with commit of the fix for this issue.
Created attachment 138893 [details]
Proposed Patch v2
(In reply to alexander.burdukov from comment #2)
> Patch looks OK and it should work fine for me. Please, specify a nightly
> build where it can be verified.
OK, but at first the change has to pass an API review.
(In reply to alexander.burdukov from comment #3)
> Note, that attached patch contains a fix for another issue, so it should not
> be committed with commit of the fix for this issue.
Thank you, attaching correct patch.
Please review the following changes in module Help System (javahelp).
org.netbeans.api.javahelp.HelpUtils (contains method mergeCustomHelpset(HelpSet))
Patch v2 looks OK for me.
If there are no objections, I'll integrate the patch tomorrow.
Thanks for reviewing.
Integrated into 'main-silver', will be available in build *201308290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Jaroslav Havlin <email@example.com>
Log: #234144: Support of online help published on the web
Verified on latest NB 8.0