Appboard/old/kiosk mode
Kiosk Mode (also called Stack Auto-Rotation) is a customization supported by AppBoard for displaying multiple Stacks without any interaction from the end user. Some customers use AppBoard in an operations center, or in a kiosk display, to display information without the ability for the user to interact with the screen. In this case, it may be desirable to have AppBoard automatically cycle through multiple Stacks.
This page provides instructions for configuring a Javascript implementation of Kiosk Mode.
Summary of Solution
The solution detailed on this page places a Javascript file on the AppBoard server that augments the stock AppBoard Viewer code by including reference to a Javascript file. This Javascript file tells AppBoard to auto-rotate between a defined list of Stacks at a defined timing interval. The end user can then reference either the standard URL to use AppBoard normally, or s a special URL to use AppBoard in Kiosk Mode.
Creating and Customizing the Javascript File
Perform the following steps to create and customize the auto-rotation Javascript file:
- Save the "Javascript Code" shown below into the following file:
- [Install_Home]/server/webapps/enportal/visualizer/kiosk.js
- Edit the file in a text editor to configure the following settings:
- Rotation Delay
- Locate the var rotate_delay setting
- Modify the setting to the number of seconds you want AppBoard to wait before rotating to the next Stack, times 1000
- List of Stacks to Rotate
- Perform the following steps to identify the Stack IDs of the Stacks to include in the rotation:
- Create a Backup to update the stacks.xml_<date>.completed file.
- Open the most recently updated version of the file in a text editor:
- [Install_Home]/server/webapps/enportal/WEB-INF/xmlroot/appboard/config/stacks.xml_<date>.completed
- Search the file for the name of each Stack to include in the rotation. The line above the Stack Name will contain the StackID. The section with the Stack ID will look similar to the following:
- <obj className="appboard.config.Stack" id="CFFA24B3-C9EF-07E1-0636-DF6972E931A7">
- <attribute name="title" value="<StackName>">
- Locate the var stacks = [ section
- Replace the sample StackIDs by copying and pasting the StackIDs you located above for each Stack that you want to include in the rotation
Javascript Code
[xml,N]
var stacks_control = "Button"; // Button or Tab
var rotate_delay = 30000; // in milliseconds
// update the list below with Stack IDs relevant to your installation
var stacks = [
"57EC79E3-0D96-8688-8F95-DF693FDC103F",
"CB8E041F-B2FC-E03C-2F6A-DF695751B487",
"CFFA24B3-C9EF-07E1-0636-DF6972E931A7"
];
var stack_idx = 1; // initial stack to rotate to
// simple control function to rotate through available stacks
function rotateStacks() {
window.location.hash = '#stacksControl=' + stacks_control + ';selectedStackId=' + stacks[stack_idx];
stack_idx++;
if ( stack_idx > stacks.length - 1 ) {
stack_idx = 0;
}
}
// start rotation once the page finishes loading
window.onload = function() {
setInterval( rotateStacks, rotate_delay );
};
// do some setup stuff if we want Button mode vs Tab mode
if ( stacks_control == "Button" ) {
var scHash = "#stacksControl=" + stacks_control;
if ( window.location.hash != scHash ) {
var redirect = window.location.pathname + scHash;
window.location = redirect;
}
}
Incorporating Stack Rotation Into AppBoard
Perform the following steps to implement the kiosk.js file into the AppBoard system:
- Locate the file [Install_Home]/server/webapps/enportal/ab/index.jsp
- Copy this file to the directory [Install_Home]/server/webapps/enportal/visualizer/.
- Edit the new copy of index.jsp, adding the following line just before the closing </head> tag:
<script type="text/javascript" src="kiosk.js"></script>
Invoking Kiosk Mode
Instruct your AppBoard users to replace their AppBoard URL with the following URL to run in Kiosk Mode:
http://<hostname>:<port>/enportal/visualizer/index.jsp