Eclipse plug-ins generated by the DITA-OT, with the eclipse_csh plug-in, provide dynamic context-sensitive Help for Eclipse-based applications that define abstract Help contexts and use the ContextProviderDelegate (supplied by org.eclipse.datatools.help).
Abstract Help contexts allow UI developers to isolate the Eclipse Help system's concrete Help context ID strings and Help search expressions from the UI implementation (Java code). That gives user assistance (UA) content developers more control over Help contexts and context-specific content, so they can provide more useful, and more precisely targeted, dynamic context-sensitive help.
For many developers, one of the main problems with Eclipse dynamic context-sensitive Help is the necessity to embed Help context ID strings and context-specific Help search expressions in the UI code. That can reduce code portability, and it forces recompiling whenever a Help context ID string or a Help search expression needs to be changed. It makes UI implementation more cumbersome, particularly in an agile development (or RAD) environment. Unless all UI contexts are explicitly specified, and frozen in advance, developers are tempted to delay implementing context-sensitive Help to avoid otherwise unnecessary recompiling and rebuilding.
By using the org.eclipse.datatools.help.ContextProviderDelegate (the DTP help-helper, provided by the Eclipse Data Tools Platform project), and defining abstract Help contexts in their code, UI developers are free to implement dynamic context-sensitive Help at any point in the UI development cycle.
By using the DITA-OT, with the eclipse_csh plug-in, UA content developers (writers) and information architects can define the associations of Help context IDs with UA content, using special context-sensitive Help markup in a standard DITA map that produces an Eclipse online documentation plug-in. Content developers are free to revise the UI-UA context associations and context-specific Help search expressions at any time, without impacting UI code.
The eclipse_csh plug-in is available from the DITA-OT project on sourceforge.net: [URL pending final release to open source]
Download the eclipse_csh zip file (eclipse_csh_1.0.0.zip), and extract all files and folders into the plugins/ directory, in a previously installed DITA-OT.
Run the DITA-OT integrator.xml Ant buildfile to complete the plug-in installation.
Any DITA map document that defines an Eclipse online documentation (doc) plug-in can be modified to also define a corresponding context-sensitive Help plug-in, by inserting the appropriate context-related markup.
DITA maps for context-sensitive Help plug-ins must contain a <topicmeta> element as the first child of the <map> element, and for each UI plug-in whose Help context IDs are identified in the map, that <topicmeta> element must contain one <othermeta> element that identifies the UI plug-in.
<map id="org.eclipse.datatools.ui.doc">
<topicmeta>
...
<othermeta name="ui-plugin"
content="org.eclipse.datatools.connectivity.ui"/>
<othermeta name="ui-plugin"
content="org.eclipse.datatools.connectivity.ui.dse"/>
</topicmeta>
...
</map>
The name attribute value "ui-plugin" is a fixed, literal string. The content attribute value is the Eclipse plug-in ID of a UI plug-in.
DITA maps for context-sensitive Help plug-ins contain <resourceid> elements, each of which identifies a concrete Help context ID associated with a DITA topic.
<topicmeta>
<resourceid id="help_context_ID_string"/>
</topicmeta>
<topicref navtitle="label attribute in contexts.xml topic element"
href="path/to/topic.xml">
<topicmeta>
<resourceid id="help_context_ID_string"/>
</topicmeta>
</topicref>
<topicref navtitle="label attribute in contexts.xml topic element"
href="path/to/topic.xml">
<topicmeta>
<resourceid id="help_context_ID_1"/>
<resourceid id="help_context_ID_2"/>
<resourceid id="help_context_ID_3"/>
</topicmeta>
</topicref>
<topicref navtitle="label attribute in contexts.xml topic element"
href="path/to/topic.xml">
<topicmeta>
<searchtitle>Optional text to override the help About \
title.</searchtitle>
<shortdesc>Text for context description.</shortdesc>
<resourceid id="help_context_ID_string"/>
</topicmeta>
</topicref>
<contexts>
...
<context id="help_context_ID_string"
title="Optional text to override the help About title.">
<description>Text for context description.</description>
<topic label="label attribute in contexts.xml topic element"
href="PLUGINS_ROOT/doc_plugin_ID/path/to/topic.xml"/>
</context>
...
</contexts>
where doc_plugin_ID is the value of the id attribute on the
<map> element.To provide dynamic context-sensitive Help, an Eclipse-based application must define the associations between its UI controls and Help contexts dynamically, by implementing methods of org.eclipse.help.IContextProvider. One of those methods (getContext) must return a concrete Help context ID string, which matches an IContext object contributed by an extension of org.eclipse.help.contexts, and defined in an Eclipse context XML file. Another method (getSearchExpression) must return a context-specific Help search expression, if the application requires more targeted search results than the default help search expression provides.
The eclipse_csh plug-in for DITA-OT provides the processing to generate context-sensitive Help plug-ins, which serve as companions to Eclipse online documentation plug-ins generated by DITA-OT (using its standard dita2eclipsehelp transtype). Indeed, the dita2eclipse_csh transtype target depends on the dita2eclipsehelp target to first generate an Eclipse online documentation plug-in.
Eclipse plug-ins produced by eclipse_csh do not contribute (or contain) any topic-based UA content. Their context XML files refer to topics contributed by their companion documentation plug-ins.
Successful delivery of Eclipse dynamic context-sensitive Help requires close coordination of UI components and UA components. It imposes responsibilities on both Development teams and Documentation teams, and it requires ongoing collaboration.
Development teams should provide lists of helpKey constants in the form of Java source files for the helpKey constants interface classes. Java source files provided as helpKey lists must include appropriate Help context comments to provide information about each associated UI control.
Documentation teams should rely on the Java source files (for the helpKey constants interface classes) as the original and definitive sources of all helpKey constant strings.
Help context abstraction is a technique to simplify the handling of Help context IDs and Help search expressions in the UI code, by abstracting them to "help keys."
This separation of responsibilities enables the project team to provide higher quality, and more precisely targeted, dynamic context-sensitive help.
For more information about the DTP help-helper, see: http://www.eclipse.org/datatools/doc/20080310_DTP_Help-Helper.pdf.
Dave Resch
Sybase Inc.
OASIS DITA Help Subcommittee