Changeset 4548


Ignore:
Timestamp:
02/24/14 10:30:00 (10 years ago)
Author:
olof
Message:

added helper-function for checking existing aid

Location:
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection
Files:
2 edited

Legend:

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

    r4547 r4548  
    1414                           annotationProxy.log('got Annotation ');
    1515                           annotationProxy.log(result);
    16                            bitsObjectMng.Database.addObject(result, 'dasish.remote', undefined);     
     16                           if(bitsObjectMng.Database._dasish_aid_exists('_uncategorized', result.dasish_aid, true)){
     17                               annotationProxy.log('AID already in database : ' + result.dasish_aid);
     18                           }else{
     19                                bitsObjectMng.Database.addObject(result, 'dasish.remote', undefined); 
     20                           }
    1721                       });
    1822                    });
  • DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/objectmng.js

    r4356 r4548  
    35063506                        return (fRtn>0);
    35073507                },
     3508                /////////////////////////////////////////////////////////////////////
     3509                _dasish_aid_exists : function(aMode,dasish_aid,aTransaction){
     3510                        if(aMode == undefined || aMode == "") aMode = this._defaultMode;
     3511                        if(aTransaction == undefined) aTransaction = true;
     3512                        var oSql = 'select count(dasish_aid) from om_object where dasish_aid="'+dasish_aid+'"';
     3513                        var oRtn = this.selectCount(aMode,oSql,aTransaction);
     3514                        if(oRtn>0){
     3515                            return true;
     3516                        }else{
     3517                            return false;
     3518                        }
     3519                       
     3520                },
    35083521
    35093522/////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.