Remote Subject UI Applet

NAME

guinea.tools.remoteui.RemoteUIApplet.class - an applet to request a remote subject UI client from subject UI server and start it.

SYNOPSIS

appletviewer URL
netscape URL

DESCRIPTION

The RemoteUIApplet is an applet that can be used to connect to a remote subject UI server the same as with the gpRemoteUIClient tool. Since the client is an applet, you can theoretically use any networked java-capable device to display the test user interface to the subject. At least Sun's JDK appletviewer and netscape 4.06 (both on SGI) seem to work. Also a quick test with Windoze version of netscape 4.06 seemed to work. Netscape's versions prior to 4.06 generally didn't seem to work.

The applet will show as a small panel on the web browser. The applet allows the subject to set the remote UI server's hostname and port number. A popup menu can also be used to select the UI server's hostname and port. Finally the subject presses the 'Connect' button to initiate the connection to the remote server. From there on things go the same as with the gpRemoteUIClient tool.

Here is an image of the applet:

[image of remote UI applet]
An example of RemoteUIApplet: on left there is a textfield to select the server hostname, next is a button to pop up a selection of available UI servers, next is a textfield to set the port number and finally a 'Connect' button to contact the remote UI server.

APPLET CONFIGURATION

Applet's parameters and options are set by the tester by giving parameters to the applet using the applet-tag's param-tags on the HTML-page that invokes the applet. The default server host and the list of selectable servers from the popup menu can be configured. Also the fonts used by the applet can be set.

Font parameters

Font parameters allow setting different fonts for different objects in the applet panel. Available parameters are:

menufont fontspec
Set the font for menu items in the host popup menu.
textfont fontspec
Set the font for textfields (hostname and port).
buttonfont fontspec
Set the font for buttons (connect-button).
font fontspec
Set the default font. It will be used if other specific fonts have been set.

Server host parameters

Server host parameters allow setting the default server hostname and portnumber as well as list of hosts available from the host menu. Available parameters are:

defaultHost hostinfo
Set the hostname and port of the subject UI server shown initially.
defaultPort portnumber
Set the default port number to use if port number has not been explicitly set (usually with menu configuration and hostinfos).
hostN hostinfo
Add a server into the popup menu. The N is an integer starting from 1 (one). The applet will scan applet parameters starting from host1 and goes on to host2, host3 and so on. It will stop when it finds no host(n+1) after host(n). Parameter names host3, host03 and host003 are all equivalent.

The hostinfo parameter tells the address of the server and which port to use. The simplest form is the host name alone, for example:

  foo.bar.com
      
It specifies the host 'foo.bar.com' and uses the default port. A non-default port number can be specified:
  foo.bar.com:9000
      
Port 9000 of host 'foo.bar.com' is specified. For the menu, also a label can be set:
  foo.bar.com:9000;GuineaPig UI server
      
This will define the same address as previous but on the menu, 'GuineaPig UI server' will be shown as the label. If no label is set, the hostname will be used as the label. If default port is used, the port number can be left out:
  foo.bar.com;GuineaPig UI server
      

In the hostinfo sepcifications, the hostname can be set to 'DOCUMENTHOST' (all capitals). This will be automatically replaced with hostname of the host the applet was loaded from. For example:

  DOCUMENTHOST;GuineaPig UI server
      
If the applet was loaded from host foo.bar.com, this hostinfo will be automatically changed to
  foo.bar.com;GuineaPig UI server
      
The port number can be added the same way as with other examples. If the applet was loaded from local disk (using a file: URL), 'localhost' will be used as the hostname.

Other options

It is possible to disable the host menu and the textfields for entering host name and port number. Also the applet can be set to automatically connect to the UI server when applet is started. Options are:

showHostMenu true or false
Whether to show the host menu to the subject for selecting the server host. By default this option on (value is true) and the host menu is shown. Set to false to disable the menu (the menu will not be shown).
allowSetHost true or false
Whether to allow the subject to set the hostname and port by using the textfields. By default this option is on (value is true). Set to false to not allow the subject to set the host name and port number, the textfields are used only to show the name of the selected host. The host menu can be used to select the server host (unless the host menu also has been disabled).
autoConnect true or false
Whether to automatically connect to the server when the applet is started. By default this option is off (value is false). When using the autoconnect, the server host should have been set with the defaultHost parameter. Also the allowSetHost and showHostMenu should generally be set to false.

APPLET TAG

The HTML's <APPLET> tag is used to embed the applet onto the page and to pass parameters to the applet. Here is an example of what the applet tag would look like:
  <applet code="guinea.tools.remoteui.RemoteUIApplet.class" archive="guinea.jar"
          width=400 height=50
          alt="Your browser understands the APPLET tag but isn't running the applet, for some reason.">

  <param name="font" value="Serif-14">
  <param name="menufont" value="Serif-italic-14">

  <param name="defaultHost" value="localhost;Localhost">
  <param name="defaultPort" value="6000">

  <param name="host1" value="bird.hut.fi;Hynden kone">
  <param name="host2" value="helmholtz.hut.fi">
  <param name="host3" value="helmholtz.hut.fi:6001;Helmholtz, port 6001">

  Your browser is completely ignoring the APPLET tag!
  </applet>
      
More detailed description of some tags:

code
The java class name of the applet. It must be as shown or the applet will not work.
archive
The name of the Java ARchive (jar) that contains GuineaPig java classes. In this example the guinea.jar file must be found from the same directory where this html-file is in.
param
Parameters are passed to the applet with param tags. They each contain a parameter name, value pair. See above for available parameters names and values.

NOTES

Usually web browsers only allow network connections to the same host where the applet was loaded from. Some browsers can be set to allow connections to other hosts also. For example, JDK's appletviewer allows applet to make connections to other hosts if network access properties are changed to allow unrestricted access. Running applets from local disk (using file: URLs) usually allow unrestricted network access.

The Java tutorial gives more detailed information about what applets can and can't do.

SEE ALSO

gpRemoteUIClient, gpUIServerTest
Java tutorial: what applets can and can't do

· Utils Index · Document index ·

Last modified: Fri Oct 30 12:30:08 EET 1998