Terminal Emulation & Transformation Community
  • Home
  • Blogs
  • FORUM
  • About
  • Contact
  • Resources

Programmable Host On-Demand using Java Web start technology

10/3/2017

2 Comments

 
Picture
What is Programmable Host On-Demand
The Programmable Host On-Demand API is a set of Java APIs that allow developers to integrate various pieces of the Host On-Demand client code, such as terminals, menus, and toolbars, into their own custom Java applications and applets.

Advantages of using Programmable Host On-Demand
  • The underlying Host On-Demand code handles "wiring" of the various components, including saving user preferences, such as macros, keyboard remapping, and color remapping, to the local file system for future use.
  • The developer must only determine the layout of the Host On-Demand desktop.
  • The developer can use the API to create a Host On-Demand desktop that shows the session icons and allows sessions to be started by double clicking the icons or a custom desktop that does not show the session icons. In the latter case, an API call starts the sessions.

In this blog, focus remains on custom applets.

What is Java Web start technology
Applets are typically downloaded from a Web server and run on a client machine in a Web browser that has Java support i.e users need to enable Java plugin support in their browser via NPAPI plugins. Most browsers stopped supporting NPAPI plugins except Microsoft Internet explorer because plugins are a source of performance problems, security incidents and crashes.

Note:
Microsoft has also released their own plugin free web browser Edge.
The way forward for existing applet based applications is to use Java web-start technology as suggested by Oracle.

Java Web Start
(also known as JavaWS, javaws or JAWS or JNLP) is a framework developed by Sun Microsystems (now Oracle) that allows users to start application software for the Java Platform directly from the Internet using a web browser. Some key benefits of this technology include seamless version updating for globally distributed applications and greater control of memory allocation to the Java virtual machine.
 
Putting these together in IBM Host On-Demand
IBM Host On-Demand web start client can wrap applets into an application. Users need to implement LoadableAppletInterface and WSLoadableAppletInterface interfaces so that the Host On-Demand wrapper can access the custom applet.
If the custom code has components directly added to the applet, developer must add them to a separate panel and then add this panel to the applet container. Rest of the customer code will work as it is.

Step:1 – Modify the custom class to implement the required interfaces
Sample applet modified code:

    
Create a custom jar with all the required manifest parameters, e.g. customJar.jar has TermTest.class file.

Step:2 – Configuring the Host On-Demand page.

From Host On-Demand version 12 onwards, any html page comes with an associated JNLP file. This JNLP file has all the required jars listed as part of the “preloadComponentList”.

Note:
To be able to use Programmable Host On-Demand, users must select this component in preload option in deployment wizard, it is not enabled by default.
The jar with custom code needs to be added as an additional archive using deployment wizard. The JNLP file can also be edited later. Administrator must place the Java archives in the Host On-Demand publish directory.

HTML parameter Name: AdditionalArchives
HTML parameter Values: Names of archives, without file extensions separated by commas. 
Example:
HTML parameter Name: AdditionalArchives
HTML parameter Values: customJar,customJar1

Edit the following parameters in the JNLP file:
  1. <jnlp codebase="http://localhost/hod">
    This is the Host On-Demand codebase.
  2. <property name="jnlp.hod.DocumentBase" value="http://localhost/hod/termtest.html"/>
    This will be the web address of the HTML page created.
  3. <property name="jnlp.hod.CachedClientSupportedApplet" value="TermTest"/>
    This will be name of the applet class.
  4. <property name="jnlp.hod.AdditionalArchives" value="customJar"/>
    This needs to be added only if you did not add AdditionalArchive parameter when creating the JNLP from the deployment wizard. You can specify multiple archive names separated by comma.

​Below is a Sample JNLP file:

    
Now Programmable Host On-demand users can access their page by using either one of the below URL’s
http://localhost/hod/TermTest.html or http://localhost/hod/TermTest.jnlp
Picture
Special considerations:
  1. Web start is independent of the browser – applications can’t access JavaScript API or JavaScript functions.
  2. For faster access, archives are downloaded to local machine.
  3. A shortcut to the JNLP is created on the desktop.

Some references
  • https://www.ibm.com/support/knowledgecenter/en/SSS9FA_12.0.0/com.ibm.hod.doc/doc/proghod/phFirstApplet.html
  • http://docs.oracle.com/javase/8/docs/technotes/guides/javaws/
  • https://blogs.oracle.com/java-platform-group/npapi-plugin-perspectives-and-the-oracle-jre ​

Praveen Shashikant
Chief Programmer, HOD
praveeny@hcl.com 
2 Comments
Minneapolis web design company link
7/29/2019 04:49:08 am

I am glad that you shared this with us and I really appreciates your work as well. Great share!

Reply
Faribault mn web design link
7/29/2019 11:17:21 pm

I admire this article for the well-researched content and excellent wording

Reply



Leave a Reply.

    Archives

    May 2020
    October 2019
    July 2019
    June 2019
    May 2019
    March 2019
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    January 2018
    December 2017
    October 2017
    September 2017

    Categories

    All
    HACP
    HACPEE
    HATS
    HOD
    PCOMM

    RSS Feed

Proudly powered by Weebly
  • Home
  • Blogs
  • FORUM
  • About
  • Contact
  • Resources