Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366688

Summary: displayHelpResource does not accept "toc=" or "contextId="
Product: [Eclipse Project] Platform Reporter: Jesper Eskilson <jesper.eskilson>
Component: User AssistanceAssignee: platform-ua-inbox <platform-ua-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.2   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Jesper Eskilson CLA 2011-12-14 07:52:35 EST
Build Identifier: M20110909-1335

IWorkbenchHelpSystem#displayHelpResource is documented to accept a URL as described in IHelpResource#getHref. However, the actual implementation in DefaultHelpUI is documented to accept URL queries on the form key=value&key=value..., where the valid keys are toc, topic, tab, and contextId. When stepping through the call

helpSystem.displayHelpResource("toc=/my.plugin.id/toc.xml")

I ended up inside HelpDisplay#displayHelpURL, which seems to only accept "tab" and "topic".

It looks like I should be able to use IWorkbenchHelpSystem#displayHelpResource to display a "toc.xml" file in the help browser, but that the implementation of this is missing from the HelpDisplay class.

(Or is there another way to display a "toc.xml" help resource?)

Reproducible: Always

Steps to Reproduce:
Execute the following code, assuming that you have a plugin with the id "plugin.id" with a toc.xml in it.:

        IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench()
                .getHelpSystem();
        helpSystem
                .displayHelpResource("toc=/plugin.id/toc.xml");

I would have expected that the TOC in the given plugin would be displayed, but instead I get the following error:

!ENTRY org.eclipse.help.base 4 0 2011-12-14 13:22:04.678
!MESSAGE An exception occurred while launching help.  Check the log at /home/jesperes/runtime-EclipseApplication/.metadata/.log
!STACK 0
java.net.MalformedURLException: no protocol: toc=/com.iar.doc.HelpEclipseARMDebugging_2D1/toc.xml
        at java.net.URL.<init>(URL.java:583)
        at java.net.URL.<init>(URL.java:480)
        at java.net.URL.<init>(URL.java:429)
        at org.eclipse.help.ui.internal.DefaultHelpUI$ExternalWorkbenchBrowser.displayURL(DefaultHelpUI.java:88)
        at org.eclipse.help.internal.base.HelpDisplay.displayHelpURL(HelpDisplay.java:196)
        at org.eclipse.help.internal.base.HelpDisplay.displayHelpResource(HelpDisplay.java:90)
        at org.eclipse.help.ui.internal.DefaultHelpUI.displayHelpResource(DefaultHelpUI.java:275)
Comment 1 Lars Vogel CLA 2019-11-14 03:18:40 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.