Index: documentation/trunk/tutorials/xml-source/tutorial_en.xml
===================================================================
--- documentation/trunk/tutorials/xml-source/tutorial_en.xml	(revision 25940)
+++ documentation/trunk/tutorials/xml-source/tutorial_en.xml	(revision 25942)
@@ -8,5 +8,5 @@
 <TutorialList>
 <Title>
-<Text id="0001">Greenstone tutorial exercises (October 2010)</Text>
+<Text id="0001">Greenstone tutorial exercises (2012)</Text>
 </Title>
 <Version current="2.85"/>
@@ -646,5 +646,12 @@
 <MajorVersion number="2"><Text id="0359c">Leave the feature selection controls at their default values, so that <AutoText key="glidict::CDM.FormatManager.AllFeatures" type="italics"/> is selected for <AutoText key="glidict::CDM.FormatManager.Feature"/>, and <AutoText text="VList" /> is selected as the <AutoText key="glidict::CDM.FormatManager.Part"/>. In the <AutoText key="glidict::CDM.FormatManager.Editor"/>, edit the text as follows:</Text></MajorVersion>
 <MajorVersion number="3"><Text id="0359d">Click on the <b>browse</b> Format Feature. Find the section under <b>documentNode</b> where it says</Text>
-<Format>&lt;td valign=&quot;top&quot;&gt;&lt;gsf:displayText name=&quot;ImageName&quot;&#47;&gt;:&lt;gsf:metadata name=&quot;Image&quot;&#47;&gt;&lt;br&#47;&gt;&lt;gsf:displayText name=&quot;Width&quot;&#47;&gt;:&lt;gsf:metadata name=&quot;ImageWidth&quot;&#47;&gt;&lt;br&#47;&gt;&lt;gsf:displayText name=&quot;Height&quot;&#47;&gt;:&lt;gsf:metadata name=&quot;ImageHeight&quot;&#47;&gt;&lt;br&#47;&gt;&lt;gsf:displayText name=&quot;Size&quot;&#47;&gt;:&lt;gsf:metadata name=&quot;ImageSize&quot;&#47;&gt;&lt;&#47;td&gt;</Format><Text id="0395d">Edit the text as follows:</Text></MajorVersion>
+<Format>
+  &lt;td valign=&quot;top&quot;&gt;<br/>
+  <Tab n="1"/>&lt;gsf:displayText name=&quot;ImageName&quot;&#47;&gt;:&lt;gsf:metadata name=&quot;Image&quot;&#47;&gt;&lt;br&#47;&gt;<br/>
+  <Tab n="1"/>&lt;gsf:displayText name=&quot;Width&quot;&#47;&gt;:&lt;gsf:metadata name=&quot;ImageWidth&quot;&#47;&gt;&lt;br&#47;&gt;<br/>
+  <Tab n="1"/>&lt;gsf:displayText name=&quot;Height&quot;&#47;&gt;:&lt;gsf:metadata name=&quot;ImageHeight&quot;&#47;&gt;&lt;br&#47;&gt;<br/>
+  <Tab n="1"/>&lt;gsf:displayText name=&quot;Size&quot;&#47;&gt;:&lt;gsf:metadata name=&quot;ImageSize&quot;&#47;&gt;<br/>
+  &lt;&#47;td&gt;</Format>
+<Text id="0395d">Edit the text as follows:</Text></MajorVersion>
 <BulletList>
 <Bullet>
@@ -1047,5 +1054,5 @@
 <Format>
 &lt;gsf:metadata name=&quot;dc.Creator&quot; /&gt; <br />
-&lt;gsf:metadata name=&quot;ex.Creator&quot; /&gt;<br />
+&lt;gsf:metadata name=&quot;Creator&quot; /&gt;<br />
 </Format>
 <Text id="fw-23a-3">To display dc.Creator if it is present, otherwise display ex.Creator, use</Text>
@@ -1053,5 +1060,5 @@
 &lt;gsf:choose-metadata&gt;<br />
   <Tab n="1"/>&lt;gsf:metadata name=&quot;dc.Creator&quot; /&gt;<br />
-  <Tab n="1"/>&lt;gsf:metadata name=&quot;ex.Creator&quot; /&gt;<br />  
+  <Tab n="1"/>&lt;gsf:metadata name=&quot;Creator&quot; /&gt;<br />  
 &lt;/gsf:choose-metadata&gt;<br />
 </Format>
@@ -1205,28 +1212,77 @@
 <Text id="fw-24">Opening PDF files with query terms highlighted</Text>
 </Heading>
+<MajorVersion number="2">
 <NumberedItem>
 <Text id="fw-24a">Next we'll customize the <AutoText text="SearchVList"/> format statement to highlight the query terms in a PDF file when it is opened from the search result list. This requires Acrobat Reader 7.0 version or higher, and currently only works on a Microsoft Windows platform.</Text>
 </NumberedItem>
 <NumberedItem>
