PV-WAVE® Net Possibilities!


Using PV-WAVE on the Internet or Intranets

By James Philips

The possibilities are endless. Below are just a few of the ideas with links to examples if they are available. If you are using PV-WAVE (or any VNI product) at your Web site please drop JavaJim a note. I will add you to our list and publish what you are doing and how you did it. Feel free to use any of the ideas or code examples. If you make any significant improvements, send them back to JavaJim so the rest of us can benefit from them.

The basic methods are:

Off-line Picture Generation

Obvious I'm sure, but offered for completeness. In this scenario you use PV-WAVE to generate static images of your data and write them to a file to be displayed at a later time. I recommend that you get the dc_image extension for PV-WAVE so that you can read and write GIF and JPEG files directly from PV-WAVE.

Nothing defines your project or shows off your data better than a nice picture. Don't be the only one without graphics on your home page. When you get your pictures up, be sure to notify JavaJim and we will include you the Our Friends section.

Server Apps - Batch Mode

The most popular and easiest-to-implement method is running PV-WAVE in batch mode on your server. This allows the user to select or define the visual by submitting a request via a forms interface. The information is sent to PV-WAVE, and a predefined PV-WAVE procedure is executed using the supplied information. The visual result is written to a file and displayed to the user.

From the user's perspective this differs from the Server Apps - Interactive Modein that the process to create the visual is predefined and the user just specifies the parameters. In the Interactive Mode, the user is allowed to run PV-WAVE (or PV-WAVE application) in and ad-hoc fashion just as if they were doing it locally.

< Would a block diagram of this method be helpful? Tell JavaJim>

In batch mode the normal sequence of events is:

  1. The user selects the link to submit a job from your HTML page.
  2. A "form" is created, and the user selects and/or enters the information for the request.
  3. The user's parameters are sent to the server, and a PV-WAVE process is launched.
  4. PV-WAVE reads the parameters and executes a predefined PV-WAVE process.
  5. The results are written to a file, and the PV-WAVE process terminates.
  6. The results are then displayed to the user.

Pretty straightforward. Implement the input form in CGI, VBscript, or JavaScript. A Java Applet would probably be overkill in this situation. For communicating with PV-WAVE, I would recommend calling PV-WAVE using a startup procedure and having PV-WAVE read the input from a predefined (or derived) file name.

Click here for information on using CGI to drive PV-WAVE Server Apps in Batch mode. Here are some examples of Server Apps - Batch Mode.

PV-WAVE Tips Search

Scientific Modeling and Visualization Classroom at Virginia Tech.

Server Apps - Interactive Mode

You have always been able to distribute your PV-WAVE user interface over a UNIX network using X and Motif. Now you can play the same game over The Net (Internet or intranet). This method is tailor-made for Java. In fact, this was JavaJim's first Java Applet. Well, not really, JavaJim's first Applet was tweaking TumblingDukes into TumblingCEO, but that one isn't going to see the light of day.

If you want to run PV-WAVE from your Java-enabled browser or you just want to see how it was done, then go to Wapplet. This is just a feasibility study, and you will probably want to do something more meaningful with your Java Applet, but this will give you a good head start.

WARNING! SECURITY ISSUES WITH THIS METHOD!

MAJOR security concerns with this method. Let's discuss them.

Java: The Java language places strict constraints on Java Applets. For example, Java Applets cannot access anything on the Client system, including files, so the data used by PV-WAVE must be on the server. See the JavaSoft home page for more information on Java Applet restrictions.

More importantly, there are not-so-bright people out there and some very bright evil people. Both can do nasty things to your server if you are not careful. PV-WAVE can execute operating system commands. Certain commands like 'rm -rf /*' can have a disastrous result. PV-WAVE can also read and write files, which is all a good evil-doer needs to build a Trojan Horse. SO PLEASE BE CAREFUL!

Presumably if you are on an intranet, you will not need to worry about the evil people. However, if your Java Applet allows users to enter PV-WAVE commands then you are asking for trouble. JavaJim recommends that you make your Applets not just fool-proof, but damn fool-proof. Go to Wapplet to see more on the issue of security.

Client Plug-In

There are two possibilities on using client-side PV-WAVE on The Net. A Plug-In is the most intimate connection between PV-WAVE and your browser. A Client Helper is more of an arms-length relationship.

In either case The Net server will download PV-WAVE code as .pro or .cpr files, and the browser hands them off to PV-WAVE for execution. You may do this if you want to use the client's CPU instead of the server's. Or, maybe the data are on the client -- this is also a good way to version control your PV-WAVE applications.

If you have a good idea for a client-side PV-WAVE application send JavaJim a note and we'll see what we can do. JavaJim is looking for an example of either implementation on the client side.

Client Helper App

There are two possibilities on using client-side PV-WAVE on The Net. The Client Helper Application is an arms-length relationship between PV-WAVE and your browser. A Client Plug-In is a more intimate connection between PV-WAVE and your browser.

In either case, The Net server will download PV-WAVE code as .pro or .cpr files, and the browser hands them off to PV-WAVE for execution. You may do this if you want to use the client's CPU instead of the server's. Or, maybe the data are on the client -- this is also a good way to version control your PV-WAVE applications.

If you have a good idea for a client-side PV-WAVE application, send JavaJim a note, and we'll see what we can do. JavaJim is looking for an example of either implementation on the client side.

For a longer list of sites using PV-WAVE, go to Our Friends.