Are you interested in adding your own C++, Visual Basic, or Java applications to the AS/400 Operations Navigator tree? OpsNav’s new plug-in feature lets your users consolidate all of their AS/400 administration tasks and client/server programs into a single application environment. Learn how to integrate your application’s specialized functions into OpsNav and how you can deliver your own plug-ins to users.
I BM has continually been improving the functionality of AS/400 Operations Navigator (OpsNav) with each new release of Client Access for Windows 95/NT. With the new AS/400 Client Access Express for Windows (the Express client), OpsNav introduces a plug-in feature that provides a common framework for AS/400 Business Partners and customers to add their own applications to their users’ OpsNav tree. After you have created your application plug-in, you can take advantage of the support provided by the Client Access Selective Setup program to distribute your new OpsNav plug-in within your organization or to outside users and customers.
How Does the Plug-in Feature Work?
Regardless of whether your plug-in is written in C++, Visual Basic (VB), or Java, the principle is the same: You implement a set of predefined classes and methods that are invoked by the Navigator in response to a particular user action. Take a look at the following example of how to create a Java plug-in; however, be aware that this example is meant for overview purposes only. (For more information on how to create plug-ins using all three of these programming languages, consult the Related Materials section at the end of this article.)
You can use the plug-in support to add a new container to the OpsNav tree, as shown in Figure 1. When the user clicks on the container, the plug-in’s Java code is called to obtain the container’s contents—in this case, a list of messages on the user’s default message queue. OpsNav communicates with the Java plug-in by invoking methods defined on a special Java interface, known as the ListManager interface (Note: the javadocs for these Java interfaces are
available at the AS/400 Information Center Web site, www.as400.ibm.com/infocenter. The .jar file—jopnav.jar—resides in the Client Access/Classes folder). The plug-in support defines this interface specifically for the purpose of letting Java applications supply list data to the OpsNav tree and list views. To integrate your application into OpsNav, you create a new Java class that implements this interface. The methods on the new class call into your existing Java application to obtain the list data, as shown in Figure 2.
What happens when the user wants to perform an action on one of your objects? In Figure 3, the user right-clicked on a message object to display its context menu. OpsNav called a predefined method on another Java interface, ActionsManager, to obtain the list of menu items supported for message objects. Once again, you would create a new Java class that implements this interface. This is how you make your application’s specialized functions available to your users through OpsNav.
When the user selects the menu item, the Navigator calls another ActionsManager method to perform the action. Your ActionsManager implementation calls your existing Java application, which can then display a confirmation dialog or some other, more- sophisticated user interface panel that lets the user perform a specialized task.
The plug-in feature allows you to define actions on any of the base objects supplied with OpsNav, as well as on new object types that your plug-in introduces into the hierarchy. Based on its current status, you can “gray out” actions that aren’t appropriate for an object, and you can supply status bar help for each action. You can also refresh portions of the main OpsNav window after an action is performed.
The OpsNav user interface is designed to let users work with lists of AS/400 resources and to perform actions on them. The architecture of the plug-in feature reflects this user interface design by defining interfaces for working with lists of objects in a hierarchy and for defining actions on those objects. A third interface, DropTargetManager, is defined to allow plug-in containers to handle drag-and-drop operations.
How Do You Install Plug-ins?
You can deliver your plug-in code to OpsNav users by including it with your OS/400 applications. The install program for the application writes the plug-in’s code binaries, registry file, and translatable resources to the /QIBM/ UserData/OpNavPlugins folder in the AS/400 Integrated File System (AS/400 IFS). Once this process is completed, users can obtain the plug-in from the AS/400 IFS (with the help of an AS/400 NetServer mapped network drive) by invoking the Client Access Selective Setup program. The setup program copies your plug-in code to the user’s machine, downloads the appropriate translatable resources based on the language settings on the user’s PC, and runs the registry file to write your plug-in’s registry information to the Windows registry. All you need is a setup file, which identifies the files to be installed. If you provide a Windows policy template with your plug-in, you can also take advantage of Windows system policies to control which network users can install your plug-in. And you can use the AS/400-based application administration support of OpsNav to control which users and user groups can access your plug-in.
After the users have installed your new plug-in, you may choose to either upgrade it at a later date or ship bug fixes. When the code is upgraded on the AS/400, the Client Access Check Version program will detect that this process has occurred and automatically download the updates to the users’ machines. Client Access also provides uninstall support, which lets your users completely remove the plug-in from their machines anytime they wish. Users can learn what plug-ins are installed on their machines by clicking on the Plug-ins tab on the OpsNav Properties for an AS/400.
How Does OpsNav Learn About Your Plug-in?
You’ve seen how OpsNav invokes your plug-in in response to a specific user interaction and how to install the plug-in on your Windows desktop. But how does OpsNav even know that your plug-in exists?
Plug-ins identify themselves to OpsNav by supplying information in the Windows registry when the plug-in software is installed on the Windows desktops of your users.
The registry entries specify the location of the plug-in code and identify the classes that implement the special OpsNav interfaces. You can supply additional registry information that lets OpsNav determine whether the plug-in’s function should be activated for a particular AS/400 system. For example, a plug-in may require a certain minimum release of OS/400, or it may specify that a certain product needs to be installed on the AS/400 in order for it to function.
When a user clicks on an AS/400 in the OpsNav tree after installing a plug-in, the AS/400 is examined to determine whether it is capable of supporting the new plug-in. The software prerequisites (specified in the plug-in’s registry entries) are compared against the software installed on the AS/400. If the plug-in’s requirements are satisfied, the new function will be displayed in the OpsNav tree. If the requirements are not met, the plug-in’s function will not appear in the OpsNav tree hierarchy for that AS/400. However, the plug-in may participate in the decision of whether to be included in the hierarchy by implementing a special function, which can be called by OpsNav during this scanning process.
Plug-in Requirements
An OpsNav plug-in stipulates different requirements according to the programming language you plan to use. To function as an OpsNav plug-in, C++ applications developed using Microsoft’s Visual C++ must be written to run on Version 4.2 or later. Java plug-ins run on the IBM Win32 Runtime Environment, Java Edition, Version 1.1.7 (Win32 JRE), and Sun’s Java Foundation Classes (JFC), Release 1.0.3. Visual Basic plug-ins run on Version 5.0 of the VB runtime environment. The plug-in feature is also provided in the Client Access for Windows 95/NT product for C++ plug-ins only, beginning in Version 3 Release 2. For detailed information on how to create OpsNav plug-ins, browse the AS/400 Information Center and Technical Studio Web sites or check the references listed below.
Plug-in to the Future
Operations Navigator is designed to serve as the foundation of the AS/400’s user interface for the future. Now, you can participate in the growth of this exciting new interface by taking advantage of these same design features that make it easy to incorporate new functions into OpsNav. By adding your own C++, Java, or Visual Basic applications to OpsNav, you can provide an integrated application environment for users or customers who administer AS/400 systems.
Related Materials
AS/400 Client Access Express for Windows Version 4 Release 4 Modification 0 (SG24-5191), IBM Web Redpiece, available at www.redbooks.ibm.com
AS/400 Information Center and Technical Studio Web sites, IBM, www.as400.ibm.com/ infocenter
AS/400 Operations Navigator Plug-in Support White Paper, IBM, www.as400.ibm. com/oper_nav/pluginwpaper.htm
Operations Navigator Plug-In Support Web page, IBM, www.as400.ibm.com/oper_nav/ pluginpage.htm
Operations Navigator Plug-In Support, IBM Technical Studio document, www.as400. ibm.com/tstudio/opsnav/plugin/pludex.htm
“OpsNav: New York-to-L.A. Enormous,” M id ra ng e Co mp ut in g (W eb E di ti on ), May 1999, www.midrangecomputing.com/ mc/99/05
Operations Navigator
OpsNav
Plug-in Support
New OpsNav Interface
Classes
Your Existing Application
Figure 2: To integrate applications into OpsNav, create new interface classes that let the Navigator communicate with your existing application.
Figure 3: Right-clicking on a message object displays its context menu.
LATEST COMMENTS
MC Press Online