Changeset 34529
- Timestamp:
- 2020-11-06T23:49:48+13:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/trunk/tutorials/xml-source/tutorial_en.xml
r34517 r34529 2012 2012 </MajorVersion> 2013 2013 <MajorVersion number="3"> 2014 <Text id="assoc-files-24b">The above change to the browse format statement, adds the equivalent document icon (a PDF icon in this case) next to the source icon (Word icon) for general classifiers. But the Titles classifier has its own separate format statement, listed as "C1 List" in <AutoText key="glidict::CDM.FormatManager.Feature"/>. So the same change indicated above needs to also be made to "C1 List" format statement. After doing so, preview the collection and browse the collection either by Titles or by Filenames.</Text>2014 <Text id="assoc-files-24b">The above change to the browse format statement, adds the equivalent document icon (a PDF icon in this case) next to the source icon (Word icon) for general classifiers. Preview the collection and browse the collection either by Titles or by Filenames.</Text> 2015 2015 </MajorVersion> 2016 2016 <Text id="assoc-files-24a">Preview the collection.</Text> … … 4010 4010 <Text id="0690a"><MajorVersion number="2">Refresh in the web browser to view</MajorVersion><MajorVersion number="3"><b>Preview</b></MajorVersion> the new <MajorVersion number="2"><AutoText key="coredm::_Global:labelTitle_"/></MajorVersion><MajorVersion number="3"><AutoText key="gs3::metadata_names::Title.buttonname" /></MajorVersion> list.</Text> 4011 4011 <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> 4012 <Text id="0687d">You may notice that the <AutoText text="Titles"/> browser shows the volume numbers in inverse order. To correct this, in the <AutoText key="glidict::GUI.Design"/> Pane, under <AutoText key="glidict::CDM.GUI.Classifiers"/>, configure the <AutoText text="titles" /> <AutoText text="List" /> classifier. Tick <AutoText text="sort_leaf_nodes_using"/> and set the metadata to <Format>ex.Volume</Format>. Rebuilding now will ensure the <i>ex.Volume</i> Number of each newspaper are listed in numeric order. This has the effect of also sorting the <i>ex.Number</i> value for each <i>ex.Volume</i>.</Text> 4012 4013 </NumberedItem> 4013 4014 <Heading> … … 4644 4645 </MajorVersion> 4645 4646 <MajorVersion number="3"> 4646 <Text id="oaiserver-22">Greenstone 3's OAI implementation uses the OAI standard for Dublin Core, <AutoText text="oai_dc" type="italics"/>, metadata format. By default, it maps all Dublin Core metadata you may have assigned to your collections into <AutoText text="oai_dc" type="italics"/>. This default mapping is specified in the configurable file <Path>resources\oai\OAIConfig .xml.in</Path>, from which <Path>web\WEB-INF\classes\OAIConfig-oaiserver.xml</Path> is generated. If all (or most) of your collections will be using a different metadata format, you can edit the <Path>resources\oai\OAIConfig.xml.in</Path> file's <Format>elementList</Format> section to create mappings from the metadata fields you're using to the metadata fields in <AutoText text="oai_dc" type="italics"/>.</Text>4647 <Text id="oaiserver-22a">You can also specify mappings at collection level, overriding the mappings in <Format>OAIConfig .xml.in</Format> on a per-collection basis. So if a collection specifies metadata for a different metadata set format from the default mappings in <Format>OAIConfig.xml.in</Format>, adjust the collection's <Path>web\sites\localsite\collect\<collection-name>\etc\collectionConfig.xml</Path> file to tell Greenstone how to map the metadata fields of your chosen metadata set format into the <AutoText text="oai_dc" type="italics"/> Dublin Core metadata set supported by the Greenstone OAI server.</Text>4647 <Text id="oaiserver-22">Greenstone 3's OAI implementation uses the OAI standard for Dublin Core, <AutoText text="oai_dc" type="italics"/>, metadata format. By default, it maps all Dublin Core metadata you may have assigned to your collections into <AutoText text="oai_dc" type="italics"/>. This default mapping is specified in the configurable file <Path>resources\oai\OAIConfig-oaiserver.xml.in</Path>, from which <Path>web\WEB-INF\classes\OAIConfig-oaiserver.xml</Path> is generated. If all (or most) of your collections will be using a different metadata format, you can edit the <Path>resources\oai\OAIConfig-oaiserver.xml.in</Path> file's <Format>elementList</Format> section to create mappings from the metadata fields you're using to the metadata fields in <AutoText text="oai_dc" type="italics"/>.</Text> 4648 <Text id="oaiserver-22a">You can also specify mappings at collection level, overriding the mappings in <Format>OAIConfig-oaiserver.xml.in</Format> on a per-collection basis. So if a collection specifies metadata for a different metadata set format from the default mappings in <Format>OAIConfig-oaiserver.xml.in</Format>, adjust the collection's <Path>web\sites\localsite\collect\<collection-name>\etc\collectionConfig.xml</Path> file to tell Greenstone how to map the metadata fields of your chosen metadata set format into the <AutoText text="oai_dc" type="italics"/> Dublin Core metadata set supported by the Greenstone OAI server.</Text> 4648 4649 <Text id="oaiserver-23">For instance, look in the <b>demo</b> collection's collectionConfig.xml file (<Path>web\sites\localsite\collect\lucene-jdbm-demo\etc\collectionConfig.xml</Path>) and scroll down to the definition for the <Format>OAIPMH</Format> ServiceRack. Look at its <Format>ListMetadataFormats</Format> section containing element mappings, which will explain and provide an example for how to specify such an oai mapping from the <AutoText text="DLS" type="italics"/> metadata format that the <b>demo</b> collection uses, to the Dublin Core (<AutoText text="oai_dc" type="italics"/>) metadata used by Greenstone's OAI server. Its <AutoText key="metadata::dls.Organization"/> metadata is mapped to <AutoText text="oai_dc.publisher"/> using the following line in the collectionConfig.xml configuration file (note the use of case):</Text> 4649 4650 <Format><element name="dc:publisher"><br /> … … 4698 4699 <MajorVersion number="3"> 4699 4700 <NumberedItem> 4700 <Text id="gs-oai-3-3">For this exercise, we will be visiting the <b>Open Archives Validator</b>, for which your OAIserver needs to provide a valid email address. In a text editor, open up your Greenstone installation's <Path>resources\oai\OAIConfig .xml.in</Path> file. Set the value of the <Format>adminEmail</Format> element to the email address where the validation results are to be sent. Also set the OAI <Format>repositoryIdentifier</Format> element. The structure of its value is like a domain name and needs to be of the form of <Format>word-dot-extension</Format>, such as "greenstone.org". For more information on the structure of its value, see <Link>http://www.openarchives.org/OAI/2.0/guidelines-oai-identifier.htm</Link>. (If you wanted to additionally test the behaviour of the ResumptionToken feature against the OAI Validator, you would set the <Format>resumeAfter</Format> element to a low value like 5).</Text>4701 </NumberedItem> 4702 <NumberedItem> 4703 <Text id="gs-oai-3-4">The modifications to OAIConfig .xml.in need to be brought into effect, so quit and relaunch the Greenstone 3 server application if it is already running. Otherwise, go to <Menu>Start → Greenstone → Greenstone3 Server</Menu> to start it up. When the library home page opens in your browser, change the library suffix in the URL to <Format>oaiserver</Format>, which is the baseURL of your OAI Server and would be of the form <Format>http://domain/greenstone3/oaiserver</Format>. Copy this URL and visit <Link>http://www.openarchives.org/Register/ValidateSite</Link>.</Text>4701 <Text id="gs-oai-3-3">For this exercise, we will be visiting the <b>Open Archives Validator</b>, for which your OAIserver needs to provide a valid email address. In a text editor, open up your Greenstone installation's <Path>resources\oai\OAIConfig-oaiserver.xml.in</Path> file. Set the value of the <Format>adminEmail</Format> element to the email address where the validation results are to be sent. Also set the OAI <Format>repositoryIdentifier</Format> element. The structure of its value is like a domain name and needs to be of the form of <Format>word-dot-extension</Format>, such as "greenstone.org". For more information on the structure of its value, see <Link>http://www.openarchives.org/OAI/2.0/guidelines-oai-identifier.htm</Link>. (If you wanted to additionally test the behaviour of the ResumptionToken feature against the OAI Validator, you would set the <Format>resumeAfter</Format> element to a low value like 5).</Text> 4702 </NumberedItem> 4703 <NumberedItem> 4704 <Text id="gs-oai-3-4">The modifications to OAIConfig-oaiserver.xml.in need to be brought into effect, so quit and relaunch the Greenstone 3 server application if it is already running. Otherwise, go to <Menu>Start → Greenstone → Greenstone3 Server</Menu> to start it up. When the library home page opens in your browser, change the library suffix in the URL to <Format>oaiserver</Format>, which is the baseURL of your OAI Server and would be of the form <Format>http://domain/greenstone3/oaiserver</Format>. Copy this URL and visit <Link>http://www.openarchives.org/Register/ValidateSite</Link>.</Text> 4704 4705 </NumberedItem> 4705 4706 </MajorVersion> … … 4859 4860 </NumberedItem> 4860 4861 <NumberedItem><Text id="ucp-11">Visit the <Link url="http://www.djvu.org/resources/djvu_digital_vs_super_hero_pdf.php">'DjVu-Digital vs. "Super Hero" PDF' page</Link>. The page compares a PDF sample document to its equivalent DjVu version and provides download links for both.</Text> 4861 <Text id="ucp-11a">Download their <Link url="http://www.djvu.org/docs/superhero.djvu?djvuopts&zoom=page">sample DjVu document</Link> into your <i>DjVu Collection</i>'s import folder.</Text>4862 <Text id="ucp-11a">Download their <Link url="http://www.djvu.org/docs/superhero.djvu?djvuopts&zoom=page">sample DjVu document</Link> into your <i>DjVu Collection</i>'s <b>import</b> folder at <MajorVersion number="2"><Path>Greenstone → collect → djvucoll → import</Path> </MajorVersion><MajorVersion number="3"><Path>Greenstone → web → sites → localsite → collect → djvucoll → import</Path></MajorVersion>.</Text> 4862 4863 </NumberedItem> 4863 4864 <NumberedItem><Text id="ucp-12">Back in GLI, in the <b>Collection</b> view of the <AutoText key="glidict::GUI.Gather"/> pane, right click and select <AutoText key="glidict::CollectionPopupMenu.Refresh"/>. You should now see your new document "superhero.djvu" ready to be built.</Text> … … 4896 4897 </NumberedItem> 4897 4898 <Heading><Text id="ucp-24">Processing DjVu documents with the UnknownConverterPlugin</Text></Heading> 4898 <NumberedItem><Text id="ucp-25">Now that you know how to run the <i>djvutxt</i> conversion tool from the commandline, open up the DjVu Collection in GLI. Go into the <AutoText key="glidict::GUI.Design"/> pane's <AutoText key="glidict::CDM.GUI.Plugins"/> section and add a new <AutoText text="UnknownConverterPlugin"/> instance. (There's already one in the Document Plugin pipeline, but it is not set up for processing djvu files.) Click the<AutoText key="glidict::CDM.PlugInManager.Configure" type="button"/> and set up the plugin as follows:</Text>4899 <NumberedItem><Text id="ucp-25">Now that you know how to run the <i>djvutxt</i> conversion tool from the commandline, open up the DjVu Collection in GLI. Go into the <AutoText key="glidict::GUI.Design"/> pane's <AutoText key="glidict::CDM.GUI.Plugins"/> section and add a new <AutoText text="UnknownConverterPlugin"/> instance. (There's already one in the Document Plugin pipeline, but it is not set up for processing djvu files.) Press <AutoText key="glidict::CDM.PlugInManager.Configure" type="button"/> and set up the plugin as follows:</Text> 4899 4900 <BulletList> 4900 4901 <Bullet><Text id="ucp-26">set its <Format>convert_to</Format> field to <Format>text</Format></Text></Bullet> … … 5554 5555 <Text id="ic-08a">Use the terminal to first run the incremental import stage:</Text> 5555 5556 <Format>perl -S incremental-import.pl -incremental -manifest manifests/add-new-files.xml <MajorVersion number="3">-site localsite</MajorVersion> incremen</Format> 5556 <Text id="ic-08d">The build log output will end with the messages "3 documents were considered for processing" and "3 documents were processed and included in the collection." So this means just the 3 newly added documents were imported, just as specified by our manifest file add-new-files.xml.</Text> 5557 <Text id="ic-08d">The build log output will end with the messages</Text> 5558 <Format>* 3 documents were considered for processing<br /> 5559 * 3 documents were processed and included in the collection" 5560 </Format> 5561 <Text id="ic-08e">This means just the 3 newly added documents were imported, just as specified by our manifest file add-new-files.xml.</Text> 5557 5562 <Text id="ic-08b">Once that <Format>incremental-import</Format> command has finished running, start off the incremental buildcol stage of the build process:</Text> 5558 5563 <Format>perl -S incremental-buildcol.pl -activate <MajorVersion number="3">-site localsite</MajorVersion> incremen</Format> … … 5902 5907 </NumberedItem> 5903 5908 <NumberedItem> 5904 <Text id="hp-05">Restart the server by clicking the <b>Restart Library</b> button in the small Greenstone Server window. (Any time you make changes to an <i>interfaceConfig.xml</i> file, you must restart the server for the changes to take effect.) When the server restarts, look at your home page again. Because <i>home-tutorial.xsl</i> does not yet exist, you should just see unformatted text. </Text> 5909 <Text id="hp-05">Restart the server by clicking the <b>Restart Library</b> button in the small Greenstone Server window. (Any time you make changes to an <i>interfaceConfig.xml</i> file, you must restart the server for the changes to take effect.) When the server restarts, look at your home page again. Because <i>home-tutorial.xsl</i> does not yet exist, you should see:</Text> 5910 <Format>Couldn't find and/or load the stylesheet "pages/home-tutorial.xsl" for a=p, sa=home, in collection.</Format> 5905 5911 </NumberedItem> 5906 5912 <NumberedItem> … … 6157 6163 6158 6164 6159 <Text id="hp-05">This <i>library servlet</i> defines the default Greenstone3 library (called <b>library</b>). As you can see, the <b>library_name</b> is <i>library</i>, the <b>site_name</b> is <i>localsite</i>, and the <b>interface_name</b> is <i>default</i>. If you look at the next servlet section, you will see that it has a library_name of <i>halftone-library</i>, uses <i>localsite</i> and the interface <i>halftone</i>. If you continue to scroll down, you will see several other library servlets defin ed. There are also other kinds of servlets, for example, you will see a servlet called <i>oaiserver</i>, which provides the functionality for the OAI server (located at <i>http://localhost:8383/greenstone3/oaiserver</i>).</Text>6165 <Text id="hp-05">This <i>library servlet</i> defines the default Greenstone3 library (called <b>library</b>). As you can see, the <b>library_name</b> is <i>library</i>, the <b>site_name</b> is <i>localsite</i>, and the <b>interface_name</b> is <i>default</i>. If you look at the next servlet section, you will see that it has a library_name of <i>halftone-library</i>, uses <i>localsite</i> and the interface <i>halftone</i>. If you continue to scroll down, you will see several other library servlets definitions, albeit inactive as they're commented out. There are also other kinds of de-activeated servlets, such as <i>gateway</i>. These are beyond the scope of this tutorial.</Text> 6160 6166 </NumberedItem> 6161 6167 <NumberedItem> … … 6542 6548 <Tab n="2"/><xsl:variable name="collectionFolder" select="@name"/><br /> 6543 6549 <Tab n="2"/><xsl:variable name="collectionName" select="displayItemList/displayItem[@name='name']"/><br /> 6544 <Tab n="2"/><xsl:variable name="aboutImage" select="displayItemList/displayItem[@name='icon']"/><br /> 6550 <Tab n="2"/><xsl:variable name="homeImage" select="displayItemList/displayItem[@name='icon']"/><br /> 6551 <Tab n="2"/><xsl:variable name="aboutImage" select="displayItemList/displayItem[@name='smallicon']"/><br /> 6545 6552 <Tab n="2"/><xsl:variable name="collDesc" select="displayItemList/displayItem[@name='description']"/><br /> 6546 6553 <Tab n="2"/><xsl:variable name="numDocs" select="metadataList/metadata[@name='numDocs']"/><br /><br /> … … 6553 6560 <Tab n="2"/><xsl:choose><br /> 6554 6561 <Tab n="3"/><xsl:when test="$collDesc"><br /> 6555 <Tab n="4"/><p class="justify"><xsl: value-of select="$collDesc" disable-output-escaping="yes"/></p><br />6562 <Tab n="4"/><p class="justify"><xsl:apply-templates select="displayItemList/displayItem[@name='description']"/></p><br /> 6556 6563 <Tab n="3"/></xsl:when><br /> 6557 6564 <Tab n="3"/><xsl:otherwise><br /> … … 6631 6638 <Tab n="3"/></head><br/> 6632 6639 <Tab n="3"/><body><br/> 6633 <Tab n="4"/><xsl:apply-templates select="/page"/><br/> 6640 <Tab n="4"/><div class="container" id="gs_content"> 6641 <Tab n="5"/><xsl:apply-templates select="/page"/><br/> 6642 <Tab n="4"/></div> 6634 6643 <Tab n="4"/><xsl:call-template name="gs_footer"/><br/> 6635 6644 <Tab n="3"/></body><br/> … … 6639 6648 <Text id="ni3-03">Every page in our library uses this template. As you can see, it contains the basic structure of our HTML page. Inside the HTML header, the <b>create-html-header</b> template is called (<Format><xsl:call-template name="create-html-header"/></Format>). This is the template in <b>header.xsl</b> we edited in the previous tutorial. Inside the body of the HTML, we use two templates: <b>/page</b> and <b>gs_footer</b>. (The <b>/page</b> template is "applied" instead of called. The reason for this is complex and not relevant to this tutorial.)</Text> 6640 6649 <Text id="ni3-04"> The <b>/page</b> template is where the content of each individual page is. For the home page, it is the content we just added to <b>home.xsl</b>. Since the <b>perrin</b> interface does not have XSL files for any of the other page types, the content of all of the other pages depends on the default interface: on the collection's about page, it's the collection description; on search pages, it is the query boxes and search results; on document pages it is the document content, etc. </Text> 6641 <Text id="ni3-0 4">The <b>gs_footer</b> template is where we will put our page's footer.</Text>6650 <Text id="ni3-05">The <b>gs_footer</b> template is where we will put our page's footer.</Text> 6642 6651 </NumberedItem> 6643 6652 <NumberedItem> … … 6659 6668 </NumberedItem> 6660 6669 <NumberedItem> 6661 <Text id="ni3-08">You'll notice that the image slider and the highlighted items are right up against the edge of the page. In <b>main.xsl</b>, replace <Format><xsl:apply-templates select="/page"/></Format> with:</Text> 6670 <Text id="ni3-08">You'll notice that the image slider and the highlighted items are right up against the edge of the page. In <b>main.xsl</b>, replace 6671 <Format> 6672 <Tab n="2"/><div class="container" id="gs_content"><br /> 6673 <Tab n="3"/><xsl:apply-templates select="/page"/><br /> 6674 <Tab n="2"/></div><br /> 6675 </Format> 6676 with:</Text> 6662 6677 <Format> 6663 6678 <Tab n="2"/><div class="wrapper"><br/> … … 7006 7021 </NumberedItem> 7007 7022 <NumberedItem> 7008 <Text id="ni3-2 7">Save and close <b>main.xsl</b> and refresh the web browser to see the top bar. Click the <b>Login</b> button and log in as <b>admin</b> (if you hadn't already changed the password, use the default password of "admin") to see all of the links appear along the top, including links to the <b>Add User</b> page, to the <b>Administration</b> page, and to Logout.</Text>7023 <Text id="ni3-28">Save and close <b>main.xsl</b> and refresh the web browser to see the top bar. Click the <b>Login</b> button and log in as <b>admin</b> (if you hadn't already changed the password, use the default password of "admin") to see all of the links appear along the top, including links to the <b>Add User</b> page, to the <b>Administration</b> page, and to Logout.</Text> 7009 7024 </NumberedItem> 7010 7025 <Heading>
Note:
See TracChangeset
for help on using the changeset viewer.