-<Text id="fw-24c">The search terms are kept in the macro variable <AutoText text="_cgiargq_"/>, and we append <AutoText text="#search=&quot;_cgiargq_&quot;"/> to the end of a PDF file link to pass the query terms to the PDF file.</Text>
-<Text id="fw-24d"><AutoText text="PDFPlugin"/> renames each PDF file as <AutoText text="doc.pdf"/> and saves it in a unique directory for that document, so we use</Text>
-<Format>_httpcollection_/index/assoc/[archivedir]/doc.pdf</Format>
-<Text id="fw-24e">to refer to the PDF source file. (However, if you used the <AutoText text="-keep_original_filename"/> option to <AutoText text="PDFPlugin"/> when building the collection, the original name of the PDF file is kept, and we use</Text>
-<Format>_httpcollection_/index/assoc/[archivedir]/[Source]</Format>
-<Text id="fw-24f">instead to locate the PDF source file.)</Text>
-</NumberedItem>
-<NumberedItem>
-<Text id="fw-24g">Add <AutoText text="SearchVList"/> by selecting <AutoText text="Search"/> from the <AutoText key="glidict::CDM.FormatManager.Feature"/> drop down list, and <AutoText text="VList"/> from the <AutoText key="glidict::CDM.FormatManager.Part"/> list. Click <AutoText key="glidict::CDM.FormatManager.Add" type="button"/> to add the <AutoText text="SearchVList"/> format statement into the list of assigned formats. We need to test whether the file is a PDF file before linking to doc.pdf, using <Format>{If}{[ex.FileFormat] eq 'PDF',,}</Format>. For PDF files, we use the above format instead of the <Format>[ex.srclink]</Format> and <Format>[ex./srclink]</Format> variables to link to the file.</Text>
+<Text id="fw-24c">The search terms are kept in the macro variable <AutoText text="_queryterms_"/>, and we append <AutoText text="#search=&quot;_queryterms_&quot;"/> to the end of a PDF file link to pass the query terms to the PDF.</Text>
+<Text id="fw-24d"><AutoText text="PDFPlugin"/> saves each PDF file in a unique directory. You can use </Text>
+<Format>_httpcollection_/index/assoc/[archivedir]/[srclinkFile]</Format>
+<Text id="fw-24f">to refer to these files.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="fw-24g">Add <AutoText text="SearchVList"/> by selecting <AutoText text="Search"/> from the <AutoText key="glidict::CDM.FormatManager.Feature"/> drop down list, and <AutoText text="VList"/> from the <AutoText key="glidict::CDM.FormatManager.Part"/> list. Click <AutoText key="glidict::CDM.FormatManager.Add" type="button"/> to add the <AutoText text="SearchVList"/> format statement into the list of assigned formats. We need to test whether the file is a PDF file before linking to it, using <Format>{If}{[ex.FileFormat] eq 'PDF',,}</Format>. For PDF files, we use the above path format instead of the <Format>[ex.srclink]</Format> and <Format>[ex./srclink]</Format> variables to link to the file.</Text>
 <Text id="fw-24b">The resulting format statement is:</Text>
 <Format>
 &lt;td valign="top"&gt;[link][icon][/link]&lt;/td&gt;<br/>
 &lt;td valign="top"&gt;<highlight>{If}{[ex.FileFormat] eq 'PDF', &lt;a
-href=\"_httpcollection_/index/assoc/[archivedir]/doc.pdf#search=&amp;quot;_cgiargq_&amp;quot;\"&gt;{Or}{[ex.thumbicon],[ex.srcicon]}&lt;/a&gt;,<br/>[ex.srclink]{Or}{[ex.thumbicon],[ex.srcicon]}[ex./srclink]}</highlight>&lt;/td&gt;<br/>
+href=\&quot;_httpcollection_/index/assoc/[archivedir]/[srclinkFile]#search=&amp;quot;_queryterms_&amp;quot;\&quot;&gt;{Or}{[ex.thumbicon],[ex.srcicon]}&lt;/a&gt;,<br/>[ex.srclink]{Or}{[ex.thumbicon],[ex.srcicon]}[ex./srclink]}</highlight>&lt;/td&gt;<br/>
 &lt;td valign="top"&gt;[highlight]<br/>
 {Or}{[dc.Title],[ex.Title],Untitled}<br/>
 [/highlight]{If}{[ex.Source],&lt;br&gt;&lt;i&gt;([ex.Source])&lt;/i&gt;}&lt;/td&gt;<br/>
 </Format>
-<Text id="fw-24i">When the PDF icons are clicked in the search results, Acrobat will open the file with the search window open, and the query terms highlighted.</Text>
-</NumberedItem>
+</NumberedItem>
+</MajorVersion>
+<MajorVersion number="3">
+<NumberedItem>
+<Text id="fw-24a-3">Next we'll customize the <AutoText text="search"/> format statement to highlight the query terms in a PDF file when it is opened from the search result list. This requires Acrobat Reader 7.0 version or higher, and currently only works on a Microsoft Windows platform.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="fw-24c-3">To highlight the query terms in a PDF document, we need to pass them into the PDF file by appending <AutoText text="#search=&quot;query&quot;"/> to the end of the document link. We need to create the link ourselves rather than using &lt;gsf:link type=&quot;source&quot;/&gt; in the format statement. </Text>
+<Text id="fw-24d-3"><AutoText text="PDFPlugin"/> saves each PDF file in a unique directory for that document, and we can use</Text>
+<Format>&lt;gsf:metadata name=&quot;httpPath&quot; type=&quot;collection&quot;/&gt;/index/assoc/&lt;gsf:metadata name=&quot;archivedir&quot;/&gt;/&lt;gsf:metadata name=&quot;srclinkFile&quot;/&gt;</Format>
+<Text id="fw-24e-3">to refer to the PDF source file. 
+The search terms can be found in the &quot;q&quot; cgi parameter. You can access this using &lt;gsf:cgi-param name=&quot;q&quot;/&gt;.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="fw-24g-3">Select <AutoText text="search"/> in <AutoText key="glidict::CDM.GUI.Formats"/> for editing. We need to test whether the file is a PDF file before linking to it, using a test on whether the Greenstone extracted FileFormat metadata is PDF. For PDF files, we now generate the link explicitly.</Text>
+<Text id="fw-24b-3">The resulting format statement is:</Text>
+<Format>
+  &lt;td valign=&quot;top&quot;&gt;<br/>
+    <Tab n="1"/>&lt;gsf:link type=&quot;document&quot;&gt;<br/>
+        <Tab n="2"/>&lt;gsf:icon type=&quot;document&quot;/&gt;<br/>
+    <Tab n="1"/>&lt;/gsf:link&gt;<br/>
+  &lt;&#47;td&gt;<br/>
+  <br />
+  &lt;td valign=&quot;top&quot;&gt;<br/>
+  <highlight>
+  &lt;gsf:switch&gt;<br/>
+	<Tab n="1"/>&lt;gsf:metadata name=&quot;FileFormat&quot;/&gt;<br/>
+	<Tab n="1"/>&lt;gsf:when test=&quot;equals&quot; test-value=&quot;PDF&quot;&gt;<br/>
+		<Tab n="2"/>&lt;a&gt;&lt;xsl:attribute name=&quot;href&quot;&gt;&lt;gsf:metadata name=&quot;httpPath&quot; type=&quot;collection&quot;/&gt;/index/assoc/&lt;gsf:metadata name=&quot;archivedir&quot;/&gt;/&lt;gsf:metadata name=&quot;srclinkFile&quot;/&gt;#search=&amp;amp;quot;&lt;gsf:cgi-param name=&quot;query&quot;/&gt;&amp;amp;quot;&lt;/xsl:attribute&gt;<br/>
+			<Tab n="3"/>&lt;gsf:choose-metadata&gt;<br/>
+				<Tab n="4"/>&lt;gsf:metadata name=&quot;thumbicon&quot;/&gt;<br/>
+				<Tab n="4"/>&lt;gsf:metadata name=&quot;srcicon&quot;/&gt;<br/>
+			<Tab n="3"/>&lt;/gsf:choose-metadata&gt;<br/>
+		<Tab n="2"/>&lt;/a&gt;<br/>
+	<Tab n="1"/>&lt;/gsf:when&gt;<br/>
+	<Tab n="1"/>&lt;gsf:otherwise&gt;<br/>
+		<Tab n="2"/>&lt;gsf:link type=&quot;source&quot;&gt;<br/>
+			<Tab n="3"/>&lt;gsf:choose-metadata&gt;<br/>
+				<Tab n="4"/>&lt;gsf:metadata name=&quot;thumbicon&quot;/&gt;<br/>
+				<Tab n="4"/>&lt;gsf:metadata name=&quot;srcicon&quot;/&gt;<br/>
+			<Tab n="3"/>&lt;/gsf:choose-metadata&gt;<br/>
+		<Tab n="2"/>&lt;/gsf:link&gt;<br/>
+	<Tab n="1"/>&lt;/gsf:otherwise&gt;<br/>
+  &lt;/gsf:switch&gt;</highlight><br/>	
+  &lt;&#47;td&gt;<br/>
+  <br />
+&lt;td valign=&quot;top&quot;&gt;<br/>
+...
+</Format>
+</NumberedItem>
+</MajorVersion>
+<Text id="fw-24i">When the PDF icons are clicked in the search results, Acrobat will open the file with the search window open with the query terms highlighted.</Text>
 </Content>
 </Tutorial>
@@ -1354,4 +1410,5 @@
 </Content>
 </Tutorial>
+<MajorVersion number="2">
 <Tutorial id="export_to_CDROM">
 <Title>
@@ -1378,4 +1435,5 @@
 </Content>
 </Tutorial>
+</MajorVersion>
 <Tutorial id="large_html_collection">
 <Title>
