Changeset 26110 for documentation/trunk


Ignore:
Timestamp:
2012-08-15T19:12:32+12:00 (12 years ago)
Author:
ak19
Message:

Many changes to the Formatting the (Tudor) HTML collection tutorial, to get it to work for GS3. And a minor change to the Enchanced collection of (Tudor) HTML files tutorial for GS3.

File:
1 edited

Legend:

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

    r26101 r26110  
    17441744</NumberedItem>
    17451745<NumberedItem>
    1746 <Text id="0452">The search page includes a pulldown menu that allows you to select one of these partitions for searching. For example, try searching the <i>relatives</i> partition for <i>mary</i> and then search the <i>monarchs</i> partition for the same thing.</Text>
     1746<Text id="0452">The <MajorVersion number="2">search</MajorVersion><MajorVersion number="3"><AutoText text="form search"/></MajorVersion> page includes a pulldown menu that allows you to select one of these partitions for searching. For example, try searching the <i>relatives</i> partition for <i>mary</i> and then search the <i>monarchs</i> partition for the same thing.</Text>
    17471747</NumberedItem>
    17481748<NumberedItem>
     
    17831783<Content>
    17841784<NumberedItem>
    1785 <Text id="0468">Open up your <b>tudor</b> collection, go to the <AutoText key="glidict::GUI.Format"/> panel (by clicking on its tab) and select <AutoText key="glidict::CDM.GUI.Formats"/> from the left-hand list. Leave the editing controls at their default value, so that <AutoText key="glidict::CDM.FormatManager.Feature"/> displays <AutoText key="glidict::CDM.FormatManager.AllFeatures" type="italics"/> and <AutoText text="VList"/> is selected as the <AutoText key="glidict::CDM.FormatManager.Part"/>. The text in the <AutoText key="glidict::CDM.FormatManager.Editor"/> box reads as follows:</Text>
     1785<Text id="0468">Open up your <b>tudor</b> collection, go to the <AutoText key="glidict::GUI.Format"/> panel (by clicking on its tab) and select <AutoText key="glidict::CDM.GUI.Formats"/> from the left-hand list. <MajorVersion number="2">Leave the editing controls at their default value, so that <AutoText key="glidict::CDM.FormatManager.Feature"/> displays <AutoText key="glidict::CDM.FormatManager.AllFeatures" type="italics"/> and <AutoText text="VList"/> is selected as the <AutoText key="glidict::CDM.FormatManager.Part"/>. The text in the <AutoText key="glidict::CDM.FormatManager.Editor"/> box reads as follows:</MajorVersion><MajorVersion number="3">Select the <AutoText text="browse"/> format feature and inspect its long format statement.</MajorVersion></Text>
     1786<MajorVersion number="2">
    17861787<Format>
    17871788&lt;td valign=top&gt;[link][icon][/link]&lt;/td&gt;<br/>
     
    17901791{Or}{[dc.Title],[exp.Title],[ex.Title],Untitled}<br/>
    17911792[/highlight]{If}{[ex.Source],&lt;br&gt;&lt;i&gt;([ex.Source])&lt;/i&gt;}&lt;/td&gt;
    1792 </Format>
     1793</Format>
     1794</MajorVersion>
    17931795<Text id="0469">This displays something that looks like this: </Text>
    17941796<Indent>
     
    17961798</Indent>
    17971799<Text id="0472">for a particular document whose <i>Title</i> metadata is <AutoText text="A discussion of question five from Tudor Quiz: Henry VIII"/> and whose <i>Source</i> metadata is <AutoText text="quizstuff.html"/>.</Text>
    1798 <Text id="0473">This format appears in the search results list, in the <AutoText key="coredm::_Global:labelTitle_"/> list, and also when you get down to individual documents in the <AutoText key="coredm::_Global:labelSubject_"/> hierarchy. This is Greenstone's default format statement.</Text>
     1800<Text id="0473">This format appears in the search results list, in the <AutoText key="coredm::_Global:labelTitle_"/> list, and also when you get down to individual documents in the <AutoText key="coredm::_Global:labelSubject_"/> hierarchy. This is Greenstone's default format statement<MajorVersion number="3"> used in the <AutoText text="browse"/> and <AutoText text="search"/> format features.</MajorVersion>.</Text>
    17991801</NumberedItem>
    18001802<Comment>
     
    18021804</Comment>
    18031805<NumberedItem>
    1804 <Text id="0475">Delete the contents of the <AutoText key="glidict::CDM.FormatManager.Editor"/> box and replace it with this simpler version:</Text>
    1805 <Format>
     1806<MajorVersion number="2"><Text id="0475">Delete the contents of the <AutoText key="glidict::CDM.FormatManager.Editor"/> box and replace it with this simpler version:</Text></MajorVersion>
     1807<MajorVersion number="3"><Text id="0475-3">Replace the <AutoText text="documentNode"/> template of the <AutoText text="browse"/> format feature with:</Text></MajorVersion>
     1808<Format>
     1809<MajorVersion number="2">
    18061810&lt;td&gt;[link][icon][/link]&lt;/td&gt; <br/>
    18071811&lt;td&gt;[ex.Title]&lt;br&gt;<br/>
    18081812&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&gt;([ex.Source])&lt;/i&gt;<br/>
    18091813&lt;/td&gt;
    1810 </Format>
    1811 <Text id="0476"><b>Preview</b> the result (you don't need to build the collection, because changes to format statements take effect immediately). Look at some search results and at the <AutoText key="coredm::_Global:labelTitle_"/> list. They are just the same as before! Under most circumstances this far simpler format statement is entirely equivalent to Greenstone's more complex default. </Text>
     1814</MajorVersion>
     1815<MajorVersion number="3">
     1816  &lt;gsf:template match=&quot;documentNode&quot;&gt;<br/>
     1817    <Tab n="1"/>&lt;td valign=&quot;top&quot;&gt;<br/>
     1818      <Tab n="2"/>&lt;gsf:link type=&quot;document&quot;&gt;<br/>
     1819        <Tab n="3"/>&lt;gsf:icon type=&quot;document&quot;/&gt;<br/>
     1820      <Tab n="2"/>&lt;/gsf:link&gt;<br/>
     1821    <Tab n="1"/>&lt;/td&gt;<br/>
     1822    <Tab n="1"/>&lt;td valign=&quot;top&quot;&gt;<br/>
     1823      <Tab n="2"/>&lt;gsf:metadata name=&quot;Title&quot;/&gt;<br/>
     1824      <Tab n="2"/>&lt;br/&gt;<br/>
     1825      <Tab n="2"/>&lt;i&gt;(&lt;gsf:metadata name=&quot;Source&quot;/&gt;)&lt;/i&gt;<br/>
     1826    <Tab n="1"/>&lt;/td&gt;<br/>
     1827  &lt;/gsf:template&gt;
     1828</MajorVersion>
     1829</Format>
     1830<MajorVersion number="3">
     1831<Text id="0475-3a">Replace the <AutoText text="search"/> format feature with the above format statement too.</Text>
     1832</MajorVersion>
     1833<Text id="0476"><b>Preview</b> the result (you don't need to build the collection, because changes to format statements take effect immediately). Look at some search results and at the <AutoText key="coredm::_Global:labelTitle_"/> list. They are just the same as before! Under most circumstances this far simpler format statement is entirely equivalent to Greenstone's more complex default.</Text>
     1834<MajorVersion number="3">
     1835<Text id="0476-3">We can also reduce the <AutoText text="VList classifierNode"/> template of the <AutoText text="browse"/> format feature further, also without changing the display. Replace it with:</Text>
     1836<Format>
     1837  &lt;gsf:template match=&quot;classifierNode[@classifierStyle = 'VList']&quot;&gt;<br/>
     1838    <Tab n="1"/>&lt;td valign=&quot;top&quot;&gt;<br/>
     1839      <Tab n="2"/>&lt;gsf:link type=&quot;classifier&quot;&gt;<br/>
     1840        <Tab n="3"/>&lt;gsf:icon type=&quot;classifier&quot;/&gt;<br/>
     1841      <Tab n="2"/>&lt;/gsf:link&gt;<br/>
     1842    <Tab n="1"/>&lt;/td&gt;<br/>
     1843    <Tab n="1"/>&lt;td valign=&quot;top&quot;&gt;<br/>
     1844      <Tab n="2"/>&lt;gsf:metadata name=&quot;Title&quot;/&gt;<br/>
     1845      <Tab n="2"/>&lt;br/&gt;<br/>
     1846      <Tab n="2"/>&lt;i&gt;(&lt;gsf:metadata name=&quot;Source&quot;/&gt;)&lt;/i&gt;<br/>
     1847    <Tab n="1"/>&lt;/td&gt;<br/>
     1848  &lt;/gsf:template&gt;
     1849</Format>
     1850</MajorVersion>
     1851<MajorVersion number="2">
    18121852<Comment>
    18131853<Text id="0478">But there's a problem. Beside the bookshelves in the <AutoText key="coredm::_Global:labelSubject_"/> browser, beneath the subject appears a mysterious "()". What is printed for these bookshelves is governed by the same format statement, and though bookshelf nodes of the hierarchy have associated <i>Title</i> metadata&mdash;their title is the name of the metadata value associated with that bookshelf&mdash;they do not have <AutoText key="metadata::ex.Source"/> metadata, so it comes out blank.</Text>
    18141854</Comment>
    1815 </NumberedItem>
    1816 <NumberedItem>
     1855</MajorVersion>
     1856</NumberedItem>
     1857<NumberedItem>
     1858<MajorVersion number="2">
    18171859<Text id="0482">In the <AutoText key="glidict::CDM.GUI.Formats"/> section of the <AutoText key="glidict::GUI.Format"/> panel, the <AutoText key="glidict::CDM.FormatManager.Feature"/> menu (just above <AutoText key="glidict::CDM.FormatManager.Part"/> menu) displays <AutoText key="glidict::CDM.FormatManager.AllFeatures" type="italics"/>. That implies that the same format is used for the search results, titles, and all nodes in the subject hierarchy&mdash;including internal nodes (that is, bookshelves). The <AutoText key="glidict::CDM.FormatManager.Feature"/> menu can be used to restrict a format statement to a specific one of these lists. We will override this format statement for the hierarchical <i>subject</i> classifier. In the <AutoText key="glidict::CDM.FormatManager.Feature"/> menu, scroll down to the item that says</Text>
     1860</MajorVersion>
     1861<MajorVersion number="3">
     1862<Text id="0482-3">Since we edited the <AutoText text="browse"/> format feature, the same format statements are used for the titles, and all nodes in the subject hierarchy&mdash;including internal nodes (that is, bookshelves). The <AutoText key="glidict::CDM.FormatManager.Feature"/> menu can be used to restrict a format statement to a specific classifier and its nodes. We will override this format statement for the hierarchical <i>subject</i> classifier. In the <AutoText key="glidict::CDM.FormatManager.Feature"/> menu, scroll down to the item that says</Text>
     1863</MajorVersion>
    18181864<Indent>
    1819 CL2: Hierarchy -metadata <AutoText key="metadata::dc.Subject" type="plain"/>
     1865CL2<MajorVersion number="2">:</MajorVersion> Hierarchy -metadata <AutoText key="metadata::dc.Subject" type="plain"/>
    18201866</Indent>
    18211867<Text id="0483">and select it. This is the format statement that affects the second classifier (i.e., "CL2"), which is a <AutoText text="Hierarchy"/> classifier based on <AutoText key="metadata::dc.Subject"/> metadata.</Text>
    18221868<Text id="0483a">Click <AutoText key="glidict::CDM.FormatManager.Add" type="button"/> to add this format statement to the collection.</Text>
     1869<MajorVersion number="2">
    18231870<Text id="0484">Edit the <AutoText key="glidict::CDM.FormatManager.Editor"/> box below to read</Text>
    1824 <Format>
     1871</MajorVersion>
     1872<MajorVersion number="3">
     1873<Text id="0484-3">Edit the <AutoText key="glidict::CDM.FormatManager.Editor"/> box below to contain the following format statements for the <AutoText text="documentNode"/> and <AutoText text="VList classifierNode"/> templates. (The changes to the <AutoText text="documentNode"/> template are mostly the same as before, but without reference to the Source document. This time, the <AutoText text="VList classifierNode"/> template is simplified further still.)</Text>
     1874</MajorVersion>
     1875<Format>
     1876<MajorVersion number="2">
    18251877&lt;td&gt;[link][icon][/link]&lt;/td&gt;<br/>
    18261878&lt;td&gt;[ex.Title]&lt;/td&gt;
     1879</MajorVersion>
     1880<MajorVersion number="3">
     1881&lt;gsf:template match=&quot;documentNode&quot;&gt;<br/>
     1882    <Tab n="1"/>&lt;td valign=&quot;top&quot;&gt;<br/>
     1883      <Tab n="2"/>&lt;gsf:link type=&quot;document&quot;&gt;<br/>
     1884        <Tab n="3"/>&lt;gsf:icon type=&quot;document&quot;/&gt;<br/>
     1885      <Tab n="2"/>&lt;/gsf:link&gt;<br/>
     1886    <Tab n="1"/>&lt;/td&gt;<br/>
     1887    <Tab n="1"/>&lt;td valign=&quot;top&quot;&gt;<br/>
     1888      <Tab n="2"/>&lt;gsf:metadata name=&quot;Title&quot;/&gt;<br/>
     1889    <Tab n="1"/>&lt;/td&gt;<br/>
     1890  &lt;/gsf:template&gt;<br/>
     1891<br/>
     1892  &lt;gsf:template match=&quot;classifierNode[@classifierStyle = 'VList']&quot;&gt;<br/>
     1893    <Tab n="1"/>&lt;td valign=&quot;top&quot;&gt;<br/>
     1894      <Tab n="2"/>&lt;gsf:link type=&quot;classifier&quot;&gt;<br/>
     1895        <Tab n="3"/>&lt;gsf:icon type=&quot;classifier&quot;/&gt;<br/>
     1896      <Tab n="2"/>&lt;/gsf:link&gt;<br/>
     1897    <Tab n="1"/>&lt;/td&gt;<br/>
     1898    <Tab n="1"/>&lt;td valign=&quot;top&quot;&gt;<br/>
     1899      <Tab n="2"/>&lt;gsf:metadata name=&quot;Title&quot;/&gt;<br/>
     1900    <Tab n="1"/>&lt;/td&gt;<br/>
     1901  &lt;/gsf:template&gt;
     1902</MajorVersion>
    18271903</Format>
    18281904</NumberedItem>
    18291905<NumberedItem>
    1830 <Text id="0486"><b>Preview</b> the <AutoText key="coredm::_Global:labelSubject_"/> list in the collection. First, the offending "()" has disappeared from the bookshelves. Second, when you get down to a list of documents in the subject hierarchy, the filename does not appear beside the title, because <AutoText key="metadata::ex.Source"/> is not specified in the format statement and this format statement applies to all nodes in the <i>subject</i> classifier. Note that the search results and titles lists have not changed: they still display the filename underneath the title.</Text>
    1831 </NumberedItem>
    1832 <NumberedItem>
     1906<Text id="0486"><b>Preview</b> the <AutoText key="coredm::_Global:labelSubject_"/> list in the collection. <MajorVersion number="2">First, the offending "()" has disappeared from the bookshelves. Second, when</MajorVersion><MajorVersion number="3">When</MajorVersion> you get down to a list of documents in the subject hierarchy, the filename does not appear beside the title, because <AutoText key="metadata::ex.Source"/> is not specified in the format statement and this format statement applies to all nodes in the <i>subject</i> classifier. Note that the search results and titles lists have not changed: they still display the filename underneath the title.</Text>
     1907</NumberedItem>
     1908<NumberedItem>
     1909<MajorVersion number="2">
    18331910<Text id="0487">Let's change the search results format so that <AutoText key="metadata::dc.Subject"/> metadata is displayed here instead of the filename. In the <AutoText key="glidict::CDM.FormatManager.Feature"/> menu (under <AutoText key="glidict::CDM.GUI.Formats"/> on the <AutoText key="glidict::GUI.Format"/> panel), scroll down to the item <AutoText text="Search"/> and select it. Click <AutoText key="glidict::CDM.FormatManager.Add" type="button"/> to add this format statement to the collection. Change the <AutoText key="glidict::CDM.FormatManager.Editor"/> box below to read</Text>
     1911</MajorVersion>
     1912<MajorVersion number="3">
     1913<Text id="0487-3">Select the <AutoText text="search"/> format feature once more for some further editing. Replace the line:</Text>
     1914</MajorVersion>
     1915<MajorVersion number="2">
    18341916<Format>
    18351917&lt;td&gt;[link][icon][/link]&lt;/td&gt;<br/>
     
    18381920&lt;/td&gt;<br/>
    18391921</Format>
    1840 </NumberedItem>
     1922</MajorVersion>
     1923<MajorVersion number="3">
     1924<Format>
     1925  &lt;i&gt;(&lt;gsf:metadata name=&quot;Source&quot;/&gt;)&lt;/i&gt;<br/>
     1926</Format>
     1927<Text id="ep-16">with</Text>
     1928<Format>
     1929  &lt;gsf:metadata name=&quot;dc.Subject&quot;/&gt;<br/>
     1930</Format>
     1931</MajorVersion>
     1932</NumberedItem>
     1933<MajorVersion number="2">
    18411934<NumberedItem>
    18421935<Text id="0489">To insert the <AutoText text="[dc.Subject]"/>, position the cursor at the appropriate point and either type it in, or select it from the <AutoText key="glidict::CDM.FormatManager.Insert_Variable"/> drop down menu. This menu shows many of the things that you can put in square brackets in the format statement.</Text>
    18431936</NumberedItem>
     1937</MajorVersion>
    18441938<NumberedItem>
    18451939<Text id="0490"><b>Preview</b> the collection. Documents in the search results list will be displayed like this:</Text>
     
    18491943</NumberedItem>
    18501944<NumberedItem>
    1851 <Text id="0494">Finally, let's return to the <AutoText key="coredm::_Global:labelSubject_" type="italics"/> hierarchy and learn how to do different things to the bookshelves and to the documents themselves. In the <AutoText key="glidict::CDM.FormatManager.Feature"/> menu, re-select the item</Text>
     1945<Text id="0494">Finally, let's return to the <AutoText key="coredm::_Global:labelSubject_" type="italics"/> hierarchy and learn how to do different things to the bookshelves and to the documents themselves. <MajorVersion number="2">In the <AutoText key="glidict::CDM.FormatManager.Feature"/> menu, re-select the item</MajorVersion><MajorVersion number="3">Reselect the format feature for</MajorVersion></Text>
    18521946<Indent>
    1853 CL2: Hierarchy -metadata <AutoText key="metadata::dc.Subject" type="plain"/>
    1854 </Indent>
     1947CL2<MajorVersion number="2">:</MajorVersion> Hierarchy -metadata <AutoText key="metadata::dc.Subject" type="plain"/>
     1948</Indent>
     1949<MajorVersion number="2">
    18551950<Text id="0495">Edit the <AutoText key="glidict::CDM.FormatManager.Editor"/> box below to read</Text>
    18561951<Format>
     
    18641959<Text id="0497">The <AutoText text="If"/> statement tests the value of the variable <AutoText text="numleafdocs"/>. This variable is only set for internal nodes of the hierarchy, i.e. bookshelves, and gives the number of documents below that node. If it is set we take the first branch, otherwise we take the second. Commas are used to separate the branches. The curly brackets serve to indicate that the <AutoText text="If"/> is special&mdash;otherwise the word <AutoText text="If" type="quoted"/> itself would be output.</Text>
    18651960</Comment>
    1866 </NumberedItem>
    1867 <NumberedItem>
    1868 <Text id="0498"><b>Preview</b> the collection and examine the subject hierarchy again to see the effect of your changes. Bookshelves should say <AutoText text="Bookshelf title:"/> and then the title, while documents will display <AutoText text="Title:"/> and the title. Note that the number of documents in the bookshelf is not displayed: we are using <Format>[numleafdocs]</Format> to test what kind of item in the list we are at, but we are not displaying it.</Text>
     1961</MajorVersion>
     1962<MajorVersion number="3">
     1963<Text id="0495-3">For the <AutoText text="documentNode"/> template, adjust its display of the title to:</Text>
     1964<Format>
     1965  &lt;td valign=&quot;top&quot;&gt;<br/>
     1966    <Tab n="1"/>&lt;b&gt;Title:&lt;/b&gt; &lt;gsf:metadata name=&quot;Title&quot;/&gt;<br/>
     1967  &lt;/td&gt;
     1968</Format>
     1969<Text id="0496-3">Next adjust the title display of the <AutoText text="VList classifierNode"/> template too:</Text>
     1970<Format>
     1971  &lt;td valign=&quot;top&quot;&gt;<br/>
     1972    <Tab n="1"/>&lt;b&gt;Bookshelf title:&lt;/b&gt; &lt;gsf:metadata name=&quot;Title&quot;/&gt;<br/>
     1973  &lt;/td&gt;
     1974</Format>
     1975</MajorVersion>
     1976</NumberedItem>
     1977<NumberedItem>
     1978<Text id="0498"><b>Preview</b> the collection and examine the subject hierarchy again to see the effect of your changes. Bookshelves should say <AutoText text="Bookshelf title:"/> and then the title, while documents will display <AutoText text="Title:"/> and the title.<MajorVersion number="2"> Note that the number of documents in the bookshelf is not displayed: we are using <Format>[numleafdocs]</Format> to test what kind of item in the list we are at, but we are not displaying it.</MajorVersion></Text>
    18691979</NumberedItem>
    18701980</Content>
Note: See TracChangeset for help on using the changeset viewer.