Changeset 5680 for DASISH


Ignore:
Timestamp:
09/26/14 09:21:36 (10 years ago)
Author:
stephanie.roth@snd.gu.se
Message:

Updated to xml:id and href attributes in annotation element. Added ownerHref element instead of owner attribute.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/client/branches/webannotator-basic/chrome/markingcollection/content/markingcollection/annotator-service/conversion.utils.js

    r5483 r5680  
    120120    var backend_url = annotationFramework.getBackend();
    121121    var backend_relpath = backend_url.substring(backend_url.indexOf(":")+3);
    122     pos = backend_relpath.indexOf("/");
    123     backend_relpath = backend_relpath.substring(pos)
     122    var pos = backend_relpath.indexOf("/");
     123   
     124    /* Notes on var annotation:
     125     * UUID is hardcoded starting with a letter (below), because value is used for attribute xml:id as well. */
    124126   
    125127    var annotation = '<?xml version="1.0" encoding="UTF-8"?>\n\
     
    128130                            xsi:schemaLocation="http://www.dasish.eu/ns/addit http://dasish.eu/DASISH-schema.xsd"\n\
    129131                            xmlns:xhtml="http://www.w3.org/1999/xhtml"\n\
    130                             URI="' + annotationFramework.getBackend() + '/api/annotations/00000000-0000-0000-' + om_object.oid.substring(0, 4) + '-' + om_object.oid.substring(4, 14) + '00"\n\
    131                             ownerRef="' + annotationFramework.getBackend() + '/api/principals/00000000-0000-0000-' + om_object.oid.substring(0, 4) + '-' + om_object.oid.substring(4, 14) + '00">\n\
     132                            xml:id="aaa00000-0000-0000-' + om_object.oid.substring(0, 4) + '-' + om_object.oid.substring(4, 14) + '00"\n\
     133                            href="' + backend_relpath.substring(pos) + '/api/annotations/aaa00000-0000-0000-' + om_object.oid.substring(0, 4) + '-' + om_object.oid.substring(4, 14) + '00"\n\
     134                        <ownerHref>' + backend_relpath.substring(pos) + '/api/principals/aaa00000-0000-0000-' + om_object.oid.substring(0, 4) + '-' + om_object.oid.substring(4, 14) + '00</ownerHref>\n\
    132135                        <headline>' + om_object.oid_title + '</headline>\n\
    133136                        <lastModified>' + timestamp.toISOString() + '</lastModified>\n\
     
    139142                        </body>\n\
    140143                        <targets>\n\
    141                             <targetInfo ref="' + annotationFramework.getBackend() + '/api/targets/00000000-0000-0000-' + om_object.oid.substring(0, 4) + '-' + om_object.oid.substring(4, 14) + '00">\n\
     144                            <targetInfo ref="' + annotationFramework.getBackend() + '/api/targets/aaa00000-0000-0000-' + om_object.oid.substring(0, 4) + '-' + om_object.oid.substring(4, 14) + '00">\n\
    142145                                <link>' + om_object.doc_url + xpointer + '</link>\n\
    143146                                <version>' + timestamp.toISOString() + '</version>\n\
Note: See TracChangeset for help on using the changeset viewer.