source: main/trunk/model-cols-dev/pei-jones/collect/photos/etc/collectionConfig.xml@ 27948

Last change on this file since 27948 was 27948, checked in by davidb, 11 years ago

First cut at a collection specificially designed to annotate the photos of the Pei Jones collection

File size: 17.7 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?><CollectionConfig xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
2 <metadataList>
3 <metadata lang="en" name="creator"/>
4 <metadata lang="en" name="maintainer"/>
5 <metadata lang="en" name="public">true</metadata>
6 </metadataList>
7 <displayItemList>
8 <displayItem assigned="true" lang="en" name="description">&lt;p&gt;Pei Te Hurinui Jones, 1898-1976, was an outstanding figure in New Zealand - from his editorial work compiling and translating the songs of Maori tribes in Nga Moteatea, to founding one of the first New Zealand owned and operated million dollar companies, to being the President of the Maori Council and advisor to King Koriki and the Maori Queen, Dame Te Atairangikaahu. If you've read (or watched) any of Shakespeare's plays in Maori, then you've experienced some of the work of Pei Jones.&lt;/p&gt;
9
10 &lt;p&gt; In conjunction with staff from the School of Maori and Pacific Development, our library staff have worked tirelessly to gather scholarly material and artefacts relating to his academic life, made available as a special collection and housed in its own room on the top floor of the recently re-developed library building. Over the last 5 years, work has been undertaken to digitize these items and develop a digital library which you are now visiting.&lt;/p&gt;</displayItem>
11 <displayItem assigned="true" lang="en" name="name">pj-photos</displayItem>
12 <displayItem assigned="true" lang="en" name="text">text</displayItem>
13 <displayItem assigned="true" lang="en" name="dc.Title,ex.dc.Title,Title">titles</displayItem>
14 <displayItem assigned="true" lang="en" name="Source">filenames</displayItem>
15 <displayItem assigned="true" lang="en" name="gsimg.Annotation">image annotations</displayItem>
16 <displayItem assigned="true" lang="en" name="document:text">text</displayItem>
17 <displayItem assigned="true" lang="en" name="document:ex.Title">Title</displayItem>
18 <displayItem assigned="true" lang="en" name="document:ex.Source">Source</displayItem>
19 <displayItem assigned="true" lang="en" name="document">document</displayItem>
20 <displayItem assigned="true" lang="en" name="section">section</displayItem>
21 <displayItem assigned="true" lang="en" name="shortDescription">Photographs from the Pei Jones collection</displayItem>
22 </displayItemList>
23 <format>
24 <gsf:template name="choose-title">
25 <gsf:choose-metadata>
26 <gsf:metadata name="dc.Title"/>
27 <gsf:metadata name="exp.Title"/>
28 <gsf:metadata name="ex.dc.Title"/>
29 <gsf:metadata name="Title"/>
30 <gsf:default>Untitled</gsf:default>
31 </gsf:choose-metadata>
32 </gsf:template>
33 </format>
34 <search type="lucene">
35 <level name="document">
36 <displayItem lang="en" name="name">document</displayItem>
37 </level>
38 <level name="section">
39 <displayItem lang="en" name="name">section</displayItem>
40 </level>
41 <defaultLevel name="document"/>
42 <index name="text">
43 <displayItem lang="en" name="name">text</displayItem>
44 </index>
45 <index name="dc.Title,ex.dc.Title,Title">
46 <displayItem lang="en" name="name">titles</displayItem>
47 </index>
48 <index name="Source">
49 <displayItem lang="en" name="name">filenames</displayItem>
50 </index>
51 <index name="gsimg.Annotation">
52 <displayItem lang="en" name="name">image annotations</displayItem>
53 </index>
54 <defaultIndex name="text"/>
55 <indexOption name="casefold"/>
56 <indexOption name="stem"/>
57 <searchType name="plain"/>
58 <searchType name="simpleform"/>
59 <searchType name="advancedform"/>
60 <format>
61 <gsf:template match="documentNode">
62
63 <td align="center" valign="top" width="104">
64 <gsf:link type="document">
65 <gsf:choose-metadata>
66 <gsf:metadata name="thumbicon"/>
67 <gsf:metadata name="srcicon"/>
68 </gsf:choose-metadata>
69 </gsf:link>
70 </td>
71 <td valign="top">
72 <gsf:link type="document">
73<!--
74Defined in the global format statement
75 -->
76 <xsl:call-template name="choose-title"/>
77<!--
78 <gsf:switch>
79 <gsf:metadata name="Source"/>
80 <gsf:when test="exists">
81 <br/>
82 <i>(<gsf:metadata name="Source"/>)</i>
83 </gsf:when>
84 </gsf:switch>
85 -->
86 </gsf:link>
87 </td>
88 </gsf:template>
89 </format>
90 </search>
91 <infodb type="gdbm"/>
92 <import>
93 <pluginList>
94 <plugin name="GreenstoneXMLPlugin"/>
95 <plugin name="PagedImagePlugin">
96 <option name="-create_thumbnail" value="true"/>
97 <option name="-thumbnailsize" value="100"/>
98 <option name="-thumbnailtype" value="gif"/>
99 <option name="-create_screenview" value="true"/>
100 <option name="-screenviewsize" value="500"/>
101 <option name="-screenviewtype" value="jpg"/>
102 <option name="-no_cover_image"/>
103 </plugin>
104 <plugin name="TextPlugin"/>
105 <plugin name="ImagePlugin">
106 <option name="-enable_cache"/>
107 </plugin>
108
109 <plugin name="MetadataXMLPlugin"/>
110 <plugin name="ArchivesInfPlugin"/>
111 <plugin name="DirectoryPlugin"/>
112 </pluginList>
113 </import>
114 <browse>
115 <classifier name="List">
116 <option name="-metadata" value="dc.Title;Title"/>
117 <option name="-partition_type_within_level" value="approximate_size"/>
118 </classifier>
119<!--
120 <classifier name="AZCompactList">
121 <option name="-metadata" value="dc.Format"/>
122 </classifier>
123-->
124 <format>
125 <gsf:template match="documentNode">
126
127 <td align="center" valign="top" width="104">
128 <gsf:link type="document">
129 <gsf:choose-metadata>
130 <gsf:metadata name="thumbicon"/>
131 <gsf:metadata name="srcicon"/>
132 </gsf:choose-metadata>
133 </gsf:link>
134 </td>
135 <td valign="top">
136 <gsf:link type="document">
137<!--
138Defined in the global format statement
139 -->
140 <xsl:call-template name="choose-title"/>
141<!--
142<gsf:switch>
143 <gsf:metadata name="Source"/>
144 <gsf:when test="exists">
145 <br/>
146 <i>(<gsf:metadata name="Source"/>)</i>
147 </gsf:when>
148 </gsf:switch>
149 -->
150 </gsf:link>
151 </td>
152 </gsf:template>
153 <gsf:template match="classifierNode[@classifierStyle = 'VList']">
154 <td valign="top">
155 <gsf:link type="classifier">
156 <gsf:icon type="classifier"/>
157 </gsf:link>
158 </td>
159 <td valign="top">
160 <gsf:metadata name="Title"/>
161 </td>
162 </gsf:template>
163 <gsf:template match="classifierNode[@classifierStyle = 'HList']">
164 <gsf:link type="classifier">
165 <gsf:metadata name="Title"/>
166 </gsf:link>
167 </gsf:template>
168 </format>
169 </browse>
170 <display>
171 <format>
172 <xsl:template name="additionalHeaderContent">
173 <xsl:call-template name="PeiJoinesBackground"/>
174
175 <xsl:variable name="url">
176 <xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name= 'httpPath']"/>
177 </xsl:variable>
178 <link href="{$url}/script/image-annotator/css/annotation.css" rel="stylesheet" type="text/css"/>
179<!--
180 <link href="{$url}/style/pei-jones-background.css" rel="stylesheet" type="text/css"/>
181-->
182 <link href="{$url}/script/text-annotator/annotator.min.css" rel="stylesheet" type="text/css"/>
183 <gsf:script src="{$url}/script/image-annotator/js/jquery.annotate2.js"/>
184 <gsf:script src="{$url}/script/gsajax-min.js"/>
185 <gsf:script src="{$url}/script/setup-features.js"/>
186<!--
187gsf:script src="{$url}/script/text-annotator/annotator-full.min.js"/>
188-->
189 <script text="text/javascript">
190 <xsl:text disable-output-escaping="yes">$(document).ready(function(){
191 /* hide cover image div */
192 var found = $(document).find("#coverImage");
193
194 if(found.length != 0){
195 var coverImageDiv = found[0];
196 $(coverImageDiv).hide();
197 }
198 });</xsl:text>
199 </script>
200 </xsl:template>
201<!--
202Overwriting this template allows you to change the heading of the document.
203-->
204<!--
205<gsf:template name="documentHeading">
206<span style="font-weight:bold; font-size: 120%;">
207<xsl:call-template name="choose-title"/>
208</span>
209</gsf:template>
210-->
211<!--
212Overwriting this template can be used to redefine the content of the whole document. This is useful for simple documents, but not recommended for more complex documents (e.g. hierachical and paged documents) as it can prevent any sub-sections from showing.
213-->
214 <gsf:template name="documentContent">
215<!--
216Checks the format of the current GSDL document - in this case, either "Photographs", "Books" or "Scanned Documents".
217-->
218 <xsl:variable name="format">
219 <gsf:metadata name="dc.Format"/>
220 <gsf:default>""</gsf:default>
221 </xsl:variable>
222 <xsl:choose>
223<!--
224If the current document is in the format of a (Realistic) Book, then link the image on the page to the matching realistic book for people to view/read.
225-->
226 <xsl:when test="contains($format,'Books')">
227 <xsl:variable name="BookName">
228 <gsf:choose-metadata>
229 <gsf:metadata name="Title"/>
230 <gsf:default>""</gsf:default>
231 </gsf:choose-metadata>
232 </xsl:variable>
233 <xsl:variable name="NewBookName">
234 <xsl:call-template name="replace-function">
235 <xsl:with-param name="stringIn" select="string($BookName)"/>
236 <xsl:with-param name="charsIn" select="' '"/>
237 <xsl:with-param name="charsOut" select="'_'"/>
238 </xsl:call-template>
239 </xsl:variable>
240 <xsl:variable name="url">
241 <xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name= 'httpPath']"/>
242 <xsl:text>/books/</xsl:text>
243 <xsl:value-of select="$NewBookName"/>
244 <xsl:text>/index.html</xsl:text>
245 </xsl:variable>
246 <a href="{$url}" target="_blank">
247 <xsl:call-template name="wrappedSectionImage"/>
248 </a>
249 <br/>
250 <br/>
251 <p>Click on the image above to view/read the book.</p>
252 </xsl:when>
253 <xsl:otherwise>
254 <xsl:if test="contains($format,'Photographs')">
255 <script text="text/javascript">
256 <xsl:text disable-output-escaping="yes">$(window).load(function(){
257
258 var found = $(".zoomImage").find("img");
259 var imageJson;
260 var matches;
261 var existing_notes;
262 var img;
263
264 if(found.length != 0){
265 img = found[0];
266 }else{
267
268 var imageDivName = "#image" + gs.cgiParams.d;
269
270 found = $(imageDivName).find("img");
271
272 if(found.length != 0)
273 img = found[0];
274 }
275
276 if(img !== null &amp;&amp; img !== undefined){
277
278 imageJson = '</xsl:text>
279 <gsf:metadata name="gsimg.Annotation"/>
280 <xsl:text disable-output-escaping="yes">';
281
282 matches = getImageNoteMatches(imageJson);
283 existing_notes = getExistingImageNotes(matches);
284
285 $(img).attr('id','toAnnotate');
286
287 $('#toAnnotate').annotateImage({
288 editable: true,
289 useAjax: true,
290 notes: existing_notes
291 });
292 }else{
293 console.log("ERROR: Image could not be found for annotating");
294 }
295
296 });</xsl:text>
297 </script>
298 </xsl:if>
299 <xsl:call-template name="wrappedSectionImage"/>
300 <br/>
301 <br/>
302 <xsl:call-template name="wrappedSectionText"/>
303 </xsl:otherwise>
304 </xsl:choose>
305 </gsf:template>
306<!--
307This is a template for replacing characters in a string, e.g. replacing spaces with underscore characters.
308-->
309 <xsl:template name="replace-function">
310 <xsl:param name="stringIn"/>
311 <xsl:param name="charsIn"/>
312 <xsl:param name="charsOut"/>
313 <xsl:choose>
314 <xsl:when test="contains($stringIn,$charsIn)">
315 <xsl:value-of select="concat(substring-before($stringIn,$charsIn),$charsOut)"/>
316 <xsl:call-template name="replace-function">
317 <xsl:with-param name="stringIn" select="substring-after($stringIn,$charsIn)"/>
318 <xsl:with-param name="charsIn" select="$charsIn"/>
319 <xsl:with-param name="charsOut" select="$charsOut"/>
320 </xsl:call-template>
321 </xsl:when>
322 <xsl:otherwise>
323 <xsl:value-of select="$stringIn"/>
324 </xsl:otherwise>
325 </xsl:choose>
326 </xsl:template>
327<!--
328Overwriting this template can be used to change the content of section headings.
329-->
330<!--
331<gsf:template name="sectionHeading">
332<xsl:call-template name="choose-title"/>
333</gsf:template>
334-->
335<!--
336This template is called when displaying the paged scanned documents in the library collection. Controls the display of the area where the user collapses/expands pages.
337-->
338 <gsf:template name="topLevelSectionContent">
339<!--
340Create a variable to store numpages.
341-->
342 <xsl:variable name="NumPages">
343 <gsf:choose-metadata>
344 <gsf:metadata name="NumPages"/>
345 <gsf:default>0</gsf:default>
346 </gsf:choose-metadata>
347 </xsl:variable>
348<!--
349Check if $NumPages == 1
350-->
351 <xsl:if test="$NumPages=1">
352<!--
353Write functionality so that we don't have to collapse the page - it should be instantly viewable.
354-->
355 <script>
356 <xsl:text disable-output-escaping="yes"> </xsl:text> </script>
357 </xsl:if>
358 <xsl:call-template name="wrappedSectionImage"/>
359 <xsl:call-template name="wrappedSectionText"/>
360 </gsf:template>
361<!--
362Overwriting this template can be used to change the content of each section - useful for paged documents.
363-->
364 <gsf:template name="sectionContent">
365<!--
366<p>
367<gsf:metadata name="assocfilepath" select="root"/>
368</p>
369-->
370<!--
371Check if dc.format == "Scanned Documents"
372-->
373 <xsl:variable name="FileFormat">
374 <gsf:choose-metadata>
375 <gsf:metadata name="dc.Format" select="root"/>
376 <gsf:default>""</gsf:default>
377 </gsf:choose-metadata>
378 </xsl:variable>
379 <xsl:if test="contains($FileFormat,'Scanned Documents')">
380 <script type="text/javascript">
381 <xsl:text disable-output-escaping="yes">var docID = gs.cgiParams.d;
382 var num = '</xsl:text>
383 <gsf:metadata name="Title"/>
384 <xsl:text disable-output-escaping="yes">';
385 var divId = "#small" + docID + "_" + num;
386 var found = $(divId).find("img");
387
388 //Load up existing image annotations
389 var imageJson = '</xsl:text>
390 <gsf:metadata name="gsimg.Annotation" select="root"/>
391 <xsl:text disable-output-escaping="yes">';
392
393 var matches = getImageNoteMatches(imageJson);
394 var existing_notes = getExistingImageNotes(matches,num);
395 console.log(existing_notes);
396
397 if(found.length != 0){
398 var img = found[0];
399
400 var img_width = img.width;
401 var img_height = img.height;
402
403 var imgId = 'img_annotate'+docID+'_'+num;
404
405 $(img).attr('id',imgId);
406 $('#'+imgId).annotateImage({
407 editable: true,
408 useAjax: true,
409 notes: existing_notes,
410 width: img_width,
411 height: img_height,
412 page: num
413 });
414
415 //enable text annotating - assumes that only one pre element exists on the page...
416 /*var preAnnotator = $("pre").annotator();
417
418 preAnnotator.annotator('addPlugin','Store',{
419
420 prefix: 'cgi-bin/metadata-server.pl',
421
422 //Attach uri of the current page to all annotations to allow search
423 annotationData: {
424 'uri': 'http://localhost:8787/greenstone3/library/colection/pjpaged/document/HASH012777c0ef1cbbe239b1cc66'
425 },
426
427 loadFromSearch: {
428 'limit': 20,
429 'uri': 'http://localhost:8787/greenstone3/library/colection/pjpaged/document/HASH012777c0ef1cbbe239b1cc66'
430 },
431
432 urls: {
433 create: 'createurl',
434 read: 'readurl',
435 update: 'updateurl',
436 destroy: 'destroyurl',
437 search: 'searchurl'
438 }
439
440 });*/
441
442
443 }</xsl:text>
444 </script>
445 </xsl:if>
446 <xsl:call-template name="wrappedSectionImage"/>
447 <br/>
448 <br/>
449 <xsl:call-template name="wrappedSectionText"/>
450 </gsf:template>
451 </format>
452 </display>
453 <replaceListRef id="gs2-standard"/>
454 <replaceListRef id="gs2-image"/>
455 <serviceRackList><!-- comment out the following serviceRack if you want to disable OAI for this collection -->
456 <serviceRack name="OAIPMH">
457 <ListMetadataFormats><!--What metadata sets to support is collection specific. To support other metadata schema, simply add a metadataFormat element here.
458 The support of unqualified Dublin Core metadata set is mandatory in the oai specification.
459 -->
460 <metadataFormat metadataPrefix="oai_dc">
461 <metadataPrefix>oai_dc</metadataPrefix>
462 <schema>http://www.openarchives.org/OAI/2.0/oai_dc.xsd</schema>
463 <metadataNamespace>http://www.openarchives.org/OAI/2.0/oai_dc/</metadataNamespace><!--<metadataElements>dc.Title,dc.Creator,dc.Subject,dc.Description,dc.Publisher,dc.Contributor,dc.Date,dc.Type,dc.Format,dc.Identifier,dc.Source,dc.Language,dc.Relation,dc.Coverage,dc.Rights</metadataElements>-->
464 <mappingList><!--
465 The mapping is in the form: <publicly supported metadata name>,<mapped metadata name>, short as <A>,<B>
466 The first metadata name is medatory; if there is no mapped name followed, then the first name must be used by the records and
467 searchable in the database, otherwise it is the mapped name stored in the database. The number of mapping elements matches the
468 number of external metadata of the records. If only one name is present, the returned metadata will use this name plus the retrieved value;
469 if both <A>,<B> are present, the returned metadata will use <A>'s name plus <B>'s value retrieved from database.
470
471 **Bear in mind: if this mapping list is not present, the standard dc. metadata names (15 in total) will be used to retrieve metadata in the database.
472
473 **The only case when this mapping is not present is that: 1. this metadata format is oai_dc; 2. the metadata is also stored in the database by Dublin Core's names.
474 -->
475 <mapping>dc:title,Title</mapping><!-- This mapping example means that the dc.Title is requested and the value of the metadata Title, which is used in this repository, is returned as response. -->
476 </mappingList>
477 </metadataFormat>
478 </ListMetadataFormats>
479 </serviceRack>
480 </serviceRackList>
481</CollectionConfig>
Note: See TracBrowser for help on using the repository browser.