creator greenstone@cs.waikato.ac.nz maintainer greenstone@cs.waikato.ac.nz public true indexes section:text defaultindex section:text plugin GAPlug # We want the two types of paged documents to be treated differently: paged # and hierarchical. So include two PagedImgPlug plugins and modify the process_exp. plugin PagedImgPlug -screenview -minimumsize 100 -documenttype hierarchy -process_exp xml.*\.item$ plugin PagedImgPlug -screenview -minimumsize 100 -documenttype paged plugin ArcPlug plugin RecPlug -use_metadata_files classify AZCompactList -metadata Series -sort Date classify DateList # Format statements to display Series, Volume, Number and Date information format DocumentVList "[link][icon][/link] {If}{[Series],[Series] {If}{[Volume],Vol. [Volume]} {If}{[Number],No. [Number]},[highlight]{Or}{[Title],[PageNum]}[/highlight]}" format CL1VList "[link][icon][/link] {If}{[numleafdocs],[Title],{If}{[Volume],Vol. [Volume]} {If}{[Number],No. [Number]} ([Date])}" format SearchVList "[link][icon][/link] [parent(Top):Series] {If}{[parent(Top):Volume],Vol. [parent(Top):Volume]} {If}{[parent(Top):Number],No. [parent(Top):Number]} Page [Title]" format DateList "[link][icon][/link] [Series] {If}{[Volume],Vol. [Volume]} {If}{[Number],No. [Number]}" format HList "[link][highlight][ex.Title][/highlight][/link]" # We customise the document display, so use the extended options format AllowExtendedOptions true # We want to add in fullsize/preview/text buttons to switch between the different versions of each page format DocumentHeading "
{Or}{[parent(Top):Series],[Series]}
[DocumentButtonDetach][DocumentButtonHighlight] {If}{_cgiargp_ eq 'fullsize',{If}{[screenicon],_document:viewpreview_} {If}{[Text] ne \'This document has no text. \',_document:viewtext_}, {If}{_cgiargp_ eq 'preview',{If}{[srcicon],_document:viewfullsize_} {If}{[Text] ne \'This document has no text. \',_document:viewtext_}, {If}{[srcicon],_document:viewfullsize_} {If}{[screenicon],_document:viewpreview_}}}
[DocTOC]
" # Document text display changes based on the p argument - this is not used #normally for document display, so we can use it here to switch between #fullsize/preview/text versions. format DocumentText "
{If}{_cgiargp_ eq 'fullsize',[srcicon], {If}{_cgiargp_ eq 'preview',[screenicon],{If}{[Text] ne \'This document has no text. \',[Text]}}}
" collectionmeta iconcollection [l=en] "_httpprefix_/collect/pagedimg-e/images/en/pagedimg-e.gif" # -- English strings -------------------- collectionmeta collectionname [l=en] "Paged Image example" collectionmeta .section:text [l=en] "newspaper pages" # -- English text ----------------------- collectionmeta collectionextra [l=en] "This collection contains a few newspapers from the Niupepa collection of Maori newspapers.

How the collection works

Each newspaper issue consists of a set of images, one per page, and a set of text files for the OCR'd text. An item file links the set of pages into a single newspaper document. PagedImgPlug is used to process the item files.

There are two styles of item files, and this collection demonstrates both. The first uses a text based format, and consists of a list of metadata for the document, and a list of pages. Here are some examples: Te Waka o Te Iwi, Vol. 1, No. 1, Te Whetu o Te Tau, Vol. 1, No. 3. This format allows specification of document level metadata, and a single list of pages.

The second style is an extended format, and uses XML. It allows a hierarchy of pages, and metadata specification at the page level as well as at the document level. An example is Matariki 1881, No. 2. This newspaper also has an abstract associated with it. The contents have been grouped into two sections: Supplementary Material, which contains the Abstract, and Newspaper Pages, which contains the page images.

Paged documents can be presented with a hierarchical table of contents (e.g. this one), or with next and previous page arrows, and a goto page box (e.g. this one). This is specified by the -documenttype (hierarchy|paged) option to PagedImgPlug. The next and previous arrows suit the linear sequence documents, while the table of contents suits the hierarchically organised document. Ordinarily, a Greenstone collection would have one plugin per document type, and all documents of that type get the same processing. In this case, we want to treat the XML-based item files differently from the text-based item files. We can achieve this by adding two PagedImgPlug plugins to the collection, and configuring them differently.

plugin PagedImgPlug -screenview -minimumsize 100 -documenttype hierarchy -process_exp xml.*\.item$
plugin PagedImgPlug -screenview -minimumsize 100 -documenttype paged

XML based newpapers have been grouped into a folder called xml. This enables us to process these files differently, by utilising the process_exp option which all plugins support. The first PagedImgPlug in the list looks for item files underneath the xml folder. These documents will be processed as hierarchical documents. Item files that don't match the process expression (i.e. aren't underneath the xml folder) will be passed onto the second PagedImgPlug, and these are treated as paged documents.

Note that GLI will not let you add two of the same plugin (apart from UnknownPlug), so this must be added to the collect.cfg file manually. The collection must not be open in GLI while you are doing this.

Formatting

We have modified the document formatting to display fullsized images, preview images or text, with buttons to switch between them. This involves modifications to the DocumentHeading and DocumentText format statements in the collection configuration file, and some macro definitions in the extra.dm macro file. The extra.dm macro file provides definitions for the buttons (\_viewfullsize\_, \_viewpreview\_, \_viewtext\_) which are used by the format statement in the collect.cfg file. The format statement switches the document display and sets the buttons to be displayed based on the p argument, which is also set by the format statement. "