Running BBj Thin Client from an Applet

 

In BBj 15.0 and higher, Thin Client applets are deprecated.

Description

The BASIS BBj Thin Client allows a user to run a remote program on their machine. The user can either do this through a Web browser or as a stand-alone client.

How to Run Thin Client From an Applet

BASIS provides a Thin Client applet for the purpose of running BBj applications in a Web browser. Within the html code of the Web page, the following applet tag needs to be put in:

<APPLET CODE = "com.basis.bbj.client.bbjapplet.BBjApplet" WIDTH = 650 HEIGHT = 475 >

<PARAM NAME = CODE VALUE = "com.basis.bbj.client.bbjapplet.BBjApplet" >
<PARAM NAME="cache_archive" VALUE="BBjThinClient.jar,ThirdParty.jar">
<PARAM NAME="cache_option" VALUE="Plugin">
<PARAM NAME="cache_version" VALUE="1.0.0.1,1.0.0.1">
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
<PARAM NAME = "AppServerPort" VALUE = "port_number" >
<PARAM NAME = "BBjProgram" VALUE = "program_name">
<PARAM NAME = "BBjConfig" VALUE ="config_file">
</APPLET>


Within the applet tag, the following five parameters may be set (*indicates those that are required):

  • AppServerPort* – The port on which AppServer is running.

  • BBjProgram* – The program, located on the server that is to be run.

  • BBjConfig – The configuration file, on the server, which is to be used.

  • WorkingDirectory – This applet parameter provides the same functionality as the -WD parameter to the BBj executable. BBj will attempt to change to the specified directory before loading or running the program.

  • TerminalAlias – This applet parameter specifies the terminal alias in the config.bbx to use for channel zero. It is equivalent to the "-t" option to the BBj executable.

NOTE: To ensure the cache is updated with the new jars, increment the cache version of the external jar script or html file.

The following can be added to set the look and feel of an applet:

   <PARAM NAME = "LookAndFeel" VALUE = "VPRO5">

Example

This is the applet tag necessary to run BASIS's CUI Web Demo:

<APPLET CODE = "com.basis.bbj.bbjapplet.BBjApplet" WIDTH = 650 HEIGHT = 475 >

<PARAM NAME = CODE VALUE = "com.basis.bbj.bbjapplet.BBjApplet" >
<PARAM NAME="cache_archive" VALUE="BBjThinClient.jar,ThirdParty.jar">
<PARAM NAME="cache_option" VALUE="Plugin">
<PARAM NAME="cache_version" VALUE="1.0.0.1,1.0.0.1">
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
<PARAM NAME = "AppServerPort" VALUE ="2003">
<PARAM NAME = "BBjProgram" VALUE ="sample1.bbj">
<PARAM NAME = "BBjConfig" VALUE ="config.min">
</APPLET>

For further examples, look at Sample1Index.html in the demos/cuiweb directory and ec.html in the demos/ecommerce directory.

 

Prototype Web Demo Example

Listed below is prototype example for running a BBj program in a Web browser. The sample is installed as <bbj install>/lib/prototype.html. Set the values for the following parameters for customized implementation:

 

Parameter

Description

w

Specifies frame width.

h

Specifies frame height.

App

Specifies application name for Title Bar and Header.

Cfg

Specifies the config file name.

LookAndFeel


Prog

Specifies program name.

After the protptype.html file has been edited to run an application, it must be saved in the lib directory as <bbj install>/lib/<myapp>.html, where <myapp> is the name supplied for the new .html file. To test the application, click on the .html file in Windows Explorer or open the file in a browser.

To see a working example of this type of browser application, view sample1Index.html in the <bbj install.>/lib directory.

 

<HTML>
<HEAD>
<TITLE>
[App]
</TITLE>
</HEAD>

<BODY BGCOLOR="white">

<center>
<h1>[App]</h1>

<SCRIPT LANGUAGE="JavaScript"><!--
    var _info = navigator.userAgent; var _ns = false;
    var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
//--></SCRIPT>

<SCRIPT LANGUAGE="JavaScript1.1"><!--
    var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0)) && (navigator.appVersion.indexOf("5.") != 0));
//--></SCRIPT>

<SCRIPT LANGUAGE="JavaScript"><!--
    if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH=[w] HEIGHT=[h] codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_0-win.cab#Version=1,4,0,mn"><NOEMBED><XMP>');
    else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;jpi-version=1.4" java_CODE ="com.basis.bbj.client.bbjapplet.BBjApplet" cache_option="Plugin" cache_archive="BBjThinClient.jar,ThirdParty.jar"cache_version="1.0.0.1,1.0.0.1" WIDTH=[w] HEIGHT=[h] AppServerPort="2003" BBjProgram=[Prog] BBjConfig=[Cfg] SecureConnection="false" pluginspage="http://java.sun.com/products/plugin/1.4/plugin-install.html"><NOEMBED><XMP>');
//--></SCRIPT>

<APPLET CODE = "com.basis.bbj.client.bbjapplet.BBjApplet" WIDTH=[w] HEIGHT=[h] ></XMP>
<PARAM NAME = CODE VALUE = "com.basis.bbj.client.bbjapplet.BBjApplet">

<PARAM NAME="cache_archive" VALUE="BBjThinClient.jar,ThirdParty.jar.">
<PARAM NAME="cache_option" VALUE="Plugin">
<PARAM NAME="cache_version" VALUE="1.0.0.1,1.0.0.1">

<PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.4">
<PARAM NAME = "AppServerPort" VALUE ="2003">
<PARAM NAME = "BBjProgram" VALUE =[Prog]>
<PARAM NAME = "BBjConfig" VALUE =[Cfg]>
<PARAM NAME = "SecureConnection" VALUE ="false">

</APPLET>

</NOEMBED></EMBED></OBJECT>

</center>

</BODY>
</HTML>