Changeset 26081
- Timestamp:
- 2012-08-07T20:26:11+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/trunk/tutorials/xml-source/tutorial_en.xml
r26078 r26081 3039 3039 </NumberedItem> 3040 3040 <NumberedItem> 3041 <Text id="0687">Now we change the format statement for <AutoText key="coredm::_Global:labelTitle_" type="italics"/> to display more information about the documents. In the <AutoText key="glidict::CDM.GUI.Formats"/> section of the <AutoText key="glidict::GUI.Format"/> panel, select the <AutoText text="dc.Title;ex.Title"/> classifier (CL1) in the <AutoText key="glidict::CDM.FormatManager.Feature"/> list, and <AutoText text="VList"/> in the <AutoText key="glidict::CDM.FormatManager.Part"/> list. Click <AutoText key="glidict::CDM.FormatManager.Add" type="button"/> to add this format statement to your collection. Delete the contents of the <AutoText key="glidict::CDM.FormatManager.Editor"/> box, and add the following text. (This format statement can be copied and pasted from the file <Path>sample_files → niupepa → formats → titles_tweak.txt</Path>.)</Text> 3041 <Text id="0687">Now we change the format statement for <AutoText key="coredm::_Global:labelTitle_" type="italics"/> to display more information about the documents. In the <AutoText key="glidict::CDM.GUI.Formats"/> section of the <AutoText key="glidict::GUI.Format"/> panel, select the <AutoText text="dc.Title;ex.Title"/> classifier (CL1) in the <AutoText key="glidict::CDM.FormatManager.Feature"/> list<MajorVersion number="2">, and <AutoText text="VList"/> in the <AutoText key="glidict::CDM.FormatManager.Part"/> list.</MajorVersion> Click <AutoText key="glidict::CDM.FormatManager.Add" type="button"/> to add this format statement to your collection. 3042 <MajorVersion number="2">Delete the contents of the <AutoText key="glidict::CDM.FormatManager.Editor"/> box, and add the following text. (This format statement can be copied and pasted from the file <Path>sample_files → niupepa → formats → titles_tweak.txt</Path>.)</MajorVersion> 3043 <MajorVersion number="3">Edit the contents of the <AutoText text="browse"/> format statement by removing the following in the <AutoText text="documentNode"/> template:</MajorVersion> 3044 </Text> 3045 <MajorVersion number="2"> 3042 3046 <Format> 3043 3047 <td valign="top">[link][icon][/link]</td><br/> … … 3047 3051 </td> 3048 3052 </Format> 3053 </MajorVersion> 3054 <MajorVersion number="3"> 3055 <Format> 3056 <td valign="top"><br /> 3057 <Tab n="1"/><gsf:link type="source"><br /> 3058 <Tab n="2"/><gsf:choose-metadata><br /> 3059 <Tab n="3"/><gsf:metadata name="thumbicon"/><br /> 3060 <Tab n="3"/><gsf:metadata name="srcicon"/><br /> 3061 <Tab n="2"/></gsf:choose-metadata><br /> 3062 <Tab n="1"/></gsf:link><br /> 3063 </td><br /> 3064 <td valign="top"><br /> 3065 <Tab n="1"/><gsf:link type="document"><br /> 3066 <Tab n="2"/><xsl:call-template name="choose-title"/><br /> 3067 <Tab n="1"/></gsf:link><br /> 3068 <Tab n="1"/><gsf:switch><br /> 3069 <Tab n="2"/><gsf:metadata name="Source"/><br /> 3070 <Tab n="2"/><gsf:when test="exists"><br /> 3071 <Tab n="3"/><br/><br /> 3072 <Tab n="3"/><i><br /> 3073 <Tab n="3"/><gsf:metadata name="Source"/>)<br /> 3074 <Tab n="3"/></i><br /> 3075 <Tab n="2"/></gsf:when><br /> 3076 <Tab n="1"/></gsf:switch><br /> 3077 </td> 3078 </Format> 3079 <Text id="0687-3a">In its place, insert the following (which can be copied from <Path>sample_files → niupepa → formats → titles_tweak_gs3.txt</Path>):</Text> 3080 <Format> 3081 <td valign="top"><br /> 3082 <Tab n="1"/>Volume:<gsf:metadata name="Volume"/> Number:<gsf:metadata name="Number"/> Date:<gsf:metadata format="formatDate" name="Date"/><br /> 3083 </td><br /> 3084 </Format> 3085 <Text id="0687-3b">Then, in <AutoText text="classifierNode"/> template for <AutoText text="VList"/>s, replace the contents of the final <Format><td></Format> table cell element with the following which can also be copied from the file <Path>titles_tweak_gs3.txt</Path>:</Text> 3086 <Format> 3087 <td valign="top"><br /> 3088 <Tab n="1"/><xsl:call-template name="choose-title"/> (<gsf:metadata name="numleafdocs"/>)<br /> 3089 </td><br /> 3090 </Format> 3091 </MajorVersion> 3049 3092 </NumberedItem> 3050 3093 <NumberedItem> 3051 3094 <Text id="0690a">Refresh in the web browser to view the new <AutoText key="coredm::_Global:labelTitle_" type="italics"/> list.</Text> 3052 <Text id="0687c">As a consequence of using the <AutoText text="bookshelf_type"/> option of the <AutoText text="List"/> classifier, bookshelf icons appear when titles are browsed. This revised format statement has the effect of specifying in brackets how many items are contained within a bookshelf . It works by exploiting the fact that only bookshelf icons define <Format>[numleafdocs]</Format> metadata.For document nodes, Title is not displayed. Instead, Volume, Number and Date information are displayed.</Text>3095 <Text id="0687c">As a consequence of using the <AutoText text="bookshelf_type"/> option of the <AutoText text="List"/> classifier, bookshelf icons appear when titles are browsed. This revised format statement has the effect of specifying in brackets how many items are contained within a bookshelf<MajorVersion number="3">, for classifier nodes</MajorVersion>. <MajorVersion number="2">It works by exploiting the fact that only bookshelf icons define <Format>[numleafdocs]</Format> metadata.</MajorVersion> For document nodes, Title is not displayed. Instead, Volume, Number and Date information are displayed.</Text> 3053 3096 </NumberedItem> 3054 3097 <Heading> … … 3058 3101 <Text id="0686">Back in the <AutoText key="glidict::GUI.Design"/> panel, under the <AutoText key="glidict::CDM.GUI.Classifiers"/> section, add a <AutoText text="DateList" /> classifier, leaving its <AutoText text="metadata"/> option set to <AutoText key="metadata::ex.Date"/>.</Text> 3059 3102 </NumberedItem> 3103 <MajorVersion number="3"> 3104 <NumberedItem> 3105 <Text id="0686b-3">In the <AutoText key="glidict::CDM.GUI.Formats"/> section of the <AutoText key="glidict::GUI.Format"/> panel, select <AutoText text="DateList" /> in the <AutoText key="glidict::CDM.FormatManager.Feature"/> list, and click <AutoText key="glidict::CDM.FormatManager.Add" type="button"/> to add this format statement to your collection. Replace the final <Format><td></Format> table cell element of the new <AutoText text="DateList"/>'s <AutoText text="VList classifierNode"/> template with:</Text> 3106 <Format> 3107 <td valign="top"><br /> 3108 <Tab n="1"/><xsl:call-template name="choose-date"/><br /> 3109 </td> 3110 </Format> 3111 </NumberedItem> 3112 <NumberedItem> 3113 <Text id="0686b-3a">The above makes reference to the "choose-date" template which we're about to create: select the <AutoText text="global"/> format statement in the <AutoText key="glidict::CDM.GUI.Formats"/> and append the following definition for the "choose-date" template (which can be copied from <Path>sample_files → niupepa → formats → global_tweak_gs3.txt</Path>):</Text> 3114 <Format> 3115 <gsf:template name="choose-date"><br /> 3116 <Tab n="1"/><gsf:choose-metadata><br /> 3117 <Tab n="2"/><gsf:metadata format="formatDate" name="dc.Date"/><br /> 3118 <Tab n="2"/> <gsf:metadata format="formatDate" name="exp.Date"/><br /> 3119 <Tab n="2"/><gsf:metadata format="formatDate" name="ex.dc.Date"/><br /> 3120 <Tab n="2"/><gsf:metadata format="formatDate" name="Date"/><br /> 3121 <Tab n="2"/><gsf:default>undated</gsf:default><br /> 3122 <Tab n="1"/></gsf:choose-metadata><br /> 3123 </gsf:template> 3124 </Format> 3125 </NumberedItem> 3126 </MajorVersion> 3060 3127 <NumberedItem> 3061 3128 <Text id="0686b"><b>Build</b> the collection, and <b>preview</b> the <AutoText key="coredm::_Global:labelDate_" type="italics"/> list.</Text> 3062 3129 </NumberedItem> 3063 3130 <NumberedItem> 3064 <Text id="0691">The <AutoText key="coredm::_Global:labelDate_" type="italics"/> list groups documents by date. Greenstone's internal date format is YYYYMMDD, for example 18580601, and this is crucial for the <AutoText text="DateList" /> classifier to correctly parse date metadata and generate an ordered date list. However, the date has been made to look nice by adding a <AutoText text="[format:]"/> macro to Date metadata in the format statement.</Text> 3065 </NumberedItem> 3066 <NumberedItem> 3131 <Text id="0691">The <AutoText key="coredm::_Global:labelDate_" type="italics"/> list groups documents by date. Greenstone's internal date format is YYYYMMDD, for example 18580601, and this is crucial for the <AutoText text="DateList" /> classifier to correctly parse date metadata and generate an ordered date list. However, the date has been made to look nice by adding a <MajorVersion number="2"><AutoText text="[format:]"/> macro</MajorVersion><MajorVersion number="3">"<AutoText text="format=formatDate"/>" attribute</MajorVersion> to Date metadata in the format statement.</Text> 3132 </NumberedItem> 3133 <NumberedItem> 3134 <MajorVersion number="2"> 3067 3135 <Text id="0691a">In the <AutoText key="glidict::CDM.GUI.Formats"/> section of the <AutoText key="glidict::GUI.Format"/> panel, select <AutoText key="glidict::CDM.FormatManager.AllFeatures"/> in the <AutoText key="glidict::CDM.FormatManager.Feature"/> list, and <AutoText text="DateList" /> in the <AutoText key="glidict::CDM.FormatManager.Part"/> list. Click <AutoText key="glidict::CDM.FormatManager.Add" type="button"/> to add this format statement to your collection. Replace the last line</Text> 3068 3136 <Format> … … 3073 3141 <td>{Or}{[dc.Date],[exp.Date],[ex.Date]}</td> 3074 3142 </Format> 3143 </MajorVersion> 3144 <MajorVersion number="3">Back in the <AutoText text="global"/> format statement, edit the display of the date metadata to remove the special date-formatting, so that it looks like: 3145 <Format> 3146 <gsf:template name="choose-date"><br /> 3147 <Tab n="1"/><gsf:choose-metadata><br /> 3148 <Tab n="2"/><gsf:metadata name="dc.Date"/><br /> 3149 <Tab n="2"/> <gsf:metadata name="exp.Date"/><br /> 3150 <Tab n="2"/><gsf:metadata name="ex.dc.Date"/><br /> 3151 <Tab n="2"/><gsf:metadata name="Date"/><br /> 3152 <Tab n="2"/><gsf:default>undated</gsf:default><br /> 3153 <Tab n="1"/></gsf:choose-metadata><br /> 3154 </gsf:template> 3155 </Format> 3156 </MajorVersion> 3075 3157 <Text id="0691c">Refresh in the web browser to view the new <AutoText key="coredm::_Global:labelDate_" type="italics"/> list. The dates are now shown in internal format. </Text> 3076 3158 </NumberedItem> 3077 3159 <NumberedItem> 3078 <Text id="0691d">Change the format statement back to reinstate the nicely formatted dates. This can be done by selecting <AutoText text="DateList"/> in assigned format statements panel and clicking <<AutoText text="Reset to Default"/>></Text> 3079 </NumberedItem> 3160 <Text id="0691d">Change the format statement back to reinstate the nicely formatted dates. 3161 <MajorVersion number="2"> 3162 This can be done by selecting <AutoText text="DateList"/> in assigned format statements panel and clicking <<AutoText text="Reset to Default"/>>. 3163 </MajorVersion> 3164 <MajorVersion number="3"> 3165 This can be done by selecting <AutoText text="global"/> in assigned format statements panel and clicking <<AutoText text="Undo"/>> a few times.</MajorVersion> 3166 </Text> 3167 </NumberedItem> 3168 <MajorVersion number="2"> 3080 3169 <Heading> 3081 3170 <Text id="0694">Displaying scanned images and suppressing dummy text</Text> … … 3107 3196 <Text id="0698c"><b>Preview</b> the collection and view one of the <AutoText text="Te Waka o Te Iwi"/> documents. The line <AutoText key="perlmodules::BasePlugin.dummy_text" type="quoted"/> should now be gone.</Text> 3108 3197 </NumberedItem> 3198 </MajorVersion> 3109 3199 <Heading> 3110 3200 <Text id="0690k">Searching at page level</Text> … … 3114 3204 </NumberedItem> 3115 3205 <NumberedItem> 3116 <Text id="0690d">Go to the <AutoText key="glidict::CDM.GUI.Indexes"/> section of the <AutoText key="glidict::GUI.Design"/> panel. Remove the <AutoText key="metadata::ex.Source"/> index . Check the <AutoText key="glidict::CDM.LevelManager.Section"/> checkbox to build the indexes on section level as well as document level. Make section level the default by selecting its <AutoText key="glidict::CDM.LevelManager.Default"/> radio button.</Text>3206 <Text id="0690d">Go to the <AutoText key="glidict::CDM.GUI.Indexes"/> section of the <AutoText key="glidict::GUI.Design"/> panel. Remove the <AutoText key="metadata::ex.Source"/> index and<MajorVersion number="3">, if not already the case,</MajorVersion> check the <AutoText key="glidict::CDM.LevelManager.Section"/> checkbox to build the indexes on section level as well as document level. Make section level the default by selecting its <AutoText key="glidict::CDM.LevelManager.Default"/> radio button.</Text> 3117 3207 </NumberedItem> 3118 3208 <NumberedItem> … … 3121 3211 <NumberedItem> 3122 3212 <Text id="0690m"><b>Build</b> and <b>preview</b> the collection.</Text> 3123 <Text id="0690d-2">Compare searching at "newspaper" level with searching at "page" level. A useful search term for this collection is <AutoText text="aroha" type="quoted"/>.</Text> 3124 </NumberedItem> 3213 <Text id="0690d-2"><MajorVersion number="3">Choose <AutoText text="form search"/>. </MajorVersion>Compare searching at "newspaper" level with searching at "page" level. A useful search term for this collection is <AutoText text="aroha" type="quoted"/>.</Text> 3214 </NumberedItem> 3215 <MajorVersion number="2"> 3125 3216 <Heading> 3126 3217 <Text id="0690-tidy">Tidying up search results</Text> … … 3145 3236 <Text id="0690g"><b>Preview</b> the collection. </Text> 3146 3237 </NumberedItem> 3147 <Comment> 3148 <Text id="0690h">You might notice that newspaper level search results only display the newspaper Title, and not any volume information, while page level search results only show a large scan of the newspaper page, the Title of the page (the page number), and not the Title of the newspaper. We'll modify the format statement to show Volume and Number information, and for page results, the newspaper title as well as the page number.</Text> 3149 </Comment> 3150 <NumberedItem> 3151 <Text id="0690h-1">In the <AutoText key="glidict::CDM.GUI.Formats"/> section, select <AutoText text="Search"/> in <AutoText key="glidict::CDM.FormatManager.Feature"/>, and <AutoText text="VList"/> in <AutoText key="glidict::CDM.FormatManager.Part"/>. Click <AutoText key="glidict::CDM.FormatManager.Add" type="button"/> to add this format to the collection. The previous changes modified <AutoText text="VList"/>, so they will apply to all <AutoText text="VList"/>s that don't have specific format statements. These next changes are made to <AutoText text="SearchVList"/> so will only apply to search results. </Text> 3152 <Text id="0690i">The extracted Title for the current section is specified as <Format>[ex.Title]</Format> while the Title for the parent section is <Format>[parent:ex.Title]</Format>. Since the same <AutoText text="SearchVList"/> format statement is used when searching both whole newspapers and newspaper pages, we need to make sure it works in both cases.</Text> 3238 </MajorVersion> 3239 <Comment> 3240 <Text id="0690h">You might notice that newspaper level search results only display the newspaper Title, and not any volume information, while page level search results only show <MajorVersion number="2">a large scan of the newspaper page, </MajorVersion>the Title of the page (the page number), and not the Title of the newspaper. We'll modify the format statement to show Volume and Number information, and for page results, the newspaper title as well as the page number.</Text> 3241 </Comment> 3242 <NumberedItem> 3243 <Text id="0690h-1">In the <AutoText key="glidict::CDM.GUI.Formats"/> section, select <AutoText text="Search"/> in <AutoText key="glidict::CDM.FormatManager.Feature"/><MajorVersion number="3"> to adjust how search results are displayed.</MajorVersion><MajorVersion number="2">, and <AutoText text="VList"/> in <AutoText key="glidict::CDM.FormatManager.Part"/>. Click <AutoText key="glidict::CDM.FormatManager.Add" type="button"/> to add this format to the collection. The previous changes modified <AutoText text="VList"/>, so they will apply to all <AutoText text="VList"/>s that don't have specific format statements. These next changes are made to <AutoText text="SearchVList"/> so will only apply to search results. </MajorVersion></Text> 3244 <Text id="0690i">The extracted Title for the current section is specified as <Format><MajorVersion number="2">[ex.Title]</MajorVersion><MajorVersion number="3"><gsf:metadata name="Title"/></MajorVersion></Format> while the Title for the parent section is <Format><MajorVersion number="2">[parent:ex.Title]</MajorVersion><MajorVersion number="3"><gsf:metadata name="Title" select="parent"/></MajorVersion></Format>. Since the same <AutoText text="SearchVList"/> format statement is used when searching both whole newspapers and newspaper pages, we need to make sure it works in both cases.</Text> 3245 <MajorVersion number="2"> 3153 3246 <Text id="0690j">Set the format statement to the following text (it can be copied and pasted from the file <Path>sample_files → niupepa → formats → search_tweak.txt</Path>):</Text> 3154 <Format> 3247 </MajorVersion> 3248 <MajorVersion number="3"> 3249 <Text id="0690j-3">Replace the lines comprising the final <Format><td></Format> table cell element with the following format statement (it can be copied and pasted from the file <Path>sample_files → niupepa → formats → search_tweak_gs3.txt</Path>):</Text> 3250 </MajorVersion> 3251 <Format> 3252 <MajorVersion number="2"> 3155 3253 <td valign="top">[link][icon][/link]</td><br/> 3156 3254 <td valign="top"><br/> … … 3159 3257 <br/><i>({Or}{[format:parent:ex.Date],[format:ex.Date],undated})</i></td><br/> 3160 3258 </td> 3259 </MajorVersion> 3260 <MajorVersion number="3"> 3261 <td><br /> 3262 <Tab n="1"/><gsf:switch><br /> 3263 <Tab n="2"/><gsf:metadata name="Title" select="parent"/><br /> 3264 <Tab n="2"/><gsf:when test="exists"><br /> 3265 <Tab n="3"/><gsf:metadata name="Title" select="parent"/> Volume:<gsf:metadata name="Volume" select="parent"/> Number:<gsf:metadata name="Number" select="parent"/> - Page:<gsf:metadata name="Title"/><br /> 3266 <Tab n="2"/></gsf:when><br /> 3267 <Tab n="2"/><gsf:otherwise><br /> 3268 <Tab n="3"/><gsf:metadata name="Title"/> Volume:<gsf:metadata name="Volume"/> Number:<gsf:metadata name="Number"/><br /> 3269 <Tab n="2"/></gsf:otherwise><br /> 3270 <Tab n="1"/></gsf:switch><br /> 3271 <Tab n="1"/><br/><br /> 3272 <Tab n="1"/><i><br /> 3273 <Tab n="2"/><gsf:choose-metadata><br /> 3274 <Tab n="3"/><gsf:metadata name="Date" select="parent" format="formatDate" /><br /> 3275 <Tab n="3"/><gsf:metadata name="Date" format="formatDate" /><br /> 3276 <Tab n="3"/><gsf:default>undated</gsf:default><br /> 3277 <Tab n="2"/></gsf:choose-metadata><br /> 3278 <Tab n="1"/></i><br /> 3279 </td> 3280 </MajorVersion> 3161 3281 </Format> 3162 3282 <Text id="0690l"><b>Preview</b> the search results. Items display newspaper title, Volume, Number and Date, and pages also display the page number.</Text> … … 3248 3368 1:images/12_3_6_1.gif:text/12_3_6_1.txt 3249 3369 </Format> 3250 <Text id="sc16">Note that if there is no text file, you can leave that space blank. You need to add a line for each page in the document. Make sure you increment the page number for each line.</Text>3251 </NumberedItem> 3252 <NumberedItem> 3253 <Text id="sc17">Save the file using <b>Filename</b> <AutoText text="12_3_6.item" type="italics"/>, and save as a plain text document. (If you are using Windows, make sure the file isn'tsaved as <AutoText text="12_3_6.item.txt" type="italics"/>.) Back in the <AutoText key="glidict::GUI.Gather"/> panel of the Librarian Interface, locate the new file in the <b>Workspace</b> tree, and drag it into the collection, adding it to the <AutoText text="12"/> folder.</Text>3370 <Text id="sc16">Note that if there is no text file, you can leave that space blank. You need to add a line for each page in the document. Make sure you increment the page number as well as the image number for each line.</Text> 3371 </NumberedItem> 3372 <NumberedItem> 3373 <Text id="sc17">Save the file using <b>Filename</b> <AutoText text="12_3_6.item" type="italics"/>, and save as a plain text document. (If you are using Windows, make sure the file doesn't accidentally end up getting saved as <AutoText text="12_3_6.item.txt" type="italics"/>.) Back in the <AutoText key="glidict::GUI.Gather"/> panel of the Librarian Interface, locate the new file in the <b>Workspace</b> tree, and drag it into the collection, adding it to the <AutoText text="12"/> folder.</Text> 3254 3374 </NumberedItem> 3255 3375 <NumberedItem> … … 3268 3388 </NumberedItem> 3269 3389 <NumberedItem> 3270 <Text id="sc24"><b>Build</b> and <b>preview</b> the collection. The xml style items have been included, but the document display for these items is not very nice.</Text> 3271 </NumberedItem> 3390 <Text id="sc24"><b>Build</b> and <b>preview</b> the collection. The xml style items have been included<MajorVersion number="2">, but the document display for these items is not very nice</MajorVersion>.</Text> 3391 </NumberedItem> 3392 <MajorVersion number="2"> 3272 3393 <Heading> 3273 3394 <Text id="sc24a">Using <AutoText text="process_exp"/> to control document processing</Text> … … 3329 3450 <Text id="sc35"><b>Preview</b> the collection. View some of the documents—once you have reached a newspaper page, you should get fullsize, preview and text options.</Text> 3330 3451 </NumberedItem> 3452 </MajorVersion> 3331 3453 </Content> 3332 3454 </Tutorial>
Note:
See TracChangeset
for help on using the changeset viewer.