Changeset 4544


Ignore:
Timestamp:
02/21/14 13:07:48 (10 years ago)
Author:
olof
Message:

moved test insert to separate function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotations.wired.marker.js

    r4358 r4544  
    44            annotationProxy.log('getAnnotations for: ' + url);
    55
    6             //temp annotation for testing insert via bitsObjectMng.Database.addObject()
     6
     7             
     8
     9            //if (bitsObjectMng.Database.existsObject(tmp, undefined)) {
     10            //    this.log("annotationProxy annotation exists in the database");
     11            //} else {
     12            //    this.log("annotationProxy inserting annotation in the database");
     13            //    bitsObjectMng.Database.addObject(tmp, '_uncategorized', undefined);
     14            //}
     15            /*
     16             annotationFramework.getAnnotations({link: url, access: read}, function(result) {
     17             var annotations = $(result);
     18             
     19             annotations.find('annotation').each(function() {
     20             var aid = $(this).attr('ref').substr($(this).attr('ref').lastIndexOf('/') + 1);
     21             
     22             annotationFramework.getAnnotation(aid, function(annotation){
     23             annotation.find('annotation').each(function() {
     24             var om_object = annotation2om_object(this);
     25             
     26             //bitsObjectMng.Database.addObject
     27             });
     28             });
     29             });
     30             });
     31             */
     32        },
     33        insertTestAnnotation: function(){
     34             //temp annotation for testing insert via bitsObjectMng.Database.addObject()
    735            var tmp = {
    836                "oid": 1320227156,
     
    4371             
    4472            //insert test via bitsObjectMng (works but the annotation does not show :-( )   
    45             bitsObjectMng.Database.addObject(tmp, 'dasish.remote', undefined);
    46              
    47 
    48             //if (bitsObjectMng.Database.existsObject(tmp, undefined)) {
    49             //    this.log("annotationProxy annotation exists in the database");
    50             //} else {
    51             //    this.log("annotationProxy inserting annotation in the database");
    52             //    bitsObjectMng.Database.addObject(tmp, '_uncategorized', undefined);
    53             //}
    54             /*
    55              annotationFramework.getAnnotations({link: url, access: read}, function(result) {
    56              var annotations = $(result);
    57              
    58              annotations.find('annotation').each(function() {
    59              var aid = $(this).attr('ref').substr($(this).attr('ref').lastIndexOf('/') + 1);
    60              
    61              annotationFramework.getAnnotation(aid, function(annotation){
    62              annotation.find('annotation').each(function() {
    63              var om_object = annotation2om_object(this);
    64              
    65              //bitsObjectMng.Database.addObject
    66              });
    67              });
    68              });
    69              });
    70              */
     73            bitsObjectMng.Database.addObject(tmp, 'dasish.remote', undefined);           
    7174        },
    7275        postAnnotation: function(om_object) {
Note: See TracChangeset for help on using the changeset viewer.