What is JWPS?

The java WPS package, called jWPS for short, is a set of java classes that will allow a java application to operate with OS/2 and eComStation's (eCS) Workplace Shell (WPS).

Why do I need this?

There are many reasons that this is a useful tool. Among these are the following

An example

Here is an example of how to work with jWPS. A common task is to open the view of an object, say a folder, and maybe set a few extended attributes. Here is a program in toto to do that. It will take the name of a folder from the command line and set the subject line, then open the default view and popup.

  import net.jqhome.jwps.*;             // get the base classes
  import net.jqhome.jwps.ea.*;          // get the EA support
  import net.jqhome.jwps.ea.standard.*; // get the standard EAs.
  import net.jqhome.jwps.fs.*;          // get everything for the file system
 
  
  public class MyJWPSTestClass{
  
     public static main(String[] args){
        try{
           JWPFolder folder = new JWPFolder(args[0]);  // in a real app we'd check the arguments are ok
           SubjectEA subject = new SubjectEA(args[1]); // put the phrase in quotation marks when invoking the program
           folder.setEA(subject);
           folder.open();
           folder.showPopup();
        }catch(JWPException x){
           x.printStackTrace(); // in case of an error, dump it all out.
        }
     } //end main
  
  } //end class
  

It really is that simple. A nice, clean set of calls and well-defined way for things to fail.

Requirements

At this point it runs under GoldenCode Development's Java 1.4.1. It does not run under Innotek's Java port because jWPS does make native calls. Innotek's port is effectively running in a souped-up a Win-OS2 session, which has no concept of the WPS. You will also need Rich Walsh's package RWS (check on Hobbes for the most recent version – this was written against version 0.60). This is what allows jWPS to make WPS calls. If you do not have this, though, there are several extremely useful utilities included.

Installation

The main files are the jar, jwp.jar and the corresponding dll, jwp.dll. The dll goes someplace in your LIBPATH and the jar must be in your java classpath. The dll's for RWS must be in your libpath too.