Changeset 36364
- Timestamp:
- 2022-08-09T13:34:47+12:00 (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/trunk/tutorials/xml-source/tutorial_en.xml
r35532 r36364 5500 5500 <Text id="ic-03">Do not build the collection in GLI. We'll be building and rebuilding manually, from the command-line terminal. So close GLI once the files and folders have finished copying into your collection. You can choose to run the Greenstone server at any stage, however.</Text> 5501 5501 </NumberedItem> 5502 <!-- 5502 5503 <NumberedItem> 5503 5504 <Text id="ic-04">In a text editor, open your <Format>incremen</Format> collection's <Format><MajorVersion number="2">collect.cfg</MajorVersion><MajorVersion number="3">collectionConfig.xml</MajorVersion></Format> file located in <Format><MajorVersion number="3">web\sites\localsite\</MajorVersion>collect\incremen\etc</Format>.</Text> … … 5514 5515 </MajorVersion> 5515 5516 </NumberedItem> 5517 --> 5516 5518 <NumberedItem> 5517 5519 <Text id="ic-05">Since this is the first time we're building our collection, we're going to do a complete build. And we'll use the command line to do so. Open a terminal. To open a terminal in Windows, press Ctrl+r and type <Format>cmd</Format> in the <b>Run</b> dialog that displays. To open a terminal on a Mac machine, click on menu <Path>Go → Utilities → Terminal</Path>. Use the terminal to <Format>cd</Format> into your Greenstone installation folder. For instance, if you have your Greenstone installed on Windows as "<i>Greenstone</i>" within your account folder at <Format>C:\Users\me</Format>, then type the following in your terminal and hit Enter:</Text> … … 5593 5595 <Manifest><br /> 5594 5596 <Tab n="1"/><Delete><br /> 5595 < Tab n="2"/><OID>b18ase-b18ase_htm</OID><br />5597 <!--<Tab n="2"/><OID>b18ase-b18ase_htm</OID><br /> 5596 5598 <Tab n="2"/><OID>fb33fe-fb33fe_htm</OID><br /> 5599 --> 5600 <Tab n="2"/><OID>b18ase</OID><br /> 5601 <Tab n="2"/><OID>fb33fe</OID><br /> 5597 5602 <Tab n="1"/></Delete><br /> 5598 5603 </Manifest> … … 5600 5605 <Text id="ic-10b">As per the above manifest file, the operation to be performed by an incremental build is a <Delete> operation on two documents. For the delete operation, the documents are not indicated by the <Filename> XML element, but by the <OID> element which specifies the object identifier. We need to use the OID here because we're telling Greenstone precisely what the identifiers of the documents are that we wish to have removed from our collection. The identifiers of every built document in a Greenstone collection are specified in the Identifier field of the document's <i>doc.xml</i> file located in the collection's <Format>archives</Format> folder. The <i>doc.xml</i> file is the Greenstone-specific XML format in which Greenstone stores documents already imported.</Text> 5601 5606 <Text id="ic-10c">For instance, to find the identifier of the <i>b18ase.htm</i> document in your built collection, open up <Format><MajorVersion number="3">web\sites\localsite\</MajorVersion>collect\incremen\archives\b18ase-b.dir\doc.xml</Format> in a text editor. Then scroll down, looking for a piece of Greenstone extracted metadata labelled <i>Identifier</i>, which is the OID for this document:</Text> 5602 <Format><Metadata name="Identifier">b18ase-b18ase_htm</Metadata></Format> 5607 <!--<Format><Metadata name="Identifier">b18ase-b18ase_htm</Metadata></Format>--> 5608 <Format><Metadata name="Identifier">b18ase</Metadata></Format> 5603 5609 <Text id="ic-10d">The above value for the document identifier is what's used in the <i>delete-some-files.xml</i> manifest file to refer to this document. This document is one of two that are to be deleted as per the manifest file. Make sure to close the <i>doc.xml</i> file if you have it open.</Text> 5604 5610 </NumberedItem> 5611 <!-- 5605 5612 <NumberedItem> 5606 5613 <Text id="ic-11">So then, let's first physically remove these two documents from our collection, so that the contents of the <Format>import</Format> folder match what the manifest specifies: use a file browser to remove the folders <i>b18ase</i> and <i>fb33fe</i> from the collection's <Format>import</Format> folder.</Text> 5607 5614 </NumberedItem> 5615 --> 5608 5616 <NumberedItem> 5609 5617 <Text id="ic-12">Finally, let's incrementally rebuild the collection, specifying the manifest file that Greenstone should use this time to carry out the incremental build operation. As before, there are two steps.</Text> … … 5668 5676 </Comment> 5669 5677 <NumberedItem> 5670 <Text id="ic-21">Now repeat all the above exercises in the same sequence once again, but with a new collection called <i>autoincr</i> also based on the <i>Demo</i> collection. Remember to once again set <Format><importOption name="OIDtype" value="full_filename"/></Format> in the collectionConfig.xml file andto make <Format>document</Format> level for searching the <Format>default</Format>. And build the collection the first time around with <Format>perl -S full-rebuild.pl -site localsite autoincr</Format>, also largely as before. However, this time <i>don't</i> pass in any manifest file as an argument to the subsequent rebuild commands which use the <Format>incremental-import.pl</Format> script. So you'd be running these commands after each change:</Text>5678 <Text id="ic-21">Now repeat all the above exercises in the same sequence once again, but with a new collection called <i>autoincr</i> also based on the <i>Demo</i> collection. Remember <!--to once again set <Format><importOption name="OIDtype" value="full_filename"/></Format> in the collectionConfig.xml file and--> to make <Format>document</Format> level for searching the <Format>default</Format>. And build the collection the first time around with <Format>perl -S full-rebuild.pl -site localsite autoincr</Format>, also largely as before. However, this time <i>don't</i> pass in any manifest file as an argument to the subsequent rebuild commands which use the <Format>incremental-import.pl</Format> script. So you'd be running these commands after each change:</Text> 5671 5679 <Format> 5672 5680 perl -S incremental-import.pl -incremental -site localsite autoincr<br />
Note:
See TracChangeset
for help on using the changeset viewer.