Changeset 4357
- Timestamp:
- 01/27/14 19:20:38 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotation-service.js
r4330 r4357 52 52 }); 53 53 }, 54 postAnnotation: function(annotation) { 54 deleteAnnotationByOid: function(oid) { 55 var aid; 56 var aSql = 'select dasish_aid from om_object where oid="' + oid + '"'; 57 var rtn = bitsObjectMng.Database.selectB("", aSql); // aMode = "" defaults to predefined value; aSql contains sql statement 58 59 aid = rtn[0].dasish_aid; 60 61 if (aid) { // ajax request only for annotations posted to and available in backend database 62 return $.ajax({ 63 url: this.getBackend() + '/api/annotations/' + aid, 64 type: 'DELETE', 65 error: function(jqXHR, status, thrownError) { 66 // Handle any errors 67 if (typeof Firebug !== 'undefined' && Firebug.Console) { 68 Firebug.Console.log("+ + + + + + + + + + + + + + + + + + + + + + + +"); 69 Firebug.Console.log("Status Code (DELETE request): " + jqXHR.status); 70 Firebug.Console.log("Error DELETE request: " + thrownError); 71 } 72 }, 73 success: function(result) { 74 if (typeof Firebug !== 'undefined' && Firebug.Console) { 75 Firebug.Console.log("DELETE request was successful."); 76 Firebug.Console.log(result); 77 } 78 } 79 }); 80 } 81 }, 82 postAnnotation: function(annotation, oid) { 55 83 return $.ajax({ 56 84 type: "POST", … … 73 101 if (typeof Firebug !== 'undefined' && Firebug.Console) { 74 102 Firebug.Console.log("+ + + + + + + + + + + + + + + + + + + + + + + +"); 75 Firebug.Console.log("Status Code : " + jqXHR.status);103 Firebug.Console.log("Status Code POST request: " + jqXHR.status); 76 104 Firebug.Console.log("Response Body: " + jqXHR.responseText); 77 105 Firebug.Console.log("+ + + + + + + + + + + + + + + + + + + + + + + +"); 78 Firebug.Console.log("AID: " + aid);79 106 } 107 // Firebug.Console.log("OID: " + oid); 108 // Firebug.Console.log("AID: " + aid); 109 // Firebug.Console.log(bitsObjectMng.Database.getObject({oid: oid})); 110 111 var aSql = 'update om_object set dasish_aid = "' + aid + '" where oid="' + oid + '"'; 112 // insert request to local sqlite database where aid gets inserted 113 rtn = bitsObjectMng.Database.cmd("", aSql); // aMode = "" defaults to predefined value; aSql contains sql statement 114 115 // Database insert request is true if successful 116 // Firebug.Console.log(rtn); 117 80 118 } 81 119 });
Note: See TracChangeset
for help on using the changeset viewer.