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:choose-metadata>
|
---|
37 | <gsf:metadata name="dc.Title"/>
|
---|
38 | <gsf:metadata name="exp.Title"/>
|
---|
39 | <gsf:metadata name="Title"/>
|
---|
40 | <gsf:default>Untitled</gsf:default>
|
---|
41 | </gsf:choose-metadata>
|
---|
42 | <gsf:switch>
|
---|
43 | <gsf:metadata name="Source"/>
|
---|
44 | <gsf:when test="exists">
|
---|
45 | <br/>
|
---|
46 | <i>(<gsf:metadata name="Source"/>)</i>
|
---|
47 | </gsf:when>
|
---|
48 | </gsf:switch>
|
---|
49 | </td>
|
---|
50 | </gsf:template>
|
---|
51 | <gsf:template match="classifierNode">
|
---|
52 | <td valign="top">
|
---|
53 | <gsf:link type="classifier">
|
---|
54 | <gsf:icon type="classifier"/>
|
---|
55 | </gsf:link>
|
---|
56 | </td>
|
---|
57 | <td valign="top">
|
---|
58 | <gsf:metadata name="srclink"/>
|
---|
59 | <gsf:choose-metadata>
|
---|
60 | <gsf:metadata name="thumbicon"/>
|
---|
61 | <gsf:metadata name="srcicon"/>
|
---|
62 | </gsf:choose-metadata>
|
---|
63 | <gsf:metadata name="/srclink"/>
|
---|
64 | </td>
|
---|
65 | <td valign="top">
|
---|
66 | <gsf:choose-metadata>
|
---|
67 | <gsf:metadata name="dc.Title"/>
|
---|
68 | <gsf:metadata name="exp.Title"/>
|
---|
69 | <gsf:metadata name="Title"/>
|
---|
70 | <gsf:default>Untitled</gsf:default>
|
---|
71 | </gsf:choose-metadata>
|
---|
72 | <gsf:switch>
|
---|
73 | <gsf:metadata name="Source"/>
|
---|
74 | <gsf:when test="exists">
|
---|
75 | <br/>
|
---|
76 | <i>(<gsf:metadata name="Source"/>)</i>
|
---|
77 | </gsf:when>
|
---|
78 | </gsf:switch>
|
---|
79 | </td>
|
---|
80 | </gsf:template>
|
---|
81 | <gsf:template match="classifierNode" mode="horizontal">
|
---|
82 | <gsf:link type="horizontal">
|
---|
83 | <gsf:metadata name="Title"/>
|
---|
84 | </gsf:link>
|
---|
85 | </gsf:template>
|
---|
86 | </format></browse><display><format>
|
---|
87 | <gsf:option name="sideBar" value="false"/>
|
---|
88 | <xsl:template name="additionalHeaderContent">
|
---|
89 | <!-- jQuery must be included before Annotator -->
|
---|
90 | <script src="sites/localsite/collect/peijones/js/annotator/lib/vendor/jquery.js">
|
---|
91 | <xsl:text> </xsl:text>
|
---|
92 | </script>
|
---|
93 | <!-- If you're sure your users will only be using browsers modern
|
---|
94 | enough to have their own JSON.parse and JSON.stringify
|
---|
95 | implementations you can skip this -->
|
---|
96 | <script src="sites/localsite/collect/peijones/js/annotator/lib/vendor/json2.js">
|
---|
97 | <xsl:text> </xsl:text>
|
---|
98 | </script>
|
---|
99 | <script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator-full.min.js">
|
---|
100 | <xsl:text> </xsl:text>
|
---|
101 | </script>
|
---|
102 | <!-- The main Annotator script -->
|
---|
103 | <!--<script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.min.js"><xsl:text> </xsl:text></script> -->
|
---|
104 | <!-- Annotator's styling and images -->
|
---|
105 | <link href="sites/localsite/collect/peijones/js/annotator/pkg/annotator.min.css" rel="stylesheet" type="text/css"/>
|
---|
106 | <!-- The following plugins are entirely optional -->
|
---|
107 | <!-- The Store plugin. Saves annotations to a remote backend -->
|
---|
108 | <!-- <script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.store.min.js"><xsl:text> </xsl:text></script> -->
|
---|
109 | <!-- The Auth plugin. Allows users of Annotator to authenticate themselves
|
---|
110 | to the remote backend -->
|
---|
111 | <!--<script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.auth.min.js"><xsl:text> </xsl:text></script> -->
|
---|
112 | <!-- The Permissions plugin. See who created which annotation and create
|
---|
113 | annotations as a specified user -->
|
---|
114 | <!--<script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.permissions.min.js"><xsl:text> </xsl:text></script> -->
|
---|
115 | <!-- The Tags plugin. Edit and display tag keywords on annotations -->
|
---|
116 | <!--<script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.tags.min.js"><xsl:text> </xsl:text></script> -->
|
---|
117 | <!-- The Markdown plugin. Treat annotation text as Markdown -->
|
---|
118 | <!-- <script src="sites/localsite/collect/peijones/js/annotator/lib/vendor/showdown.js"><xsl:text> </xsl:text></script> -->
|
---|
119 | <!-- <script src="sites/localsite/collect/peijones/js/annotator/pkg/annotator.markdown.min.js"><xsl:text> </xsl:text></script> -->
|
---|
120 | <!-- Photo note scripts -->
|
---|
121 | <script src="sites/localsite/collect/peijones/js/documentmaker/BrowserDetect.js" type="text/javascript">
|
---|
122 | <xsl:text> </xsl:text>
|
---|
123 | </script>
|
---|
124 | <script src="sites/localsite/collect/peijones/js/documentmaker/PhotoNotes-1.5.js" type="text/javascript">
|
---|
125 | <xsl:text> </xsl:text>
|
---|
126 | </script>
|
---|
127 | <link href="sites/localsite/collect/peijones/style/PhotoNotes-1.5.css" rel="stylesheet" type="text/css"/>
|
---|
128 | <!-- Zoom scripts -->
|
---|
129 | <!--<script src="interfaces/{$interface_name}/js/jquery-1.4.2.js" type="text/javascript"><xsl:text> </xsl:text></script>-->
|
---|
130 | <script src="sites/localsite/collect/peijones/js/documentmaker/zoomer.jquery.js" type="text/javascript">
|
---|
131 | <xsl:text> </xsl:text>
|
---|
132 | </script>
|
---|
133 | <link href="sites/localsite/collect/peijones/style/style.css" rel="stylesheet" type="text/css"/>
|
---|
134 | <script type="text/javascript">
|
---|
135 | <xsl:text disable-output-escaping="yes">
|
---|
136 | _zoomEnabled = true;
|
---|
137 | function readyImagesForZoom()
|
---|
138 | {
|
---|
139 | var noZoom = document.getElementById("noZoom");
|
---|
140 | var wrap = document.getElementById("wrap");
|
---|
141 | if(!noZoom || !wrap)
|
---|
142 | {
|
---|
143 | return;
|
---|
144 | }
|
---|
145 | var smallImageDiv = document.getElementById("small");
|
---|
146 | var smallImage = smallImageDiv.getElementsByTagName("img")[0];
|
---|
147 | smallImageDiv.style.width = smallImageWidth + "px";
|
---|
148 | smallImageDiv.style.height = smallImageHeight + "px";
|
---|
149 | var multiplier = largeImageHeight / smallImageHeight;
|
---|
150 | $("#wrap").anythingZoomer({
|
---|
151 | expansionSize:50,
|
---|
152 | speedMultiplier:multiplier
|
---|
153 | });
|
---|
154 |
|
---|
155 | noZoom.onclick = function(){addZoom();}
|
---|
156 | document.getElementById("overlay").onclick = function(){removeZoom();}
|
---|
157 |
|
---|
158 | removeZoom();
|
---|
159 | }
|
---|
160 | function addZoom()
|
---|
161 | {
|
---|
162 | if(!_zoomEnabled)
|
---|
163 | {
|
---|
164 | return;
|
---|
165 | }
|
---|
166 |
|
---|
167 | var wrapper = document.getElementById("wrap");
|
---|
168 | var noZoom = document.getElementById("noZoom");
|
---|
169 |
|
---|
170 | if(!noZoom || !wrapper)
|
---|
171 | {
|
---|
172 | return;
|
---|
173 | }
|
---|
174 |
|
---|
175 | noZoom.style.display = "none";
|
---|
176 | wrapper.style.display = "block";
|
---|
177 | var option = document.getElementById("zoomOption");
|
---|
178 | if(option)
|
---|
179 | {
|
---|
180 | option.setAttribute("onclick", "removeZoom();");
|
---|
181 | }
|
---|
182 | }
|
---|
183 | function removeZoom()
|
---|
184 | {
|
---|
185 | if(!_zoomEnabled)
|
---|
186 | {
|
---|
187 | return;
|
---|
188 | }
|
---|
189 |
|
---|
190 | var wrapper = document.getElementById("wrap");
|
---|
191 | var noZoom = document.getElementById("noZoom");
|
---|
192 |
|
---|
193 | if(!noZoom || !wrapper)
|
---|
194 | {
|
---|
195 | return;
|
---|
196 | }
|
---|
197 |
|
---|
198 | wrapper.style.display = "none";
|
---|
199 | noZoom.style.display = "block";
|
---|
200 | var option = document.getElementById("zoomOption");
|
---|
201 | if(option)
|
---|
202 | {
|
---|
203 | option.setAttribute("onclick", "addZoom();");
|
---|
204 | }
|
---|
205 | }
|
---|
206 | </xsl:text>
|
---|
207 | </script>
|
---|
208 | <script text="text/javascript">
|
---|
209 | <xsl:text disable-output-escaping="yes">
|
---|
210 |
|
---|
211 | var _posCount = 0;
|
---|
212 | var _notes;
|
---|
213 | function initNotes()
|
---|
214 | {
|
---|
215 | /* create the Photo Note Container */
|
---|
216 | _notes = new PhotoNoteContainer(document.getElementById("noZoom"));
|
---|
217 | getNotes();
|
---|
218 | }
|
---|
219 |
|
---|
220 | function deleteFunction(note)
|
---|
221 | {
|
---|
222 | var status = true;
|
---|
223 |
|
---|
224 | if (note && note.id && note.id > 0) {
|
---|
225 | var metaposStr = note.id - 1;
|
---|
226 |
|
---|
227 | var jsonVal = '{"caption":"' + note.text + '", "area":{"x":' + note.rect.left + ', "y":' + note.rect.top + ', "width":' + note.rect.width + ', "height":' + note.rect.height + '}}';
|
---|
228 |
|
---|
229 | 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;
|
---|
230 | 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;
|
---|
231 | 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;
|
---|
232 |
|
---|
233 | var indexCallback =
|
---|
234 | {
|
---|
235 | success: function(response)
|
---|
236 | {
|
---|
237 | for(var i = 0; i < _notes.length; i++)
|
---|
238 | {
|
---|
239 | var currentNote = _notes[i];
|
---|
240 | if(currentNote.id > note.id)
|
---|
241 | {
|
---|
242 | currentNote.id--;
|
---|
243 | }
|
---|
244 | }
|
---|
245 | },
|
---|
246 | failed: function(){alert("Failed to delete index metadata of note with id: " + note.id);},
|
---|
247 | };
|
---|
248 |
|
---|
249 | var archiveCallback =
|
---|
250 | {
|
---|
251 | success: function(){buildFunction(gs.cgiParams.c);},
|
---|
252 | failed: function(){alert("Failed to delete archive metadata of note with id: " + note.id);}
|
---|
253 | }
|
---|
254 |
|
---|
255 | var importCallback =
|
---|
256 | {
|
---|
257 | success: function(){},
|
---|
258 | failed: function(){alert("Failed to delete import metadata of note with id: " + note.id);}
|
---|
259 | }
|
---|
260 |
|
---|
261 | YAHOO.util.Connect.asyncRequest("GET", removeFromIndexURL, indexCallback);
|
---|
262 | YAHOO.util.Connect.asyncRequest("GET", removeFromArchivesURL, archiveCallback);
|
---|
263 | YAHOO.util.Connect.asyncRequest("GET", removeFromImportURL, callback);
|
---|
264 | }
|
---|
265 | else {
|
---|
266 | alert("Failed to find valid note data to delete");
|
---|
267 | status = false;
|
---|
268 | }
|
---|
269 |
|
---|
270 | return status;
|
---|
271 | }
|
---|
272 |
|
---|
273 | function saveFunction(note)
|
---|
274 | {
|
---|
275 | var saveIndexCallback =
|
---|
276 | {
|
---|
277 | success: function(response){},
|
---|
278 | failed: function(reponse){ alert("Failed to save index metadata of note with id: " + note.id)},
|
---|
279 | };
|
---|
280 |
|
---|
281 | var saveArchivesCallback =
|
---|
282 | {
|
---|
283 | success: function(response){buildFunction(gs.cgiParams.c);},
|
---|
284 | failed: function(response){ alert("Failed in save import metadata of note with id: " + note.id) }
|
---|
285 | };
|
---|
286 |
|
---|
287 | var saveImportCallback =
|
---|
288 | {
|
---|
289 | success: function(response){},
|
---|
290 | failed: function(response){ alert("Failed in save import metadata of note with id: " + note.id) }
|
---|
291 | };
|
---|
292 |
|
---|
293 | var jsonVal = '{"caption":"' + note.text + '", "area":{"x":' + note.rect.left + ', "y":' + note.rect.top + ', "width":' + note.rect.width + ', "height":' + note.rect.height + '}}';
|
---|
294 | var metaposStr = (note && note.id && note.id > 0) ? note.id - 1 : _posCount;
|
---|
295 |
|
---|
296 | 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;
|
---|
297 | 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;
|
---|
298 | 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;
|
---|
299 | YAHOO.util.Connect.asyncRequest("GET", saveIndexURL, saveIndexCallback);
|
---|
300 | YAHOO.util.Connect.asyncRequest("GET", saveArchivesURL, saveArchivesCallback);
|
---|
301 | YAHOO.util.Connect.asyncRequest("GET", saveImportURL, saveImportCallback);
|
---|
302 |
|
---|
303 | return 1;
|
---|
304 | }
|
---|
305 |
|
---|
306 | function getNotes()
|
---|
307 | {
|
---|
308 | if(gs.variables.photoNotes == null || gs.variables.photoNotes == undefined)
|
---|
309 | {
|
---|
310 | console.log("No photo notes");
|
---|
311 | return;
|
---|
312 | }
|
---|
313 |
|
---|
314 | for(var i = 0; i < gs.variables.photoNotes.length; i++)
|
---|
315 | {
|
---|
316 | var note = gs.variables.photoNotes[i];
|
---|
317 | if(!note)
|
---|
318 | {
|
---|
319 | continue;
|
---|
320 | }
|
---|
321 | var newNote = new PhotoNote(note.caption, i+1, new PhotoNoteRect(note.area.x,note.area.y,note.area.width,note.area.height));
|
---|
322 | newNote.onsave = saveFunction;
|
---|
323 | newNote.ondelete = deleteFunction;
|
---|
324 | _notes.AddNote(newNote);
|
---|
325 | _posCount++;
|
---|
326 | }
|
---|
327 |
|
---|
328 | addNoteOverAndOutHandlers();
|
---|
329 | }
|
---|
330 |
|
---|
331 | function AddNote()
|
---|
332 | {
|
---|
333 | var newNote = new PhotoNote('Add note text here...',_posCount+1,new PhotoNoteRect(10,10,50,50));
|
---|
334 | newNote.onsave = saveFunction;
|
---|
335 | newNote.ondelete = deleteFunction;
|
---|
336 | _notes.AddNote(newNote);
|
---|
337 | _posCount++;
|
---|
338 |
|
---|
339 | addNoteOverAndOutHandlers();
|
---|
340 | newNote.Select();
|
---|
341 | }
|
---|
342 |
|
---|
343 | function addNoteOverAndOutHandlers()
|
---|
344 | {
|
---|
345 | var divs = document.getElementsByTagName("DIV");
|
---|
346 | for(var i = 0; i < divs.length; i++)
|
---|
347 | {
|
---|
348 | if(divs[i].getAttribute("class") && divs[i].getAttribute("class").search("fn-area") != -1)
|
---|
349 | {
|
---|
350 | divs[i].onmouseover = function(){_zoomEnabled = false;}
|
---|
351 | divs[i].onmouseout = function(){_zoomEnabled = true;}
|
---|
352 | }
|
---|
353 | }
|
---|
354 | }
|
---|
355 |
|
---|
356 | window.onload = function(){initNotes(); readyImagesForZoom(); initAnnotator();};
|
---|
357 | </xsl:text>
|
---|
358 | </script>
|
---|
359 | <script text="text/javascript">
|
---|
360 | <xsl:text disable-output-escaping="yes">
|
---|
361 |
|
---|
362 | function checkLoop(pid, serverFunction, callback)
|
---|
363 | {
|
---|
364 | var startLoop = function()
|
---|
365 | {
|
---|
366 | var loopCallback =
|
---|
367 | {
|
---|
368 | success:function(response)
|
---|
369 | {
|
---|
370 | var checkText = response.responseText;
|
---|
371 | if(checkText == null || checkText == "")
|
---|
372 | {
|
---|
373 | console.log("There was an error getting the XML to check the status of " + serverFunction);
|
---|
374 | }
|
---|
375 | else
|
---|
376 | {
|
---|
377 | var checkCodeStart = checkText.indexOf("code=\"") + 6;
|
---|
378 | var checkCodeEnd = checkText.indexOf("\"", checkCodeStart);
|
---|
379 | var code = checkText.substring(checkCodeStart, checkCodeEnd);
|
---|
380 |
|
---|
381 | if(code == 11 || code == 1) //11 is COMPLETED, 1 is success
|
---|
382 | {
|
---|
383 | callback();
|
---|
384 | }
|
---|
385 | else if(code == 12 || code == 3) //12 is HALTED, 3 is ERROR
|
---|
386 | {
|
---|
387 | console.log("There was an error on the server, could not check status of " + serverFunction);
|
---|
388 | }
|
---|
389 | else
|
---|
390 | {
|
---|
391 | setTimeout(startLoop, 1000);
|
---|
392 | }
|
---|
393 | }
|
---|
394 | },
|
---|
395 | failed:function()
|
---|
396 | {
|
---|
397 | console.log("There was a problem checking the status of " + serverFunction)
|
---|
398 | }
|
---|
399 | }
|
---|
400 | YAHOO.util.Connect.asyncRequest("GET", gs.xsltParams.library_name + "?a=g&rt=s&ro=1&s=" + serverFunction + "&s1.pid=" + pid, loopCallback);
|
---|
401 | }
|
---|
402 | startLoop();
|
---|
403 | }
|
---|
404 |
|
---|
405 | function buildFunction(collection)
|
---|
406 | {
|
---|
407 | var buildCallback =
|
---|
408 | {
|
---|
409 | success:function(response)
|
---|
410 | {
|
---|
411 | var buildText = response.responseText;
|
---|
412 | if(buildText == null || buildText == "")
|
---|
413 | {
|
---|
414 | console.log("There was an error getting the xml response from the building request");
|
---|
415 | }
|
---|
416 | else
|
---|
417 | {
|
---|
418 | var buildPIDStart = buildText.indexOf("pid=\"") + 5;
|
---|
419 | var buildPIDEnd = buildText.indexOf("\"", buildPIDStart);
|
---|
420 | var buildPID = buildText.substring(buildPIDStart, buildPIDEnd);
|
---|
421 |
|
---|
422 | checkLoop(buildPID, "BuildCollection", function()
|
---|
423 | {
|
---|
424 | var activateCallback =
|
---|
425 | {
|
---|
426 | success: function(response)
|
---|
427 | {
|
---|
428 | var activateText = response.responseText;
|
---|
429 | if(activateText == null || activateText == "")
|
---|
430 | {
|
---|
431 | console.log("There was an error getting the xml response from the activating request");
|
---|
432 | }
|
---|
433 | else
|
---|
434 | {
|
---|
435 | var activatePIDStart = activateText.indexOf("pid=\"") + 5;
|
---|
436 | var activatePIDEnd = activateText.indexOf("\"", activatePIDStart);
|
---|
437 | var activatePID = activateText.substring(activatePIDStart, activatePIDEnd);
|
---|
438 |
|
---|
439 | checkLoop(activatePID, "ActivateCollection", function()
|
---|
440 | {
|
---|
441 | var updateCallback =
|
---|
442 | {
|
---|
443 | success: function(response){},
|
---|
444 | failed: function(reponse){ alert("Failed in saveFunction() to re-read config files");}
|
---|
445 | };
|
---|
446 | YAHOO.util.Connect.asyncRequest("GET", gs.xsltParams.library_name + "?a=s&sa=c", updateCallback);
|
---|
447 | });
|
---|
448 | }
|
---|
449 | },
|
---|
450 | failed: function(response)
|
---|
451 | {
|
---|
452 | console.log("Failed to get response from activate collection request");
|
---|
453 | }
|
---|
454 | }
|
---|
455 | YAHOO.util.Connect.asyncRequest("GET", gs.xsltParams.library_name + "?a=g&rt=r&ro=1&s=ActivateCollection&s1.collection=" + collection, activateCallback);
|
---|
456 | });
|
---|
457 | }
|
---|
458 | },
|
---|
459 | failed: function(){console.log("Failed to get build collection response")}
|
---|
460 | }
|
---|
461 |
|
---|
462 | YAHOO.util.Connect.asyncRequest("GET", gs.xsltParams.library_name + "?a=g&rt=r&ro=1&s=BuildCollection&s1.collection=" + collection, buildCallback);
|
---|
463 | }
|
---|
464 |
|
---|
465 | function saveAndBuildCollection(col)
|
---|
466 | {
|
---|
467 | var json = "[";
|
---|
468 | for(var i = 0; i < gs.annotationArray.keys.length; i++)
|
---|
469 | {
|
---|
470 | var current = gs.annotationArray[gs.annotationArray.keys[i]];
|
---|
471 | var metaToAdd = ["user", "text", "tags"];
|
---|
472 |
|
---|
473 | for(var j = 0; j < metaToAdd.length; j++)
|
---|
474 | {
|
---|
475 | if(metaToAdd[j] == "user")
|
---|
476 | {
|
---|
477 | json += '{"docid":"' + gs.cgiParams.d + '", "metaname":"gstext.' + metaToAdd[j] + '", "metavalue":"' + current.user.name + '"}';
|
---|
478 | }
|
---|
479 | else
|
---|
480 | {
|
---|
481 | json += '{"docid":"' + gs.cgiParams.d + '", "metaname":"gstext.' + metaToAdd[j] + '", "metavalue":"' + current[metaToAdd[j]] + '"}';
|
---|
482 | }
|
---|
483 |
|
---|
484 | if(j != (metaToAdd.length - 1) || i != (gs.annotationArray.keys.length - 1))
|
---|
485 | {
|
---|
486 | json += ',';
|
---|
487 | }
|
---|
488 | }
|
---|
489 | }
|
---|
490 | json += "]";
|
---|
491 |
|
---|
492 | var saveArchivesURL = "cgi-bin/metadata-server.pl?a=set-archives-metadata-array&c=" + gs.cgiParams.c + "&site=localsite&collect=" + gs.cgiParams.c + "&json=" + json;
|
---|
493 | var saveIndexURL = "cgi-bin/metadata-server.pl?a=set-metadata-array&c=" + gs.cgiParams.c + "&site=localsite&collect=" + gs.cgiParams.c + "&json=" + json;
|
---|
494 | var saveImportURL = "cgi-bin/metadata-server.pl?a=set-import-metadata-array&c=" + gs.cgiParams.c + "&site=localsite&collect=" + gs.cgiParams.c + "&json=" + json; //FIX THIS
|
---|
495 |
|
---|
496 | var saveArchivesCallback =
|
---|
497 | {
|
---|
498 | success:function(){console.log("Away to build"); buildFunction(gs.cgiParams.c);},
|
---|
499 | failed: function(){alert("Failed to save text annotations index metadata");}
|
---|
500 | }
|
---|
501 | YAHOO.util.Connect.asyncRequest("GET", saveArchivesURL, saveArchivesCallback);
|
---|
502 |
|
---|
503 | var saveIndexCallback =
|
---|
504 | {
|
---|
505 | success:function(){},
|
---|
506 | failed: function(){alert("Failed to save text annotations import metadata");}
|
---|
507 | }
|
---|
508 | YAHOO.util.Connect.asyncRequest("GET", saveIndexURL, saveIndexCallback);
|
---|
509 |
|
---|
510 | var saveImportCallback =
|
---|
511 | {
|
---|
512 | success:function(){},
|
---|
513 | failed: function(){alert("Failed to save text annotations import metadata");}
|
---|
514 | }
|
---|
515 | YAHOO.util.Connect.asyncRequest("GET", saveImportURL, saveImportCallback);
|
---|
516 | }
|
---|
517 |
|
---|
518 | function initAnnotator()
|
---|
519 | {
|
---|
520 | gs.annotationArray = new Array();
|
---|
521 | gs.annotationArray.keys = new Array();
|
---|
522 |
|
---|
523 | var elem = document.getElementById("gs-document-text");
|
---|
524 | elem.innerHTML = '<button id="saveButton">Save annotations</button><br/>' + elem.innerHTML;
|
---|
525 |
|
---|
526 | var button = document.getElementById("saveButton");
|
---|
527 | button.onclick = function(){saveAndBuildCollection(gs.cgiParams.c);};
|
---|
528 |
|
---|
529 | jQuery(function ($) {
|
---|
530 | if (typeof $.fn.annotator !== 'function') {
|
---|
531 | 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`.");
|
---|
532 | } else {
|
---|
533 | /*
|
---|
534 | jQuery('#gs-document-text').annotator()
|
---|
535 | .annotator('addPlugin', 'Store', {
|
---|
536 | prefix: 'http://annotateit.org/api',
|
---|
537 | annotationData: {'uri':document.URL}
|
---|
538 | })
|
---|
539 | .annotator('addPlugin', 'Auth', {
|
---|
540 | userId: 'papitha', // Your AnnotateIt username
|
---|
541 | consumerKey: '39fc339cf058bd22176771b3e33c5dac', // Your Account Key
|
---|
542 | authToken: '852b7fc25396d2aedf9aeb44dd58518faa679dbf027892164bfb81900bd09741' // Your Auth Token
|
---|
543 | });
|
---|
544 | */
|
---|
545 |
|
---|
546 | jQuery(function ($) {
|
---|
547 | // Include AnnotateIt credentials to load the store plugin.
|
---|
548 | $('#gs-document-text').annotator().annotator('setupPlugins', {
|
---|
549 | userId: 'papitha',
|
---|
550 | userName: 'Papitha',
|
---|
551 | accountId: '39fc339cf058bd22176771b3e33c5dac',
|
---|
552 | authToken: '852b7fc25396d2aedf9aeb44dd58518faa679dbf027892164bfb81900bd09741',
|
---|
553 | }, {
|
---|
554 | Store:
|
---|
555 | {
|
---|
556 | prefix: 'http://localhost:5000',
|
---|
557 | annotationData: {'uri':gs.cgiParams.c + "-" + gs.cgiParams.d},
|
---|
558 | loadFromSearch: {'uri':gs.cgiParams.c + "-" + gs.cgiParams.d}
|
---|
559 | }
|
---|
560 | });
|
---|
561 | });
|
---|
562 | }
|
---|
563 | });
|
---|
564 | }
|
---|
565 | </xsl:text>
|
---|
566 | </script>
|
---|
567 | </xsl:template>
|
---|
568 | <xsl:template name="documentImage">
|
---|
569 | <!-- Get the photo notes for this document node -->
|
---|
570 | <gsf:variable-struct name="photoNotes">
|
---|
571 | <gsf:metadata multiple="true" name="gsimg.photoNote" separator=", "/>
|
---|
572 | </gsf:variable-struct>
|
---|
573 | <!-- Get details about the image for zooming -->
|
---|
574 | <h3>
|
---|
575 | <gsf:choose-metadata>
|
---|
576 | <gsf:metadata name="dc.Title"/>
|
---|
577 | <gsf:metadata name="ex.Title"/>
|
---|
578 | </gsf:choose-metadata>
|
---|
579 | </h3>
|
---|
580 | <xsl:variable name="imageWidth">
|
---|
581 | <gsf:choose-metadata>
|
---|
582 | <gsf:metadata name="ImageWidth"/>
|
---|
583 | <gsf:default>-1</gsf:default>
|
---|
584 | </gsf:choose-metadata>
|
---|
585 | </xsl:variable>
|
---|
586 | <xsl:variable name="imageHeight">
|
---|
587 | <gsf:choose-metadata>
|
---|
588 | <gsf:metadata name="ImageHeight"/>
|
---|
589 | <gsf:default>-1</gsf:default>
|
---|
590 | </gsf:choose-metadata>
|
---|
591 | </xsl:variable>
|
---|
592 | <xsl:variable name="screenImageWidth">
|
---|
593 | <gsf:choose-metadata>
|
---|
594 | <gsf:metadata name="ScreenWidth"/>
|
---|
595 | <gsf:default>-1</gsf:default>
|
---|
596 | </gsf:choose-metadata>
|
---|
597 | </xsl:variable>
|
---|
598 | <xsl:variable name="screenImageHeight">
|
---|
599 | <gsf:choose-metadata>
|
---|
600 | <gsf:metadata name="ScreenHeight"/>
|
---|
601 | <gsf:default>-1</gsf:default>
|
---|
602 | </gsf:choose-metadata>
|
---|
603 | </xsl:variable>
|
---|
604 | <script type="text/javascript">
|
---|
605 | <xsl:text>largeImageHeight =</xsl:text>
|
---|
606 | <xsl:value-of select="$imageHeight"/>
|
---|
607 | <xsl:text>;</xsl:text>
|
---|
608 | <xsl:text>largeImageWidth =</xsl:text>
|
---|
609 | <xsl:value-of select="$imageWidth"/>
|
---|
610 | <xsl:text>;</xsl:text>
|
---|
611 | <xsl:text>smallImageHeight =</xsl:text>
|
---|
612 | <xsl:value-of select="$screenImageHeight"/>
|
---|
613 | <xsl:text>;</xsl:text>
|
---|
614 | <xsl:text>smallImageWidth =</xsl:text>
|
---|
615 | <xsl:value-of select="$screenImageWidth"/>
|
---|
616 | <xsl:text>;</xsl:text>
|
---|
617 | </script>
|
---|
618 | <div id="noZoom" style="display:block;">
|
---|
619 | <img style="width: {$screenImageWidth}; height: {$screenImageHeight};">
|
---|
620 | <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>
|
---|
621 | </img>
|
---|
622 | <!--
|
---|
623 | <gsf:metadata name="screenicon"/>
|
---|
624 | -->
|
---|
625 | </div>
|
---|
626 | <!--<xsl:if test="$imageHeight != -1">-->
|
---|
627 | <div id="wrap" style="display:none; width: {$screenImageWidth}; height: {$screenImageHeight};">
|
---|
628 | <div id="small" style="width: {$screenImageWidth}; height: {$screenImageHeight};">
|
---|
629 | <!--
|
---|
630 | <gsf:metadata name="screenicon"/>
|
---|
631 | -->
|
---|
632 | <img style="width: {$screenImageWidth}; height: {$screenImageHeight};">
|
---|
633 | <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>
|
---|
634 | </img>
|
---|
635 | </div>
|
---|
636 | <div id="mover">
|
---|
637 | <div id="overlay">
|
---|
638 | <xsl:text> </xsl:text>
|
---|
639 | </div>
|
---|
640 | <div id="large">
|
---|
641 | <img style="width: {$imageWidth}; height: {$imageHeight};">
|
---|
642 | <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>
|
---|
643 | </img>
|
---|
644 | </div>
|
---|
645 | </div>
|
---|
646 | </div>
|
---|
647 | <input onclick="AddNote();" style="margin-left:30px;" type="button" value="Tag Photo!"/>
|
---|
648 | <!--</xsl:if>-->
|
---|
649 | </xsl:template>
|
---|
650 | </format></display><replaceListRef id="gs2-standard"/><replaceListRef id="gs2-image"/><serviceRackList>
|
---|
651 | <!-- comment out the following serviceRack if you want to disable OAI for this collection -->
|
---|
652 | <serviceRack name="OAIPMH">
|
---|
653 | <ListMetadataFormats>
|
---|
654 | <!--What metadata sets to support is collection specific. To support other metadata schema, simply add a metadataFormat element here.
|
---|
655 | The support of unqualified Dublin Core metadata set is mandatory in the oai specification.
|
---|
656 | -->
|
---|
657 | <metadataFormat metadataPrefix="oai_dc">
|
---|
658 | <metadataPrefix>oai_dc</metadataPrefix>
|
---|
659 | <schema>http://www.openarchives.org/OAI/2.0/oai_dc.xsd</schema>
|
---|
660 | <metadataNamespace>http://www.openarchives.org/OAI/2.0/oai_dc/</metadataNamespace>
|
---|
661 | <!--<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>
|
---|
662 | -->
|
---|
663 | <mappingList>
|
---|
664 | <!--
|
---|
665 | The mapping is in the form: <publicly supported metadata name>,<mapped metadata name>, short as <A>,<B>
|
---|
666 | The first metadata name is medatory; if there is no mapped name followed, then the first name must be used by the records and
|
---|
667 | searchable in the database, otherwise it is the mapped name stored in the database. The number of mapping elements matches the
|
---|
668 | number of external metadata of the records. If only one name is present, the returned metadata will use this name plus the retrieved value;
|
---|
669 | if both <A>,<B> are present, the returned metadata will use <A>'s name plus <B>'s value retrieved from database.
|
---|
670 |
|
---|
671 | **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.
|
---|
672 |
|
---|
673 | **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.
|
---|
674 | -->
|
---|
675 | <mapping>dc.Title,Title</mapping>
|
---|
676 | <!-- 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. -->
|
---|
677 | </mappingList>
|
---|
678 | </metadataFormat>
|
---|
679 | </ListMetadataFormats>
|
---|
680 | </serviceRack>
|
---|
681 | </serviceRackList></CollectionConfig>
|
---|