Changeset 4555
- Timestamp:
- 02/25/14 12:40:51 (10 years ago)
- 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 1 1 var annotationProxy = (function() { 2 2 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 }, 3 17 getAnnotations: function(url) { 4 18 annotationProxy.log('getAnnotations for: ' + url); 5 6 19 7 20 annotationFramework.getAnnotations(url, … … 14 27 annotationProxy.log('got Annotation '); 15 28 annotationProxy.log(result); 29 16 30 if(bitsObjectMng.Database._dasish_aid_exists('_uncategorized', result.dasish_aid, true)){ 17 31 annotationProxy.log('AID already in database : ' + result.dasish_aid); … … 19 33 bitsObjectMng.Database.addObject(result, 'dasish.remote', undefined); 20 34 } 35 21 36 }); 22 37 }); … … 48 63 */ 49 64 }, 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": 468 };69 70 //fungerar71 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": 887 };88 89 //insert test via bitsObjectMng (works but the annotation does not show :-( )90 bitsObjectMng.Database.addObject(tmp, 'dasish.remote', undefined);91 },92 65 postAnnotation: function(om_object) { 93 66 var annotation = om_object2annotation(om_object); -
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/conversion.utils.js
r4549 r4555 13 13 bgn_dom: "", 14 14 end_dom: "", 15 oid_title: " Test test test",15 oid_title: "", 16 16 oid_property: "<PROPERTY><HYPER_ANCHOR></HYPER_ANCHOR><NOTE></NOTE></PROPERTY>", 17 17 oid_mode: "0", … … 35 35 var time = $(annotation).find('lastModified').text(); 36 36 37 //get aid 37 38 var URI = $(annotation).find('annotation').attr('URI'); 38 39 om_object.dasish_aid = URI.split('/annotations/')[1]; … … 57 58 58 59 //build hyperanchor 59 console.log('fragment: ' + om_object.bgn_dom + '&' + om_object.end_dom + '&' + style);60 60 var hyperanchor = '#hyperanchor1.3' + encodeURIComponent(':' + om_object.bgn_dom.replace(/"/g, '"') + '&' + om_object.end_dom.replace(/"/g, '"') + '&' + style); 61 61 … … 63 63 om_object.oid_title = title; 64 64 65 //generate oid from aid (hash) 65 66 om_object.oid = hashCode(om_object.dasish_aid); 66 67 if (om_object.oid < 0) { 67 68 om_object.oid = om_object.oid * -1; 68 69 } 69 console.log(link); 70 71 //construct annotation structure 70 72 om_object.oid_property = "<PROPERTY><HYPER_ANCHOR>" + om_object.doc_url + hyperanchor + "</HYPER_ANCHOR><NOTE>" + body + "</NOTE></PROPERTY>"; 71 73 … … 74 76 om_object.oid_type = 'text'; 75 77 } 78 79 //reformat date 76 80 var d = new Date(time); 77 81 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 3506 3506 return (fRtn>0); 3507 3507 }, 3508 3508 ///////////////////////////////////////////////////////////////////// 3509 3509 _dasish_aid_exists : function(aMode,dasish_aid,aTransaction){ 3510 //helper function for finding existing annotations 3510 3511 if(aMode == undefined || aMode == "") aMode = this._defaultMode; 3511 3512 if(aTransaction == undefined) aTransaction = true;
Note: See TracChangeset
for help on using the changeset viewer.