Changeset 4555


Ignore:
Timestamp:
02/25/14 12:40:51 (10 years ago)
Author:
olof
Message:

removed unuesed test-function an added placeholder return for getLoggedInInfo

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

Legend:

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

    r4548 r4555  
    11var annotationProxy = (function() {
    22    return {
     3        /***
     4         * Get current user info
     5         * @returns {undefined} false if user in not loged in. user object if loged in
     6         */
     7        getLoggedInInfo: function(){
     8            var user_placeholder = {
     9                URI: 'https://lux17.mpi.nl/ds/webannotator/api/users/00000000-0000-0000-0000-0000000009999',
     10                uid : '00000000-0000-0000-0000-0000000009999',
     11                dislayName: 'Test Testsson',
     12                eMail: 'test@test.com'
     13            };
     14           
     15            return user_placeholder;
     16        },
    317        getAnnotations: function(url) {
    418            annotationProxy.log('getAnnotations for: ' + url);
    5 
    619
    720            annotationFramework.getAnnotations(url,
     
    1427                           annotationProxy.log('got Annotation ');
    1528                           annotationProxy.log(result);
     29                           
    1630                           if(bitsObjectMng.Database._dasish_aid_exists('_uncategorized', result.dasish_aid, true)){
    1731                               annotationProxy.log('AID already in database : ' + result.dasish_aid);
     
    1933                                bitsObjectMng.Database.addObject(result, 'dasish.remote', undefined); 
    2034                           }
     35                           
    2136                       });
    2237                    });
     
    4863             */
    4964        },
    50         insertTestAnnotation: function(){
    51              //temp annotation for testing insert via bitsObjectMng.Database.addObject()
    52             var tmp = {
    53                 "oid": 1320227156,
    54                 "pfid": "0",
    55                 "doc_title": "Svensk nationell datatjÀnst | Svensk Nationell DatatjÀnst",
    56                 "doc_url": "http://snd.gu.se/",
    57                 "con_url": "http://snd.gu.se/",
    58                 "bgn_dom": "//div[@id=\"node-170\"]/div[1]/div[1]/div[1]/div[1]/p[1](34)(3)",
    59                 "end_dom": "//div[@id=\"node-170\"]/div[1]/div[1]/div[1]/div[1]/p[1](54)(3)",
    60                 "oid_title": "Test test test",
    61                 "oid_property": "<PROPERTY><HYPER_ANCHOR>http://snd.gu.se/#hyperanchor1.3%3A%2F%2Fdiv%5B%40id%3D%26quot%3Bnode-170%26quot%3B%5D%2Fdiv%5B1%5D%2Fdiv%5B1%5D%2Fdiv%5B1%5D%2Fdiv%5B1%5D%2Fp%5B1%5D(34)(3)%26%2F%2Fdiv%5B%40id%3D%26quot%3Bnode-170%26quot%3B%5D%2Fdiv%5B1%5D%2Fdiv%5B1%5D%2Fdiv%5B1%5D%2Fdiv%5B1%5D%2Fp%5B1%5D(54)(3)%26border%3Athin%20dotted%20rgb(255%2C204%2C0)%3Bbackground-color%3Argb(255%2C255%2C204)%3Bcolor%3Argb(0%2C0%2C0)%3B</HYPER_ANCHOR><NOTE>SND is a service organization</NOTE></PROPERTY>",
    62                 "oid_mode": "0",
    63                 "oid_type": "text",
    64                 "oid_txt": "serviceorganisation", //must be the marked text!
    65                 "oid_img": null,
    66                 "oid_date": "2013/9/20 11:0:22",
    67                 "pfid_order": 4
    68               };
    69            
    70             //fungerar
    71             var tmp2 = {
    72                 "oid": "20130920171330",
    73                 "pfid": "0",
    74                 "doc_title": "Svensk nationell datatjÀnst | Svensk Nationell DatatjÀnst",
    75                 "doc_url": "http://snd.gu.se/",
    76                 "con_url": "http://snd.gu.se/",
    77                 "bgn_dom": "//div[@id=\"node-170\"]/div[1]/div[1]/div[1]/div[1]/p[1](0)(3)",
    78                 "end_dom": "//div[@id=\"node-170\"]/div[1]/div[1]/div[1]/div[1]/p[1](7)(3)",
    79                 "oid_title": "test testar",
    80                 "oid_property": "<PROPERTY><HYPER_ANCHOR>http://snd.gu.se/#hyperanchor1.3%3A%2F%2Fdiv%5B%40id%3D%26quot%3Bnode-170%26quot%3B%5D%2Fdiv%5B1%5D%2Fdiv%5B1%5D%2Fdiv%5B1%5D%2Fdiv%5B1%5D%2Fp%5B1%5D(0)(3)(Sve)%26%2F%2Fdiv%5B%40id%3D%26quot%3Bnode-170%26quot%3B%5D%2Fdiv%5B1%5D%2Fdiv%5B1%5D%2Fdiv%5B1%5D%2Fdiv%5B1%5D%2Fp%5B1%5D(7)(3)(nsk)%26border%3Athin%20dotted%20rgb(255%2C204%2C0)%3Bbackground-color%3Argb(255%2C255%2C204)%3Bcolor%3Argb(0%2C0%2C0)%3B</HYPER_ANCHOR><NOTE>testing</NOTE></PROPERTY>",
    81                 "oid_mode": "0",
    82                 "oid_type": "text",
    83                 "oid_txt": "Svensk",
    84                 "oid_img": null,
    85                 "oid_date": "09/20/2013 17:13:21",
    86                 "pfid_order": 8
    87               };
    88              
    89             //insert test via bitsObjectMng (works but the annotation does not show :-( )   
    90             bitsObjectMng.Database.addObject(tmp, 'dasish.remote', undefined);           
    91         },
    9265        postAnnotation: function(om_object) {
    9366            var annotation = om_object2annotation(om_object);
  • DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/conversion.utils.js

    r4549 r4555  
    1313        bgn_dom: "",
    1414        end_dom: "",
    15         oid_title: "Test test test",
     15        oid_title: "",
    1616        oid_property: "<PROPERTY><HYPER_ANCHOR></HYPER_ANCHOR><NOTE></NOTE></PROPERTY>",
    1717        oid_mode: "0",
     
    3535    var time = $(annotation).find('lastModified').text();
    3636
     37    //get aid
    3738    var URI = $(annotation).find('annotation').attr('URI');
    3839    om_object.dasish_aid = URI.split('/annotations/')[1];
     
    5758
    5859    //build hyperanchor
    59     console.log('fragment: ' + om_object.bgn_dom + '&' + om_object.end_dom + '&' + style);
    6060    var hyperanchor = '#hyperanchor1.3' + encodeURIComponent(':' + om_object.bgn_dom.replace(/"/g, '&quot;') + '&' + om_object.end_dom.replace(/"/g, '&quot;') + '&' + style);
    6161
     
    6363    om_object.oid_title = title;
    6464
     65    //generate oid from aid (hash)
    6566    om_object.oid = hashCode(om_object.dasish_aid);
    6667    if (om_object.oid < 0) {
    6768        om_object.oid = om_object.oid * -1;
    6869    }
    69     console.log(link);
     70   
     71    //construct annotation structure
    7072    om_object.oid_property = "<PROPERTY><HYPER_ANCHOR>" + om_object.doc_url + hyperanchor + "</HYPER_ANCHOR><NOTE>" + body + "</NOTE></PROPERTY>";
    7173
     
    7476        om_object.oid_type = 'text';
    7577    }
     78   
     79    //reformat date
    7680    var d = new Date(time);
    7781    om_object.oid_date = (d.getFullYear() + '/' + (parseInt(d.getMonth()) + 1)) + '/' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
  • DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/objectmng.js

    r4548 r4555  
    35063506                        return (fRtn>0);
    35073507                },
    3508                 /////////////////////////////////////////////////////////////////////
     3508/////////////////////////////////////////////////////////////////////
    35093509                _dasish_aid_exists : function(aMode,dasish_aid,aTransaction){
     3510                        //helper function for finding existing annotations
    35103511                        if(aMode == undefined || aMode == "") aMode = this._defaultMode;
    35113512                        if(aTransaction == undefined) aTransaction = true;
Note: See TracChangeset for help on using the changeset viewer.