creator greenstone@cs.waikato.ac.nz maintainer greenstone@cs.waikato.ac.nz public true buildtype mg 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 -process_exp xml.*\.item$ -create_screenview true -OIDtype assigned -minimumsize 100 -OIDmetadata ItemOID -documenttype hierarchy plugin PagedImagePlugin -create_screenview true -OIDtype assigned -minimumsize 100 -OIDmetadata ItemOID -documenttype paged 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" # -- French strings -------------------- collectionmeta collectionname [l=fr] "Exemple d'image mise en page" collectionmeta .section:text [l=fr] "pages de journaux" # -- Spanish strings -------------------- collectionmeta collectionname [l=es] "Ejemplo de imágenes paginadas" collectionmeta .section:text [l=es] "páginas de diario" # -- Simplified Chinese strings -------------------- collectionmeta collectionname [l=zh] "分页图片示范馆藏" collectionmeta .section:text [l=zh] "报纸页面" # -- 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. " # -- French text ----------------------- collectionmeta collectionextra [l=fr] " Cette collection contient quelques journaux de la collection de journaux Maori Niupepa.

Comment fonctionne la collection

Chaque numéro de revue est constitué d'une série d'images, une par page, et d'une série de fichiers textuels issus de l'OCR. Un fichier d'exemplaire fait le lien entre la série d'images et le document du numéro du journal. Le plugiciel PagedImagePlugin est utilisé pour traiter les fichiers d'exemplaire.

Il y a deux styles de fichiers d'exemplaires, et cette collection les utilise tous les deux. Le premier utilise un format textuel, et regroupe une liste de métadonnées et une liste de pages. En voici quelques exemples : Te Waka o Te Iwi, Vol. 1, No. 1, Te Whetu o Te Tau, Vol. 1, No. 3. Ce format permet de spécifier des métadonnées de niveau document, et une seule liste de pages.

Le second style est un format étendu et utilise XML. Il permet de hiérarchiser les pages, et de spécifier des métadonnées aussi bien au niveau de la page que du document. En voici un exemple : Matariki 1881, No. 2. Ce journal a aussi un résumé qui lui est associé. Les contenus ont donc été regroupés en deux sections : matériaux complémentaires, qui contient les résumés, et pages du journal, qui contient les images des pages. Les documents paginés peuvent être présentés avec une table des matières hiérarchique (voir par exemple celle-ci), ou avec des flèches de navigation pour atteindre la page précédente ou la page suivante, ainsi qu'une boîte permettant d'atteindre une page en particulier (par exemple celle-ci). Cela est défini par l'option -documenttype (hierarchy|paged) du plugiciel PagedImagePlugin. Les flèches de navigation suivent l'organisation linéaire des documents, tandis que la table des matières respecte l'organisation hiérarchique des documents. Normalement, une collection Greenstone utilise un seul plugiciel par type de document, et tous les documents de ce type subissent le même traitement. Dans ce cas, nous voulons traiter différemment les fichiers d'exemplaires au format XML et les ficiers d'exemplaires au format texte. Nous pouvons arriver à ce résultat en ajoutant deux plugiciels PagedImagePlugin à la collection, et en les configurant différemment de la façon suivante :

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

Les journaux décrits en XML ont été regroupés dans un dossier appelé xml. Cela nous permet de traiter ces fichiers différemment, en utilisant l'option process_exp dont disposent tous les plugiciels. Le premier plugiciel PagedImagePlugin de la liste recherche les fichiers d'exemplaires à l'intérieur du dossier xml. Ces documents seront alors traités comme des documents hiérarchisés. Les fichiers d'exemplaires qui ne correspondent pas à l'expression de recherche (c'est à dire qui ne sont pas situés dans le dossier xml) seront traités par le second plugiciel PagedImagePlugin, comme des documents paginés.

Formatage

Nous avons modifié le formatage du document pour afficher les images en haute résolution, prévisualiser les images ou le texte, avec un bouton pour passer d'un mode à l'autre. Cela implique des modifications dans les déclarations des formats DocumentHeading et DocumentText, dans le fichier de configuration de la collection, et la définition de certaines macros dans le fichier de macro extra.dm. Le fichier de macro extra.dm définit les boutons (\_viewfullsize\_, \_viewpreview\_, \_viewtext\_) qui sont utilisés par la déclaration de format dans le fichier collect.cfg. La déclaration de format change l'affichage du document et définit les boutons affichés en se basant sur l'argument p, qui est aussi défini dans la déclaration du format. " # -- 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 con un único 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 de avance o retroceso de páginas, y una opción \"Ir a\" (por ejemplo, esta). Esto se especifica con la opción -documenttype (hierarchy|paged) del PagedImagePlugin. Las flechas de avance o retroceso permiten la recorrida secuencial del documento, mientras que la tabla de contenidos recorrer el documento organizado jerárquicamente. Normalmente, una colección de Greenstone tendría solo un plugin por tipo de documento, y todos los documentos de ese tipo tendrán el mismo procesamiento. En este caso, queremos tratar a los archivos .item con formato XML de una manera diferente a los archivos .item con formato plano. Podemos lograr esto agregando 2 plugins PagedImagePlugin a la colección, y configurándolos de manera diferente.

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

