source: trunk/gsdl-documentation/tutorials/README.html@ 13637

Last change on this file since 13637 was 13637, checked in by kjdon, 16 years ago

README file for greenstone tutorials. needs updating for new repository structure

  • Property svn:keywords set to Author Date Id Revision
File size: 12.5 KB
Line 
1<html>
2<head>
3<title>Greenstone tutorials.</title>
4</head>
5<body>
6<h1>Greenstone Tutorial Information</h1>
7
8<h2>Contents</h2>
9<ul>
10<li><a href="#requirements">Requirements</a></li>
11<li><a href="#contents">Contents of this package</a></li>
12<li><a href="#generate-html">Generating HTML files</a></li>
13<li><a href="#languages">Generating files for other langauges</a></li>
14<li><a href="#workshop">Generataing a workshop</a></li>
15<li><a href="#format">Tutorial XML Format</a></li>
16<li><a href="#print">Notes for printing</a></li>
17</ul>
18
19<a name="requirements"/>
20<h2>Requirements</h2>
21
22To use this package to re-generate the Greenstone tutorial HTML, or generate a workshop, you need to have the following:
23<ul>
24<li>Greenstone version 2.71 installed</li>
25<li>A Java runtime system</li>
26</ul>
27
28<a name="contents"/>
29<h2>Contents of this package</h2>
30
31<dl>
32<dt>README.html</dt><dd>This file</dd>
33<dt>tutorial_en.xml</dt><dd>The main tutorial XML file, in English. Valid for 2.71</dd>
34<dt>tutorial_[fr|ru|es].xml</dt><dd>Translations (of an old version) of tutorial_en.xml. Valid for 2.70</dd>
35<dt>Dictionary.java</dt><dd>Java class for retrieving text strings based on keys from GLI dictionary, Perl dictionary, macro files</dd>
36<dt>
37<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>
38<dt>common.xml</dt><dd>Common XSL templates for use with all transforms</dd>
39<dt>xml-to-one-html.xsl</dt><dd>XSL Transform file to generate a single HTML page containing all tutorials</dd>
40<dt>xml-to-index.xsl</dt><dd>XSL Transform file to generate an index file for individual tutorial HTML files</dd>
41<dt>xml-to-many-html.xsl</dt><dd>XSL Transform file to generate individual HTML files for each tutorial</dd>
42<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>
43<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>
44<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>
45<dt>xml-to-wiki-index.xsl</dt><dd>XSL Transform file to generate wiki syntax for an index on the Greenstone wiki</dd>
46<dt>manifest.xml</dt><dd>Sample manifest file for workshop generation</dd>
47<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>
48</dl>
49
50<a name="generate-html"/>
51<h2>Generating HTML files</h2>
52
53<ol>
54<li>Run <tt>source setup.bash</tt> in the top level directory of your Greenstone installation</li>
55<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>
56<li>cd to the appropriate directory</li>
57<li>Generate the index page:<br/>
58<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>
59<li>Generate the individual pages<br/>
60<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>
61<li>Generate a single HTML file containing all tutorials<br/>
62<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>
63<li>Generate the top level combined index. Should be run from the gsdl-tutorial directory, not from the subdirectory<br/>
64<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>
65</ol>
66
67Windows versions of these commands are like the following:
68<ol>
69<li>Run <tt>setup</tt> in the top level directory of your Greenstone installation</li>
70<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>
71<li>cd to the appropriate directory</li>
72<li>Generate the index page:<br/>
73<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>
74<li>Generate the individual pages<br/>
75<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>
76<li>Generate a single HTML file containing all tutorials<br/>
77<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>
78<li>Generate the top level combined index. Should be run from the gsdl-tutorial directory, not from the subdirectory<br/>
79<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>
80</ol>
81
82<p>The generate-html.sh/bat scripts are shell scripts that carry out a lot of these commands for you.</p>
83
84<a name="languages"/>
85<h2>Generating files for other languages</h2>
86
87<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>
88
89<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>
90
91<tt>&lt;xsl:variable name="diction" select="dict:new('en')"/&gt;</tt>
92
93<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>
94
95<a name="workshop"/>
96<h2>Generating the exercises for a workshop</h2>
97
98<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>
99
100<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>
101
102<ol>
103<li>Run <tt>source setup.bash</tt> in the top level directory of your Greenstone installation</li>
104<li>Create a subdirectory in gsdl-tutorials for your output files, eg "workshop"</li>
105<li>cd to this directory</li>
106<li>Generate one file per workshop session:<br/>
107<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>
108<li>Generate a single file containing all sessions<br/>
109<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>
110</ol>
111
112Windows versions of these commands are like:
113<ol>
114<li>Run <tt>setup</tt> in the top level directory of your Greenstone installation</li>
115<li>Create a subdirectory in gsdl-tutorials for your output files, eg "workshop"</li>
116<li>cd to this directory</li>
117<li>Generate one file per workshop session:<br/>
118<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>
119<li>Generate a single file containing all sessions<br/>
120<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>
121</ol>
122
123<p>The generate-workshop.sh/bat scripts are shell scripts that carry out these commands for you.</p>
124
125<p>A basic manifest file looks something like this:
126<pre>
127&lt;Manifest&gt;
128 &lt;Title&gt;Greenstone Hawaii Workshop, Jun 2006&lt;/Title&gt;
129 &lt;Section id="one" number="1"&gt;
130 &lt;Heading&gt;Lab 1: Installing Greenstone&lt;/Heading&gt;
131 &lt;TutorialRef id="install_greenstone"/&gt;
132 &lt;TutorialRef id="update_greenstone_installation"/&gt;
133 &lt;/Section&gt;
134 &lt;Section id="two" number="2"&gt;
135 &lt;Heading&gt;Lab 2: Building a collection&lt;/Heading&gt;
136 &lt;TutorialRef id="small_html_collection"/&gt;
137 &lt;TutorialRef id="word_pdf_collection"/&gt;
138 &lt;/Section&gt;
139&lt;/Manifest&gt;
140</pre>
141
142<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>
143
144For more control over the exercises, you can specify only part of a tutorial should be used in one exercise.
145For example, in the Hawaii workshop, we split the Word and PDF exercise over two lab sessions. To do this we used &lt;SplitTutorialRef&gt;.
146
147<pre>
148&lt;SplitTutorialRef id="word_pdf_collection" titleextra="&mdash;Part A" type="preceding" split="Heading[2]"&gt;
149&lt;EndNotes&gt;
150&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;
151&lt;/EndNotes&gt;
152&lt;/SplitTutorialRef&gt;
153....
154&lt;SplitTutorialRef id="word_pdf_collection" titleextra="&mdash;Part B" type="following" current="true" split="Heading[2]"&gt;
155&lt;BeginNotes&gt;
156&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;
157&lt;/BeginNotes&gt;
158&lt;/SplitTutorialRef&gt;
159</pre>
160
161<p><b>SplitTutorialRef</b> has some extra attributes:<br/>
162<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/>
163<b>split</b>: the XML node to split the tutorial on.<br/>
164<b>type</b>: whether we want the sections before the split (preceeding) or after the split (following).<br/>
165<b>current</b>: set to true if the node to split on should be included.
166</p>
167<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.
168The format inside BeginNotes and EndNotes follows the format of the general tutorial, see below.</p>
169<a name="format"/>
170<h2>Tutorial XML Format</h2>
171
172<p>tutorial_en.xml is the main file. Make modifications in that. The translator takes care of the other languages.</p>
173
174<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>
175
176<p>Tag examples:<br/><br/>
177
178<tt>&lt;Link&gt;url&lt;/Link&gt;</tt> for URLS.<br/>
179<tt>&lt;Link url="url"&gt;display text&lt;/Link&gt;</tt> for URLS which have different text to display<br/>
180<tt>&lt;Format&gt;format statement, or macro statement&lt;/Format&gt;</tt><br/>
181<tt>&lt;Path&gt;file paths&lt;/Path&gt;</tt><br/>
182<tt>&lt;Menu&gt; menu sequence, eg File &rarr; New&lt;/Menu&gt;</tt><br/>
183</p>
184<p>Bullet lists:
185<pre>
186&lt;BulletList&gt;
187 &lt;Bullet&gt;
188 &lt;Text id="223"&gt;first bullet point&lt;/Text&gt;
189 &lt;/Bullet&gt;
190 ...
191&lt;/BulletList&gt;
192</pre>
193</p>
194Main numbering
195<pre>
196&lt;NumberedItem&gt;
197 text, comments etc go in here
198&lt;/NumberedItem&gt;
199</pre>
200
201Block of text in italics:
202<pre>
203&lt;Comment&gt;
204 &lt;Text id="xxx"&gt;some italics text&lt;/Text&gt;
205&lt;/Comment&gt;
206</pre>
207
208Section heading:
209<pre>
210&lt;Heading&gt;
211 &lt;Text id="009"&gt;A heading&lt;/Text&gt;
212&lt;/Heading&gt;
213</pre>
214
215<a name="print"/>
216<h2>Tutorial printing notes</h2>
217
218To print the tutorials with appropriate highlighting in place, need to set "print background colours" in page setup (mozilla).
219
220
221</body>
222</html>
Note: See TracBrowser for help on using the repository browser.