The WOW i5 Gateway add-on product allows end users to view i5 spool files from the web with a single click. Advanced features also allow for conversion of spool file data into MS Excel and PDF formats. Spool files can be produced with any language or command. The WOW i5 Gateway Repository is used to register, view, and manage existing spool files. Advanced WOW security allows for spool files to be viewable only by authorized users.

 

The i5 Gateway add-on offers the following features:

Installation

Setup

Creating a CL Command Operation

The Spooled File Manager

Spooled File Manager Operation

Spooled File Viewer Operation

Using the Spooled File Manager

Utilizing the i5 External API

Calling an Operation that Alters Data

Calling an Operation that Copies Data Back to the i5

Installation

PlanetJ's WOW i5 Gateway add-on is very simple to install, especially if you already have tomcat and WOW installed on your system already.

 

There are really only 2 steps to install the i5 Gateway:

 

  1. Restore the WOW metadata library (WOWI5GTWY, provided in your download package):
  1. FTP the save file provided (wowi5gtwy.savf) to your i5. Assuming the save file created has the same name, then
  2. RSTLIB SAVLIB(WOWI5GTWY2) DEV(*SAVF) SAVF(WOWI5GTWWOW Y) MBROPT(*ALL) ALWOBJDIF(*ALL) RSTLIB(WOWI5GTWY)
  1. Add the jars to your existing WOW webcontext in Tomcat:
  1. Copy the jars found (pd4ml_demo.jar, wow-i5-gateway.jar) in the wow-i5-gateway folder and paste it into your existing webapp's lib folder: ~\Tomcat 6.0\webapps\wow65\WEB-INF\lib
  2. Restart Tomcat to pickup the new jar files.

Setup

Included with the install, is a WOW metadata library (similar to PJUSER64), which will provide basic i5 Gateway functionality, to set up this metadata library, please follow these instructions:

 

The link assumes the browser is run from the local WOW server (localhost) and the web context is wow65.

Creating a CL Command Operation

With this add-on, a user can create an operation that runs a i5 CL command. After the command has completed, feedback from the command call can be displayed as the operation results. The feedback can include spooled files, the AS400 joblog and any error messages encountered.

To create a CL Command operation, set the following operation fields from the WOW Builder:

NOTE: If you need to run more than 1 CL command, separate them with a semi-colon. For example:

An example of the output from a CL Command operation is:

The Spooled File Manager

With this add-on, a user can display any spooled file registered in the WOW spooled file metadata table, WSPLF. The spooled file data can be displayed in the browser, sent to a PDF, or sent to an Excel file.

To create a spooled file manager operation, 2 operations will be needed. One for displaying WSPLF, and one for displaying the spooled files. This document will also show you how to use the spooled file manager as well.

Spooled File Manager Operation

To create a spooled file manager set the following operation fields from the WOW Builder:

SELECT * FROM planetj_usr.WSPLF

planetj.dataengine.i5gateway.SpooledFileRow

/wow/plugins/i5gateway/jsp/pw_results.jsp

Spooled File Viewer Operation

To create the spooled file viewer operation set the following operation fields from the WOW Builder:

/wow/plugins/i5gateway/jsp/splf.jsp

Using the Spooled File Manager

To use the spooled file manager, first run the operation. Once WSPLF is populated with spooled file metadata, you will see several row actions for handling spooled files:

Below is sample output from viewing a spooled file:

Utilizing the i5 External API

This API allows any i5 program with database access the capability to call a URL, which can then be used to call a WOW operation. The WOW operation can then perform any needed function, such as a) inserting or updating a row of data, or b) copying remote data back to a table on the i5. The WOW operation can be run using any connection configured within WOW (SQL Server, MySQL, Oracle, i5, etc.).

All that is needed to invoke the URL, is a COMMAND (WOW table in WOWI5GTWY) row with the required fields populated. The URL can be invoke by either inserting the COMMAND row or updating it. The COMMAND file should be included with the WOWI5GTWY library. When the row is inserted or updated, a trigger program attached to the COMMAND file (via an ADDPFTRG command) is run, which sends the command and parameters to the WOW server. The result depends on which WOW operation is run and what URL parameters are included.

The following is a step by step example of how to use the API:

ADDPFTRG FILE(WOWI5GTWY/COMMAND)

TRGTIME(*AFTER) TRGEVENT(*UPDATE)

PGM(WOWI5GTWY/APITRIG)

ALWREPCHG(*YES)

Calling an Operation that Alters Data

In this section we will walk through an example call of an operation to alter data.

NOTE: Parameter names are case sensitive.

NOTE: The parameter names are case sensitive.

Calling an Operation that Copies Data Back to the i5

You must specify the CopyTable property group in the Properties field. The CopyTable property must be specified, since the source and destination tables cannot be the same. The CopyTable properties are as follows:

NOTE: The parameter names are case sensitive.