WebFOCUS API Packages and Classes

In this section:

The WebFOCUS API contains two packages.

Package

Description

ibi.webfoc

Contains classes used to create the context in which the request will execute. It also contains the API calls required to run a WebFOCUS reporting procedure or a Managed Reporting request within Web or non-Web Java applications.

ibi.webfoc.wfutil

Contains classes used to provide error handling and retrieve additional environment variables to be included in the processing of a WebFOCUS request.



x
WebFOCUS API Classes

In this section:

Applications that integrate WebFOCUS functionality through the WebFOCUS API will need to perform a few common tasks, such as authentication, creating the environment context, and executing the request. This section describes the classes that accomplish these tasks. The WebFOCUS API sample application illustrates how to use these classes in your application. For details, see WebFOCUS API Samples.



x
Authentication

Typically, user credentials are retrieved from a form. These credentials must then be mapped to the required sign-on request parameters to authenticate against a WebFOCUS Reporting Server and/or the Managed Reporting repository. The following diagram illustrates how the WebFOCUS API sample application handles the login process.

The ApplController servlet detects a login action and calls the ibi.ajs.wfapi.LoginAction class.The com.ibi.ajs.wfapi.LoginAction class gathers the logon credentials from the logon.jsp form and calls the ibi.ajs.wfapi.LoginContext JavaBean to create the login context. The login context is then sent to the ibi.ajs.wfapi.samples.WfApiRequestHandler class, which then adds the credentials to the WFApplicationRequest object.



x
Setting Up the Context

In addition to providing valid credentials, the WebFOCUS API requires that an initialization context be created with the proper request parameters and its values necessary to run a request. This includes the root directory to the WebFOCUS script files (\ibi\WebFOCUS77\client\wfc) and any Web server environment variables needed by the application. To initialize the environment in which the application will run, developers must implement the ibi.webfoc.WFApplicationRequest class and use the ibi.webfoc.WFApplicationRequest.addParameter() method to add variables to the WebFOCUS table. To add cookie information or Web server variables to the WebFOCUS table, developers must implement the ibi.webfoc.WFServletVariableTableExtension class. To see an example of how to implement these classes/methods, see the following classes in the WebFOCUS API sample application:



x
Processing the Request

After the user credentials and initialization variables have been added to the WebFOCUS variable table, the request can then be submitted to the WebFOCUS API using the ibi.webfoc.WFWorkerUtil.processRequest() method. The initialization context must be passed to this method. For an example of how to implement this method, see com.ibi.ajs.wfapi.samples.WfApiRequestHandler class in the WebFOCUS API sample.


WebFOCUS