JamMo Loader
------------

(c) 2010 University of Oulu

JamMo Loader manages data files of JamMo application, including musical and
graphical material. It replaces the jammo-data Debian package, and downloads
all data from a given server as requested.


Data Index File
---------------

There is one Data Index File (DIF) for each JamMo data package version.
A DIF file name has the following naming scheme:

jammo_<package name>.dif

The <package name> is a string describing a single group of data files, such
as songs_fi.

DIF files are plain text files using line feeds ('\n') and spaces as
field separators (only one space between fields!). Each DIF file has
the following structure:

<relative path of a data file> <data file timestamp> <data file size>
<relative path of a data file> <data file timestamp> <data file size>
<relative path of a data file> <data file timestamp> <data file size>
<relative path of a data file> <data file timestamp> <data file size>
<relative path of a data file> <data file timestamp> <data file size>
...


The <relative path of a data file> is a string. It contains the file name
of a data file containing a path relative to the JamMo data installation
directory.

The <data file timestamp> is an integer value. It contains the time when
the data file is last updated. The value is seconds since UNIX epoch
(January 1st, 1970).

The <data file size> is an integer value. It contains the size of the data
file in bytes.

There can be unlimited amount of data file lines in a DIF file.

A DIF file called jammo_songs_fi.dif may contain the following data, for
example:

themes/animal/loop1.wav	1280662692	23940
themes/animal/comping.ogg	1280747297	348182


Data File Directory
-------------------

The actual data files are stored in a directory (and subdirectories)
accessed usually using http. Data files are versioned by appending
a timestamp to their file name.

Thus, a file name must be

<data file name>.<data file timestamp>

where the <data file name> is the original file name that appears also in
the DIF file and the <data file timestamp> is the responding timestamp of
the file. The file must be located under a directory specified by the
<relative path of a datafile> in the DIF file.

For example, the example DIF file from the previous chapter has the following
directories and files along it:

themes/
themes/animal/
themes/animal/loop1.wav.1280662692
themes/animal/comping.ogg.1280747297


Server-side tool
----------------

The create-dif.sh is a server-side tool that is used to create and update
DIF files and copy the versioned data files into a repository directory.

Usage: ./create-dif.sh jammo_<package name>.dif <original directory> <dif directory>

The <package name> parameters are already specified above. The <original
directory> should contain the original data files that will be copied into
the <dif directory> and indexed into the DIF file.
