Changeset 26032 for documentation

Show
Ignore:
Timestamp:
27.07.2012 16:35:30 (7 years ago)
Author:
ak19
Message:

Adjusted the recently added Associated Files tutorial to work with Greenstone 3.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • documentation/trunk/tutorials/xml-source/tutorial_en.xml

    r26030 r26032  
    14871487</NumberedItem> 
    14881488<NumberedItem> 
    1489 <Text id="assoc-files-12">If you're working with structured Word documents that contain formatted headings and you want better structured and formatted HTML versions of the documents to be generated by Greenstone from the Word format, optionally set the <Format>windows_scripting</Format> option for the <AutoText text="WordPlugin"/> if building on Windows, or turn on the <Format>open_office_scripting</Format> option if this extension has been added to your Greenstone installation and either OpenOffice or LibreOffice is available on your system.</Text> 
    1490 <Text id="assoc-files-13">Optionally set the <AutoText text="level1_heading" type="italics"/> to <i>heading\s*1</i>, or whatever is appropriate for your documents if they use style information for headings that deviate from the norm for Word. Repeat as is needed for <AutoText text="level2_heading" type="italics"/> and so forth. For more details on how to control sections within a Word document, see the <TutorialRef id="enhanced_word"/> tutorial.</Text> 
     1489<Text id="assoc-files-12">If you're working with structured Word documents that contain formatted headings and you want better structured and formatted HTML versions of the documents to be generated by Greenstone from the Word format, optionally set the <Format>windows_scripting</Format> option for the <AutoText text="WordPlugin"/> if building on Windows. Alternatively, you can turn on the <Format>open_office_scripting</Format> option if this extension has been added to your Greenstone installation and if either OpenOffice or LibreOffice is available on your system.</Text> 
     1490<Text id="assoc-files-13">If you're using windows scripting, optionally set the <AutoText text="level1_heading" type="italics"/> to <i>heading\s*1</i>, or whatever is appropriate for your documents if they use style information for headings that deviate from the norm for Word. Repeat as is needed for <AutoText text="level2_heading" type="italics"/> and so forth. For more details on how to control sections within a Word document, see the <TutorialRef id="enhanced_word"/> tutorial.</Text> 
    14911491</NumberedItem> 
    14921492<NumberedItem> 
     
    14951495<NumberedItem> 
    14961496<Text id="assoc-files-15">Building the collection at this point will have the effect that internally Greenstone will have captured this relationship between the different file versions of the same documents; however, until we make some adjustments to the format statements, none of this will be visible to the end-user. The collection built at this point (with default settings) allows a user to search the text from the Word document, browse by title metadata and so on, but when it comes to the point of viewing a document there will only be the choice of viewing the Word version of the document, or the HTML version that Greenstone automatically generates by processing the Word document.</Text> 
    1497 <Text id="assoc-files-16">To go beyond this, the key change to make is to alter the part of default VList statement that says:</Text> 
    1498 <Format><td valign="top">[ex.srclink]{Or}{[ex.thumbicon],[ex.srcicon]}[ex./srclink]</td></Format> 
     1497<Text id="assoc-files-16">To go beyond this, the key change to make is to alter the part of the <MajorVersion number="2">default VList statement that says:</MajorVersion><MajorVersion number="3">documentNode template of the <AutoText text="browse"/> format statement which chooses between <Format>thumbicon</Format> and <Format>srcicon</Format>, and replace this with a reference to <Format>equivDocIcon</Format> instead.</MajorVersion></Text> 
     1498<MajorVersion number="2"> 
     1499<Format> 
     1500<td valign="top">[ex.srclink]{Or}{[ex.thumbicon],[ex.srcicon]}[ex./srclink]</td> 
     1501</Format> 
    14991502<Text id="assoc-files-18">to:</Text> 
    1500 <Format><td valign="top">[ex.equivDocLink][ex.equivDocIcon][ex./equivDocLink]</td></Format> 
    1501 <Text id="assoc-files-19">Two things occur in this edit. The main difference is the switch from using <AutoText text="ex.srclink" type="italics"/> and <AutoText text="ex.srcicon" type="italics"/> that provides the link to the primary source document (which is the Word document), and replace it with a hyperlink around an icon to the document that Greenstone has associated as an equivalent document (which is the PDF version). The icon Greenstone chooses to show is based on the filename extension of the matching file it has found. In this case <img src="../tutorial_files/ipdf.gif"/>.</Text> 
    1502 <Text id="assoc-files-20">The second (more minor) change in this edit is to simplify the statement a bit. The original uses an <Format>{Or}</Format> statement to show a thumbnail version of the document if Greenstone has one, in preference over the source icon. Since in this collection we have no thumbnails generated, it has been simplified by eliminating the <Format>{Or}</Format> combination and going straight to the <AutoText text="ex.equivDocIcon" type="italics"/> metadata item.</Text> 
    1503 <Text id="assoc-files-21">Switch to the <AutoText key="glidict::GUI.Format"/> panel and edit the format statement for VList (All).</Text> 
     1503<Format> 
     1504<td valign="top">[ex.equivDocLink][ex.equivDocIcon][ex./equivDocLink]</td> 
     1505</Format> 
     1506</MajorVersion> 
     1507<Text id="assoc-files-19">Two things occur in this replacement. The main difference is the switch from using <AutoText text="ex.srclink" type="italics"/> and <AutoText text="ex.srcicon" type="italics"/> that provides the link to the primary source document (which is the Word document), and replace it with a hyperlink around an icon to the document that Greenstone has associated as an equivalent document (which is the PDF version). The icon Greenstone chooses to show is based on the filename extension of the matching file it has found. In this case <img src="../tutorial_files/ipdf.gif"/>.</Text> 
     1508<MajorVersion number="2"> 
     1509<Text id="assoc-files-20">The second (more minor) change in this edit is to simplify the statement a bit. The original uses an <Format>{Or}</Format> statement to show a thumbnail version of the document, if Greenstone has one, in preference over the source icon. Since in this collection we have no thumbnails generated, it has been simplified by eliminating the <Format>{Or}</Format> combination and going straight to the <AutoText text="ex.equivDocIcon" type="italics"/> metadata item.</Text> 
     1510<Text id="assoc-files-21">To make the change then, switch to the <AutoText key="glidict::GUI.Format"/> panel and edit the format statement for VList (All).</Text> 
    15041511<Text id="assoc-files-22">Change:</Text> 
    15051512<Format> 
     
    15191526 [/highlight]{If}{[dc.Creator],: [sibling(All'\, '):dc.Creator]}</td><br /> 
    15201527</Format>  
     1528</MajorVersion> 
     1529<MajorVersion number="3"> 
     1530<Text id="assoc-files-20-3">The second (more minor) change in this edit is to simplify the statement a bit. The original uses a <Format>&lt;gsf:choose-metadata/&gt;</Format> statement to show a thumbnail version of the document, if Greenstone has one, in preference over the source icon. Since in this collection we have no thumbnails generated, it has been simplified by eliminating the <Format>&lt;gsf:choose-metadata/&gt;</Format> combination and going straight to the <AutoText text="ex.equivDocIcon" type="italics"/> metadata item.</Text> 
     1531<Text id="assoc-files-21-3">To make the change then, switch to the <AutoText key="glidict::GUI.Format"/> panel and edit the documentNode template of the <AutoText text="browse"/> format statement</Text> 
     1532<table> 
     1533<th> 
     1534<td><Text id="assoc-files-22"><b>Change:</b></Text></td> 
     1535<td><Text id="assoc-files-23"><b>To:</b></Text></td> 
     1536</th> 
     1537<tr> 
     1538<td valign="bottom"> 
     1539<Format> 
     1540&lt;td valign=&quot;top&quot;&gt;<br /> 
     1541  <Tab n="1"/>&lt;gsf:link type=&quot;source&quot;&gt;<br /> 
     1542    <Tab n="2"/>&lt;gsf:choose-metadata&gt;<br /> 
     1543      <Tab n="3"/>&lt;gsf:metadata name=&quot;thumbicon&quot;/&gt;<br /> 
     1544      <Tab n="3"/>&lt;gsf:metadata name=&quot;srcicon&quot;/&gt;<br /> 
     1545    <Tab n="2"/>&lt;/gsf:choose-metadata&gt;<br /> 
     1546  <Tab n="1"/>&lt;/gsf:link&gt;<br /> 
     1547&lt;/td&gt;<br /> 
     1548&lt;td valign=&quot;top&quot;&gt;<br /> 
     1549  <Tab n="1"/>&lt;gsf:link type=&quot;document&quot;&gt;<br /> 
     1550    <Tab n="2"/>&lt;gsf:choose-metadata&gt;<br /> 
     1551      <Tab n="3"/>&lt;gsf:metadata name=&quot;dc.Title&quot;/&gt;<br /> 
     1552      <Tab n="3"/>&lt;gsf:metadata name=&quot;exp.Title&quot;/&gt;<br /> 
     1553      <Tab n="3"/>&lt;gsf:metadata name=&quot;ex.dc.Title&quot;/&gt;<br /> 
     1554      <Tab n="3"/>&lt;gsf:metadata name=&quot;Title&quot;/&gt;<br /> 
     1555      <Tab n="3"/>&lt;gsf:default&gt;Untitled&lt;/gsf:default&gt;<br /> 
     1556    <Tab n="2"/>&lt;/gsf:choose-metadata&gt;<br /> 
     1557  <Tab n="1"/>&lt;/gsf:link&gt;<br /> 
     1558  <Tab n="1"/>&lt;gsf:switch&gt;<br /> 
     1559    <Tab n="2"/>&lt;gsf:metadata name=&quot;Source&quot;/&gt;<br /> 
     1560    <Tab n="2"/>&lt;gsf:when test=&quot;exists&quot;&gt;<br /> 
     1561      <Tab n="3"/>&lt;br/&gt;&lt;i&gt;(&lt;gsf:metadata name=&quot;Source&quot;/&gt;)&lt;/i&gt;<br /> 
     1562    <Tab n="2"/>&lt;/gsf:when&gt;<br /> 
     1563  <Tab n="1"/>&lt;/gsf:switch&gt;<br /> 
     1564&lt;/td&gt; 
     1565</Format> 
     1566</td> 
     1567<td valign="bottom"> 
     1568<Format> 
     1569&lt;td valign=&quot;top&quot;&gt;<br /> 
     1570<highlight> 
     1571  <Tab n="1"/>&lt;gsf:metadata name=&quot;equivDocLink&quot;/&gt;<br /> 
     1572  <Tab n="1"/>&lt;gsf:metadata name=&quot;equivDocIcon&quot;/&gt;<br /> 
     1573  <Tab n="1"/>&lt;gsf:metadata name=&quot;/equivDocLink&quot;/&gt; 
     1574</highlight><br /> 
     1575&lt;/td&gt;<br /> 
     1576&lt;td valign=&quot;top&quot;&gt;<br /> 
     1577  <Tab n="1"/>&lt;gsf:link type=&quot;document&quot;&gt;<br /> 
     1578    <Tab n="2"/>&lt;gsf:choose-metadata&gt;<br /> 
     1579      <Tab n="3"/>&lt;gsf:metadata name=&quot;dc.Title&quot;/&gt;<br /> 
     1580      <Tab n="3"/>&lt;gsf:metadata name=&quot;exp.Title&quot;/&gt;<br /> 
     1581      <Tab n="3"/>&lt;gsf:metadata name=&quot;ex.dc.Title&quot;/&gt;<br /> 
     1582      <Tab n="3"/>&lt;gsf:metadata name=&quot;Title&quot;/&gt;<br /> 
     1583      <Tab n="3"/>&lt;gsf:default&gt;Untitled&lt;/gsf:default&gt;<br /> 
     1584    <Tab n="2"/>&lt;/gsf:choose-metadata&gt;<br /> 
     1585  <Tab n="1"/>&lt;/gsf:link&gt;<br />  
     1586  <Tab n="1"/>&lt;gsf:switch&gt; 
     1587    <highlight><br /> 
     1588    <Tab n="2"/>&lt;gsf:metadata name=&quot;dc.Creator&quot;/&gt;<br /> 
     1589    <Tab n="2"/>&lt;gsf:when test=&quot;exists&quot;&gt;<br /> 
     1590      <Tab n="3"/>&lt;br/&gt;&lt;gsf:metadata name=&quot;dc.Creator&quot; separator=&quot;, &quot;/&gt;<br /> 
     1591    <Tab n="2"/>&lt;/gsf:when&gt; 
     1592  </highlight><br /> 
     1593  <Tab n="1"/>&lt;/gsf:switch&gt;<br /> 
     1594&lt;/td&gt; 
     1595</Format>  
     1596</td> 
     1597</tr> 
     1598</table> 
     1599<br /> 
     1600</MajorVersion> 
    15211601<Text id="assoc-files-24">Note: When Greenstone encounters a file that matches the provided <Format>associate_ext</Format> value (<Format>pdf</Format> in our case), it sets the metadata value <AutoText text="ex.equivDocIcon"/> for that document to be the macro <i>_iconXXX_</i>, where <i>XXX</i> is whatever the filename extension is (so <AutoText text="_iconpdf_" type="italics"/> in our case). As long as there is an existing macro defined for that combination of the word <i>icon</i> and the filename extension, then a suitable icon will be displayed when the document appears in a VList. For <i>pdf</i> the displayed icon will be <img src="../tutorial_files/ipdf.gif"/>.</Text> 
    15221602</NumberedItem>