Changeset 4667
- Timestamp:
- 03/11/14 15:31:21 (10 years ago)
- Location:
- DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotation-service.js
r4547 r4667 29 29 beforeSend: function(xhr){xhr.setRequestHeader('Content-Type', 'application/xml');}, 30 30 success: function(xml, textStatus, jqXHR) { 31 32 33 31 var annotations = Array(); 34 32 … … 40 38 annotationProxy.log(this.getAttribute('ref')); 41 39 42 43 40 annotations.push(this.getAttribute('ref')); 44 41 }); 45 42 46 47 43 callback.call(undefined, annotations); 48 44 }, 49 45 error: function(result){ 50 46 annotationProxy.log('ERROR calling the annotation backend '+result); 51 Firebug.Console.log(result);52 47 } 53 48 }); … … 74 69 }, 75 70 deleteAnnotationByOid: function(oid) { 76 Firebug.Console.log('entering DELETE for oid: '+oid);71 annotationProxy.log('entering DELETE for oid: '+oid); 77 72 var aid; 78 73 var aSql = 'select dasish_aid from om_object where oid="' + oid + '"'; … … 87 82 error: function(jqXHR, status, thrownError) { 88 83 // Handle any errors 89 if (typeof Firebug !== 'undefined' && Firebug.Console) { 90 Firebug.Console.log("+ + + + + + + + + + + + + + + + + + + + + + + +"); 91 Firebug.Console.log("Status Code (DELETE request): " + jqXHR.status); 92 Firebug.Console.log("Error DELETE request: " + thrownError); 93 } 84 85 annotationProxy.log("+ + + + + + + + + + + + + + + + + + + + + + + +"); 86 annotationProxy.log("Status Code (DELETE request): " + jqXHR.status); 87 annotationProxy.log("Error DELETE request: " + thrownError); 94 88 }, 95 89 success: function(result) { 96 if (typeof Firebug !== 'undefined' && Firebug.Console) { 97 Firebug.Console.log("DELETE request was successful."); 98 Firebug.Console.log(result); 99 } 90 91 annotationProxy.log("DELETE request was successful."); 92 annotationProxy.log(result); 100 93 } 101 94 }); … … 135 128 // insert request to local sqlite database where aid gets inserted 136 129 var rtn = bitsObjectMng.Database.cmd("", aSql); // aMode = "" defaults to predefined value; aSql contains sql statement 137 Firebug.Console.log('UPDATE of AID done');138 Firebug.Console.log(rtn);130 annotationProxy.log('UPDATE of AID done'); 131 annotationProxy.log(rtn); 139 132 // Database insert request is true if successful 140 133 // Firebug.Console.log(rtn); -
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/conversion.utils.js
r4555 r4667 1 1 /*** 2 * 2 * Convert an DWAN XML annotation to a WiredMarker annotation object 3 3 * @param {object} annotation annotation object from webservice 4 4 * @returns {annotationToOmObject.om_object} an object for Wired Marker … … 39 39 om_object.dasish_aid = URI.split('/annotations/')[1]; 40 40 41 //get xpointer from url 41 42 var urlParts = link.split("#xpointer"); 42 43 … … 85 86 86 87 /** 87 * converts wired marker annotations to dassish annotations88 * Converts WiredMarker annotation object to DWAN XML annotation 88 89 * @param {object} om_object contains wired marker object for annotation 89 90 * @returns {String} annotation in xml … … 113 114 path.endType = RegExp.$3; 114 115 115 var xpointer = ''; 116 117 xpointer += "#xpointer(start-point(string-range(" + path.start + "/text()[1],''," + path.startOffset + "))"; 118 xpointer += "/range-to(string-range(" + path.end + "/text()[1],''," + path.endOffset + ")))"; 116 var xpointer = "#xpointer(start-point(string-range(" + path.start + "/text()[1],''," + path.startOffset + "))"; 117 xpointer += "/range-to(string-range(" + path.end + "/text()[1],''," + path.endOffset + ")))"; 119 118 120 119 var annotation = '<?xml version="1.0" encoding="UTF-8"?>\n\ … … 173 172 }; 174 173 } 175 176 /*177 From SQL-lite for wired-marker178 <PROPERTY>179 <HYPER_ANCHOR>http://localhost/annotation/test/test-service.html#hyperanchor1.3%3A%2Fhtml%5B1%5D%2Fbody%5B1%5D%2Fdiv%5B2%5D%2Fp%5B1%5D(0)(3)(Ane)%26%2Fhtml%5B1%5D%2Fbody%5B1%5D%2Fdiv%5B2%5D%2Fp%5B1%5D(45)(3)(ter)%26background-color%3A%20rgb(%2044%2C%20254%2C%20%2081)%3Bcolor%3Argb(0%2C0%2C0)%3B</HYPER_ANCHOR>180 <NOTE>text om en fï¿œrfattare</NOTE>181 </PROPERTY>182 unescaped: http://localhost/annotation/test/test-service.html#hyperanchor1.3:/html[1]/body[1]/div[2]/p[1](0)(3)(Ane)&/html[1]/body[1]/div[2]/p[1](45)(3)(ter)&background-color: rgb( 44, 254, 81);color:rgb(0,0,0);text om en fï¿œrfattare183 */
Note: See TracChangeset
for help on using the changeset viewer.