Los Diarios basados en XML fueron agrupados en una carpeta llamada xml. Esto permite procesar esos archivos de una forma diferente, utilizando la opción process_exp que todos los plugin soportan. El primer plugin PagedImagePlugin de la lista busca archivos .item dentro de la carpeta xml. Estos documentos serán procesados como documentos jerárquicos. Los archivos item que no coincidan con ese criterio (p.e. no están dentro de la carpeta xml) serán pasados al segundo PagedImagePlugin, y serán tratados como documentos paginados.

Formateo

Hemos modificado el formateo del documento para mostrar imágenes a tamaño completo, previsualización de la imagen o el texto, con botones para intercambiar entre ellos. esto incluye modificaciones a las cadenas de formateo del DocumentHeading y del DocumentText en el archivo de configuración, y algunas definiciones de macros en el archivo extra.dm. El archivo de macros extra.dm provee definiciones para os botones (\_viewfullsize\_, \_viewpreview\_, \_viewtext\_) que son usados por la cadena de formateo en el collect.cfg. Dicha cadena de formateo cambia la visualización del documento y configura los botones de acuerdo al argumento p, el cual también es configurado por la cadena de formateo. " # -- Simplified Chinese text ----------------------- collectionmeta collectionextra [l=zh] "本馆藏包含若干源自 Niupepa馆藏的毛利报纸。

本馆藏如何工作

每期报纸由一组图片组成,每页对应一张图片,以及一组包含OCR文本的文本文件。 由一个item文件将一组页面链接起来,形成一个报纸文档。PagedImagePlugin用于处理这些item文件。

item文件有两种格式,而本馆藏将演示这两种格式。第一种是基于文本的格式,由一个文档元数据列表和 一个页面列表组成. 比如: Te Waka o Te Iwi,第1卷,第1期Te Whetu o Te Tau,第1卷,第3期。 这种格式允许设置文档级的元数据,以及一个页面列表。

第二种格式是一种使用XML的扩展格式。这种格式允许设置层级式页面列表,并且元数据可以是页面级的也可以是文档级的。 比如Matariki 1881,第2期。这期报纸还有附属的文摘。 这期报纸的内容被分为两个部分:包括文摘在内的补充材料,以及报纸的页面,即页面图片。

分页文档可以用一个层级式的内容大纲显示(例如这个文档) ,或者用下一页和前一页的页面箭头以及一个跳转页面输入框来显示 (比如这个文档)。 这是通过设定PagedImagePlugin的-documenttype (hierarchy|paged)选项来实现的。 下一页和前一页箭头适用于线性序列的文档,而内容大纲适用于层级式的文档。一般情况下,一个Greenstone馆藏用一个插件处理一种类型的文档, 因此所有同类型的文档都将以同一种方式进行处理。在这种情况下,我们想用不同的方式分别处理基于XML的item文件与基于文本的item文件。 这可以通过在馆藏中添加两个PagedImagePlugin插件来完成,并对其分别进行不同的设置。

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

基于XML的报纸被集中置于一个称为xml的文件夹中。这允许我们用不同方式对这些文件进行处理, 这是通过设置所有插件都支持的process_exp选项来实现的。列表中的第一个PagedImagePlugin将查找xml文件夹下的所有item文件。 这些文档将会按层级式文档进行处理。不匹配处理表达式的item文件(即不在xml文件夹中的item文件)将被传递给第二个PagedImagePlugin,而这些将会按分页文档进行处理。

格式化

我们已经修改了文档的格式使其显示全幅的图片,预览图片或者文本,以及在不同模式之间进行转换的按钮。 这涉及到在馆藏的配置文件中修改 DocumentHeading和DocumentText格式变量,以及 extra.dm宏文件中的一些宏。 extra.dm宏文件提供按钮(\_viewfullsize\_,\_viewpreview\_,\_viewtext\_)的定义,这些定义在collect.cfg文件的格式变量中用到。 格式变量根据p参数的值转换到不同的文档显示模式以及对应的按钮,而p参数也是由格式参数所设定的。 "