The CommandHelpRetriever class retrieves help text for i5/OS™ control language (CL) commands and generates that text either in HTML or User Interface Manager (UIM) format. You can run CommandHelpRetriever from a command line or embed the functionality into your Java™ program.
To use CommandHelpRetriever, your server must run i5/OS V5R1 or later and have an XML parser and XSL processor in the CLASSPATH environment variable. For more information, see the following page:
XML parser and XSLT processor
Additionally, the Generate Command Documentation (GENCMDDOC) CL command uses the CommandHelpRetriever class. So you can simply use the GENCMDDOC command to take advantage of the functionality offered by the CommandHelpRetriever class. For more information, see the following page:
Generate Command Documentation (GENCMDDOC)
You can run the CommandHelpRetriever class as a stand-alone command line program. To run CommandHelpRetriever from a command line, you must pass the following minimum parameters:
You can also pass optional parameters to CommandHelpRetriever that include the iSeries server, the user ID, password, and the location for the generated file.
For more information, see the Javadoc reference documentation for CommandHelpRetriever.
Example: Using CommandHelpRetriever from a command line
The following example generates an HTML file called CRTLIB.html in the current directory.
java com.ibm.as400.util.CommandHelpRetriever -library QSYS -command CRTLIB -system MySystem -userid MyUserID -password MyPassword
You can also use the CommandHelpRetriever class in your Java application to display the help documentation for specified CL commands. After you create a CommandHelpRetriever object, you can use the generateHTML and generateUIM methods to generate help documentation in either format.
When you use generateHTML(), you can display the generated HTML in the panel group for the command or you can specify a different panel group.
The following example creates a CommandHelpRetriever object and generates String objects that represent the HTML and UIM help documentation for the CRTLIB command.
CommandHelpRetriever helpGenerator = new CommandHelpRetriever(); AS400 system = new AS400("MySystem", "MyUserID", "MyPassword"); Command crtlibCommand = new Command(system, "/QSYS.LIB/CRTLIB.CMD"); String html = helpGenerator.generateHTML(crtlibCommand); String uim = helpGenerator.generateUIM(crtlibCommand);
For more information about the CommandHelpRetriever class, see the following Javadoc reference documentation:
CommandHelpRetriever