Add a new button to the Cave kiosk

From VrlWiki
Jump to navigation Jump to search

The Cave kiosk interface automatically displays buttons for scripts in a certain location whose names are formatted in a particular way. There are currently two interfaces, for which buttons must be configured separately.

  • The new interface, which will eventually become the only interface, is located on the wallconsole machine at /var/www/html/kiosk-jnh/kiosk.cgi and may be viewed on the web from any machine in the Cave room.
  • The old interface, which will eventually be deprecated, is located on the wallconsole machine at /var/www/html/kiosk/kiosk.cgi viewed on the web from any machine in the Cave room.

To add a new button to the kiosk interface, especially if it corresponds to a new user, you're probably going to have to both create a button and configure the data directories.

Create a Button

On the New Interface

The new interface parses a directory structure on the CCV filesystem to generate tabs and buttons, so adding them is a snap, with no SSHing required.

  1. cd ~cavedemo/kiosk
  2. Within this directory are directories corresponding to the tabs on the kiosk interface. We try to keep the number of tabs limited, so you probably don't need to create a new directory. cd into the directory for the tab you want your button to appear in.
  3. cp -r <old> <new> to copy an old directory/button to a new one.
  4. cd <new>
  5. nano run to edit the script that the button executes, and change the username or other information as necessary.

Here's an example of a current script, ~cavedemo/kiosk/CS137_2008/jadrian/run:

#!/bin/sh

export GROOT=/share/gfx2/dollar-g
source $GROOT/tools/gfxtools-startup-bash

user="jadrian"
basepath="/share/cs137/dollar-g-cs137/tools/linux/data/cavepaintings/$user"

$G/bin/cavepainting-cave -c SaveBasePath=$basepath -c LoadBasePath=$basepath -c UserDataDir=$basepath

On the Old Interface

Adding a new tab to the old interface currently involves editing the source of the web script and is therefore beyond the scope of this article, but adding a button to an existing tab is easy if a little ugly.

  1. Log into wallconsole: ssh cavedemo@wallconsole
  2. cd $G/bin
  3. Find within this directory a script for an existing button; we'll call this script script_1 in the code for the following steps. For example, cave.cscluster.cs137fall08.jadrian corresponds to the "(cscluster) jadrian" button on the "CS137 Fall 2008" tab.
  4. Pick the name of your new script. The name is in four parts: <environment><machine><group><name>. The environment is either cave or powerwall. The machine choices for the cave environment are cscluster or cluster4. The group corresponds to the tab the button will appear on; you'll probably want general (for the "Run Programs" tab) or whatever the active variant of cs137 is. Finally, the name can be whatever you want, and will be the label on the button. Now that you've picked the name, we will refer to that as script_2.
  5. cp script_1 script_2
  6. nano script_2 to edit the script and change the commands it runs. For creating new Cavepainting scripts, you'll probably just want to change the names of the save, load, and data paths.
    • Be sure to double-check that the paths referred to in the script exist by logging into cs-nodes.
  7. Reload the kiosk webpage and your new button should be there!

Configure the Data Directories

For CS137, by default the data directory for a new user is /share/cs137/dollar-g-cs137/tools/linux/data/cavepaintings/<user>. You'll need to create this directory and make sure that its group is cs-cave. It's okay for the directory to be empty, as Cavepainting reads default content from elsewhere, but you may want to copy some things from other users.

Note that these directions don't check your data (or kiosk script, for that matter) into $G, like they should! Somebody ought to update them. =)