This page last changed on Jul 24, 2008 by stepheneb.
These instructions provide a way to install jars into the jnlp cache from a local server.
This can be used to do a CD or USB stick install of webstart based software.
SAIL Dashboard scripts
UDL SAIL Dashboard MacOS disk image archive.
I've created a disk image that has the MacOS shell scripts and Java Web Start resources that can be used to manually install all the Java Web Start resources used for the UDL activities.
Here's a copy of the script: /home/sbannasch/scripts/sds-empty I use to create an empty sail dashboard dmg on the server seymour and copy it to http://rails.dev.concord.org
rm -rf sd
svn export https:echo '' > sail-dashboard/commands/jnlps.txt
/home/sbannasch/bin/make_dmg sd sail-dashboard-empty.dmg "SAILDashboard"
scp sail-dashboard-empty.dmg email@example.com:~/rails
Here's a copy of the make_dmg script it calls:
# make hfsplus disk image from directory
# sudo make_dmg <dir_path> <dmg_nameg> [volume_label]
if [ -z "$SUDO_COMMAND" ] # Need to run this with sudo
mntusr=$(id -u) grpusr=$(id -g) sudo $0 $*
if [ -d "$1" ] # dir_path
echo "Must pass in valid dir"
if [ -n "$2" ] # dmg_name
echo "Must pass name for dmg"
if [ -n "$3" ] # volume_label.
echo "Using volume_label=Untitled"
du_output=`du -sk $dir_path 2>&1`
dir_size=`echo $du_output | cut -f1 -d" "`
dir_size=`expr $dir_size + 1000`
dd if=/dev/zero of=$dmg_name bs=1024 count=$dir_size
/sbin/mkfs.hfsplus -v "$volume_label" $dmg_name
mount -o loop -t hfsplus ./$dmg_name /mnt/tmp/
cp -r $dir_path/* /mnt/tmp
Here's a pdf of the the initial user documentation for UDL Teachers UsingSailDashboard_v1.1.pdf.
This disk image is an empty SAIL Dashboard with the two jnlps used by the current UDL project in the file: commands/jnlps.txt.
The disk image only 5MB, so after downloading you will need to run this command:
to fill the SAIL Dashboard cache with the web start resources for the jnlps listed in the file commands/jnlps.txt.
After you download it the SAIL Dashboard volume should mount.
Contained in the SAIL Dashboard volume is a folder called: sail-dashboard
Copy that to a USB stick or a portable hard drive and fill the SAIL Dashboard cache with the remote Java Web Start resources with this command:
Then mount the portable drive on any MacOS computer that needs the UDL Java Web Start resources installed and then double click this script file in the sail-dashboard folder:
FYI (background info):
These are the jnlps whose jars the sail-dashboard-udl.dmg will be populated with:
Empty SAIL Dashboard MacOS disk image archive.
There is also an empty sail-dashboard.dmg (only 3.5MB) located here:
Right now this only works on Macs ... the scripts could certainly be adapted for Windows however.
Download it, copy the sail-dashboard folder to another volume and add one or more jnlp urls in the file: sail-dashboard/commands/jnlps.txt.
With a TELS Jnlp url then you could use this script to install into the SAIL Dashboard cache the jnlp resources for a TELS run:
Copy the sail-dashboard folder to a portable hard drive or a USB stick and it can be used to preload the TELS jars onto classroom computers that don't already have the jars.
SAIL Dashboard Code Resources:
We are using the script listed here: Creating MacOS dmg files in Linux to script the production of MacOS dmg files on our Linux servers.
Creating MacOS Disk Images:
The MacOS command line utility: hdutils can be used in a shell script to create a MacOS Disk Image of the sail-dashboard folder.
In order for a MacOS disk image to mount with the sail-dashboard folder appearing in the mounted volume a copy of the sail-dashboard folder should be place inside another folder.
Creating an empty SAIL Dashboard Disk Image
svn export https:cd -
hdiutil create -srcfolder sd -fs HFS+ -volname SAIL\ Dashboard sail-dashboard-empty.dmg
Creating a SAIL Dashboard Disk Image with the Jetty jnlp servlet cache pre-filled.
After completing a svn export of sail-dashboard code edit the file: sail-dashboard/commands/jnlp.txt to include the Jnlp url(s) you would like the SAIL Dashboard to cache.
hdiutil create -srcfolder sd -fs HFS+ -volname SAIL\ Dashboard sail-dashboard.dmg
SAIL Dashboard README
These scripts can be used to pre-load the Java Web Start jar files for a Jnlp into a local users Java Web Start cache.
The folder containing these scripts and cached Jar files can be copied to a USB Flash memory stick or a portable hard drive and moved from computer to computer in a classroom to quickly preload the Java Web Start cache for the local user on each computer.
Currently these scripts only work on MacOS X
The file: commands/jnlps.txt, has a list of all the Java Web Start Jnlps that will be cached locally by the SAIL Dashboard. These are normally copies of the Jnlp urls used by the SAIL Data Service.
How to use the SAIL Dashboard Scripts:
- Cache the Java jar files used for a Jnlp into the SAIL Dashboard Cache
This command normally only needs to be done once.
To run directly from the Finder double-click the file:
This script downloads from the Internet all the Java Web Start Jars used by the Jnlp files listed in the file: commands/jnlps.txt. If you add a new Jnlp to the file: commands/jnlps.txt or you suspect that the Jars the Jnlp references have been updated you will need to run this script again.
Make sure you are on a reasonably fast Internet connection when you run this script.
The Jnlp resources will be cached in the directory:
- Copy the Java Web Start jar files cached in the SAIL Dashboard into the local Java Web Start cache directory.
This script command will copy all the Jnlp resources in the SAIL Dashboard Cache into the Java Web Start Cache for the user that is running this command.
To run directly from the Finder double-click the file:
Initial Design Work
The procedure would go like this:
- a developer follows the first 2 sections to setup the CD or USB stick.
- the developer makes a shell script or .bat file to automate the last section.
- a user can then just run the shell script or .bat file
This process uses the "-import" option built into javaws. That is documented here
But that documentation does not address how to do the "import" when versioned jars are being used. So the procedure below describes how use the "-import" option with versioned jars.
Install Empty Jnlp Server
curl http:mkdir jetty-6.1.9-stripped/webapps/jnlp
curl http:cd -
Update Jars and Jnlps in Jnlp Server
http: http:for jnlp_url in $SERVLET_JNLPS
java -Dgenerate.import.jnlps=true -cp jnlp2shell.jar org.concord.JnlpServletCacher $jnlp_url jetty-6.1.9-stripped/webapps/jnlp
this is a slightly modified version of the script on Setup Local Jnlp Server. The difference is the "-Dgenerate.import.jnlps=true".
This leaves the original codebase in the jnlp files, and removes a href attribute if they have one. This is necessary for the javaws -import command to work.
Install/Import Jars into Webstart Cache
Start the server
java -jar start.jar etc/jetty.xml
Have javaws do the import
javaws -codebase [local codebase] -import [url to local jnlp file]
The best way to figure out the appropriate codebase is to look at the jnlp file you are trying to import. Then replace
Stop the server