= eXist Interface: Maintenance of user annotations =
User annotations are maintained by the interface function /mpdl/interface/external/object.xql.
This function has 3 parameters:
* operation (possible values: read, create, update, delete)
* type (possible values: element, query)
* object (see examples below)
* attributes
* uid: user id (normally email address) of the operation (e.g. andy@mpiwg-berlin.mpg.de)
* documentId: the eXist document identifier (e.g. /tei/en/Test_1789.xml)
* xpointer: the xpointer to the position in that document (e.g.: id('page2')/TEI[1]/text[1]/body[1]/p[1]/s[3]/point(4)); see [/wiki/schema/xpointer XPointer specification]
* value: if operation is create or update: the new object (e.g. This is an annotation of Andy)
== Examples ==
=== Example document ===
[http://mpdl-test.mpiwg-berlin.mpg.de:30030/mpdl/page-query-result.xql?document=/tei/en/Test_1789.xml&mode=text&pn=2 Test document with user annotations]
=== Read annotations ===
{{{
http://mpdl-test.mpiwg-berlin.mpg.de:30030/mpdl/interface/external/object.xql?
operation=read&
type=element&
object=
}}}
[http://mpdl-test.mpiwg-berlin.mpg.de:30030/mpdl/interface/external/object.xql?operation=read&type=element&object=%3Cobject%20documentId=%22/tei/en/Test_1789.xml%22%20xpointer=%22id%28%27page2%27%29%22%3E%3C/object%3E Read annotations]
=== Create annotation ===
{{{
http://mpdl-test.mpiwg-berlin.mpg.de:30030/mpdl/interface/external/object.xql?
operation=create&
type=element&
object=
}}}
[http://mpdl-test.mpiwg-berlin.mpg.de:30030/mpdl/interface/external/object.xql?operation=create&type=element&object=%3Cobject%20uid=%22andy@mpiwg-berlin.mpg.de%22%20documentId=%22/tei/en/Test_1789.xml%22%20xpointer=%22id%28%27page2%27%29/TEI%5B1%5D/text%5B1%5D/body%5B1%5D/p%5B1%5D/s%5B3%5D/point%284%29%22%3E%3Cnote%3EThis%20is%20an%20annotation%20of%20Andy%3C/note%3E%3C/object%3E Create annotation]
=== Delete annotation ===
{{{
http://mpdl-test.mpiwg-berlin.mpg.de:30030/mpdl/interface/external/object.xql?
operation=delete&
type=element&
object=
}}}
[http://mpdl-test.mpiwg-berlin.mpg.de:30030/mpdl/interface/external/object.xql?operation=delete&type=element&object=%3Cobject%20uid=%22andy@mpiwg-berlin.mpg.de%22%20documentId=%22/tei/en/Test_1789.xml%22%20xpointer=%22id%28%27page2%27%29/TEI%5B1%5D/text%5B1%5D/body%5B1%5D/p%5B1%5D/s%5B3%5D%22%3E%3C/object%3E Delete annotation]
== Limitations ==
* Bugs
* at one position there is only one external user annotation possible so far