Changeset 28629
- Timestamp:
- 2013-11-15T12:04:26+13:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/trunk/tutorials/xml-source/tutorial_en.xml
r28619 r28629 3261 3261 <Text id="0575a">Note how we assigned <AutoText key="metadata::dc.Format"/> metadata to all documents in the collection with a minimum of labour. We did this by capitalizing on the folder structure of the original information. Even though we complained earlier about how messy this folder structure is, you can still take advantage of it when assigning metadata.</Text> 3262 3262 </Comment> 3263 <MajorVersion number="2"> 3263 3264 <Heading> 3264 3265 <Text id="0579">Suppressing dummy text</Text> … … 3271 3272 </Bullet> 3272 3273 <Bullet> 3273 <Text id="0582">Ensure that < MajorVersion number="2"><AutoText text="VList"/></MajorVersion><MajorVersion number="3">the <AutoText text="browse"/> format feature</MajorVersion> is selected, and make the changes that are highlighted below<MajorVersion number="3"> to its <AutoText text="documentNode"/> template</MajorVersion>.<MajorVersion number="2"> You need to insert five lines into the first line, and delete the second line. (Note, the changes are available in a text file, see below.)</MajorVersion></Text>3274 <Text id="0582">Ensure that <AutoText text="VList"/> is selected, and make the changes that are highlighted below. You need to insert five lines into the first line, and delete the second line. (Note, the changes are available in a text file, see below.)</Text> 3274 3275 <Text id="0582a">Change:</Text> 3275 3276 <Format> 3276 <MajorVersion number="2">3277 3277 <td valign=top><highlight>[link][icon][/link]</highlight></td><br/> 3278 3278 <highlight><td valign=top>[ex.srclink]{Or}{[ex.thumbicon],[ex.srcicon]}[ex./srclink]</td> </highlight><br/> … … 3280 3280 {Or}{[dc.Title],[exp.Title],[ex.Title],Untitled} <br/> 3281 3281 [/highlight]{If}{[ex.Source],<br><i>([ex.Source])</i>}</td> 3282 </Format> 3283 <Text id="0583">to this:</Text> 3284 <Format> 3285 <td valign=top><br/> 3286 <highlight>{If}{[dc.Format] eq 'Audio', </highlight><br/> 3287 <highlight>[srclink][srcicon][/srclink], </highlight><br/> 3288 <highlight>{If}{[dc.Format] eq 'Images',</highlight><br/> 3289 <highlight>[srclink][thumbicon][/srclink],</highlight><br/> 3290 <highlight>{If}{[dc.Format] eq 'Supplementary',</highlight><br/> 3291 <highlight>[srclink][srcicon][/srclink] [link][icon][/link],</highlight> 3292 <highlight>[link][icon][/link]}}}</highlight></td> <br/> 3293 <td valign=top>[highlight]<br/> 3294 {Or}{[dc.Title],[exp.Title],[ex.Title],Untitled}<br/> 3295 [/highlight]{If}{[ex.Source],<br><i>([ex.Source])</i>}</td> 3296 </Format> 3297 </Bullet> 3298 </BulletList> 3299 <Text id="0585">To make this easier for you we have prepared a plain text file that contains the new text. In WordPad open the following file:</Text> 3300 <Path>sample_files → beatles → format_tweaks → audio_tweak.txt</Path> 3301 <Text id="0586">(Be sure to use WordPad rather than Notepad, because Notepad does not display the line breaks correctly.) Place it in the copy buffer by highlighting the text in WordPad and selecting <Menu>Edit → Copy</Menu>. Now move back to the Librarian Interface, highlight all the text that makes up the current <AutoText text="VList"/> format statement, and use <Menu><AutoText key="glidict::Menu.Edit"/> → <AutoText key="glidict::Menu.Edit_Paste"/></Menu> to transform the old statement to the new one.</Text> 3302 <Text id="0589"><b>Preview</b> the result. You may need to click the browser's <<b>Reload</b>> button to force it to re-load the page.</Text> 3303 </NumberedItem> 3282 3304 </MajorVersion> 3283 3305 <MajorVersion number="3"> 3306 <Heading> 3307 <Text id="0579">Using switch statements</Text> 3308 </Heading> 3309 <NumberedItem> 3310 <Text id="0580">Alongside the Audio files there is an MP3 icon, which plays the audio when you click it. There is also a document icon, which doesn't make much sense with either audio or image files. We can modify the format statement to display different icons depending on the value of the <b>dc.Format</b> metadata field.</Text> 3311 <BulletList> 3312 <Bullet> 3313 <Text id="0581">Change to the <AutoText key="glidict::GUI.Format"/> panel and select the <AutoText key="glidict::CDM.GUI.Formats"/> section.</Text> 3314 </Bullet> 3315 <Bullet> 3316 <Text id="0582">Ensure that the <AutoText text="browse"/> format feature is selected, and make the changes that are highlighted below to its <AutoText text="documentNode"/> template. </Text> 3317 <Text id="0582a">Change:</Text> 3318 <Format> 3284 3319 <td valign="top"><br /> 3285 3320 <Tab n="1"/><highlight><gsf:link type="document"><br /> … … 3295 3330 <Tab n="1"/></gsf:link></highlight><br /> 3296 3331 </td> 3297 </MajorVersion>3298 3332 </Format> 3299 3333 <Text id="0583">to this:</Text> 3300 3334 <Format> 3301 <MajorVersion number="2">3302 <td valign=top><br/>3303 <highlight>{If}{[dc.Format] eq 'Audio', </highlight><br/>3304 <highlight>[srclink][srcicon][/srclink], </highlight><br/>3305 <highlight>{If}{[dc.Format] eq 'Images',</highlight><br/>3306 <highlight>[srclink][thumbicon][/srclink],</highlight><br/>3307 <highlight>{If}{[dc.Format] eq 'Supplementary',</highlight><br/>3308 <highlight>[srclink][srcicon][/srclink] [link][icon][/link],</highlight>3309 <highlight>[link][icon][/link]}}}</highlight></td> <br/>3310 <td valign=top>[highlight]<br/>3311 {Or}{[dc.Title],[exp.Title],[ex.Title],Untitled}<br/>3312 [/highlight]{If}{[ex.Source],<br><i>([ex.Source])</i>}</td>3313 </MajorVersion>3314 <MajorVersion number="3">3315 3335 <td valign="top"><br /> 3316 3336 <Tab n="1"/><highlight><gsf:switch><br /> … … 3331 3351 <Tab n="1"/></gsf:switch></highlight><br /> 3332 3352 </td> 3333 </MajorVersion>3334 3353 </Format> 3335 3354 </Bullet> 3336 3355 </BulletList> 3337 <Text id="0585">To make this easier for you we have prepared a plain text file that contains the new text. In WordPad open the following file :</Text>3338 <Path>sample_files → beatles → format_tweaks → audio_tweak <MajorVersion number="3">_3</MajorVersion>.txt</Path>3339 <Text id="0586"> (Be sure to use WordPad rather than Notepad, because Notepad does not display the line breaks correctly.) Place it in the copy buffer by highlighting the text in WordPad and selecting <Menu>Edit → Copy</Menu>. Now move back to the Librarian Interface, <MajorVersion number="2">highlight all the text that makes up the current <AutoText text="VList"/> format statement</MajorVersion><MajorVersion number="3">highlight the portion of the existing <AutoText text="documentNode"/> template of the <AutoText text="browse"/> format statement that needs to be replaced</MajorVersion>, and use <Menu><AutoText key="glidict::Menu.Edit"/> → <AutoText key="glidict::Menu.Edit_Paste"/></Menu> to transform the old statement to the new one.</Text>3356 <Text id="0585">To make this easier for you we have prepared a plain text file that contains the new text. In WordPad open the following file (Be sure to use WordPad rather than Notepad, because Notepad does not display the line breaks correctly.):</Text> 3357 <Path>sample_files → beatles → format_tweaks → audio_tweak_3.txt</Path> 3358 <Text id="0586">The <Format>gsf:switch</Format> statement allows you to display different things depending on the value (or existence) of a metadata field. This switch statement is based on the value of <b>dc.Format</b>. If dc.Format equals <i>Audio</i>, then the source icon will be displayed, linking to the source document. (For the MP3 files, the MP3 icon will display, and clicking the icon will play the MP3.) If dc.Format equals <i>Images</i>, the image thumbnail will appear, linking to the full-size image. If dc.Format equals <i>Supplementary</i>, both the source and document icons will appear, linking to the source document and the document display page, respectively. Finally, the <Format>gsf:otherwise</Format> statement says what to do in all other cases.</Text> 3340 3359 <Text id="0589"><b>Preview</b> the result. You may need to click the browser's <<b>Reload</b>> button to force it to re-load the page.</Text> 3341 3360 </NumberedItem> 3361 </MajorVersion> 3342 3362 <NumberedItem> 3343 3363 <Text id="0593">While we're at it, let's remove the source filename from where it appears after each document.</Text> … … 3425 3445 <Text id="0606-3">Make the bookshelves show how many documents they contain by modifying the <AutoText text="VList classifierNode"/> template of the <AutoText text="browse"/> format feature in the <AutoText key="glidict::CDM.GUI.Formats"/> section of the <AutoText key="glidict::GUI.Format"/> panel. Insert the highlighted statements:</Text> 3426 3446 <Format> 3427 <Tab n="1"/><gsf:template match="classifierNode[@classifierStyle = 'VList']"><br />3428 <Tab n=" 1"/>...<br />3429 <Tab n=" 1"/><gsf:metadata name="Title"/><br />3430 </td><br />3431 <highlight> <td valign="top"><br />3432 <Tab n=" 1"/>(<gsf:metadata name="numleafdocs"/>)<br />3433 </td></highlight>3434 3447 <gsf:template match="classifierNode[@classifierStyle = 'VList']"><br /> 3448 <Tab n="2"/>...<br /> 3449 <Tab n="2"/><gsf:metadata name="Title"/><br /> 3450 <Tab n="1"/></td><br /> 3451 <highlight><Tab n="1"/><td valign="top"><br /> 3452 <Tab n="2"/>(<gsf:metadata name="numleafdocs"/>)<br /> 3453 <Tab n="1"/></td></highlight><br /> 3454 <gsf:template<br /> 3435 3455 </Format> 3436 3456 <Text id="0606-3a">The complete format statement for the <AutoText text="VList classifierNode"/> template of the <AutoText text="browse"/> format feature can be copied from <Path>sample_files → beatles → format_tweaks → show_num_docs_3.txt</Path>.</Text> … … 3516 3536 </NumberedItem> 3517 3537 <NumberedItem> 3518 <Text id="0645">Using your Windowsfile browser outside Greenstone, locate the folder</Text>3538 <Text id="0645">Using your file browser outside Greenstone, locate the folder</Text> 3519 3539 <Path>sample_files → beatles → advbeat_large</Path> 3520 3540 </NumberedItem> … … 4624 4644 </NumberedItem> 4625 4645 <NumberedItem> 4626 <Text id="0759">In your Windowsfile browser, locate the <Path>archives</Path> folder for the collection you are working with (in <Path>Greenstone<MajorVersion number="3">3 → web → sites → localsite</MajorVersion> → collect → <collname> → archives</Path>). For each document in the collection, Greenstone has generated two files: <Path>docmets.xml</Path>, the core METS description, and <Path>doctxt.xml</Path>, a supporting file. (Note: unless you are connected to the Internet you may be unable to view <Path>doctxt.xml</Path> in your web browser, because it refers to a remote resource.) Depending on the source documents there may be additional files, such as the images used within a web page. One of METS' many features is the ability to reference information in external XML files. Greenstone uses this to tie the content of the document, which is stored in the external XML file <Path>doctxt.xml</Path>, to its hierarchical structure, which is described in the core METS file <Path>docmets.xml</Path>.</Text>4646 <Text id="0759">In your file browser, locate the <Path>archives</Path> folder for the collection you are working with (in <Path>Greenstone<MajorVersion number="3">3 → web → sites → localsite</MajorVersion> → collect → <collname> → archives</Path>). For each document in the collection, Greenstone has generated two files: <Path>docmets.xml</Path>, the core METS description, and <Path>doctxt.xml</Path>, a supporting file. (Note: unless you are connected to the Internet you may be unable to view <Path>doctxt.xml</Path> in your web browser, because it refers to a remote resource.) Depending on the source documents there may be additional files, such as the images used within a web page. One of METS' many features is the ability to reference information in external XML files. Greenstone uses this to tie the content of the document, which is stored in the external XML file <Path>doctxt.xml</Path>, to its hierarchical structure, which is described in the core METS file <Path>docmets.xml</Path>.</Text> 4627 4647 </NumberedItem> 4628 4648 </Content>
Note:
See TracChangeset
for help on using the changeset viewer.