source: documented-examples/trunk/pagedimg-e/etc/collect.cfg@ 22967

Last change on this file since 22967 was 22967, checked in by kjdon, 14 years ago

modified DocumentText format statement. If p=text but there is no text, then display screenicon or srcicon. Similarly, if asked for screenicon, and there is none, then display srcicon

  • Property svn:executable set to *
File size: 19.3 KB
Line 
1creator [email protected]
2maintainer [email protected]
3public true
4
5buildtype mg
6
7indexes section:text
8defaultindex section:text
9
10plugin GreenstoneXMLPlugin
11# We want the two types of paged documents to be treated differently: paged
12# and hierarchical. So include two PagedImagePlugin plugins and modify the
13# process_exp.
14plugin PagedImagePlugin -process_exp xml.*\.item$ -create_screenview true -OIDtype assigned -minimumsize 100 -OIDmetadata ItemOID -documenttype hierarchy
15plugin PagedImagePlugin -create_screenview true -OIDtype assigned -minimumsize 100 -OIDmetadata ItemOID -documenttype paged
16plugin MetadataXMLPlugin
17plugin ArchivesInfPlugin
18plugin DirectoryPlugin
19
20classify AZCompactList -metadata Series -sort Date
21classify DateList
22
23# Format statements to display Series, Volume, Number and Date information
24
25format DocumentVList "<td valign=top>[link][icon][/link]</td>
26<td valign=top>{If}{[Series],[Series] {If}{[Volume],Vol. [Volume]} {If}{[Number],No. [Number]},[highlight]{Or}{[Title],[PageNum]}[/highlight]}</td>"
27
28format CL1VList "<td valign=top>[link][icon][/link]</td>
29<td valign=top>{If}{[numleafdocs],[Title],{If}{[Volume],Vol. [Volume]} {If}{[Number],No. [Number]} ([format:Date])}</td>"
30
31format SearchVList "<td valign=top>[link][icon][/link]</td>
32<td valign=top>[parent(Top):Series] {If}{[parent(Top):Volume],Vol. [parent(Top):Volume]} {If}{[parent(Top):Number],No. [parent(Top):Number]} Page [Title]</td>"
33
34format DateList "<td valign=top>[link][icon][/link]</td>
35<td valign=top>[Series] {If}{[Volume],Vol. [Volume]} {If}{[Number],No. [Number]}</td>"
36
37format HList "[link][highlight][ex.Title][/highlight][/link]"
38
39# We customise the document display, so use the extended options
40format AllowExtendedOptions true
41
42# We want to add in fullsize/preview/text buttons to switch between the
43# different versions of each page
44
45format DocumentHeading "<center><table width=_pagewidth_>
46<tr valign=top><td>{Or}{[parent(Top):Series],[Series]}</td></tr>
47<tr valign=top><td><table><tr><td>
48[DocumentButtonDetach][DocumentButtonHighlight]
49{If}{_cgiargp_ eq \'fullsize\',{If}{[screenicon],_document:viewpreview_}
50{If}{[NoText] eq \'1\',,_document:viewtext_},
51{If}{_cgiargp_ eq \'preview\',{If}{[srcicon],_document:viewfullsize_}
52{If}{[NoText] eq \'1\',,_document:viewtext_},
53{If}{[srcicon],_document:viewfullsize_}
54{If}{[screenicon],_document:viewpreview_}}}
55</td></tr></table></td>
56<td>[DocTOC]</td></tr></table></center>"
57
58# Document text display changes based on the p argument - this is not used
59#normally for document display, so we can use it here to switch between
60#fullsize/preview/text versions.
61format DocumentText "<center><table width=_pagewidth_><tr><td>
62{If}{_cgiargp_ eq \'fullsize\',[srcicon],
63{If}{_cgiargp_ eq \'preview\',{Or}{[screenicon],[srcicon]},{If}{[NoText] eq \'1\',{Or}{[screenicon],[srcicon]},[Text]}}}
64</td></tr></table></center>"
65
66
67# -- English strings --------------------
68collectionmeta collectionname [l=en] "Paged Image example"
69collectionmeta .section:text [l=en] "newspaper pages"
70
71# -- French strings --------------------
72collectionmeta collectionname [l=fr] "Exemple d'image mise en page"
73collectionmeta .section:text [l=fr] "pages de journaux"
74
75# -- Spanish strings --------------------
76collectionmeta collectionname [l=es] "Ejemplo de imágenes paginadas"
77collectionmeta .section:text [l=es] "páginas de diario"
78
79# -- Simplified Chinese strings --------------------
80collectionmeta collectionname [l=zh] "分页囟片瀺范銆藏"
81collectionmeta .section:text [l=zh] "报纞页面"
82
83# -- English text -----------------------
84
85collectionmeta collectionextra [l=en] "This collection contains a few newspapers from the
86<a href=\'http://www.nzdl.org/cgi-bin/library?a=p&amp;p=about&amp;c=niupepa\'>
87Niupepa</a> collection of Maori newspapers.
88
89<h3>How the collection works</h3>
90<p>Each newspaper issue consists of a set of images, one per page, and a set
91of text files for the OCR\'d text. An item file links the set of pages into a
92single newspaper document. PagedImagePlugin is used to process the item files.
93<p>There are two styles of item files, and this collection demonstrates both.
94The first uses a text based format, and consists of a list of metadata for the
95document, and a list of pages. Here are some examples:
96<a href=\'_httpcollection_/import/09/09\_1\_1.item\'>Te Waka o Te Iwi, Vol. 1, No. 1</a>,
97<a href=\'_httpcollection_/import/10/10\_1\_3.item\'>Te Whetu o Te Tau, Vol. 1, No. 3</a>.
98This format allows specification of document level metadata, and a single list of pages.
99<p>The second style is an extended format, and uses XML. It allows a hierarchy
100of pages, and metadata specification at the page level as well as at the
101document level. An example is <a href=\'_httpcollection_/import/xml/23/23\_\_2.item\'>Matariki 1881, No. 2</a>.
102This newspaper also has an abstract associated with it. The contents have been
103grouped into two sections: Supplementary Material, which contains the Abstract,
104and Newspaper Pages, which contains the page images.
105<p>Paged documents can be presented with a hierarchical table of contents
106(e.g. <a href=\'?a=d&amp;c=_cgiargc_&amp;d=23\_\_1.2.1&p=text\'>this one</a>),
107or with next and previous page arrows, and a goto page box
108(e.g. <a href=\'?a=d&amp;c=_cgiargc_&amp;d=10\_1\_2&p=preview\'>this one</a>).
109This is specified by the <tt>-documenttype (hierarchy|paged)</tt> option to PagedImagePlugin.
110The next and previous arrows suit the linear sequence documents, while the table of contents
111suits the hierarchically organised document. Ordinarily, a Greenstone collection
112would have one plugin per document type, and all documents of that type get
113the same processing. In this case, we want to treat the XML-based item files
114differently from the text-based item files. We can achieve this by adding two
115PagedImagePlugin plugins to the collection, and configuring them differently.
116<p><tt>plugin PagedImagePlugin -documenttype hierarchy -process_exp xml.*\.item$; <br/> plugin PagedImagePlugin -documenttype paged</tt>
117
118<p>XML based newpapers have been grouped into a folder called <tt>xml</tt>.
119This enables us to process these files differently, by utilising the
120<tt>process_exp</tt> option which all plugins support. The first PagedImagePlugin
121in the list looks for item files underneath the xml folder. These documents
122will be processed as hierarchical documents. Item files that don\'t match the
123process expression (i.e. aren\'t underneath the xml folder) will be passed onto
124the second PagedImagePlugin, and these are treated as paged documents.
125
126<p><b>Formatting</b>
127<p>We have modified the document formatting to display fullsized images,
128preview images or text, with buttons to switch between them. This involves
129modifications to the DocumentHeading and DocumentText format statements in the
130<a href=\'_httpcollection_/etc/collect.cfg\' target=\'collect.cfg\'>collection configuration file</a>,
131and some macro definitions in the <a href=\'_httpcollection_/macros/extra.dm\' target=\'extra.dm\'>extra.dm macro file</a>.
132The extra.dm macro file provides definitions for the buttons (\_viewfullsize\_,
133\_viewpreview\_, \_viewtext\_) which are used by the format statement in the
134collect.cfg file. The format statement switches the document display and sets
135the buttons to be displayed based on the p argument, which is also set by the
136format statement.
137"
138
139# -- French text -----------------------
140
141collectionmeta collectionextra [l=fr] "
142Cette collection contient quelques journaux de la collection de journaux Maori
143<a href='http://www.nzdl.org/cgi-bin/library?a=p&amp;p=about&amp;c=niupepa'>Niupepa</a>.
144
145<h3>Comment fonctionne la collection</h3>
146
147<p>Chaque numéro de revue est constitué d'une série d'images, une par page, et d'une série de
148fichiers textuels issus de l'OCR. Un fichier d'exemplaire fait le lien entre la série d'images
149et le document du numéro du journal. Le plugiciel PagedImagePlugin est utilisé pour traiter les
150fichiers d'exemplaire. <p>Il y a deux styles de fichiers d'exemplaires, et cette collection les
151utilise tous les deux. Le premier utilise un format textuel, et regroupe une liste de métadonnées
152et une liste de pages.
153
154En voici quelques exemples : <a href='_httpcollection_/import/09/09\_1\_1.item'>Te Waka o Te Iwi, Vol. 1, No. 1</a>,
155<a href='_httpcollection_/import/10/10\_1\_3.item'>Te Whetu o Te Tau, Vol. 1, No. 3</a>.
156Ce format permet de spécifier des métadonnées de niveau document, et une seule liste de pages.
157
158<p>Le second style est un format étendu et utilise XML. Il permet de hiérarchiser les pages,
159et de spécifier des métadonnées aussi bien au niveau de la page que du document.
160En voici un exemple : <a href='_httpcollection_/import/xml/23/23\_\_2.item'>Matariki 1881, No. 2</a>.
161Ce journal a aussi un résumé qui lui est associé. Les contenus ont donc été regroupés en deux sections :
162matériaux complémentaires, qui contient les résumés, et pages du journal, qui contient les images des pages.
163Les documents paginés peuvent être présentés avec une table des matiÚres hiérarchique (voir par exemple
164<a href='?a=d&amp;c=_cgiargc_&amp;d=23\_\_1.2.1&p=text'>celle-ci</a>), ou avec des flÚches de navigation pour
165atteindre la page précédente ou la page suivante, ainsi qu'une boîte permettant d'atteindre une page en particulier
166(par exemple <a href='?a=d&amp;c=_cgiargc_&amp;d=10\_1\_2&p=preview'>celle-ci</a>). Cela est défini par l'option
167<tt>-documenttype (hierarchy|paged)</tt> du plugiciel PagedImagePlugin. Les flÚches de navigation suivent l'organisation
168linéaire des documents, tandis que la table des matiÚres respecte l'organisation hiérarchique des documents. Normalement,
169une collection Greenstone utilise un seul plugiciel par type de document, et tous les documents de ce type subissent le même
170traitement. Dans ce cas, nous voulons traiter différemment les fichiers d'exemplaires au format XML et les ficiers d'exemplaires
171au format texte. Nous pouvons arriver à ce résultat en ajoutant deux plugiciels PagedImagePlugin à la collection, et en
172les configurant différemment de la façon suivante :
173<p><tt>plugin PagedImagePlugin -documenttype hierarchy -process_exp xml.*\.item$; <br/> plugin PagedImagePlugin -documenttype paged</tt>
174<p>Les journaux décrits en XML ont été regroupés dans un dossier
175appelé <tt>xml</tt>. Cela nous permet de traiter ces fichiers différemment, en utilisant l'option <tt>process_exp</tt>
176dont disposent tous les plugiciels. Le premier plugiciel PagedImagePlugin de la liste recherche les fichiers d'exemplaires
177à l'intérieur du dossier xml. Ces documents seront alors traités comme des documents hiérarchisés. Les fichiers d'exemplaires
178qui ne correspondent pas à l'expression de recherche (c'est à dire qui ne sont pas situés dans le dossier xml) seront traités
179par le second plugiciel PagedImagePlugin, comme des documents paginés. <p><b>Formatage</b> <p>Nous avons modifié le formatage
180du document pour afficher les images en haute résolution, prévisualiser les images ou le texte, avec un bouton pour passer
181d'un mode à l'autre. Cela implique des modifications dans les déclarations des formats DocumentHeading et DocumentText,
182dans le <a href='_httpcollection_/etc/collect.cfg' target=\'collect.cfg\'>fichier de configuration de la collection</a>,
183et la définition de certaines macros dans le <a href='_httpcollection_/macros/extra.dm' target=\'extra.dm\'>fichier de
184macro extra.dm</a>. Le fichier de macro extra.dm définit les boutons (\_viewfullsize\_, \_viewpreview\_, \_viewtext\_) qui
185sont utilisés par la déclaration de format dans le fichier collect.cfg. La déclaration de format change l'affichage du document
186et définit les boutons affichés en se basant sur l'argument p, qui est aussi défini dans la déclaration du format.
187"
188
189# -- Spanish text -----------------------
190collectionmeta collectionextra [l=es] "
191Esta colección contiene algunos diarios de la colección <a href=\"http://www.nzdl.org/cgi-bin/library?a=p&amp;p=about&amp;c=niupepa\">
192Niupepa</a> de periódicos Maories.
193
194<h3>Cómo funciona la colección</h3>
195<p>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.
196<p>Hay dos estilos para escribir esos archivos item. y esta colección demuestra ambos.
197El 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:
198<a href=\'_httpcollection_/import/09/09\_1\_1.item\'>Te Waka o Te Iwi, Vol. 1, No. 1</a>,
199<a href=\'_httpcollection_/import/10/10\_1\_3.item\'>Te Whetu o Te Tau, Vol. 1, No. 3</a>.
200Este formato permite la especificación de metadatos a nivel de documento, y una lista simple de páginas.
201<p>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 <a href=\'_httpcollection_/import/xml/23/23\_\_2.item\'>Matariki 1881, No. 2</a>.
202Este 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.
203<p>Los documentos paginados pueden presentarse con una tabla de contenidos jerárquica (por ej. <a href=\'?a=d&amp;c=_cgiargc_&amp;d=23\_\_1.2.1&amp;p=text\'>esta</a>),
204o con flechas de avance o retroceso de páginas, y una opción \"Ir a\"
205(por ejemplo, <a href=\'?a=d&amp;c=_cgiargc_&amp;d=10\_1\_2&amp;p=preview\'>esta</a>).
206Esto se especifica con la opción <tt>-documenttype (hierarchy|paged)</tt> del PagedImagePlugin.
207Las 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.
208
209<p><tt>plugin PagedImagePlugin -documenttype hierarchy -process_exp xml.*\.item$; <br/> plugin PagedImagePlugin -documenttype paged</tt>
210
211<p>Los Diarios basados en XML fueron agrupados en una carpeta llamada <tt>xml</tt>.
212Esto permite procesar esos archivos de una forma diferente, utilizando la opción <tt>process_exp</tt> 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.
213
214<p><b>Formateo</b>
215<p>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 <a href=\'_httpcollection_/etc/collect.cfg\' target=\'collect.cfg\'>archivo de configuración</a>,
216y algunas definiciones de macros en <a href=\'_httpcollection_/macros/extra.dm\' target=\'extra.dm\'>el archivo extra.dm</a>.
217El 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.
218
219"
220
221# -- Simplified Chinese text -----------------------
222collectionmeta collectionextra [l=zh] "本銆藏包
223含若干源自
224<a href='http://www.nzdl.org/cgi-bin/library?a=p&amp;p=about&amp;c=niupepa'>Niupepa</a>銆藏的毛利报纞。
225
226<h3>本銆藏劂䜕工䜜</h3>
227
228<p>每期报纞由䞀组囟片组成每页对应䞀匠囟片以及䞀组包
229含OCR文本的文本文件。
230由䞀䞪item文件将䞀组页面铟接起来圢成䞀䞪报纞文档。PagedImagePlugin甚于倄理这些item文件。
231
232<p>item文件有䞀种栌匏而本銆藏将挔瀺这䞀种栌匏。第䞀种是基于文本的栌匏由䞀䞪文档å…
233ƒæ•°æ®åˆ—è¡šå’Œ
234䞀䞪页面列衚组成. 比劂 <a href='_httpcollection_/import/09/09\_1\_1.item'>Te Waka o Te Iwi第1卷第1期</a>
235<a href='_httpcollection_/import/10/10\_1\_3.item'>Te Whetu o Te Tau第1卷第3期</a>。
236这种栌匏å…
237è®žè®Ÿçœ®æ–‡æ¡£çº§çš„å…
238ƒæ•°æ®ïŒŒä»¥åŠäž€äžªé¡µé¢åˆ—衚。
239
240<p>第二种栌匏是䞀种䜿甚XML的扩展栌匏。这种栌匏å…
241è®žè®Ÿçœ®å±‚级匏页面列衚并䞔å…
242ƒæ•°æ®å¯ä»¥æ˜¯é¡µé¢çº§çš„也可以是文档级的。
243比劂<a href='_httpcollection_/import/xml/23/23\_\_2.item'>Matariki 1881第2期</a>。这期报纞还有附属的文摘。
244这期报纞的内
245容被分䞺䞀䞪郚分包
246括文摘圚内
247的补å…
248…
249材料以及报纞的页面即页面囟片。
250
251<p>分页文档可以甚䞀䞪层级匏的内
252容倧纲星瀺䟋劂<a href='?a=d&amp;c=_cgiargc_&amp;d=23\_\_1.2.1&p=text'>这䞪文档</a>
253或者
254甚䞋䞀页和前䞀页的页面箭倎以及䞀䞪跳蜬页面蟓å…
255¥æ¡†æ¥æ˜Ÿç€º
256比劂<a href='?a=d&amp;c=_cgiargc_&amp;d=10\_1\_2&p=preview'>这䞪文档</a>。
257这是通过讟定PagedImagePlugin的<tt>-documenttype (hierarchy|paged)</tt>选项来实现的。
258䞋䞀页和前䞀页箭倎适甚于线性序列的文档而内
259容倧纲适甚于层级匏的文档。䞀般情
260况䞋䞀䞪Greenstone銆藏甚䞀䞪插件倄理䞀种类型的文档
261因歀所有同类型的文档郜将以同䞀种方匏进行倄理。圚这种情
262况䞋我们想甚䞍同的方匏分别倄理基于XML的item文件䞎基于文本的item文件。
263这可以通过圚銆藏䞭添加䞀䞪PagedImagePlugin插件来完成并对å…
264¶åˆ†åˆ«è¿›è¡ŒäžåŒçš„讟眮。
265
266<p>
267<tt>plugin PagedImagePlugin -documenttype hierarchy -process_exp xml.*\.item$; <br/> plugin PagedImagePlugin -documenttype paged</tt>
268
269<p>基于XML的报纞被集䞭眮于䞀䞪称䞺<tt>xml</tt>的文件倹䞭。这å…
270è®žæˆ‘们甚䞍同方匏对这些文件进行倄理
271这是通过讟眮所有插件郜支持的<tt>process_exp</tt>选项来实现的。列衚䞭的第䞀䞪PagedImagePlugin将查扟xml文件倹䞋的所有item文件。
272这些文档将䌚按层级匏文档进行倄理。䞍匹é…
273å€„理衚蟟匏的item文件即䞍圚xml文件倹䞭的item文件将被䌠递给第二䞪PagedImagePlugin而这些将䌚按分页文档进行倄理。
274
275<p><b>栌匏化</b>
276<p>我们已经修改了文档的栌匏䜿å…
277¶æ˜Ÿç€ºå…
278šå¹…
279的囟片预览囟片或者
280文本以及圚䞍同暡匏之闎进行蜬换的按钮。
281这涉及到圚銆藏的<a href='_httpcollection_/etc/collect.cfg' target=\'collect.cfg\'>é…
282çœ®æ–‡ä»¶</a>䞭修改
283DocumentHeading和DocumentText栌匏变量以及<a href='_httpcollection_/macros/extra.dm' target=\'extra.dm\'>
284extra.dm宏文件</a>䞭的䞀些宏。
285
286extra.dm宏文件提䟛按钮\_viewfullsize\_\_viewpreview\_\_viewtext\_的定义这些定义圚collect.cfg文件的栌匏变量䞭甚到。
287栌匏变量根据p参数的倌蜬换到䞍同的文档星瀺暡匏以及对应的按钮而p参数也是由栌匏参数所讟定的。
288"
Note: See TracBrowser for help on using the repository browser.