Launching Eclipse-based help from a console module

 

+

Search Tips   |   Advanced Search

 

If your Integrated Solutions Console module contains a portlet that requires a help page, follow the instructions in this topic to implement help for the portlet.

 

Sample

The Modes sample (modes.war) demonstrates how a console module can provide user assistance or help. This sample is described in samples.html#samples.

 

Enabling portlet help

To implement portlet help, you use the portlet's doHelp() method, the EclipseHelp class, and the help setting in the portlet.xml file. Inside the doHelp() method, link to the target help topic in your Eclipse help plug-in by using the portletHelp() method of the EclipseHelp class. By including a doHelp() method in your portlet and adding the help setting to the portlet.xml file, you enable the portlet help mode. When portlet help mode is enabled, the

Icon for portlet help icon is displayed on the portlet title bar. When a user clicks the icon, a separate browser window opens and displays only that help topic.

 

Adding the doHelp method

To add the doHelp() method to your portlet, perform the following procedure:

  1. In the portlet Java file, include the following import statement:

    import com.ibm.portal.help.EclipseHelp;
    
    

  2. Implement the doHelp() method in the portlet.

       public void doHelp(RenderRequest request, RenderResponse response) 
              throws PortletException, IOException {
       }
    
    
    

  3. Inside the method, create a String to contain the help topic. The syntax for specifying a help topic is pluginID/file_path/file_name, where pluginID is the Eclipse help plug-in ID as specified in its plugin.xml file, file_path is the sub-directory path (if any), and file_name is the filename and extension of the help content file.

       public void doHelp(RenderRequest request, RenderResponse response) 
              throws PortletException, IOException {
    
          String topic = "com.ibm.isc.help.modes/help_mode.html";   }
    
    
    

  4. Call the method EclipseHelp.portletHelp() passing in the request, response, and topic as shown in the code snippet below.

       public void doHelp(RenderRequest request, RenderResponse response) 
              throws PortletException, IOException{
    
          String topic = "com.ibm.isc.help.modes/help_mode.html";
         EclipseHelp.portletHelp(request, response, topic);
       }
    
    
    

 

Setting help mode in the portlet.xml file

In addition to implementing the doHelp() method, set the help mode for that portlet in the portlet.xml file. To set help mode in the portlet.xml file, perform the following steps:

  1. Use a text editor to open the portlet deployment descriptor (the portlet.xml file). See topics under Developing portlets for more information about creating a portlet.xml file.

  2. Inside the <portlet-app> element, locate the <portlet> element for the portlet that implements the doHelp() method.

  3. Inside the <supports> sub-element, add a <portlet-mode> element like the one shown in the following example.

<?xml version="1.0" encoding="UTF-8"?>
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" 
             version="1.0" id="com.ibm.isclite.samples.Modes"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
             xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd 
                                 http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
   <portlet id="Modes_Portlet" >
      <portlet-name>ModesPortlet</portlet-name>
      <display-name>Modes portlet1 (JSR 168)</display-name>
      <display-name xml:lang="en">Modes portlet1 (JSR 168)</display-name>
      <portlet-class>com.ibm.isclite.samples.Modes</portlet-class>
      <expiration-cache>0</expiration-cache>
      <supports>
         <mime-type>text/html</mime-type>
         <portlet-mode>VIEW</portlet-mode>
         <portlet-mode>EDIT</portlet-mode>
         <portlet-mode>HELP</portlet-mode>
      </supports>
      <supported-locale>en</supported-locale>
      <resource-bundle>nls.HTML</resource-bundle>
   </portlet>

 
</portlet-app>
 

 

Creating Eclipse help

Refer to http://help.eclipse.org for information about providing HTML help as an Eclipse plugin.

 

Reference topic