Changeset 25942
- Timestamp:
- 2012-07-12T22:38:57+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/trunk/tutorials/xml-source/tutorial_en.xml
r25807 r25942 8 8 <TutorialList> 9 9 <Title> 10 <Text id="0001">Greenstone tutorial exercises ( October 2010)</Text>10 <Text id="0001">Greenstone tutorial exercises (2012)</Text> 11 11 </Title> 12 12 <Version current="2.85"/> … … 646 646 <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> 647 647 <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> 648 <Format><td valign="top"><gsf:displayText name="ImageName"/>:<gsf:metadata name="Image"/><br/><gsf:displayText name="Width"/>:<gsf:metadata name="ImageWidth"/><br/><gsf:displayText name="Height"/>:<gsf:metadata name="ImageHeight"/><br/><gsf:displayText name="Size"/>:<gsf:metadata name="ImageSize"/></td></Format><Text id="0395d">Edit the text as follows:</Text></MajorVersion> 648 <Format> 649 <td valign="top"><br/> 650 <Tab n="1"/><gsf:displayText name="ImageName"/>:<gsf:metadata name="Image"/><br/><br/> 651 <Tab n="1"/><gsf:displayText name="Width"/>:<gsf:metadata name="ImageWidth"/><br/><br/> 652 <Tab n="1"/><gsf:displayText name="Height"/>:<gsf:metadata name="ImageHeight"/><br/><br/> 653 <Tab n="1"/><gsf:displayText name="Size"/>:<gsf:metadata name="ImageSize"/><br/> 654 </td></Format> 655 <Text id="0395d">Edit the text as follows:</Text></MajorVersion> 649 656 <BulletList> 650 657 <Bullet> … … 1047 1054 <Format> 1048 1055 <gsf:metadata name="dc.Creator" /> <br /> 1049 <gsf:metadata name=" ex.Creator" /><br />1056 <gsf:metadata name="Creator" /><br /> 1050 1057 </Format> 1051 1058 <Text id="fw-23a-3">To display dc.Creator if it is present, otherwise display ex.Creator, use</Text> … … 1053 1060 <gsf:choose-metadata><br /> 1054 1061 <Tab n="1"/><gsf:metadata name="dc.Creator" /><br /> 1055 <Tab n="1"/><gsf:metadata name=" ex.Creator" /><br />1062 <Tab n="1"/><gsf:metadata name="Creator" /><br /> 1056 1063 </gsf:choose-metadata><br /> 1057 1064 </Format> … … 1205 1212 <Text id="fw-24">Opening PDF files with query terms highlighted</Text> 1206 1213 </Heading> 1214 <MajorVersion number="2"> 1207 1215 <NumberedItem> 1208 1216 <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> 1209 1217 </NumberedItem> 1210 1218 <NumberedItem> 1211 <Text id="fw-24c">The search terms are kept in the macro variable <AutoText text="_cgiargq_"/>, and we append <AutoText text="#search="_cgiargq_""/> to the end of a PDF file link to pass the query terms to the PDF file.</Text> 1212 <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> 1213 <Format>_httpcollection_/index/assoc/[archivedir]/doc.pdf</Format> 1214 <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> 1215 <Format>_httpcollection_/index/assoc/[archivedir]/[Source]</Format> 1216 <Text id="fw-24f">instead to locate the PDF source file.)</Text> 1217 </NumberedItem> 1218 <NumberedItem> 1219 <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> 1219 <Text id="fw-24c">The search terms are kept in the macro variable <AutoText text="_queryterms_"/>, and we append <AutoText text="#search="_queryterms_""/> to the end of a PDF file link to pass the query terms to the PDF.</Text> 1220 <Text id="fw-24d"><AutoText text="PDFPlugin"/> saves each PDF file in a unique directory. You can use </Text> 1221 <Format>_httpcollection_/index/assoc/[archivedir]/[srclinkFile]</Format> 1222 <Text id="fw-24f">to refer to these files.</Text> 1223 </NumberedItem> 1224 <NumberedItem> 1225 <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> 1220 1226 <Text id="fw-24b">The resulting format statement is:</Text> 1221 1227 <Format> 1222 1228 <td valign="top">[link][icon][/link]</td><br/> 1223 1229 <td valign="top"><highlight>{If}{[ex.FileFormat] eq 'PDF', <a 1224 href=\ "_httpcollection_/index/assoc/[archivedir]/doc.pdf#search=&quot;_cgiargq_&quot;\">{Or}{[ex.thumbicon],[ex.srcicon]}</a>,<br/>[ex.srclink]{Or}{[ex.thumbicon],[ex.srcicon]}[ex./srclink]}</highlight></td><br/>1230 href=\"_httpcollection_/index/assoc/[archivedir]/[srclinkFile]#search=&quot;_queryterms_&quot;\">{Or}{[ex.thumbicon],[ex.srcicon]}</a>,<br/>[ex.srclink]{Or}{[ex.thumbicon],[ex.srcicon]}[ex./srclink]}</highlight></td><br/> 1225 1231 <td valign="top">[highlight]<br/> 1226 1232 {Or}{[dc.Title],[ex.Title],Untitled}<br/> 1227 1233 [/highlight]{If}{[ex.Source],<br><i>([ex.Source])</i>}</td><br/> 1228 1234 </Format> 1229 <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> 1230 </NumberedItem> 1235 </NumberedItem> 1236 </MajorVersion> 1237 <MajorVersion number="3"> 1238 <NumberedItem> 1239 <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> 1240 </NumberedItem> 1241 <NumberedItem> 1242 <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="query""/> to the end of the document link. We need to create the link ourselves rather than using <gsf:link type="source"/> in the format statement. </Text> 1243 <Text id="fw-24d-3"><AutoText text="PDFPlugin"/> saves each PDF file in a unique directory for that document, and we can use</Text> 1244 <Format><gsf:metadata name="httpPath" type="collection"/>/index/assoc/<gsf:metadata name="archivedir"/>/<gsf:metadata name="srclinkFile"/></Format> 1245 <Text id="fw-24e-3">to refer to the PDF source file. 1246 The search terms can be found in the "q" cgi parameter. You can access this using <gsf:cgi-param name="q"/>.</Text> 1247 </NumberedItem> 1248 <NumberedItem> 1249 <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> 1250 <Text id="fw-24b-3">The resulting format statement is:</Text> 1251 <Format> 1252 <td valign="top"><br/> 1253 <Tab n="1"/><gsf:link type="document"><br/> 1254 <Tab n="2"/><gsf:icon type="document"/><br/> 1255 <Tab n="1"/></gsf:link><br/> 1256 </td><br/> 1257 <br /> 1258 <td valign="top"><br/> 1259 <highlight> 1260 <gsf:switch><br/> 1261 <Tab n="1"/><gsf:metadata name="FileFormat"/><br/> 1262 <Tab n="1"/><gsf:when test="equals" test-value="PDF"><br/> 1263 <Tab n="2"/><a><xsl:attribute name="href"><gsf:metadata name="httpPath" type="collection"/>/index/assoc/<gsf:metadata name="archivedir"/>/<gsf:metadata name="srclinkFile"/>#search=&amp;quot;<gsf:cgi-param name="query"/>&amp;quot;</xsl:attribute><br/> 1264 <Tab n="3"/><gsf:choose-metadata><br/> 1265 <Tab n="4"/><gsf:metadata name="thumbicon"/><br/> 1266 <Tab n="4"/><gsf:metadata name="srcicon"/><br/> 1267 <Tab n="3"/></gsf:choose-metadata><br/> 1268 <Tab n="2"/></a><br/> 1269 <Tab n="1"/></gsf:when><br/> 1270 <Tab n="1"/><gsf:otherwise><br/> 1271 <Tab n="2"/><gsf:link type="source"><br/> 1272 <Tab n="3"/><gsf:choose-metadata><br/> 1273 <Tab n="4"/><gsf:metadata name="thumbicon"/><br/> 1274 <Tab n="4"/><gsf:metadata name="srcicon"/><br/> 1275 <Tab n="3"/></gsf:choose-metadata><br/> 1276 <Tab n="2"/></gsf:link><br/> 1277 <Tab n="1"/></gsf:otherwise><br/> 1278 </gsf:switch></highlight><br/> 1279 </td><br/> 1280 <br /> 1281 <td valign="top"><br/> 1282 ... 1283 </Format> 1284 </NumberedItem> 1285 </MajorVersion> 1286 <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> 1231 1287 </Content> 1232 1288 </Tutorial> … … 1354 1410 </Content> 1355 1411 </Tutorial> 1412 <MajorVersion number="2"> 1356 1413 <Tutorial id="export_to_CDROM"> 1357 1414 <Title> … … 1378 1435 </Content> 1379 1436 </Tutorial> 1437 </MajorVersion> 1380 1438 <Tutorial id="large_html_collection"> 1381 1439 <Title>
Note:
See TracChangeset
for help on using the changeset viewer.