Launching Eclipse-based help

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

About this task

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.

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

Procedure

  1. Add the doHelp() method to your portlet.
    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. Create a String in the deHelp() method 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);
      
         }
      
      
  2. Set help mode in the portlet.xml file.
    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>
     
    
  4. When packaging the console module, place the Eclipse help plugin in the /help directory of the WAR file. See pack_comp.html for more information.



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Oct 21, 2010 7:37:48 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v701sca&product=was-nd-mp&topic=link_help
File name: link_help.html