The EclipseHelp format allows generated Java archive (.jar) to be embedded into Eclipse applications. Application developers can define context IDs within the user interface. These context IDs allow users to access the corresponding help page by simply pressing the F1 key or by clicking the "Help" button. Context-sensitive help can be added into eclipse plugins via the extension point "org.eclipse.help.contexts". For more information about context sensitive help please see Eclipse documentation. The following code shows the extension point for defining a file in the plug-in:

<extension
      point="org.eclipse.help.contexts">
   <contexts file="context.xml">
   </contexts>
</extension>
CODE

Scroll EclipseHelp Exporter supports context-sensitive help via generating a context.xml file containing context ids. When exporting, you can enable this feature by selecting the option to Convert Labels to Search Contexts in the export dialogue box.

The app will then convert the Confluence labels to search contexts – all exported pages containing a <context> id become the <topic> entries for that <context>. Each <topic> entry will use the relative path within the exported zip/jar as the href attribute, and the label attribute will also be the page title.

Include context search

The following steps, outline how to export confluence pages including context search:

1. Create a page tree hierarchy  

Firstly, create a space with a page tree hierarchy that has a collection of labels assigned to each page.  

2. Export 

Following this, choose the specific page or entire page tree hierarchy that you wish to export. 

3. Define the export options

Within the Eclipse Plugin Properties you can fill in the export parameters – simply, fill out the required fields such as the plugin information. 

The EclipseHelp Features tab includes the option to generate search context for labels. By checking the option Convert Labels to Search Contexts, the export will include the context search. 

Clicking Start Export will begin the export process – depending on the chosen export format, a JAR or ZIP format file will be exported. 

Checking Context-sensitive help output  

The context.xml file can be extracted from the exported file. Below, the example code snippet demonstrates where Scroll EclipseHelp Exporter includes the generated contexts and topic entries. As you can see, the labels have been converted to contexts and each context contains several topic entries that refer to the corresponding pages:

<?xml version="1.0" encoding="UTF-8"?>

<contexts>
            <context id="template">
                            <topic label="Creating a template" href="Creating_a_template.html#7929869"/>
                            <topic label="Creating an Export Scheme" href="Creating_an_Export_Scheme.html#7929872"/>
                    </context>
            <context id="bookmarks">
                            <topic label="Inserting Bookmarks" href="Inserting_Bookmarks.html#7929884"/>
                    </context>
            <context id="scheme">
                            <topic label="Creating an Export Scheme" href="Creating_an_Export_Scheme.html#7929872"/>
                            <topic label="Managing the Export Scheme" href="Managing_the_Export_Scheme.html#7929874"/>
                    </context>
            <context id="feature">
                            <topic label="Features" href="Features.html#7929878"/>
                            <topic label="Controlling the Text-Alignment" href="Controlling_the_Text-Alignment.html#7929886"/>
                            <topic label="Generating context sensitive help" href="Generating_context_sensitive_help.html#7929882"/>
                            <topic label="Indexing Terms" href="Indexing_Terms.html#7929880"/>
                            <topic label="Inserting Bookmarks" href="Inserting_Bookmarks.html#7929884"/>
                    </context>
            <context id="context">
                            <topic label="Generating context sensitive help" href="Generating_context_sensitive_help.html#7929882"/>
                    </context>
            <context id="text">
                            <topic label="Controlling the Text-Alignment" href="Controlling_the_Text-Alignment.html#7929886"/>
                    </context>
            <context id="alignment">
                            <topic label="Controlling the Text-Alignment" href="Controlling_the_Text-Alignment.html#7929886"/>
                    </context>
            <context id="termindex">
                            <topic label="Indexing Terms" href="Indexing_Terms.html#7929880"/>
                    </context>
            <context id="export">
                            <topic label="Exporting to Eclipse Help" href="Exporting_to_Eclipse_Help.html#7929876"/>
                    </context>
    </contexts>
CODE

Testing on Infocenter 

To test context searches from exports using Scroll EclipseHelp Exporter, you will need to first set up Infocenter please click here to find out more

After preparing Infocenter on your machine, copy your plug-in containing context files into the plugin directory in the Infocenter folder. In order to see the defined context simply amend this address:  http://localhost:4321/help/context?id=<PLUGIN-ID>.<CONTEXT_ID>  

  •  <PLUGIN-ID> refers to your plugin id 
  •  <CONTEXT_ID> refers to the context id in the context.xml file. 

After providing the query parameter id with the value org.k15t.help.feature you should expect to see the following XML block as a response: