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

Last change on this file since 19546 was 19546, checked in by anna, 15 years ago

Updated some French translations and added Simplified Chinese translations.

  • Property svn:executable set to *
File size: 14.7 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\',[screenicon],{If}{[NoText] eq \'1\',,[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# -- Spanish strings --------------------
72collectionmeta collectionname [l=es] "Ejemplo de imágenes paginadas"
73collectionmeta .section:text [l=es] "páginas de diario"
74
75# -- Simplified Chinese strings --------------------
76collectionmeta collectionname [l=zh] "分页囟片瀺范銆藏"
77collectionmeta .section:text [l=zh] "报纞页面"
78
79# -- English text -----------------------
80
81collectionmeta collectionextra [l=en] "This collection contains a few newspapers from the
82<a href=\'http://www.nzdl.org/cgi-bin/library?a=p&amp;p=about&amp;c=niupepa\'>
83Niupepa</a> collection of Maori newspapers.
84
85<h3>How the collection works</h3>
86<p>Each newspaper issue consists of a set of images, one per page, and a set
87of text files for the OCR\'d text. An item file links the set of pages into a
88single newspaper document. PagedImagePlugin is used to process the item files.
89<p>There are two styles of item files, and this collection demonstrates both.
90The first uses a text based format, and consists of a list of metadata for the
91document, and a list of pages. Here are some examples:
92<a href=\'_httpcollection_/import/09/09\_1\_1.item\'>Te Waka o Te Iwi, Vol. 1, No. 1</a>,
93<a href=\'_httpcollection_/import/10/10\_1\_3.item\'>Te Whetu o Te Tau, Vol. 1, No. 3</a>.
94This format allows specification of document level metadata, and a single list of pages.
95<p>The second style is an extended format, and uses XML. It allows a hierarchy
96of pages, and metadata specification at the page level as well as at the
97document level. An example is <a href=\'_httpcollection_/import/xml/23/23\_\_2.item\'>Matariki 1881, No. 2</a>.
98This newspaper also has an abstract associated with it. The contents have been
99grouped into two sections: Supplementary Material, which contains the Abstract,
100and Newspaper Pages, which contains the page images.
101<p>Paged documents can be presented with a hierarchical table of contents
102(e.g. <a href=\'?a=d&amp;c=_cgiargc_&amp;d=23\_\_1.2.1&p=text\'>this one</a>),
103or with next and previous page arrows, and a goto page box
104(e.g. <a href=\'?a=d&amp;c=_cgiargc_&amp;d=10\_1\_2&p=preview\'>this one</a>).
105This is specified by the <tt>-documenttype (hierarchy|paged)</tt> option to PagedImagePlugin.
106The next and previous arrows suit the linear sequence documents, while the table of contents
107suits the hierarchically organised document. Ordinarily, a Greenstone collection
108would have one plugin per document type, and all documents of that type get
109the same processing. In this case, we want to treat the XML-based item files
110differently from the text-based item files. We can achieve this by adding two
111PagedImagePlugin plugins to the collection, and configuring them differently.
112<p><tt>plugin PagedImagePlugin -documenttype hierarchy -process_exp xml.*\.item$ <br/>
113plugin PagedImagePlugin -documenttype paged </tt>
114
115<p>XML based newpapers have been grouped into a folder called <tt>xml</tt>.
116This enables us to process these files differently, by utilising the
117<tt>process_exp</tt> option which all plugins support. The first PagedImagePlugin
118in the list looks for item files underneath the xml folder. These documents
119will be processed as hierarchical documents. Item files that don\'t match the
120process expression (i.e. aren\'t underneath the xml folder) will be passed onto
121the second PagedImagePlugin, and these are treated as paged documents.
122
123<p><b>Formatting</b>
124<p>We have modified the document formatting to display fullsized images,
125preview images or text, with buttons to switch between them. This involves
126modifications to the DocumentHeading and DocumentText format statements in the
127<a href=\'_httpcollection_/etc/collect.cfg\' target=\'collect.cfg\'>collection configuration file</a>,
128and some macro definitions in the <a href=\'_httpcollection_/macros/extra.dm\' target=\'extra.dm\'>extra.dm macro file</a>.
129The extra.dm macro file provides definitions for the buttons (\_viewfullsize\_,
130\_viewpreview\_, \_viewtext\_) which are used by the format statement in the
131collect.cfg file. The format statement switches the document display and sets
132the buttons to be displayed based on the p argument, which is also set by the
133format statement.
134"
135
136# -- Spanish text -----------------------
137collectionmeta collectionextra [l=es] "Esta colección contiene algunos diarios de la colección
138<a href=\'http://www.nzdl.org/cgi-bin/library?a=p&amp;p=about&amp;c=niupepa\'>
139Niupepa</a> de periódicos Maories.
140
141<h3>Cómo funciona la colección</h3>
142<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 en un único documento de diario. PagedImagePlugin se utiliza para procesar esos archivos .item.
143<p>Hay dos estilos para escribir esos archivos item. y esta colección demuestra ambos.
144El 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:
145<a href=\'_httpcollection_/import/09/09\_1\_1.item\'>Te Waka o Te Iwi, Vol. 1, No. 1</a>,
146<a href=\'_httpcollection_/import/10/10\_1\_3.item\'>Te Whetu o Te Tau, Vol. 1, No. 3</a>.
147Este formato permite la especificación de metadatos a nivel de documento, y una lista simple de páginas.
148<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>.
149Este 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.
150<p>Los documentos paginados pueden presentarse con una tabla de contenidos jerárquica
151(por ej. <a href=\'?a=d&amp;c=_cgiargc_&amp;d=23\_\_1.2.1&p=text\'>esta</a>),
152o con flechas \"Siguiente"
153(por ej. <a href='?a=d&amp;c=_cgiargc_&amp;d=10\_1\_2&p=preview'>esta</a>).
154Esto es definido por la opción <tt>-documenttype (hierarchy|paged)</tt> asignada al plugin PagedImagePlugin.
155Las 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.
156<p><tt>plugin PagedImagePlugin -documenttype hierarchy -process_exp xml.*\.item$ <br/>
157plugin PagedImagePlugin -documenttype paged
158
159<p>Los diarios basados en XML han sido agrupados en una carpeta llamada <tt>xml</tt>.
160Esto nos permite procesar esos archivos de una manera diferente, utilizando la opción <tt>process_exp</tt> que es soportada por todos los plugins. El primer plugin PagedImagePlugin
161en 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.
162
163<p><b>Formateo</b>
164<p>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
165<a href='_httpcollection_/etc/collect.cfg' target=\'collect.cfg\'>archivo de configuración de la colección.</a>,
166y algunas definiciones de macros en el <a href='_httpcollection_/macros/extra.dm' target=\'extra.dm\'>archivo de macros extra.dm</a>.
167El archivo extra.dm provee definiciones para los botones (\_viewfullsize\_,
168\_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.
169"
170
171# -- Simplified Chinese text -----------------------
172collectionmeta collectionextra [l=zh] "本銆藏包
173含若干源自
174<a href='http://www.nzdl.org/cgi-bin/library?a=p&amp;p=about&amp;c=niupepa'>Niupepa</a>銆藏的毛利报纞。
175
176<h3>本銆藏劂䜕工䜜</h3>
177
178<p>每期报纞由䞀组囟片组成每页对应䞀匠囟片以及䞀组包
179含OCR文本的文本文件。
180由䞀䞪item文件将䞀组页面铟接起来圢成䞀䞪报纞文档。PagedImagePlugin甚于倄理这些item文件。
181
182<p>item文件有䞀种栌匏而本銆藏将挔瀺这䞀种栌匏。第䞀种是基于文本的栌匏由䞀䞪文档å…
183ƒæ•°æ®åˆ—è¡šå’Œ
184䞀䞪页面列衚组成. 比劂 <a href='_httpcollection_/import/09/09\_1\_1.item'>Te Waka o Te Iwi第1卷第1期</a>
185<a href='_httpcollection_/import/10/10\_1\_3.item'>Te Whetu o Te Tau第1卷第3期</a>。
186这种栌匏å…
187è®žè®Ÿçœ®æ–‡æ¡£çº§çš„å…
188ƒæ•°æ®ïŒŒä»¥åŠäž€äžªé¡µé¢åˆ—衚。
189
190<p>第二种栌匏是䞀种䜿甚XML的扩展栌匏。这种栌匏å…
191è®žè®Ÿçœ®å±‚级匏页面列衚并䞔å…
192ƒæ•°æ®å¯ä»¥æ˜¯é¡µé¢çº§çš„也可以是文档级的。
193比劂<a href='_httpcollection_/import/xml/23/23\_\_2.item'>Matariki 1881第2期</a>。这期报纞还有附属的文摘。
194这期报纞的内
195容被分䞺䞀䞪郚分包
196括文摘圚内
197的补å…
198…
199材料以及报纞的页面即页面囟片。
200
201<p>分页文档可以甚䞀䞪层级匏的内
202容倧纲星瀺䟋劂<a href='?a=d&amp;c=_cgiargc_&amp;d=23\_\_1.2.1&p=text'>这䞪文档</a>
203或者
204甚䞋䞀页和前䞀页的页面箭倎以及䞀䞪跳蜬页面蟓å…
205¥æ¡†æ¥æ˜Ÿç€º
206比劂<a href='?a=d&amp;c=_cgiargc_&amp;d=10\_1\_2&p=preview'>这䞪文档</a>。
207这是通过讟定PagedImagePlugin的<tt>-documenttype (hierarchy|paged)</tt>选项来实现的。
208䞋䞀页和前䞀页箭倎适甚于线性序列的文档而内
209容倧纲适甚于层级匏的文档。䞀般情
210况䞋䞀䞪Greenstone銆藏甚䞀䞪插件倄理䞀种类型的文档
211因歀所有同类型的文档郜将以同䞀种方匏进行倄理。圚这种情
212况䞋我们想甚䞍同的方匏分别倄理基于XML的item文件䞎基于文本的item文件。
213这可以通过圚銆藏䞭添加䞀䞪PagedImagePlugin插件来完成并对å…
214¶åˆ†åˆ«è¿›è¡ŒäžåŒçš„讟眮。
215
216<p>
217<tt>
218plugin PagedImagePlugin -documenttype hierarchy -process_exp xml.*\.item$ <br/>
219plugin PagedImagePlugin -documenttype paged
220</tt>
221
222<p>基于XML的报纞被集䞭眮于䞀䞪称䞺<tt>xml</tt>的文件倹䞭。这å…
223è®žæˆ‘们甚䞍同方匏对这些文件进行倄理
224这是通过讟眮所有插件郜支持的<tt>process_exp</tt>选项来实现的。列衚䞭的第䞀䞪PagedImagePlugin将查扟xml文件倹䞋的所有item文件。
225这些文档将䌚按层级匏文档进行倄理。䞍匹é…
226å€„理衚蟟匏的item文件即䞍圚xml文件倹䞭的item文件将被䌠递给第二䞪PagedImagePlugin而这些将䌚按分页文档进行倄理。
227
228<p><b>栌匏化</b>
229<p>我们已经修改了文档的栌匏䜿å…
230¶æ˜Ÿç€ºå…
231šå¹…
232的囟片预览囟片或者
233文本以及圚䞍同暡匏之闎进行蜬换的按钮。
234这涉及到圚銆藏的<a href='_httpcollection_/etc/collect.cfg' target=\'collect.cfg\'>é…
235çœ®æ–‡ä»¶</a>䞭修改
236DocumentHeading和DocumentText栌匏变量以及<a href='_httpcollection_/macros/extra.dm' target=\'extra.dm\'>
237extra.dm宏文件</a>䞭的䞀些宏。
238
239extra.dm宏文件提䟛按钮\_viewfullsize\_\_viewpreview\_\_viewtext\_的定义这些定义圚collect.cfg文件的栌匏变量䞭甚到。
240栌匏变量根据p参数的倌蜬换到䞍同的文档星瀺暡匏以及对应的按钮而p参数也是由栌匏参数所讟定的。
241"
Note: See TracBrowser for help on using the repository browser.