Niagara - WebService - Using JAVA applets - start-up
The article describes methods for running a WebService with support for JAVA applets (plug-in). This is equivalent to running the station without using the WorkPlace program on a PC connecting to a remote Supervisor or controller, while maintaining the same appearance of the widgets and full functionality of the station (not applicable to the platform) as from the WorkPlace program. When operating the station using HTML5 technology via a web browser, some of the functionalities are unavailable, and the widgets can look different. In addition, the examples discussed in this article do not require the purchase of a license to WorkPlace for operating stations.
1. Configuration of a Niagara station
Configuration of a station only involves setting the corresponding user's Default Web Profile to one of the Wb Web Profile profiles. In the example in question, the Default Wb Web Profile value was selected.
Fig. 1 Configuring a user
2. Establishing a connection with JAVA applet support
In order to establish a connection with JAVA applet support, first of all, the JAVA Runtime Environment (JRE) must be installed on the PC, preferably the current version.
If JAVA is already installed on the PC, there are two options for starting a connection with the WebService of the Niagara station.
2.1. Using the Niagara Web Launcherapplication from Tridium
To use the Niagara Web Launcher application, first, download the latest version of the installation file from the Tridium server. Variants are available for:
64-bit systems: https://weblauncher.niagara-central.com/NiagaraWebLauncher.msi,
32-bit systems (-x86): https://weblauncher.niagara-central.com/NiagaraWebLauncher-x86.msi.
After downloading the appropriate package, installing the program and turning it on, enter the URL of the station to which the connection will be made.
Fig. 2 Entering the URL in the Niagara Web Launcher
After confirming with the Go button, the connection will be attempted and (if an encrypted connection via HTTPS has been selected) after a short while the public key acceptance window will appear (it only displays the first time). After accepting the key, the standard WebService login window will appear, as below:
Fig. 3 Login window in the Niagara Web Launcher
2.2. Using the Java Web Start
To use the Java Web Start mechanism built into the JRE, go to any Internet browser and enter the URL of the station (in the example described here, https://192.168.192.1.247/prelogin). When the login window loads, click on the ‘click here' link next to the text ‘To connect using Java Web Start’, as indicated below:
Fig. 4 Downloading the JNLP file to run the station using Java Web Start
Upon clicking a link, a file will be downloaded to disk with the station name and the .jnlp extension (in the example described, it will be the file iSMA_B_MAC36NL.jnlp), at which point warnings may occur - to be accepted. The file should download and save itself in the indicated location or in the downloads folder of the user logged on to the PC. After running this file, the Java Web Start loading window will appear, as below:
Fig. 5 Java Web Start downloading window
The first time, a window will appear asking whether to run the application - click the Run button. After that, a security warning window (Security Warning) will appear, which you should accept with the Continue button. After confirming all windows, a window (Niagara Web Start) for logging into the station will appear as below:
Fig. 6 Station login window in the Java Web Start
3. Capabilities of WebService with support for JAVA applets
Once the appropriate login credentials are entered (regardless of the Niagara Web Launcher or Java Web Start method selected), the loading of all jar modules from the remote device will take place. Depending on the number of installed modules, this may take from a few seconds even up to a minute. During this time, the window will display the following content:
Fig. 7 Window for loading jar modules in Niagara Web Launcher and Java Web Start
At the end of loading (but only in case of an encrypted HTTPS connection) there may again be a request to accept the public key (it only displays the first time). After its acceptance, the contents of the user's default page (configured in the nav file) will appear.
The displayed graphical widgets will be identical to those displayed when browsing via WorkPlace. A good example, for example, is the TabbedPane widget, which looks different in WorkPlace than it does in the web browser with the HTML5 Hx Profile user profile. On the other hand, in Niagara Web Launcher and Java Web Start it will look identical to WorkPlace.
In addition to the basic WebService functionality, the user will be able to launch the WireSheet view and some of the Side Bars windows (e.g., Nav, or Palette). Below is an example in which the user has opened the Palette window and is in the process of opening the palette of a particular jar module.
Fig. 8 Niagara Web Launcher and Java Web Start capabilities after logging in - with the user profile set to Default Wb Web Profile.
It should be noted that the list of available jar modules includes only those installed in the device platform via Software Manager.
The user's level of access to the content depends on the assigned permissions. If the display of side bars is undesirable then the user can change the Default Web Profile to the value Basic Wb Web Profile. By changing this profile, in the example in question, it will display the following content:
Fig. 9 Niagara Web Launcher and Java Web Start capabilities after logging in - with the user profile set to the value Basic Wb Web Profile.
4. Possible problems with running WebService with JAVA applet support
In older versions of Niagara (e.g. 4.7.109.20 or 4.6.96.28), problems may occur when launching the WebService with JAVA applet support if the WorkPlace application is active at the time of enabling the Niagara Web Launcher or Java Web Start. The result will be an impression of the operating system's unresponsiveness when trying to enable the Niagara Web Launcher application or the jnlp file (Java Web Start) - in this case, turn off the WorkPlace application and try again.