1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <CollectionConfig xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
---|
3 | <metadataList><metadata lang="en" name="creator"></metadata><metadata lang="en" name="maintainer"></metadata><metadata lang="en" name="public">true</metadata></metadataList><displayItemList><displayItem assigned="true" lang="en" name="name">Pei-Jones-Flat</displayItem></displayItemList><search type="mgpp"><level name="document"><displayItem lang="en" name="name">document</displayItem></level><level name="section"><displayItem lang="en" name="name">section</displayItem></level><defaultLevel name="document"/><index name="text"><displayItem lang="en" name="name">text</displayItem></index><index name="Title"><displayItem lang="en" name="name">titles</displayItem></index><index name="Source"><displayItem lang="en" name="name">filenames</displayItem></index><index name="Plugin"/><index name="gsimg.photoNote"><displayItem lang="en" name="name">photo annotations</displayItem></index><index name="gstext.tags"><displayItem lang="en" name="name">text annotations (tags)</displayItem></index><index name="gstext.text"><displayItem lang="en" name="name">text annotations (text)</displayItem></index><index name="gstext.user"><displayItem lang="en" name="name">text annotations (user)</displayItem></index><defaultIndex name="text"/><indexOption><option name="accentfold"/><option name="casefold"/><option name="stem"/></indexOption><searchType name="plain"/><searchType name="simpleform"/><searchType name="advancedform"/><format>
|
---|
4 | <gsf:template match="documentNode">
|
---|
5 | <td valign="top">
|
---|
6 | <gsf:link type="document">
|
---|
7 | <gsf:icon type="document"/>
|
---|
8 | </gsf:link>
|
---|
9 | </td>
|
---|
10 | <td>
|
---|
11 | <gsf:switch>
|
---|
12 | <gsf:metadata name="Title" select="ancestors" separator=": "/>
|
---|
13 | <gsf:when test="exists"><gsf:metadata name="Title" select="ancestors" separator=": "/>:</gsf:when>
|
---|
14 | </gsf:switch>
|
---|
15 | <gsf:link type="document">
|
---|
16 | <gsf:metadata name="Title"/>
|
---|
17 | </gsf:link>
|
---|
18 | </td>
|
---|
19 | </gsf:template>
|
---|
20 | </format></search><infodb type="gdbm"/><import><pluginList><plugin name="ZIPPlugin"/><plugin name="GreenstoneXMLPlugin"/><plugin name="TextPlugin"/><plugin name="HTMLPlugin"><option name="-process_exp" value="(timeglider.*)(?i)(\.html?)$"/><option name="-block_exp" value="(timeglider.*)(?i)(\.jpe?g|\.png|\.gif)$"/><option name="-keep_head"/></plugin><plugin name="EmailPlugin"/><plugin name="PDFPlugin"/><plugin name="RTFPlugin"/><plugin name="WordPlugin"/><plugin name="PostScriptPlugin"/><plugin name="PowerPointPlugin"/><plugin name="ExcelPlugin"/><plugin name="PagedImagePlugin"/><plugin name="ImagePlugin"/><plugin name="ISISPlugin"/><plugin name="NulPlugin"/><plugin name="OAIPlugin"/><plugin name="HTMLImagePlugin"/><plugin name="MetadataXMLPlugin"/><plugin name="ArchivesInfPlugin"/><plugin name="DirectoryPlugin"/></pluginList></import><browse><classifier name="List"><option name="-metadata" value="dc.Title;Title"/><option name="-partition_type_within_level" value="approximate_size"/><option name="-bookshelf_type" value="never"/></classifier><classifier name="AZCompactList"><option name="-metadata" value="Source"/><option name="-removesuffix" value="(?i)\\..*"/><option name="-buttonname" value="Source"/></classifier><format>
|
---|
21 | <gsf:template match="documentNode">
|
---|
22 | <td valign="top">
|
---|
23 | <gsf:link type="document">
|
---|
24 | <gsf:icon type="document"/>
|
---|
25 | </gsf:link>
|
---|
26 | </td>
|
---|
27 | <td valign="top">
|
---|
28 | <gsf:link type="source">
|
---|
29 | <gsf:choose-metadata>
|
---|
30 | <gsf:metadata name="thumbicon"/>
|
---|
31 | <gsf:metadata name="srcicon"/>
|
---|
32 | </gsf:choose-metadata>
|
---|
33 | </gsf:link>
|
---|
34 | </td>
|
---|
35 | <td valign="top">
|
---|
36 | <gsf:link type="document">
|
---|
37 | <gsf:choose-metadata>
|
---|
38 | <gsf:metadata name="dc.Title"/>
|
---|
39 | <gsf:metadata name="exp.Title"/>
|
---|
40 | <gsf:metadata name="Title"/>
|
---|
41 | <gsf:default>Untitled</gsf:default>
|
---|
42 | </gsf:choose-metadata>
|
---|
43 | </gsf:link>
|
---|
44 | <gsf:switch>
|
---|
45 | <gsf:metadata name="Source"/>
|
---|
46 | <gsf:when test="exists">
|
---|
47 | <br/>
|
---|
48 | <i>(<gsf:metadata name="Source"/>)</i>
|
---|
49 | </gsf:when>
|
---|
50 | </gsf:switch>
|
---|
51 | </td>
|
---|
52 | </gsf:template>
|
---|
53 | <gsf:template match="classifierNode">
|
---|
54 | <td valign="top">
|
---|
55 | <gsf:link type="classifier">
|
---|
56 | <gsf:icon type="classifier"/>
|
---|
57 | </gsf:link>
|
---|
58 | </td>
|
---|
59 | <td valign="top">
|
---|
60 | <gsf:metadata name="srclink"/>
|
---|
61 | <gsf:choose-metadata>
|
---|
62 | <gsf:metadata name="thumbicon"/>
|
---|
63 | <gsf:metadata name="srcicon"/>
|
---|
64 | </gsf:choose-metadata>
|
---|
65 | <gsf:metadata name="/srclink"/>
|
---|
66 | </td>
|
---|
67 | <td valign="top">
|
---|
68 | <gsf:choose-metadata>
|
---|
69 | <gsf:metadata name="dc.Title"/>
|
---|
70 | <gsf:metadata name="exp.Title"/>
|
---|
71 | <gsf:metadata name="Title"/>
|
---|
72 | <gsf:default>Untitled</gsf:default>
|
---|
73 | </gsf:choose-metadata>
|
---|
74 | <gsf:switch>
|
---|
75 | <gsf:metadata name="Source"/>
|
---|
76 | <gsf:when test="exists">
|
---|
77 | <br/>
|
---|
78 | <i>(<gsf:metadata name="Source"/>)</i>
|
---|
79 | </gsf:when>
|
---|
80 | </gsf:switch>
|
---|
81 | </td>
|
---|
82 | </gsf:template>
|
---|
83 | <gsf:template match="classifierNode" mode="horizontal">
|
---|
84 | <gsf:link type="horizontal">
|
---|
85 | <gsf:metadata name="Title"/>
|
---|
86 | </gsf:link>
|
---|
87 | </gsf:template>
|
---|
88 | </format></browse><display><format>
|
---|
89 | <gsf:option name="sideBar" value="false"/>
|
---|
90 | <xsl:template name="additionalHeaderContent">
|
---|
91 |
|
---|
92 | <!--
|
---|
93 | <link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css"/>
|
---|
94 | <link rel="stylesheet" href="http://blueimp.github.com/Bootstrap-Image-Gallery/bootstrap-image-gallery.min.css"/>
|
---|
95 | -->
|
---|
96 | <!--[if lt IE 7]><link rel="stylesheet" href="http://blueimp.github.com/Bootstrap-Image-Gallery/bootstrap-ie6.min.css"><![endif]-->
|
---|
97 | <!--
|
---|
98 | <link rel="stylesheet" href="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.fileupload-ui.css"/>
|
---|
99 |
|
---|
100 | <script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.fileupload.js">
|
---|
101 | <xsl:text> </xsl:text>
|
---|
102 | </script>
|
---|
103 | <script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.fileupload-ui.js">
|
---|
104 | <xsl:text> </xsl:text>
|
---|
105 | </script>
|
---|
106 | <script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.iframe-transport.js">
|
---|
107 | <xsl:text> </xsl:text>
|
---|
108 | </script>
|
---|
109 | <script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/application.js">
|
---|
110 | <xsl:text> </xsl:text>
|
---|
111 | </script>
|
---|
112 |
|
---|
113 | <script src="http://blueimp.github.com/JavaScript-Templates/tmpl.min.js"><xsl:text> </xsl:text></script>
|
---|
114 | <script src="http://blueimp.github.com/JavaScript-Load-Image/load-image.min.js"><xsl:text> </xsl:text></script>
|
---|
115 | -->
|
---|
116 | <!--<script id="template-upload" type="text/html">
|
---|
117 | {% for (var i=0, files=o.files, l=files.length, file=files[0]; i<l; file=files[++i]) { %}
|
---|
118 | <tr class="template-upload fade">
|
---|
119 | <td class="preview"><span class="fade"></span></td>
|
---|
120 | <td class="name">{%=file.name%}</td>
|
---|
121 | <td class="size">{%=o.formatFileSize(file.size)%}</td>
|
---|
122 | {% if (file.error) { %}
|
---|
123 | <td class="error" colspan="2"><span class="label important">Error</span> {%=fileUploadErrors[file.error] || file.error%}</td>
|
---|
124 | {% } else if (o.files.valid && !i) { %}
|
---|
125 | <td class="progress"><div class="progressbar"><div style="width:0%;"></div></div></td>
|
---|
126 | <td class="start">{% if (!o.options.autoUpload) { %}<button class="btn primary">Start</button>{% } %}</td>
|
---|
127 | {% } else { %}
|
---|
128 | <td colspan="2"></td>
|
---|
129 | {% } %}
|
---|
130 | <td class="cancel">{% if (!i) { %}<button class="btn info">Cancel</button>{% } %}</td>
|
---|
131 | </tr>
|
---|
132 | {% } %}
|
---|
133 | </script>
|
---|
134 | <script id="template-download" type="text/html">
|
---|
135 | {% for (var i=0, files=o.files, l=files.length, file=files[0]; i<l; file=files[++i]) { %}
|
---|
136 | <tr class="template-download fade">
|
---|
137 | {% if (file.error) { %}
|
---|
138 | <td></td>
|
---|
139 | <td class="name">{%=file.name%}</td>
|
---|
140 | <td class="size">{%=o.formatFileSize(file.size)%}</td>
|
---|
141 | <td class="error" colspan="2"><span class="label important">Error</span> {%=fileUploadErrors[file.error] || file.error%}</td>
|
---|
142 | {% } else { %}
|
---|
143 | <td class="preview">{% if (file.thumbnail_url) { %}
|
---|
144 | <a href="{%=file.url%}" title="{%=file.name%}" rel="gallery"><img src="{%=file.thumbnail_url%}"/></a>
|
---|
145 | {% } %}</td>
|
---|
146 | <td class="name">
|
---|
147 | <a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}">{%=file.name%}</a>
|
---|
148 | </td>
|
---|
149 | <td class="size">{%=o.formatFileSize(file.size)%}</td>
|
---|
150 | <td colspan="2"></td>
|
---|
151 | {% } %}
|
---|
152 | <td class="delete">
|
---|
153 | <button class="btn danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}">Delete</button>
|
---|
154 | <input type="checkbox" name="delete" value="1"/>
|
---|
155 | </td>
|
---|
156 | </tr>
|
---|
157 | {% } %}
|
---|
158 | </script>-->
|
---|
159 |
|
---|
160 | <!-- jQuery must be included before Annotator -->
|
---|
161 | <!-- <script src="sites/localsite/collect/peijones/js/annotator/lib/vendor/jquery.js">-->
|
---|
162 | <!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"><xsl:text> </xsl:text></script>-->
|
---|
163 | <!-- If you're sure your users will only be using browsers modern
|
---|
164 | enough to have their own JSON.parse and JSON.stringify
|
---|
165 | implementations you can skip this -->
|
---|
166 | <script src="sites/localsite/collect/peijones/js/annotator/lib/vendor/json2.js">
|
---|
167 | <xsl:text> </xsl:text>
|
---|
168 | </script>
|
---|
169 | <script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator-full.min.js">
|
---|
170 | <xsl:text> </xsl:text>
|
---|
171 | </script>
|
---|
172 | <!-- The main Annotator script -->
|
---|
173 | <!--<script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.min.js"><xsl:text> </xsl:text></script> -->
|
---|
174 | <!-- Annotator's styling and images -->
|
---|
175 | <link href="sites/localsite/collect/peijones/js/annotator/pkg/annotator.min.css" rel="stylesheet" type="text/css"/>
|
---|
176 | <!-- The following plugins are entirely optional -->
|
---|
177 | <!-- The Store plugin. Saves annotations to a remote backend -->
|
---|
178 | <!-- <script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.store.min.js"><xsl:text> </xsl:text></script> -->
|
---|
179 | <!-- The Auth plugin. Allows users of Annotator to authenticate themselves
|
---|
180 | to the remote backend -->
|
---|
181 | <!--<script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.auth.min.js"><xsl:text> </xsl:text></script> -->
|
---|
182 | <!-- The Permissions plugin. See who created which annotation and create
|
---|
183 | annotations as a specified user -->
|
---|
184 | <!--<script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.permissions.min.js"><xsl:text> </xsl:text></script> -->
|
---|
185 | <!-- The Tags plugin. Edit and display tag keywords on annotations -->
|
---|
186 | <!--<script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.tags.min.js"><xsl:text> </xsl:text></script> -->
|
---|
187 | <!-- The Markdown plugin. Treat annotation text as Markdown -->
|
---|
188 | <!-- <script src="sites/localsite/collect/peijones/js/annotator/lib/vendor/showdown.js"><xsl:text> </xsl:text></script> -->
|
---|
189 | <!-- <script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.markdown.min.js"><xsl:text> </xsl:text></script> -->
|
---|
190 | <!-- Photo note scripts -->
|
---|
191 | <script src="sites/localsite/collect/peijones/js/documentmaker/BrowserDetect.js" type="text/javascript">
|
---|
192 | <xsl:text> </xsl:text>
|
---|
193 | </script>
|
---|
194 | <script src="sites/localsite/collect/peijones/js/documentmaker/PhotoNotes-1.5.js" type="text/javascript">
|
---|
195 | <xsl:text> </xsl:text>
|
---|
196 | </script>
|
---|
197 | <link href="sites/localsite/collect/peijones/style/PhotoNotes-1.5.css" rel="stylesheet" type="text/css"/>
|
---|
198 | <!-- Zoom scripts -->
|
---|
199 | <!--<script src="interfaces/{$interface_name}/js/jquery-1.4.2.js" type="text/javascript"><xsl:text> </xsl:text></script>-->
|
---|
200 | <script src="sites/localsite/collect/peijones/js/documentmaker/zoomer.jquery.js" type="text/javascript">
|
---|
201 | <xsl:text> </xsl:text>
|
---|
202 | </script>
|
---|
203 | <link href="sites/localsite/collect/peijones/style/style.css" rel="stylesheet" type="text/css"/>
|
---|
204 | <script type="text/javascript">
|
---|
205 | <xsl:text disable-output-escaping="yes">
|
---|
206 | _zoomEnabled = true;
|
---|
207 |
|
---|
208 | function readyImagesForZoom()
|
---|
209 | {
|
---|
210 | var noZoom = document.getElementById("noZoomImage");
|
---|
211 | var wrap = document.getElementById("wrap");
|
---|
212 | if(!noZoom || !wrap)
|
---|
213 | {
|
---|
214 | return;
|
---|
215 | }
|
---|
216 |
|
---|
217 | var smallImageDiv = document.getElementById("small");
|
---|
218 | var smallImage = smallImageDiv.getElementsByTagName("img")[0];
|
---|
219 | smallImageDiv.style.width = smallImageWidth + "px";
|
---|
220 | smallImageDiv.style.height = smallImageHeight + "px";
|
---|
221 | var multiplier = largeImageHeight / smallImageHeight;
|
---|
222 |
|
---|
223 | $("#wrap").anythingZoomer({
|
---|
224 | expansionSize:50,
|
---|
225 | speedMultiplier:multiplier
|
---|
226 | });
|
---|
227 |
|
---|
228 | noZoom.onclick = addZoom;
|
---|
229 | document.getElementById("overlay").onclick = removeZoom;
|
---|
230 |
|
---|
231 | removeZoom();
|
---|
232 | }
|
---|
233 | function addZoom()
|
---|
234 | {
|
---|
235 | if(!_zoomEnabled)
|
---|
236 | {
|
---|
237 | return;
|
---|
238 | }
|
---|
239 |
|
---|
240 | var wrapper = document.getElementById("wrap");
|
---|
241 | var noZoom = document.getElementById("noZoom");
|
---|
242 |
|
---|
243 | if(!noZoom || !wrapper)
|
---|
244 | {
|
---|
245 | return;
|
---|
246 | }
|
---|
247 |
|
---|
248 | noZoom.style.display = "none";
|
---|
249 | wrapper.style.display = "block";
|
---|
250 | var option = document.getElementById("zoomOption");
|
---|
251 | if(option)
|
---|
252 | {
|
---|
253 | option.setAttribute("onclick", "removeZoom();");
|
---|
254 | }
|
---|
255 | }
|
---|
256 | function removeZoom()
|
---|
257 | {
|
---|
258 | if(!_zoomEnabled)
|
---|
259 | {
|
---|
260 | return;
|
---|
261 | }
|
---|
262 |
|
---|
263 | var wrapper = document.getElementById("wrap");
|
---|
264 | var noZoom = document.getElementById("noZoom");
|
---|
265 |
|
---|
266 | if(!noZoom || !wrapper)
|
---|
267 | {
|
---|
268 | return;
|
---|
269 | }
|
---|
270 |
|
---|
271 | wrapper.style.display = "none";
|
---|
272 | noZoom.style.display = "block";
|
---|
273 | var option = document.getElementById("zoomOption");
|
---|
274 | if(option)
|
---|
275 | {
|
---|
276 | option.setAttribute("onclick", "addZoom();");
|
---|
277 | }
|
---|
278 | }
|
---|
279 | </xsl:text>
|
---|
280 | </script>
|
---|
281 | <script text="text/javascript">
|
---|
282 | <xsl:text disable-output-escaping="yes">
|
---|
283 |
|
---|
284 | var _posCount = 0;
|
---|
285 | var _notes;
|
---|
286 | function initNotes()
|
---|
287 | {
|
---|
288 | /* create the Photo Note Container */
|
---|
289 | _notes = new PhotoNoteContainer(document.getElementById("noZoom"));
|
---|
290 | getNotes();
|
---|
291 | }
|
---|
292 |
|
---|
293 | function deleteFunction(note)
|
---|
294 | {
|
---|
295 | var status = true;
|
---|
296 |
|
---|
297 | if (note && note.id && note.id > 0) {
|
---|
298 | var metaposStr = note.id - 1;
|
---|
299 |
|
---|
300 | var jsonVal = '{"caption":"' + note.text + '", "area":{"x":' + note.rect.left + ', "y":' + note.rect.top + ', "width":' + note.rect.width + ', "height":' + note.rect.height + '}}';
|
---|
301 |
|
---|
302 | var removeFromIndexURL = "cgi-bin/metadata-server.pl?a=remove-metadata&site=localsite&c=" + gs.cgiParams.c + "&d=" + gs.cgiParams.d + "&metaname=gsimg.photoNote&metapos=" + metaposStr;
|
---|
303 | var removeFromArchivesURL = "cgi-bin/metadata-server.pl?a=remove-archives-metadata&site=localsite&c=" + gs.cgiParams.c + "&d=" + gs.cgiParams.d + "&metaname=gsimg.photoNote&metapos=" + metaposStr;
|
---|
304 | var removeFromImportURL = "cgi-bin/metadata-server.pl?a=remove-import-metadata&site=localsite&c=" + gs.cgiParams.c + "&d=" + gs.cgiParams.d + "&metaname=gsimg.photoNote&metavalue=" + jsonVal;
|
---|
305 |
|
---|
306 | var indexCallback =
|
---|
307 | {
|
---|
308 | success: function(response)
|
---|
309 | {
|
---|
310 | for(var i = 0; i < _notes.length; i++)
|
---|
311 | {
|
---|
312 | var currentNote = _notes[i];
|
---|
313 | if(currentNote.id > note.id)
|
---|
314 | {
|
---|
315 | currentNote.id--;
|
---|
316 | }
|
---|
317 | }
|
---|
318 | _posCount--;
|
---|
319 | },
|
---|
320 | failed: function(){alert("Failed to delete index metadata of note with id: " + note.id);},
|
---|
321 | };
|
---|
322 |
|
---|
323 | var archiveCallback =
|
---|
324 | {
|
---|
325 | success: function(){buildFunction(gs.cgiParams.c);},
|
---|
326 | failed: function(){alert("Failed to delete archive metadata of note with id: " + note.id);}
|
---|
327 | }
|
---|
328 |
|
---|
329 | var importCallback =
|
---|
330 | {
|
---|
331 | success: function(){},
|
---|
332 | failed: function(){alert("Failed to delete import metadata of note with id: " + note.id);}
|
---|
333 | }
|
---|
334 |
|
---|
335 | YAHOO.util.Connect.asyncRequest("GET", removeFromIndexURL, indexCallback);
|
---|
336 | YAHOO.util.Connect.asyncRequest("GET", removeFromArchivesURL, archiveCallback);
|
---|
337 | YAHOO.util.Connect.asyncRequest("GET", removeFromImportURL, importCallback);
|
---|
338 | }
|
---|
339 | else {
|
---|
340 | alert("Failed to find valid note data to delete");
|
---|
341 | status = false;
|
---|
342 | }
|
---|
343 |
|
---|
344 | return status;
|
---|
345 | }
|
---|
346 |
|
---|
347 | function saveFunction(note)
|
---|
348 | {
|
---|
349 | var saveIndexCallback =
|
---|
350 | {
|
---|
351 | success: function(response){},
|
---|
352 | failed: function(reponse){ alert("Failed to save index metadata of note with id: " + note.id)},
|
---|
353 | };
|
---|
354 |
|
---|
355 | var saveArchivesCallback =
|
---|
356 | {
|
---|
357 | success: function(response){buildFunction(gs.cgiParams.c);},
|
---|
358 | failed: function(response){ alert("Failed in save import metadata of note with id: " + note.id) }
|
---|
359 | };
|
---|
360 |
|
---|
361 | var saveImportCallback =
|
---|
362 | {
|
---|
363 | success: function(response){},
|
---|
364 | failed: function(response){ alert("Failed in save import metadata of note with id: " + note.id) }
|
---|
365 | };
|
---|
366 |
|
---|
367 | var jsonVal = '{"caption":"' + note.text + '", "area":{"x":' + note.rect.left + ', "y":' + note.rect.top + ', "width":' + note.rect.width + ', "height":' + note.rect.height + '}}';
|
---|
368 | var metaposStr = (note && note.id && note.id > 0) ? note.id - 1 : _posCount;
|
---|
369 |
|
---|
370 | var saveIndexURL = "cgi-bin/metadata-server.pl?a=set-metadata&site=localsite&c=" + gs.cgiParams.c + "&d=" + gs.cgiParams.d + "&metaname=gsimg.photoNote&metavalue=" + jsonVal + "&metapos=" + metaposStr;
|
---|
371 | var saveArchivesURL = "cgi-bin/metadata-server.pl?a=set-archives-metadata&site=localsite&c=" + gs.cgiParams.c + "&d=" + gs.cgiParams.d + "&metaname=gsimg.photoNote&metavalue=" + jsonVal + "&metapos=" + metaposStr;
|
---|
372 | var saveImportURL = "cgi-bin/metadata-server.pl?a=set-import-metadata&site=localsite&c=" + gs.cgiParams.c + "&d=" + gs.cgiParams.d + "&metaname=gsimg.photoNote&metavalue=" + jsonVal + "&metapos=" + metaposStr;
|
---|
373 | YAHOO.util.Connect.asyncRequest("GET", saveIndexURL, saveIndexCallback);
|
---|
374 | YAHOO.util.Connect.asyncRequest("GET", saveArchivesURL, saveArchivesCallback);
|
---|
375 | YAHOO.util.Connect.asyncRequest("GET", saveImportURL, saveImportCallback);
|
---|
376 |
|
---|
377 | return 1;
|
---|
378 | }
|
---|
379 |
|
---|
380 | function getNotes()
|
---|
381 | {
|
---|
382 | if(gs.variables.photoNotes == null || gs.variables.photoNotes == undefined)
|
---|
383 | {
|
---|
384 | console.log("No photo notes");
|
---|
385 | return;
|
---|
386 | }
|
---|
387 |
|
---|
388 | for(var i = 0; i < gs.variables.photoNotes.length; i++)
|
---|
389 | {
|
---|
390 | var note = gs.variables.photoNotes[i];
|
---|
391 | if(!note)
|
---|
392 | {
|
---|
393 | continue;
|
---|
394 | }
|
---|
395 | var newNote = new PhotoNote(note.caption, i+1, new PhotoNoteRect(note.area.x,note.area.y,note.area.width,note.area.height));
|
---|
396 | newNote.onsave = saveFunction;
|
---|
397 | newNote.ondelete = deleteFunction;
|
---|
398 | _notes.AddNote(newNote);
|
---|
399 | _posCount++;
|
---|
400 | }
|
---|
401 |
|
---|
402 | addNoteOverAndOutHandlers();
|
---|
403 | }
|
---|
404 |
|
---|
405 | function AddNote()
|
---|
406 | {
|
---|
407 | var photoPos = $("#noZoom").offset();
|
---|
408 | var newNote = new PhotoNote('Add note text here...',_posCount+1,new PhotoNoteRect(20,20,50,50));
|
---|
409 | newNote.onsave = saveFunction;
|
---|
410 | newNote.ondelete = deleteFunction;
|
---|
411 | _notes.AddNote(newNote);
|
---|
412 | _posCount++;
|
---|
413 |
|
---|
414 | addNoteOverAndOutHandlers();
|
---|
415 | newNote.Select();
|
---|
416 | }
|
---|
417 |
|
---|
418 | function addNoteOverAndOutHandlers()
|
---|
419 | {
|
---|
420 | var divs = document.getElementsByTagName("DIV");
|
---|
421 | for(var i = 0; i < divs.length; i++)
|
---|
422 | {
|
---|
423 | if(divs[i].getAttribute("class") && divs[i].getAttribute("class").search("fn-area") != -1)
|
---|
424 | {
|
---|
425 | divs[i].onmouseover = function(){_zoomEnabled = false;}
|
---|
426 | divs[i].onmouseout = function(){_zoomEnabled = true;}
|
---|
427 | }
|
---|
428 | }
|
---|
429 | }
|
---|
430 |
|
---|
431 | function addStatusBar()
|
---|
432 | {
|
---|
433 | var textDiv = document.getElementById("gs-document");
|
---|
434 | var buildStatusBar = document.createElement("div");
|
---|
435 | buildStatusBar.setAttribute("id", "buildStatusBar");
|
---|
436 | buildStatusBar.setAttribute("class", "ui-state-default ui-corner-all");
|
---|
437 | buildStatusBar.setAttribute("style", "visibility:hidden; width:100%");
|
---|
438 | var buildingMessage = document.createElement("div");
|
---|
439 | buildingMessage.setAttribute("id", "buildMessage");
|
---|
440 | buildingMessage.setAttribute("style", "width:50%; padding:3px; margin:5px auto; text-align:center;");
|
---|
441 | buildStatusBar.appendChild(buildingMessage);
|
---|
442 |
|
---|
443 | textDiv.insertBefore(buildStatusBar, textDiv.firstChild);
|
---|
444 | }
|
---|
445 |
|
---|
446 | $(window).load(function(){readyImagesForZoom(); initAnnotator(); addStatusBar(); initNotes();});
|
---|
447 | </xsl:text>
|
---|
448 | </script>
|
---|
449 | <script text="text/javascript">
|
---|
450 | <xsl:text disable-output-escaping="yes">
|
---|
451 |
|
---|
452 | function checkLoop(pid, serverFunction, callback)
|
---|
453 | {
|
---|
454 | var startLoop = function()
|
---|
455 | {
|
---|
456 | var loopCallback =
|
---|
457 | {
|
---|
458 | success:function(response)
|
---|
459 | {
|
---|
460 | var checkText = response.responseText;
|
---|
461 | if(checkText == null || checkText == "")
|
---|
462 | {
|
---|
463 | console.log("There was an error getting the XML to check the status of " + serverFunction);
|
---|
464 | }
|
---|
465 | else
|
---|
466 | {
|
---|
467 | var checkCodeStart = checkText.indexOf("code=\"") + 6;
|
---|
468 | var checkCodeEnd = checkText.indexOf("\"", checkCodeStart);
|
---|
469 | var code = checkText.substring(checkCodeStart, checkCodeEnd);
|
---|
470 |
|
---|
471 | if(code == 11 || code == 1) //11 is COMPLETED, 1 is success
|
---|
472 | {
|
---|
473 | callback();
|
---|
474 | }
|
---|
475 | else if(code == 12 || code == 3) //12 is HALTED, 3 is ERROR
|
---|
476 | {
|
---|
477 | console.log("There was an error on the server, could not check status of " + serverFunction);
|
---|
478 | }
|
---|
479 | else
|
---|
480 | {
|
---|
481 | setTimeout(startLoop, 1000);
|
---|
482 | }
|
---|
483 | }
|
---|
484 | },
|
---|
485 | failed:function()
|
---|
486 | {
|
---|
487 | console.log("There was a problem checking the status of " + serverFunction)
|
---|
488 | }
|
---|
489 | }
|
---|
490 | YAHOO.util.Connect.asyncRequest("GET", gs.xsltParams.library_name + "?a=g&rt=s&ro=1&s=" + serverFunction + "&s1.pid=" + pid, loopCallback);
|
---|
491 | }
|
---|
492 | startLoop();
|
---|
493 | }
|
---|
494 |
|
---|
495 | function buildFunction(collection)
|
---|
496 | {
|
---|
497 | var buildCallback =
|
---|
498 | {
|
---|
499 | success:function(response)
|
---|
500 | {
|
---|
501 | var buildText = response.responseText;
|
---|
502 | if(buildText == null || buildText == "")
|
---|
503 | {
|
---|
504 | console.log("There was an error getting the xml response from the building request");
|
---|
505 | }
|
---|
506 | else
|
---|
507 | {
|
---|
508 | var buildPIDStart = buildText.indexOf("pid=\"") + 5;
|
---|
509 | var buildPIDEnd = buildText.indexOf("\"", buildPIDStart);
|
---|
510 | var buildPID = buildText.substring(buildPIDStart, buildPIDEnd);
|
---|
511 |
|
---|
512 | checkLoop(buildPID, "BuildCollection", function()
|
---|
513 | {
|
---|
514 | var activateCallback =
|
---|
515 | {
|
---|
516 | success: function(response)
|
---|
517 | {
|
---|
518 | var activateText = response.responseText;
|
---|
519 | if(activateText == null || activateText == "")
|
---|
520 | {
|
---|
521 | console.log("There was an error getting the xml response from the activating request");
|
---|
522 | }
|
---|
523 | else
|
---|
524 | {
|
---|
525 | var activatePIDStart = activateText.indexOf("pid=\"") + 5;
|
---|
526 | var activatePIDEnd = activateText.indexOf("\"", activatePIDStart);
|
---|
527 | var activatePID = activateText.substring(activatePIDStart, activatePIDEnd);
|
---|
528 |
|
---|
529 | checkLoop(activatePID, "ActivateCollection", function()
|
---|
530 | {
|
---|
531 | var updateCallback =
|
---|
532 | {
|
---|
533 | success: function(response){document.getElementById("buildStatusBar").style.visibility = "hidden";},
|
---|
534 | failed: function(reponse){ alert("Failed in saveFunction() to re-read config files"); document.getElementById("buildStatusBar").style.visibility = "hidden";}
|
---|
535 | };
|
---|
536 | YAHOO.util.Connect.asyncRequest("GET", gs.xsltParams.library_name + "?a=s&sa=c", updateCallback);
|
---|
537 | });
|
---|
538 | }
|
---|
539 | },
|
---|
540 | failed: function(response)
|
---|
541 | {
|
---|
542 | document.getElementById("buildStatusBar").style.visibility = "hidden";
|
---|
543 | console.log("Failed to get response from activate collection request");
|
---|
544 | }
|
---|
545 | }
|
---|
546 | YAHOO.util.Connect.asyncRequest("GET", gs.xsltParams.library_name + "?a=g&rt=r&ro=1&s=ActivateCollection&s1.collection=" + collection, activateCallback);
|
---|
547 | });
|
---|
548 | }
|
---|
549 | },
|
---|
550 | failed: function(){console.log("Failed to get build collection response"); document.getElementById("buildStatusBar").style.visibility = "hidden";}
|
---|
551 | }
|
---|
552 |
|
---|
553 | YAHOO.util.Connect.asyncRequest("GET", gs.xsltParams.library_name + "?a=g&rt=r&ro=1&s=BuildCollection&s1.collection=" + collection, buildCallback);
|
---|
554 | showBuildingMessage();
|
---|
555 | }
|
---|
556 |
|
---|
557 | function saveAndBuildCollection(col)
|
---|
558 | {
|
---|
559 | for(var j = 0; j < gs.toDeleteArray.keys.length; j++)
|
---|
560 | {
|
---|
561 | var current = gs.toDeleteArray[gs.toDeleteArray.keys[j]];
|
---|
562 | if(current == null){continue;}
|
---|
563 | var metaToDelete = ["user", "text", "tags"];
|
---|
564 | for(var l = 0; l < metaToDelete.length; l++)
|
---|
565 | {
|
---|
566 | var deleteArchivesURL = "cgi-bin/metadata-server.pl?\
|
---|
567 | a=remove-archives-metadata&\
|
---|
568 | c=" + gs.cgiParams.c + "&\
|
---|
569 | site=localsite&\
|
---|
570 | d=" + gs.cgiParams.d + "&\
|
---|
571 | metaname=gstext." + metaToDelete[l] + "&\
|
---|
572 | metavalue=" + ((l == 0) ? (current.user.name) : (current[metaToDelete[l]]));
|
---|
573 |
|
---|
574 | var deleteIndexURL = "cgi-bin/metadata-server.pl?\
|
---|
575 | a=remove-metadata&\
|
---|
576 | c=" + gs.cgiParams.c + "&\
|
---|
577 | site=localsite&\
|
---|
578 | d=" + gs.cgiParams.d + "&\
|
---|
579 | metaname=gstext." + metaToDelete[l] + "&\
|
---|
580 | metavalue=" + ((l == 0) ? (current.user.name) : (current[metaToDelete[l]]));
|
---|
581 |
|
---|
582 | var deleteImportURL = "cgi-bin/metadata-server.pl?\
|
---|
583 | a=remove-import-metadata&\
|
---|
584 | c=" + gs.cgiParams.c + "&\
|
---|
585 | site=localsite&\
|
---|
586 | d=" + gs.cgiParams.d + "&\
|
---|
587 | metaname=gstext." + metaToDelete[l] + "&\
|
---|
588 | metavalue=" + ((l == 0) ? (current.user.name) : (current[metaToDelete[l]]));
|
---|
589 | var deleteArchivesCallback =
|
---|
590 | {
|
---|
591 | success:function(){},
|
---|
592 | failed: function(){alert("Failed to save text annotations archives metadata");}
|
---|
593 | }
|
---|
594 | YAHOO.util.Connect.asyncRequest("GET", deleteArchivesURL, deleteArchivesCallback);
|
---|
595 |
|
---|
596 | var deleteIndexCallback =
|
---|
597 | {
|
---|
598 | success:function(){},
|
---|
599 | failed: function(){alert("Failed to save text annotations index metadata");}
|
---|
600 | }
|
---|
601 | YAHOO.util.Connect.asyncRequest("GET", deleteIndexURL, deleteIndexCallback);
|
---|
602 |
|
---|
603 | var deleteImportCallback =
|
---|
604 | {
|
---|
605 | success:function(){},
|
---|
606 | failed: function(){alert("Failed to save text annotations import metadata");}
|
---|
607 | }
|
---|
608 | YAHOO.util.Connect.asyncRequest("GET", deleteImportURL, deleteImportCallback);
|
---|
609 | }
|
---|
610 | }
|
---|
611 | gs.toDeleteArray = new Array();
|
---|
612 | gs.toDeleteArray.keys = new Array();
|
---|
613 |
|
---|
614 | if(gs.annotationArray.keys.length > 0)
|
---|
615 | {
|
---|
616 | var json = "[";
|
---|
617 | for(var i = 0; i < gs.annotationArray.keys.length; i++)
|
---|
618 | {
|
---|
619 | var current = gs.annotationArray[gs.annotationArray.keys[i]];
|
---|
620 | if(current == null){continue;}
|
---|
621 | var metaToAdd = ["user", "text", "tags"];
|
---|
622 |
|
---|
623 | for(var j = 0; j < metaToAdd.length; j++)
|
---|
624 | {
|
---|
625 | if(metaToAdd[j] == "user")
|
---|
626 | {
|
---|
627 | json += '{"docid":"' + gs.cgiParams.d + '", "metaname":"gstext.' + metaToAdd[j] + '", "metavalue":"' + current.user.name + '"}';
|
---|
628 | }
|
---|
629 | else
|
---|
630 | {
|
---|
631 | json += '{"docid":"' + gs.cgiParams.d + '", "metaname":"gstext.' + metaToAdd[j] + '", "metavalue":"' + current[metaToAdd[j]] + '"}';
|
---|
632 | }
|
---|
633 |
|
---|
634 | if(j != (metaToAdd.length - 1) || i != (gs.annotationArray.keys.length - 1))
|
---|
635 | {
|
---|
636 | json += ',';
|
---|
637 | }
|
---|
638 | }
|
---|
639 | }
|
---|
640 | json += "]";
|
---|
641 |
|
---|
642 | var saveArchivesURL = "cgi-bin/metadata-server.pl?a=set-archives-metadata-array&c=" + gs.cgiParams.c + "&site=localsite&collect=" + gs.cgiParams.c + "&json=" + json;
|
---|
643 | var saveIndexURL = "cgi-bin/metadata-server.pl?a=set-metadata-array&c=" + gs.cgiParams.c + "&site=localsite&collect=" + gs.cgiParams.c + "&json=" + json;
|
---|
644 | var saveImportURL = "cgi-bin/metadata-server.pl?a=set-import-metadata-array&c=" + gs.cgiParams.c + "&site=localsite&collect=" + gs.cgiParams.c + "&json=" + json;
|
---|
645 |
|
---|
646 | var saveArchivesCallback =
|
---|
647 | {
|
---|
648 | success:function(){console.log("Away to build"); buildFunction(gs.cgiParams.c);},
|
---|
649 | failed: function(){alert("Failed to save text annotations index metadata");}
|
---|
650 | }
|
---|
651 | YAHOO.util.Connect.asyncRequest("GET", saveArchivesURL, saveArchivesCallback);
|
---|
652 |
|
---|
653 | var saveIndexCallback =
|
---|
654 | {
|
---|
655 | success:function(){},
|
---|
656 | failed: function(){alert("Failed to save text annotations import metadata");}
|
---|
657 | }
|
---|
658 | YAHOO.util.Connect.asyncRequest("GET", saveIndexURL, saveIndexCallback);
|
---|
659 |
|
---|
660 | var saveImportCallback =
|
---|
661 | {
|
---|
662 | success:function(){},
|
---|
663 | failed: function(){alert("Failed to save text annotations import metadata");}
|
---|
664 | }
|
---|
665 | YAHOO.util.Connect.asyncRequest("GET", saveImportURL, saveImportCallback);
|
---|
666 | }
|
---|
667 |
|
---|
668 | gs.annotationArray = new Array();
|
---|
669 | gs.annotationArray.keys = new Array();
|
---|
670 | }
|
---|
671 |
|
---|
672 | function showRebuildOption()
|
---|
673 | {
|
---|
674 | var buildStatusBar = document.getElementById("buildStatusBar");
|
---|
675 | buildStatusBar.style.visibility = "visible";
|
---|
676 |
|
---|
677 | var buildMessage = document.getElementById("buildMessage");
|
---|
678 | buildMessage.innerHTML = 'Please rebuild to index annotations (make annotations searchable): <span id="rebuildButton" style="cursor:pointer; padding:2px;" class="ui-state-default ui-corner-all">Rebuild</span>';
|
---|
679 |
|
---|
680 | var rebuildButton = document.getElementById("rebuildButton");
|
---|
681 | rebuildButton.onclick = function(){saveAndBuildCollection("peijones");}
|
---|
682 | }
|
---|
683 |
|
---|
684 | function showBuildingMessage()
|
---|
685 | {
|
---|
686 | var buildStatusBar = document.getElementById("buildStatusBar");
|
---|
687 | buildStatusBar.style.visibility = "visible";
|
---|
688 |
|
---|
689 | var buildMessage = document.getElementById("buildMessage");
|
---|
690 | buildMessage.innerHTML = '<img src="' + gs.imageURLs.loading + '"/> Building...';
|
---|
691 | }
|
---|
692 |
|
---|
693 | function initAnnotator()
|
---|
694 | {
|
---|
695 | gs.annotationArray = new Array();
|
---|
696 | gs.annotationArray.keys = new Array();
|
---|
697 |
|
---|
698 | gs.toDeleteArray = new Array();
|
---|
699 | gs.toDeleteArray.keys = new Array();
|
---|
700 |
|
---|
701 | var elem = document.getElementById("gs-document-text");
|
---|
702 | elem.innerHTML = '<div><span style="visibility:hidden; padding: 3px;" class="ui-state-default ui-corner-all" id="saveButton">Reindex annotations</span></div><br/>' + elem.innerHTML;
|
---|
703 |
|
---|
704 | if (typeof $.fn.annotator !== 'function')
|
---|
705 | {
|
---|
706 | alert("Ooops! it looks like you haven't built the Annotator concatenation file. " + "Either download a tagged release from GitHub, or modify the Cakefile to point " + "at your copy of the YUI compressor and run `cake package`.");
|
---|
707 | }
|
---|
708 | else
|
---|
709 | {
|
---|
710 | // Include AnnotateIt credentials to load the store plugin.
|
---|
711 | $('#gs-document-text').annotator().annotator('setupPlugins', {
|
---|
712 | userId: 'papitha',
|
---|
713 | userName: 'Papitha',
|
---|
714 | accountId: '39fc339cf058bd22176771b3e33c5dac',
|
---|
715 | authToken: '852b7fc25396d2aedf9aeb44dd58518faa679dbf027892164bfb81900bd09741',
|
---|
716 | // $('#gs-document-text').annotator().annotator('setupPlugins', {
|
---|
717 | // userId: 'david',
|
---|
718 | // userName: 'David',
|
---|
719 | // accountId: 'eb096fae65f6377160ffc0eb6c000951',
|
---|
720 | // authToken: '92b3279a6b6edbaa2ed7bc4d895ef55c8f1368877bb69987985aa47195d517e7',
|
---|
721 | }, {
|
---|
722 | Store:
|
---|
723 | {
|
---|
724 | prefix: 'http://localhost:5000',
|
---|
725 | annotationData: {'uri':gs.cgiParams.c + "-" + gs.cgiParams.d},
|
---|
726 | loadFromSearch: {'uri':gs.cgiParams.c + "-" + gs.cgiParams.d}
|
---|
727 | }
|
---|
728 | });
|
---|
729 | }
|
---|
730 | }
|
---|
731 | </xsl:text>
|
---|
732 | </script>
|
---|
733 | </xsl:template>
|
---|
734 | <xsl:template name="documentImage">
|
---|
735 | <!-- Get the photo notes for this document node -->
|
---|
736 | <gsf:variable-struct name="photoNotes">
|
---|
737 | <gsf:metadata multiple="true" name="gsimg.photoNote" separator=", "/>
|
---|
738 | </gsf:variable-struct>
|
---|
739 | <!-- Get details about the image for zooming -->
|
---|
740 | <h3>
|
---|
741 | <gsf:choose-metadata>
|
---|
742 | <gsf:metadata name="dc.Title"/>
|
---|
743 | <gsf:metadata name="ex.Title"/>
|
---|
744 | </gsf:choose-metadata>
|
---|
745 | </h3>
|
---|
746 | <xsl:variable name="imageWidth">
|
---|
747 | <gsf:choose-metadata>
|
---|
748 | <gsf:metadata name="ImageWidth"/>
|
---|
749 | <gsf:default>-1</gsf:default>
|
---|
750 | </gsf:choose-metadata>
|
---|
751 | </xsl:variable>
|
---|
752 | <xsl:variable name="imageHeight">
|
---|
753 | <gsf:choose-metadata>
|
---|
754 | <gsf:metadata name="ImageHeight"/>
|
---|
755 | <gsf:default>-1</gsf:default>
|
---|
756 | </gsf:choose-metadata>
|
---|
757 | </xsl:variable>
|
---|
758 | <xsl:variable name="screenImageWidth">
|
---|
759 | <gsf:choose-metadata>
|
---|
760 | <gsf:metadata name="ScreenWidth"/>
|
---|
761 | <gsf:default>-1</gsf:default>
|
---|
762 | </gsf:choose-metadata>
|
---|
763 | </xsl:variable>
|
---|
764 | <xsl:variable name="screenImageHeight">
|
---|
765 | <gsf:choose-metadata>
|
---|
766 | <gsf:metadata name="ScreenHeight"/>
|
---|
767 | <gsf:default>-1</gsf:default>
|
---|
768 | </gsf:choose-metadata>
|
---|
769 | </xsl:variable>
|
---|
770 | <script type="text/javascript">
|
---|
771 | <xsl:text>largeImageHeight =</xsl:text>
|
---|
772 | <xsl:value-of select="$imageHeight"/>
|
---|
773 | <xsl:text>;</xsl:text>
|
---|
774 | <xsl:text>largeImageWidth =</xsl:text>
|
---|
775 | <xsl:value-of select="$imageWidth"/>
|
---|
776 | <xsl:text>;</xsl:text>
|
---|
777 | <xsl:text>smallImageHeight =</xsl:text>
|
---|
778 | <xsl:value-of select="$screenImageHeight"/>
|
---|
779 | <xsl:text>;</xsl:text>
|
---|
780 | <xsl:text>smallImageWidth =</xsl:text>
|
---|
781 | <xsl:value-of select="$screenImageWidth"/>
|
---|
782 | <xsl:text>;</xsl:text>
|
---|
783 | </script>
|
---|
784 | <span style="font-size:90%; padding: 3px; cursor:pointer;" class="ui-state-default ui-corner-top" onclick="AddNote();">New photo annotation</span>
|
---|
785 | <div id="noZoom" style="display:block;">
|
---|
786 | <img id="noZoomImage" style="width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
|
---|
787 | <xsl:attribute name="src"><xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<gsf:metadata name="assocfilepath" select="root"/>/<gsf:metadata name="Screen"/></xsl:attribute>
|
---|
788 | </img>
|
---|
789 | <!--
|
---|
790 | <gsf:metadata name="screenicon"/>
|
---|
791 | -->
|
---|
792 | </div>
|
---|
793 | <!--<xsl:if test="$imageHeight != -1">-->
|
---|
794 | <div id="wrap" style="display:none; width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
|
---|
795 | <div id="small" style="width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
|
---|
796 | <!--
|
---|
797 | <gsf:metadata name="screenicon"/>
|
---|
798 | -->
|
---|
799 | <img id="smallImage" style="width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
|
---|
800 | <xsl:attribute name="src"><xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<gsf:metadata name="assocfilepath" select="root"/>/<gsf:metadata name="Screen"/></xsl:attribute>
|
---|
801 | </img>
|
---|
802 | </div>
|
---|
803 | <div id="mover">
|
---|
804 | <div id="overlay">
|
---|
805 | <xsl:text> </xsl:text>
|
---|
806 | </div>
|
---|
807 | <div id="large" style="width: {$imageWidth}px; height: {$imageHeight}px;">
|
---|
808 | <img id="largeImage" style="width: {$imageWidth}px; height: {$imageHeight}px;">
|
---|
809 | <xsl:attribute name="src"><xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<gsf:metadata name="assocfilepath" select="root"/>/<gsf:metadata name="srclinkFile"/></xsl:attribute>
|
---|
810 | </img>
|
---|
811 | </div>
|
---|
812 | </div>
|
---|
813 | </div>
|
---|
814 |
|
---|
815 | <div>
|
---|
816 | <a style="text-decoration:underline;">
|
---|
817 | <xsl:attribute name="href">
|
---|
818 | <xsl:value-of select="$library_name"/>
|
---|
819 | <xsl:text>?downloadFile=</xsl:text>
|
---|
820 | <xsl:text>sites/localsite/collect/</xsl:text>
|
---|
821 | <xsl:value-of select="/page/pageResponse/collection/@name"/>
|
---|
822 | <xsl:text>/index/assoc/</xsl:text>
|
---|
823 | <gsf:metadata name="assocfilepath"/>
|
---|
824 | <xsl:text>/</xsl:text>
|
---|
825 | <gsf:metadata name="SourceFile"/>
|
---|
826 | </xsl:attribute>
|
---|
827 | <xsl:text>Download Image</xsl:text>
|
---|
828 | </a>
|
---|
829 | </div>
|
---|
830 |
|
---|
831 | <xsl:choose>
|
---|
832 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'p.oldUpload']/@value = 'true'">
|
---|
833 | <form action="dev?a=d&c={/page/pageResponse/collection/@name}&d={/page/pageResponse/document/documentNode/@nodeID}&dt=simple&ed=1" enctype="multipart/form-data" method="post">
|
---|
834 | <input name="fl" type="hidden">
|
---|
835 | <xsl:attribute name="value">
|
---|
836 | <xsl:text>/sites/localsite/collect/</xsl:text>
|
---|
837 | <xsl:value-of select="/page/pageResponse/collection/@name"/>
|
---|
838 | <xsl:text>/index/assoc/</xsl:text>
|
---|
839 | <gsf:metadata name="assocfilepath"/>
|
---|
840 | <xsl:text>/</xsl:text>
|
---|
841 | <gsf:metadata name="SourceFile"/>
|
---|
842 | <xsl:text>:</xsl:text>
|
---|
843 | <xsl:text>/sites/localsite/collect/</xsl:text>
|
---|
844 | <xsl:value-of select="/page/pageResponse/collection/@name"/>
|
---|
845 | <xsl:text>/index/assoc/</xsl:text>
|
---|
846 | <gsf:metadata name="assocfilepath"/>
|
---|
847 | <xsl:text>/</xsl:text>
|
---|
848 | <gsf:metadata name="Screen"/>
|
---|
849 | <xsl:text>:</xsl:text>
|
---|
850 | <xsl:text>/sites/localsite/collect/</xsl:text>
|
---|
851 | <xsl:value-of select="/page/pageResponse/collection/@name"/>
|
---|
852 | <xsl:text>/index/assoc/</xsl:text>
|
---|
853 | <gsf:metadata name="assocfilepath"/>
|
---|
854 | <xsl:text>/</xsl:text>
|
---|
855 | <gsf:metadata name="Thumb"/>
|
---|
856 | </xsl:attribute>
|
---|
857 | </input>
|
---|
858 |
|
---|
859 | <div>
|
---|
860 | Upload replacement file:<br/>
|
---|
861 | <input name="datafile" size="40" type="file"/><br/>
|
---|
862 | <input type="submit" value="Send"/>
|
---|
863 | </div>
|
---|
864 | </form>
|
---|
865 | </xsl:when>
|
---|
866 | <xsl:otherwise>
|
---|
867 | <script src="http://blueimp.github.com/JavaScript-Templates/tmpl.min.js"><xsl:text> </xsl:text></script>
|
---|
868 | <script src="http://blueimp.github.com/JavaScript-Load-Image/load-image.min.js"><xsl:text> </xsl:text></script>
|
---|
869 |
|
---|
870 | <script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.iframe-transport.js"><xsl:text> </xsl:text></script>
|
---|
871 | <script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.fileupload.js"><xsl:text> </xsl:text></script>
|
---|
872 | <script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.fileupload-ui.js"><xsl:text> </xsl:text></script>
|
---|
873 | <script src="sites/localsite/collect/peijones/js/jQuery-File-Upload/application.js"><xsl:text> </xsl:text></script>
|
---|
874 |
|
---|
875 | <script src="http://blueimp.github.com/cdn/js/bootstrap.min.js"><xsl:text> </xsl:text></script>
|
---|
876 | <script src="http://blueimp.github.com/Bootstrap-Image-Gallery/bootstrap-image-gallery.min.js"><xsl:text> </xsl:text></script>
|
---|
877 |
|
---|
878 | <link href="sites/localsite/collect/peijones/js/jQuery-File-Upload/jquery.fileupload-ui.css" rel="stylesheet"/>
|
---|
879 | <link href="http://blueimp.github.com/cdn/css/bootstrap.min.css" rel="stylesheet"/>
|
---|
880 | <link href="http://blueimp.github.com/cdn/css/bootstrap-responsive.min.css" rel="stylesheet"/>
|
---|
881 | <!--[if lt IE 7]><link rel="stylesheet" href="http://blueimp.github.com/cdn/css/bootstrap-ie6.min.css"><![endif]-->
|
---|
882 | <link href="http://blueimp.github.com/Bootstrap-Image-Gallery/bootstrap-image-gallery.min.css" rel="stylesheet"/>
|
---|
883 |
|
---|
884 | <script type="text/javascript">
|
---|
885 | <xsl:text disable-output-escaping="yes">
|
---|
886 | $(window).load(function()
|
---|
887 | {
|
---|
888 | $('#fileupload').fileupload();
|
---|
889 | $('#fileupload').bind('fileuploaddone', function (e, data)
|
---|
890 | {
|
---|
891 | var nzImg = document.getElementById("noZoomImage");
|
---|
892 | nzImg.setAttribute("src", nzImg.getAttribute("src") + "?" + (new Date()).getTime());
|
---|
893 |
|
---|
894 | var smallImg = document.getElementById("smallImage");
|
---|
895 | smallImg.setAttribute("src", smallImg.getAttribute("src") + "?" + (new Date()).getTime());
|
---|
896 |
|
---|
897 | var largeImg = document.getElementById("largeImage");
|
---|
898 | largeImg.setAttribute("src", largeImg.getAttribute("src") + "?" + (new Date()).getTime());
|
---|
899 |
|
---|
900 | readyImagesForZoom();
|
---|
901 | });
|
---|
902 | });
|
---|
903 | </xsl:text>
|
---|
904 | </script>
|
---|
905 |
|
---|
906 | <script id="template-upload" type="text/html">
|
---|
907 | <xsl:text disable-output-escaping="yes">
|
---|
908 | {% for (var i=0, files=o.files, l=files.length, file=files[0]; i<l; file=files[++i]) { %}
|
---|
909 | <tr class="template-upload fade">
|
---|
910 | <td class="preview"><span class="fade"></span></td>
|
---|
911 | <td class="name">{%=file.name%}</td>
|
---|
912 | <td class="size">{%=o.formatFileSize(file.size)%}</td>
|
---|
913 | {% if (file.error) { %}
|
---|
914 | <td class="error" colspan="2"><span class="label label-important">Error</span> {%=fileUploadErrors[file.error] || file.error%}</td>
|
---|
915 | {% } else if (o.files.valid && !i) { %}
|
---|
916 | <td>
|
---|
917 | <div class="progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>
|
---|
918 | </td>
|
---|
919 | <td class="start">{% if (!o.options.autoUpload) { %}
|
---|
920 | <button class="btn btn-primary">
|
---|
921 | <i class="icon-upload icon-white"></i> Start
|
---|
922 | </button>
|
---|
923 | {% } %}</td>
|
---|
924 | {% } else { %}
|
---|
925 | <td colspan="2"></td>
|
---|
926 | {% } %}
|
---|
927 | <td class="cancel">{% if (!i) { %}
|
---|
928 | <button class="btn btn-warning">
|
---|
929 | <i class="icon-ban-circle icon-white"></i> Cancel
|
---|
930 | </button>
|
---|
931 | {% } %}</td>
|
---|
932 | </tr>
|
---|
933 | {% } %}
|
---|
934 | </xsl:text>
|
---|
935 | </script>
|
---|
936 |
|
---|
937 | <script id="template-download" type="text/html">
|
---|
938 | <xsl:text disable-output-escaping="yes">
|
---|
939 | {% for (var i=0, files=o.files, l=files.length, file=files[0]; i<l; file=files[++i]) { %}
|
---|
940 | <tr class="template-download fade">
|
---|
941 | {% if (file.error) { %}
|
---|
942 | <td></td>
|
---|
943 | <td class="name">{%=file.name%}</td>
|
---|
944 | <td class="size">{%=o.formatFileSize(file.size)%}</td>
|
---|
945 | <td class="error" colspan="2"><span class="label label-important">Error</span> {%=fileUploadErrors[file.error] || file.error%}</td>
|
---|
946 | {% } else { %}
|
---|
947 | <td class="preview">{% if (file.thumbnail_url) { %}
|
---|
948 | <a href="{%=file.url%}" title="{%=file.name%}" rel="gallery"><img src="{%=file.thumbnail_url%}" style="height:100px;"/></a>
|
---|
949 | {% } %}</td>
|
---|
950 | <td class="name">
|
---|
951 | <a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}">{%=file.name%}</a>
|
---|
952 | </td>
|
---|
953 | <td class="size">{%=o.formatFileSize(file.size)%}</td>
|
---|
954 | <td colspan="2"></td>
|
---|
955 | {% } %}
|
---|
956 | </tr>
|
---|
957 | {% } %}
|
---|
958 | </xsl:text>
|
---|
959 | </script>
|
---|
960 |
|
---|
961 | <form action="dev" enctype="multipart/form-data" id="fileupload" method="POST">
|
---|
962 | <input name="ajaxUpload" type="hidden" value="true"/>
|
---|
963 | <input name="fl" type="hidden">
|
---|
964 | <xsl:attribute name="value">
|
---|
965 | <xsl:text>/sites/localsite/collect/</xsl:text>
|
---|
966 | <xsl:value-of select="/page/pageResponse/collection/@name"/>
|
---|
967 | <xsl:text>/index/assoc/</xsl:text>
|
---|
968 | <gsf:metadata name="assocfilepath"/>
|
---|
969 | <xsl:text>/</xsl:text>
|
---|
970 | <gsf:metadata name="SourceFile"/>
|
---|
971 | <xsl:text>:</xsl:text>
|
---|
972 | <xsl:text>/sites/localsite/collect/</xsl:text>
|
---|
973 | <xsl:value-of select="/page/pageResponse/collection/@name"/>
|
---|
974 | <xsl:text>/index/assoc/</xsl:text>
|
---|
975 | <gsf:metadata name="assocfilepath"/>
|
---|
976 | <xsl:text>/</xsl:text>
|
---|
977 | <gsf:metadata name="Screen"/>
|
---|
978 | <xsl:text>:</xsl:text>
|
---|
979 | <xsl:text>/sites/localsite/collect/</xsl:text>
|
---|
980 | <xsl:value-of select="/page/pageResponse/collection/@name"/>
|
---|
981 | <xsl:text>/index/assoc/</xsl:text>
|
---|
982 | <gsf:metadata name="assocfilepath"/>
|
---|
983 | <xsl:text>/</xsl:text>
|
---|
984 | <gsf:metadata name="Thumb"/>
|
---|
985 | </xsl:attribute>
|
---|
986 | </input>
|
---|
987 | <div class="row fileupload-buttonbar">
|
---|
988 | <div class="span6" style="margin-left:30px;">
|
---|
989 | <span class="btn btn-success fileinput-button">
|
---|
990 | <span><i class="icon-plus icon-white"><xsl:text> </xsl:text></i> Add files...</span>
|
---|
991 | <input multiple="" name="files[]" type="file"/>
|
---|
992 | </span>
|
---|
993 | <button class="btn btn-primary start" type="submit">
|
---|
994 | <i class="icon-upload icon-white"><xsl:text> </xsl:text></i> Start upload
|
---|
995 | </button>
|
---|
996 | <button class="btn btn-warning cancel" type="reset">
|
---|
997 | <i class="icon-ban-circle icon-white"><xsl:text> </xsl:text></i> Cancel upload
|
---|
998 | </button>
|
---|
999 | </div>
|
---|
1000 | <div class="span6">
|
---|
1001 | <div class="progress progress-success progress-striped active fade">
|
---|
1002 | <div class="bar" style="width:0%;"><xsl:text> </xsl:text></div>
|
---|
1003 | </div>
|
---|
1004 | </div>
|
---|
1005 | </div>
|
---|
1006 | <br/>
|
---|
1007 | <table class="table table-striped"><tbody class="files" data-target="#modal-gallery" data-toggle="modal-gallery"><xsl:text> </xsl:text></tbody></table>
|
---|
1008 | </form>
|
---|
1009 | </xsl:otherwise>
|
---|
1010 | </xsl:choose>
|
---|
1011 | <!--</xsl:if>-->
|
---|
1012 | </xsl:template>
|
---|
1013 | </format></display><replaceListRef id="gs2-standard"/><replaceListRef id="gs2-image"/><serviceRackList>
|
---|
1014 | <!-- comment out the following serviceRack if you want to disable OAI for this collection -->
|
---|
1015 | <serviceRack name="OAIPMH">
|
---|
1016 | <ListMetadataFormats>
|
---|
1017 | <!--What metadata sets to support is collection specific. To support other metadata schema, simply add a metadataFormat element here.
|
---|
1018 | The support of unqualified Dublin Core metadata set is mandatory in the oai specification.
|
---|
1019 | -->
|
---|
1020 | <metadataFormat metadataPrefix="oai_dc">
|
---|
1021 | <metadataPrefix>oai_dc</metadataPrefix>
|
---|
1022 | <schema>http://www.openarchives.org/OAI/2.0/oai_dc.xsd</schema>
|
---|
1023 | <metadataNamespace>http://www.openarchives.org/OAI/2.0/oai_dc/</metadataNamespace>
|
---|
1024 | <!--<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>
|
---|
1025 | -->
|
---|
1026 | <mappingList>
|
---|
1027 | <!--
|
---|
1028 | The mapping is in the form: <publicly supported metadata name>,<mapped metadata name>, short as <A>,<B>
|
---|
1029 | The first metadata name is medatory; if there is no mapped name followed, then the first name must be used by the records and
|
---|
1030 | searchable in the database, otherwise it is the mapped name stored in the database. The number of mapping elements matches the
|
---|
1031 | number of external metadata of the records. If only one name is present, the returned metadata will use this name plus the retrieved value;
|
---|
1032 | if both <A>,<B> are present, the returned metadata will use <A>'s name plus <B>'s value retrieved from database.
|
---|
1033 |
|
---|
1034 | **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.
|
---|
1035 |
|
---|
1036 | **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.
|
---|
1037 | -->
|
---|
1038 | <mapping>dc.Title,Title</mapping>
|
---|
1039 | <!-- 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. -->
|
---|
1040 | </mappingList>
|
---|
1041 | </metadataFormat>
|
---|
1042 | </ListMetadataFormats>
|
---|
1043 | </serviceRack>
|
---|
1044 | </serviceRackList></CollectionConfig>
|
---|