Greenstone tutorial exercise
A simple image collection
In this tutorial, we create a new collection that is based on the configuration of another collection.
- In a file browser, locate the folder sample_files → images → image-e. Copy this entire folder into your Greenstone → web → sites → localsite → collect folder.
- In the Librarian Interface, start a new collection (File → New...) called backdrop. Fill out the fields with appropriate information. For Base this collection on:, select the item Simple image collection from the pull-down menu.
When you base a collection on an existing one, it inherits all the settings of the old one, including which metadata sets (if any) the collection uses.
- Copy the images provided in sample_files → images (avoiding the README.TXT file and any folders) into your newly-formed collection.
- Change to the Create panel and build the collection.
Preview the result.
- Click on Browse in the navigation bar to view a list of the photos ordered by filename and presented as a thumbnail accompanied by some basic data about the image. The structure of this collection is the same as Simple image collection, but the content is different.
- Back in the Librarian Interface, change to the Enrich panel and view the extracted metadata for Bear.jpg.
Adding Title and Description metadata
- We work with just the first three files (Bear.jpg, Cat.jpg and Cheetah.jpg) to get a flavour of what is possible. First, we need to add the Dublin Core metadata set which is not used in the Simple image collection collection. Click the <Manage Metadata Sets...> button beneath the Collection file tree. A new window pops up showing the metadata sets used by current collection. Click the <Add...> button to bring up another window showing the available metadata sets. Select the "Dublin Core Metadata Element Set" from the list and click <Add>. Click <Close> to return to the Enrich panel.First, set each file's dc.Title field to be the same as its filename but without the filename extension.Click on Bear.jpg so its metadata fields are available, then click on its dc.Title field on the right-hand side. Type in Bear.Repeat the process for Cat.jpg, Cheetah.jpg and so on.
- Add a description for each image as dc.Description metadata.What description should you enter? To remind yourself of a file's content, the Librarian Interface lets you open files by double-clicking them. It launches the appropriate application based on the filename extension, Word for .doc files, Acrobat for .pdf files and so on.Double-click Bear.jpg: on Windows, the image will normally be displayed by Windows Photo Viewer (although this depends on how your computer has been set up).Back in the Enrich pane, make sure that Bear.jpg is selected in the collection tree on the left hand side. Enter the text Bear in the Rocky Mountains as the value for the dc.Description field.Repeat this process for Cat.jpg and Cheetah.jpg, adding a suitable description for each.
- Go to the Create panel and click <Build Collection>. Once it has finished building, preview the collection. You will not notice anything new. That's because we haven't changed the design of the collection to take advantage of the new metadata.
Change Format Features to display new metadata
- Now we customize the collection's appearance. Go to the Format panel and select Format Features from the left-hand list.Click on the browse Format Feature. Find the section under documentNode where it says
Edit the text as follows:
<gsf:displayText name="ImageName"/>:<gsf:metadata name="Image"/><br/>
<gsf:displayText name="Width"/>:<gsf:metadata name="ImageWidth"/><br/>
<gsf:displayText name="Height"/>:<gsf:metadata name="ImageHeight"/><br/>
<gsf:displayText name="Size"/>:<gsf:metadata name="ImageSize"/>
- Change <gsf:displayText name="ImageName"/>: to Title:
Change <gsf:metadata name="Image"/> to <gsf:metadata name="dc.Title"/>
After <gsf:metadata name="dc.Title"/><br/> add Description: <gsf:metadata name="dc.Description"/><br/>
Metadata names are case-sensitive in Greenstone: it is important that you capitalize "Title" and "Description" (and don't capitalize "dc").
- The first substitution alters the fragment of text that appears to the right of the thumbnail image, the second alters the item of metadata that follows it. The addition displays the description after the Title.
- Preview the collection by clicking the <Preview Collection> button. When you click on Browse in the navigation bar the presentation has changed to "Title: Bear" and so on. Each image's description should appear beside the thumbnail, following the title.
After the first three items, the Title and Description become blank because we have only assigned Dublin Core metadata to these first three. (To get a full listing you would enter all the metadata.)
Changes in the Format panel take place immediately and you can see the result straightaway by clicking the Preview Collection button. If you modify anything in the Gather, Enrich or Design panels, you will need to rebuild the collection.
Changing the size of image thumbnails
- Let's change the size of the thumbnail image and make it smaller. Thumbnail images are created by the ImagePlugin plug-in, so we need to access its configuration settings. To do this, switch to the Design panel and select Document Plugins from the list on the left. Double-click ImagePlugin to pop up a window that shows its settings. (Alternatively, select ImagePlugin with a single click and then click <Configure Plugin...> further down the screen). Currently most options are off, so standard defaults are used. Select thumbnailsize, set it to 50, and click <OK>.
Build and preview the collection.
- Once you have seen the result of the change, return to the Design panel, select the configuration options for ImagePlugin, and switch the thumbnailsize option off so that the thumbnail reverts to its normal size when the collection is re-built.
Adding a browsing classifier based on Description metadata
- Now we'll add a new browsing option based on the descriptions. In the Design panel, select Browsing Classifiers from the left-hand list. Set the menu item for Select classifier to add to List, then click <Add Classifier...>.
- A window pops up to control the classifier's options. Set the metadata option to dc.Description. Next, click the partition_type_within_level check box and choose none from the drop-down list. Click <OK>.
Build the collection, and preview it. Choose the new Description link that appears in the navigation bar.
Only three items are shown, because only items with the relevant metadata (dc.Description in this case) appear in the list. The original browse list includes all photos in the collection because it is based on ex.Image, extracted metadata that reflects an image's filename, which is set for all images in the collection.
Creating a searchable index based on Description metadata
- Now we'll add an index so that the collection can be searched by descriptions. Switch to the Design panel and select Search Indexes from the left-hand list. Click the <New Index> button. Select dc.Description from the list of metadata to include in the index and click <Add Index>. Leave Indexing Levels at its default, "document".
- Switch to the Create panel, build the collection, then preview it. There is now a Search button in the navigation bar. As an example, search for the term "bear" in the dc.Description index (which is the only index at this point).
- To change the text that is displayed for the index (Descriptions), go to the Format panel back in the Librarian Interface. Select Search from the left-hand list. This panel allows you to change the text that is displayed on the search form. Set the Display text for the "dc.Description" index to "image descriptions" (or other suitable text). Press the <Preview Collection> button. In the browser, you should now see your new text appear for the displayed index name in the search form.
Note that if you use text instead of macros in the search metadata display text, you will need to do any translations yourself.