Index: /DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotation-service.js
===================================================================
--- /DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotation-service.js	(revision 4544)
+++ /DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotation-service.js	(revision 4545)
@@ -20,43 +20,65 @@
             }
         },
-        getAnnotations: function(params, callback) {
+        getAnnotations: function(url, callback) {
+            annotationProxy.log('calling the annotation backend ');
+            
             $.ajax({
                 type: "GET",
-                url: this.getBackend() + '/annotations',
-                data: params,
+                url: this.getBackend() + '/api/annotations?link='+url,
                 dataType: "xml",
-                success: function(xml) {
+                beforeSend: function(xhr){xhr.setRequestHeader('Content-Type', 'application/xml');},
+                success: function(xml, textStatus, jqXHR) {
+                                    
+                    
                     var annotations = Array();
-
-                    $xml = $(xml);
-                    $xml.find('annotation').each(function() {
-                        var annotation = $.xml2json(this);
-
-                        annotations.push(annotation);
+                    
+                    $xml = $.parseXML(jqXHR.responseText);
+                    annotationProxy.log($xml);
+                    
+                    jQuery($xml).find('annotationInfo').each(function() {
+                        annotationProxy.log(this);
+                        annotationProxy.log(this.getAttribute('ref'));
+                        
+                        
+                        annotations.push(this.getAttribute('ref'));
                     });
+                    
 
                     callback.call(undefined, annotations);
+                },
+                error: function(result){
+                    annotationProxy.log('ERROR calling the annotation backend '+result);
+                    Firebug.Console.log(result);
                 }
             });
         },
-        getAnnotation: function(aid, callback) {
+        getAnnotation: function(annotationURL, callback) {
+            annotationProxy.log('getAnnotation '+annotationURL);
             $.ajax({
                 type: "GET",
-                url: this.getBackend() + '/' + aid,
+                url: annotationURL,
                 dataType: "xml",
-                success: function(xml) {
-                    var annotation = $xml.find('annotation');
-
-                    callback.call(undefined, annotation);
+                success: function(xml, textStatus, jqXHR) {
+                    $xml = $.parseXML(jqXHR.responseText);
+                    annotationProxy.log('GOT annotation in getAnnotation ');    
+                    annotationProxy.log($xml);
+                    var om_object = annotation2om_object($xml);
+                    
+                    callback.call(undefined, om_object);
+                },
+                error: function(error) {
+                    annotationProxy.log('ERROR in getAnnotation ');
+                    annotationProxy.log(error);
                 }
             });
         },
         deleteAnnotationByOid: function(oid) {
+            Firebug.Console.log('entering DELETE for oid: '+oid);
             var aid;
             var aSql = 'select dasish_aid from om_object where oid="' + oid + '"';
             var rtn = bitsObjectMng.Database.selectB("", aSql); // aMode = "" defaults to predefined value; aSql contains sql statement
-
+            
             aid = rtn[0].dasish_aid;
-
+            Firebug.Console.log('Resolved the AID for DELETE for aid: '+aid);
             if (aid) { // ajax request only for annotations posted to and available in backend database
                 return $.ajax({
@@ -105,12 +127,14 @@
                         Firebug.Console.log("+ + + + + + + + + + + + + + + + + + + + + + + +");
                     }
-                    // Firebug.Console.log("OID: " + oid);
-                    // Firebug.Console.log("AID: " + aid);
+                    Firebug.Console.log("OID: " + oid);
+                    Firebug.Console.log("AID: " + aid);
                     // Firebug.Console.log(bitsObjectMng.Database.getObject({oid: oid}));
 
                     var aSql = 'update om_object set dasish_aid = "' + aid + '" where oid="' + oid + '"';
+                    Firebug.Console.log(aSql);
                     // insert request to local sqlite database where aid gets inserted
-                    rtn = bitsObjectMng.Database.cmd("", aSql); // aMode = "" defaults to predefined value; aSql contains sql statement
-
+                    var rtn = bitsObjectMng.Database.cmd("", aSql); // aMode = "" defaults to predefined value; aSql contains sql statement
+                    Firebug.Console.log('UPDATE of AID done');
+                    Firebug.Console.log(rtn);
                     // Database insert request is true if successful
                     // Firebug.Console.log(rtn);
Index: /DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotations.wired.marker.js
===================================================================
--- /DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotations.wired.marker.js	(revision 4544)
+++ /DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotations.wired.marker.js	(revision 4545)
@@ -5,5 +5,17 @@
 
 
-              
+            annotationFramework.getAnnotations(url, 
+                function(annotations){
+                    annotationProxy.log('got annotations ');
+                    Firebug.Console.log(annotations);
+                    
+                    $.each(annotations, function(index, annotationURL){
+                       annotationFramework.getAnnotation(annotationURL, function(result){
+                           annotationProxy.log('got Annotation ');
+                           annotationProxy.log(result);
+                       });
+                    });
+                }
+            );
 
             //if (bitsObjectMng.Database.existsObject(tmp, undefined)) {
Index: /DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/conversion.utils.js
===================================================================
--- /DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/conversion.utils.js	(revision 4544)
+++ /DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/conversion.utils.js	(revision 4545)
@@ -31,7 +31,7 @@
     var body = $(annotation).find('body').text().trim();
     var style = $(annotation).find('body').find('xhtml\\:span').attr('style');
-    var type = $(annotation).find('body').attr('type').toLowerCase();
+    var type = $(annotation).find('mimeType').text();
     var link = $(annotation).find('link').text();
-    var time = $(annotation).attr('timeStamp');
+    var time = $(annotation).find('lastModified').text();
 
     var urlParts = link.split("#xpointer");
@@ -66,5 +66,5 @@
     om_object.oid_property = "<PROPERTY><HYPER_ANCHOR>" + om_object.doc_url + hyperanchor + "</HYPER_ANCHOR><NOTE>" + body + "</NOTE></PROPERTY>";
 
-    if (type === 'note') {
+    if (type === 'application/xml+xhtml') { //TODO: better handeling of the body
         om_object.oid_txt = body;
         om_object.oid_type = 'text';
