- Timestamp:
- 03/15/14 13:36:52 (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
r4706 r4707 56 56 success: function(xml, textStatus, jqXHR) { 57 57 $xml = $.parseXML(jqXHR.responseText); 58 annotationProxy.log('GOT annotation in getAnnotation ');59 annotationProxy.log( $xml);58 annotationProxy.log('GOT annotation in getAnnotation :'+xml); 59 annotationProxy.log(xml); 60 60 var om_object = annotation2om_object($xml); 61 61 annotationProxy.log('converted to om_object'); 62 annotationProxy.log(om_object); 62 63 callback.call(undefined, om_object); 63 64 }, … … 70 71 deleteAnnotationByOid: function(oid) { 71 72 annotationProxy.log('entering DELETE for oid: '+oid); 72 var aid; 73 var aSql = 'select dasish_aid from om_object where oid="' + oid + '"'; 74 var rtn = bitsObjectMng.Database.selectB("", aSql); // aMode = "" defaults to predefined value; aSql contains sql statement 73 var aid = annotationProxy.getAidFromOid(oid); 75 74 76 aid = rtn[0].dasish_aid;77 75 annotationProxy.log('Resolved the AID for oid: '+oid+' for aid: '+aid); 78 76 if (aid) { // ajax request only for annotations posted to and available in backend database … … 121 119 // Firebug.Console.log(bitsObjectMng.Database.getObject({oid: oid})); 122 120 123 var aSql = ' update om_object set dasish_aid = "' + aid + '" whereoid="' + oid + '"';121 var aSql = 'UPDATE om_object SET dasish_aid = "' + aid + '" WHERE oid="' + oid + '"'; 124 122 annotationProxy.log(aSql); 125 123 // insert request to local sqlite database where aid gets inserted 126 var rtn = bitsObjectMng.Database.cmd( "", aSql); // aMode = "" defaults to predefined value; aSql contains sql statement124 var rtn = bitsObjectMng.Database.cmd('', aSql); // aMode = "" defaults to predefined value; aSql contains sql statement 127 125 annotationProxy.log('UPDATE of AID done'); 128 126 annotationProxy.log(rtn); -
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotations.wired.marker.js
r4706 r4707 7 7 getLoggedInInfo: function(){ 8 8 var user_placeholder = { 9 URI : 'https://lux17.mpi.nl/ds/webannotator/api/users/00000000-0000-0000-0000-0000000009999',9 URI : 'https://lux17.mpi.nl/ds/webannotator/api/users/00000000-0000-0000-0000-0000000009999', 10 10 uid : '00000000-0000-0000-0000-0000000009999', 11 dislayName : 'Test Testsson',12 eMail : 'test@test.com'11 dislayName : 'Test Testsson', 12 eMail : 'test@test.com' 13 13 }; 14 14 … … 25 25 $.each(annotations, function(index, annotationURL){ 26 26 annotationFramework.getAnnotation(annotationURL, function(result){ 27 annotationProxy.log(' got Annotation');27 annotationProxy.log('checking if annotation exist in DB:'); 28 28 annotationProxy.log(result); 29 30 if(bitsObjectMng.Database._dasish_aid_exists('_uncategorized', result.dasish_aid, true)){ 31 annotationProxy.log('AID already in database : ' + result.dasish_aid); 32 }else{ 33 bitsObjectMng.Database.addObject(result, 'dasish.remote', undefined); 34 } 35 29 if(bitsObjectMng.Database._dasish_aid_exists('', result.dasish_aid, true)){ 30 annotationProxy.log('AID already in database : ' + result.dasish_aid); 31 }else{ 32 annotationProxy.log('Adding annotation to database : ' + result.dasish_aid); 33 bitsObjectMng.Database.addObject(result, '', undefined); 34 } 36 35 }); 37 36 }); … … 66 65 var annotation = om_object2annotation(om_object); 67 66 annotationFramework.postAnnotation(annotation, om_object.oid); 68 this.log('postAnnotation : ' + annotation);69 67 }, 70 68 updateAnnotation: function(om_object) { … … 80 78 getAidFromOid: function(oid){ 81 79 var aSql = 'SELECT dasish_aid FROM om_object WHERE oid="' + oid + '"'; 82 var rtn = bitsObjectMng.Database.selectB( "", aSql); // aMode = "" defaults to predefined value; aSql contains sql statement80 var rtn = bitsObjectMng.Database.selectB('_uncategorized', aSql); // aMode = "" defaults to predefined value; aSql contains sql statement 83 81 84 82 return rtn[0].dasish_aid;
Note: See TracChangeset
for help on using the changeset viewer.