Changeset 4706
- Timestamp:
- 03/15/14 12:14:00 (11 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
r4705 r4706 132 132 }); 133 133 }, 134 putAnnotation: function(aid, annotation) { 135 return $.ajax({ 136 type: "PUT", 137 url: this.getBackend() + '/api/annotations/'+aid+'/body', 138 dataType: "xml", 139 data: annotation, 140 contentType: "application/xml", 141 error: function(jqXHR, status, thrownError) { 142 // Handle any errors 143 144 annotationProxy.log("+ + + + + + + + + + + + + + + + + + + + + + + +"); 145 annotationProxy.log("Faild to PUT updated annotation: " + aid); 146 annotationProxy.log("Status Code: " + jqXHR.status); 147 annotationProxy.log("Error : " + thrownError); 148 149 }, 150 complete: function(jqXHR, status, responseText) { 151 var response = jqXHR.responseText.match(/URI="(.+?)"/)[1].split('/'); 152 var aid = response[response.length - 1]; 153 154 annotationProxy.log("+ + + + + + + + + + + + + + + + + + + + + + + +"); 155 annotationProxy.log("Status Code PUT request: " + jqXHR.status); 156 annotationProxy.log("Response Body: " + jqXHR.responseText); 157 annotationProxy.log("+ + + + + + + + + + + + + + + + + + + + + + + +"); 158 159 } 160 }); 161 }, 134 162 setBackend: function(url) { 135 163 this.backend = url; -
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotations.wired.marker.js
r4705 r4706 68 68 this.log('postAnnotation : ' + annotation); 69 69 }, 70 updateAnnotation: function(annotation) { 71 this.log('updateAnnotation : ' + JSON.stringify(annotation)); 72 this.log('UPDATED ANNOTATION AS XML: '); 73 var xml = om_object2annotation(annotation); 70 updateAnnotation: function(om_object) { 71 var aid = this.getAidFromOid(om_object.oid); 72 this.log('updateAnnotation : ' + JSON.stringify(om_object)); 73 this.log('UPDATED ANNOTATION AS XML (aid: '+aid+')'); 74 var xml = om_object_annotation_body(om_object); 75 74 76 this.log(xml); 77 78 annotationFramework.putAnnotation(aid, xml); 75 79 }, 76 80 getAidFromOid: function(oid){ 77 var aid;78 81 var aSql = 'SELECT dasish_aid FROM om_object WHERE oid="' + oid + '"'; 79 82 var rtn = bitsObjectMng.Database.selectB("", aSql); // aMode = "" defaults to predefined value; aSql contains sql statement 80 83 81 aid = rtn[0].dasish_aid; 82 return aid; 84 return rtn[0].dasish_aid; 83 85 }, 84 86 log: function(message) {
Note: See TracChangeset
for help on using the changeset viewer.