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

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

Some more features added to the usertracker and hooking up the page to the editenabled variable

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