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

Last change on this file since 28052 was 28052, checked in by sjm84, 11 years ago

Adding 2 examples of collection security

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