Using a custom help location
You can use any help system hosted by a web server to provide online help for a Java Component system. To make an external help system available to the Java Component application, the wwhelp.html file must redirect help requests to that external system. Any specific help target can link to any specific page.
To redirect help requests from Java Component to an alternate URL, edit or replace the wwhelp.html file in <context root>\help. You can further specify different targets using the context and topic parameters in the URLs emitted by Java Component in help requests.
Customizing the help location with wwhelp.htm
Use the following procedure to create a wwhelp.htm file that redirects Java Component context-sensitive help requests to another URL.
<script type="text/javascript" language="JavaScript1.2">
// -->
// get parameters from the URL
method GetParameter( name )
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
   return "";
   return results[1];
method LaunchHelp()
// Get URL parameters
  var context = GetParameter( 'context' );
  var topic = GetParameter( 'topic' );
  var baseURL = "http://myhelpserver/viewer/wwhelp.htm";
  // Begin flow control using context
  switch (context)
  // map the "BIRTIV" context to an outside URL
   case "BIRTIV" :
   self.location = baseURL + "?single=true&context=" + context + "&topic=" + topic ;
  // map the "UserConsole" context to an outside URL
    case "userconsole" :
baseURL = "http://myhelpserver/ajc11/wwhelp.htm";
   self.location = baseURL + "?single=true&context=" + context + "&topic=" + topic ;
  //the default behavior
   default :
   self.location = baseURL ;
The LaunchHelp() method gets the context and topic information from the URL with two calls to GetParameter. The baseURL is set to the myhelpserver application’s online help. The flow control switch statements activate specific URLs depending upon the context. Because the myhelpserver application uses the same context and topic variables as standard Java Component help, they are used directly in constructing the URL when activating the self.location methods.
<body onLoad="LaunchHelp();">
The onLoad parameter activates LaunchHelp() when the page loads.
Test your results by opening Java Component and selecting a help link. The resulting page is from the custom application. For example, the help link on the login page pictured in Figure 10-3 would link to http://myhelpserver/ajc11/help/wwhelp.htm?single=true&context=UserConsole&topic=Document_list.

Additional Links:

Copyright Actuate Corporation 2012