Index: /trunk/gsdl-documentation/tutorials/README.html
===================================================================
--- /trunk/gsdl-documentation/tutorials/README.html	(revision 13637)
+++ /trunk/gsdl-documentation/tutorials/README.html	(revision 13637)
@@ -0,0 +1,222 @@
+<html>
+<head>
+<title>Greenstone tutorials.</title>
+</head>
+<body>
+<h1>Greenstone Tutorial Information</h1>
+
+<h2>Contents</h2>
+<ul>
+<li><a href="#requirements">Requirements</a></li>
+<li><a href="#contents">Contents of this package</a></li>
+<li><a href="#generate-html">Generating HTML files</a></li>
+<li><a href="#languages">Generating files for other langauges</a></li>
+<li><a href="#workshop">Generataing a workshop</a></li>
+<li><a href="#format">Tutorial XML Format</a></li>
+<li><a href="#print">Notes for printing</a></li>
+</ul>
+
+<a name="requirements"/>
+<h2>Requirements</h2>
+
+To use this package to re-generate the Greenstone tutorial HTML, or generate a workshop, you need to have the following:
+<ul>
+<li>Greenstone version 2.71 installed</li>
+<li>A Java runtime system</li>
+</ul>
+
+<a name="contents"/>
+<h2>Contents of this package</h2>
+
+<dl>
+<dt>README.html</dt><dd>This file</dd>
+<dt>tutorial_en.xml</dt><dd>The main tutorial XML file, in English. Valid for 2.71</dd>
+<dt>tutorial_[fr|ru|es].xml</dt><dd>Translations (of an old version) of tutorial_en.xml. Valid for 2.70</dd>
+<dt>Dictionary.java</dt><dd>Java class for retrieving text strings based on keys from GLI dictionary, Perl dictionary, macro files</dd>
+<dt>
+<dt>ApplyXSLT.java</dt><dd>Java class for running the XSL transforms. I couldn't just use Xalan because the Java extensions (using Dictionary) didn't work.</dd>
+<dt>common.xml</dt><dd>Common XSL templates for use with all transforms</dd>
+<dt>xml-to-one-html.xsl</dt><dd>XSL Transform file to generate a single HTML page containing all tutorials</dd>
+<dt>xml-to-index.xsl</dt><dd>XSL Transform file to generate an index file for individual tutorial HTML files</dd>
+<dt>xml-to-many-html.xsl</dt><dd>XSL Transform file to generate individual HTML files for each tutorial</dd>
+<dt>xml-to-one-workshop.xsl</dt><dd>XSL Transform file to generate a single HTML file for a workshop. Uses the manifest.xml</dd>
+<dt>xml-to-workshop.xsl</dt><dd>XSL Transform file to generate a series of HTML files for a workshop, one per session. Uses the manifest.xml</dd>
+<dt>xml-to-top-index.xsl</dt><dd>XSL Transform file to generate a top level index file linking to all four language versions</dd>
+<dt>xml-to-wiki-index.xsl</dt><dd>XSL Transform file to generate wiki syntax for an index on the Greenstone wiki</dd>
+<dt>manifest.xml</dt><dd>Sample manifest file for workshop generation</dd>
+<dt>xalan.jar</dt><dd>XSLT transformer needed for use with Java 1.5. Java 1.4 comes with Xalan, Java 1.5 comes with XSLTC.</dd>
+</dl>
+
+<a name="generate-html"/>
+<h2>Generating HTML files</h2>
+
+<ol>
+<li>Run <tt>source setup.bash</tt> in the top level directory of your Greenstone installation</li>
+<li>Create a subdirectory in gsdl-tutorials for your output files. If you are using multiple languages and want to create top level index files, then you should name the directories en, fr, es, and ru, otherwise the links won't be valid.</li>
+<li>cd to the appropriate directory</li>
+<li>Generate the index page:<br/>
+<tt>java -cp ..:$GSDLHOME/gli:$GSDLHOME/gli/classes:$GSDLHOME/perllib:../xalan.jar -DGSDLHOME=$GSDLHOME ApplyXSLT ../xml-to-index.xsl ../tutorial_en.xml > index.html</tt></li>
+<li>Generate the individual pages<br/>
+<tt>java -cp ..:$GSDLHOME/gli:$GSDLHOME/gli/classes:$GSDLHOME/perllib:../xalan.jar -DGSDLHOME=$GSDLHOME ApplyXSLT ../xml-to-many-html.xsl ../tutorial_en.xml | perl -S $GSDLHOME/gli/help/splithelpdocument.pl</tt></li>
+<li>Generate a single HTML file containing all tutorials<br/>
+<tt>java -cp ..:$GSDLHOME/gli:$GSDLHOME/gli/classes:$GSDLHOME/perllib:../xalan.jar -DGSDLHOME=$GSDLHOME ApplyXSLT ../xml-to-one-html.xsl ../tutorial_en.xml > all_tutorials.html</tt></li>
+<li>Generate the top level combined index. Should be run from the gsdl-tutorial directory, not from the subdirectory<br/>
+<tt>java -cp .:$GSDLHOME/gli:$GSDLHOME/gli/classes:$GSDLHOME/perllib:xalan.jar -DGSDLHOME=$GSDLHOME ApplyXSLT xml-to-top-index.xsl  tutorial_en.xml > index.html</tt></li>
+</ol>
+
+Windows versions of these commands are like the following:
+<ol>
+<li>Run <tt>setup</tt> in the top level directory of your Greenstone installation</li>
+<li>Create a subdirectory in gsdl-tutorials for your output files. If you are using multiple languages and want to create top level index files, then you should name the directories en, fr, es, and ru, otherwise the links won't be valid.</li>
+<li>cd to the appropriate directory</li>
+<li>Generate the index page:<br/>
+<tt>java -cp ..:%GSDLHOME%\gli:%GSDLHOME%\gli\classes:%GSDLHOME%\perllib:..\xalan.jar -DGSDLHOME=%GSDLHOME% ApplyXSLT ..\xml-to-index.xsl ..\tutorial_en.xml > index.html</tt></li>
+<li>Generate the individual pages<br/>
+<tt>java -cp ..:%GSDLHOME%\gli:%GSDLHOME%\gli\classes:%GSDLHOME%\perllib:..\xalan.jar -DGSDLHOME=%GSDLHOME% ApplyXSLT ..\xml-to-many-html.xsl ..\tutorial_en.xml | perl -S %GSDLHOME%\gli\help\splithelpdocument.pl</tt></li>
+<li>Generate a single HTML file containing all tutorials<br/>
+<tt>java -cp ..:%GSDLHOME%\gli:%GSDLHOME%\gli\classes:%GSDLHOME%\perllib:..\xalan.jar -DGSDLHOME=%GSDLHOME% ApplyXSLT ..\xml-to-one-html.xsl ..\tutorial_en.xml > all_tutorials.html</tt></li>
+<li>Generate the top level combined index. Should be run from the gsdl-tutorial directory, not from the subdirectory<br/>
+<tt>java -cp .:%GSDLHOME%\gli:%GSDLHOME%\gli\classes:%GSDLHOME%\perllib:xalan.jar -DGSDLHOME=%GSDLHOME% ApplyXSLT xml-to-top-index.xsl  tutorial_en.xml > index.html</tt></li>
+</ol>
+
+<p>The generate-html.sh/bat scripts are shell scripts that carry out a lot of these commands for you.</p>
+ 
+<a name="languages"/>
+<h2>Generating files for other languages</h2>
+
+<p>The English version of the tutorial is currently valid for Greenstone 2.71, while the French, Spanish and Russian versions are valid for Greenstone version 2.70. If you want to generate a workshop using one of these languages, you will need to use Greenstone 2.70. </p>
+
+<p>You will need to replace the appropriate source file name for tutorial_en.xml in the above commands. Edit common.xsl, and change 'en' to e.g. 'fr' in the line</p>
+
+<tt>&lt;xsl:variable name="diction" select="dict:new('en')"/&gt;</tt>
+
+<p>If you want an up-to-date tutorial for another language, one option is to have the tutorial text in English, with all the button names and GLI references in the other language. To do this, use tutorial_en.xml as the source file, but change the dictionary language as above.</p>
+
+<a name="workshop"/>
+<h2>Generating the exercises for a workshop</h2>
+
+<p>For a workshop, you can select a subset of the exercises, and place them in any order you want. This is done with the manifest file. A sample manifest file has been included - this is one that we used for a Greenstone workshop in Hawaii, 2006.</p>
+
+<p>Once you have created your manifest file, you need to run the following. You can choose whether to have a separate HTML file per session, or the entire workshop in one file.</p>
+
+<ol>
+<li>Run <tt>source setup.bash</tt> in the top level directory of your Greenstone installation</li>
+<li>Create a subdirectory  in gsdl-tutorials for your output files, eg "workshop"</li>
+<li>cd to this directory</li>
+<li>Generate one file per workshop session:<br/>
+<tt>java -cp ..:$GSDLHOME/gli:$GSDLHOME/gli/classes:$GSDLHOME/perllib:../xalan.jar -DGSDLHOME=$GSDLHOME ApplyXSLT ../xml-to-workshop.xsl ../tutorial_en.xml perl -S $GSDLHOME/gli/help/splithelpdocument.pl</tt></li>
+<li>Generate a single file containing all sessions<br/>
+<tt>java -cp ..:$GSDLHOME/gli:$GSDLHOME/gli/classes:$GSDLHOME/perllib:../xalan.jar -DGSDLHOME=$GSDLHOME ApplyXSLT ../xml-to-one-workshop.xsl ../tutorial_en.xml > workshop.html</tt></li>
+</ol>
+
+Windows versions of these commands are like:
+<ol>
+<li>Run <tt>setup</tt> in the top level directory of your Greenstone installation</li>
+<li>Create a subdirectory in gsdl-tutorials for your output files, eg "workshop"</li>
+<li>cd to this directory</li>
+<li>Generate one file per workshop session:<br/>
+<tt>java -cp ..:%GSDLHOME%\gli:%GSDLHOME%\gli\classes:%GSDLHOME%\perllib:..\xalan.jar -DGSDLHOME=%GSDLHOME% ApplyXSLT ..\xml-to-workshop.xsl ..\tutorial_en.xml perl -S %GSDLHOME%\gli\help\splithelpdocument.pl</tt></li>
+<li>Generate a single file containing all sessions<br/>
+<tt>java -cp ..:%GSDLHOME%\gli:%GSDLHOME%\gli\classes:%GSDLHOME%\perllib:..\xalan.jar -DGSDLHOME=%GSDLHOME% ApplyXSLT ..\xml-to-one-workshop.xsl ..\tutorial_en.xml > workshop.html</tt></li>
+</ol>
+
+<p>The generate-workshop.sh/bat scripts are shell scripts that carry out these commands for you.</p>
+
+<p>A basic manifest file looks something like this:
+<pre>
+&lt;Manifest&gt;
+  &lt;Title&gt;Greenstone Hawaii Workshop, Jun 2006&lt;/Title&gt;
+  &lt;Section id="one" number="1"&gt;
+    &lt;Heading&gt;Lab 1: Installing Greenstone&lt;/Heading&gt;
+    &lt;TutorialRef id="install_greenstone"/&gt;
+    &lt;TutorialRef id="update_greenstone_installation"/&gt;
+  &lt;/Section&gt;
+  &lt;Section id="two" number="2"&gt;
+    &lt;Heading&gt;Lab 2: Building a collection&lt;/Heading&gt;
+    &lt;TutorialRef id="small_html_collection"/&gt;
+    &lt;TutorialRef id="word_pdf_collection"/&gt;
+  &lt;/Section&gt;
+&lt;/Manifest&gt;
+</pre>
+
+<p>The manifest has a <b>Title</b>, which is the Workshop title. Then it is divided into <b>Section</b>s. Each section will be saved in a separate file, named using the Section's <b>id</b> attribute. A Section has a <b>Heading</b>, and then a list of <b>TutorialRef</b>s - these indicate which tutorials should go into the section. The <b>id</b> attribute must match the Tutorial id used in tutorial_en.xml.</p>
+
+For more control over the exercises, you can specify only part of a tutorial should be used in one exercise.
+For example, in the Hawaii workshop, we split the Word and PDF exercise over two lab sessions. To do this we used &lt;SplitTutorialRef&gt;.
+
+<pre>
+&lt;SplitTutorialRef id="word_pdf_collection" titleextra="&mdash;Part A" type="preceding" split="Heading[2]"&gt;
+&lt;EndNotes&gt;
+&lt;Comment&gt;&lt;Text&gt;In exercise 2.1 we correct some of this incorrect metadata by manually adding Dublin Core Title metadata.&lt;/Text&gt;&lt;/Comment&gt;
+&lt;/EndNotes&gt;
+&lt;/SplitTutorialRef&gt;
+....
+&lt;SplitTutorialRef id="word_pdf_collection" titleextra="&mdash;Part B" type="following" current="true" split="Heading[2]"&gt;
+&lt;BeginNotes&gt;
+&lt;Comment&gt;&lt;Text&gt;In the Librarian Interface, open up the reports collection that you created in exercise 1.5. Remember that the extracted Title metadata for some documents was incorrect.&lt;/Text&gt;&lt;/Comment&gt;
+&lt;/BeginNotes&gt;
+&lt;/SplitTutorialRef&gt;
+</pre>
+
+<p><b>SplitTutorialRef</b> has some extra attributes:<br/>
+<b>titleextra</b>: some extra text to be added to the Title, in this case, we add "&mdash; Part A" and "&mdash; Part B".<br/>
+<b>split</b>: the XML node to split the tutorial on.<br/>
+<b>type</b>: whether we want the sections before the split (preceeding) or after the split (following).<br/>
+<b>current</b>: set to true if the node to split on should be included.
+</p>
+<p><b>SplitTutorialRef</b> can also include <b>BeginNotes</b> and/or <b>EndNotes</b> element - this is for extra text of instructions that should be added to the start or end of the exercise.
+The format inside BeginNotes and EndNotes follows the format of the general tutorial, see below.</p>
+<a name="format"/>
+<h2>Tutorial XML Format</h2>
+
+<p>tutorial_en.xml is the main file. Make modifications in that. The translator takes care of the other languages.</p>
+
+<p>All &lt;Text&gt; elements need a unique id, and all need to be on their own lines, with no other tags (apart from tags inside the text).</p>
+
+<p>Tag examples:<br/><br/>
+
+<tt>&lt;Link&gt;url&lt;/Link&gt;</tt> for URLS.<br/> 
+<tt>&lt;Link url="url"&gt;display text&lt;/Link&gt;</tt> for URLS which have different text to display<br/>
+<tt>&lt;Format&gt;format statement, or macro statement&lt;/Format&gt;</tt><br/>
+<tt>&lt;Path&gt;file paths&lt;/Path&gt;</tt><br/>
+<tt>&lt;Menu&gt; menu sequence, eg File &rarr; New&lt;/Menu&gt;</tt><br/>
+</p>
+<p>Bullet lists:
+<pre>
+&lt;BulletList&gt;
+  &lt;Bullet&gt;
+    &lt;Text id="223"&gt;first bullet point&lt;/Text&gt;
+  &lt;/Bullet&gt;
+  ...
+&lt;/BulletList&gt;
+</pre>
+</p>
+Main numbering
+<pre>
+&lt;NumberedItem&gt;
+  text, comments etc go in here 
+&lt;/NumberedItem&gt;
+</pre>
+
+Block of text in italics:
+<pre>
+&lt;Comment&gt;
+  &lt;Text id="xxx"&gt;some italics text&lt;/Text&gt;
+&lt;/Comment&gt;
+</pre>
+
+Section heading:
+<pre>
+&lt;Heading&gt;
+  &lt;Text id="009"&gt;A heading&lt;/Text&gt;
+&lt;/Heading&gt;
+</pre>
+
+<a name="print"/>
+<h2>Tutorial printing notes</h2>
+
+To print the tutorials with appropriate highlighting in place, need to set "print background colours" in page setup (mozilla).
+
+
+</body>
+</html>
