creator greenstone@cs.waikato.ac.nz maintainer greenstone@cs.waikato.ac.nz public true indexes section:text defaultindex section:text plugin GreenstoneXMLPlugin # We want the two types of paged documents to be treated differently: paged # and hierarchical. So include two PagedImagePlugin plugins and modify the # process_exp. plugin PagedImagePlugin -create_screenview true -minimumsize 100 -documenttype hierarchy -process_exp xml.*\.item$ -OIDtype assigned -OIDmetadata ItemOID plugin PagedImagePlugin -create_screenview true -minimumsize 100 -documenttype paged -OIDtype assigned -OIDmetadata ItemOID plugin MetadataXMLPlugin plugin ArchivesInfPlugin plugin DirectoryPlugin 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]} ([format: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}{[NoText] eq \'1\',,_document:viewtext_}, {If}{_cgiargp_ eq 'preview',{If}{[srcicon],_document:viewfullsize_} {If}{[NoText] eq \'1\',,_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}{[NoText] eq \'1\',,[Text]}}}
" # -- English strings -------------------- collectionmeta collectionname [l=en] "Paged Image example" collectionmeta .section:text [l=en] "newspaper pages" # -- Spanish strings -------------------- collectionmeta collectionname [l=es] "Ejemplo de imágenes paginadas" collectionmeta .section:text [l=es] "páginas de diario" # -- 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. PagedImagePlugin 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 PagedImagePlugin. 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 PagedImagePlugin plugins to the collection, and configuring them differently.

plugin PagedImagePlugin -documenttype hierarchy -process_exp xml.*\.item$
plugin PagedImagePlugin -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 PagedImagePlugin 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 PagedImagePlugin, and these are treated as paged documents.

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. " # -- Spanish text ----------------------- collectionmeta collectionextra [l=es] "Esta colección contiene algunos diarios de la colección Niupepa de periódicos Maories.

Cómo funciona la colección

Cada diario consiste en un conjunto de imágenes, una por página, y un conjunto de archivos de texto provenientes del OCR. Un archivo .item relaciona al conjunto de páginas en un único documento de diario. PagedImagePlugin se utiliza para procesar esos archivos .item.

Hay dos estilos para escribir esos archivos item. y esta colección demuestra ambos. El primero usa un formato básico de texto, y consiste en una lista de metadatos para el documento, y una lista de páginas. Aquí hay algunos ejemplos: Te Waka o Te Iwi, Vol. 1, No. 1, Te Whetu o Te Tau, Vol. 1, No. 3. Este formato permite la especificación de metadatos a nivel de documento, y una lista simple de páginas.

El segundo estilo es un formato extendido y usa XML. Permite una jerarquía de páginas, y una especificación de metadatos a nivel de documento como también de páginas. Un ejemplo es Matariki 1881, No. 2. Este diario también tiene un resumen asociado a él. Los contenidos han sido agrupados en 2 secciones: Material Suplementario, la cual contiene el resumen, y Páginas del Diario, que contiene las imágenes de las páginas.

Los documentos paginados pueden presentarse con una tabla de contenidos jerárquica (por ej. esta), o con flechas "Siguiente" y "Anterior" y un recuadro "Ir a la página..." (por ej. esta). Esto es definido por la opción -documenttype (hierarchy|paged) asignada al plugin PagedImagePlugin. Las flechas Siguiente y Anterior permiten seguir el documento de manera lineal, mientras que la tabla de contenidos muestra al documento organizado jerárquicamente. Generalmente, una colección de Greenstone tendría un plugin por cada tipo de documento y todos los documentos de ese mismo tipo tendrían el mismo procesamiento. En este caso, queremos tratar los archivos .item con formato XML de manera diferente a aquellos con formato de texto plano. Esto puede lograrse agregando dos plugin PagedImagePlugin a la colección, y configurándolo de manera diferente.

plugin PagedImagePlugin -documenttype hierarchy -process_exp xml.*\.item$
plugin PagedImagePlugin -documenttype paged

Los diarios basados en XML han sido agrupados en una carpeta llamada xml. Esto nos permite procesar esos archivos de una manera diferente, utilizando la opción process_exp que es soportada por todos los plugins. El primer plugin PagedImagePlugin en la lista busca archivos .item que se encuentren en la carpeta xml. Estos documentos se procesarán como documentos jerárquicos. Los archivos .item que no coincidan con la expresión de procesamiento (por ejemplo, los que no estén dentro de la carpeta xml) serán pasados al segundo plugin PagedImagePlugin, y se tratarán como documentos paginados.

Formateo

Hemos modificado el formateo del documento para mostrar imágenes a tamaño completo, previsualizar imágenes o texto y botones para cambiar entre estas opciones. Esto involucra modificaciones a las cadenas de formateo del DocumentHeading y el DocumentText en el archivo de configuración de la colección., y algunas definiciones de macros en el archivo de macros extra.dm. El archivo extra.dm provee definiciones para los botones (\_viewfullsize\_, \_viewpreview\_, \_viewtext\_) los cuales son usados por la sentencia de formateo en el archivo collect.cfg. La sentencia de formateo cambia la visualización del documento y setea los botones que deben mostrarse basándose en el argumento p, el cual es configurado también en la misma sentencia. "