To create a new comment on a resource, you must POST a comment XML document.
The XML document is namespace aware, and uses the default namespace
http://jazz.net/xmlns/rmps/comments/1.0/
. The other namespaces used are rdf and dcterms.
The root element is Comment. The following are the child elements.
Element | Description |
---|---|
dc:title | The title, or subject of the comment in plain text. Required. |
target-resource | The reference to the model element this is a comment for. The URI is the rdf:resource attribute of the element. Required. |
target-revision | The stream URI (version) of the resource that this is a comment on. Required. |
in-reply-to | If this is a reply to another comment this element's rdf:resource attribute holds the URI of the comment this is a reply to. |
target-range | Not used. (should be removed) |
content | One of the contents of this comment. Content can be plain text or a svg resource that is overlayed on diagram
resources. This element must have the rdf:parseType value of "Resource". There are two child elements expected; <dc:format> with
a value of text/plain or image/svg+xml , and <body> whose text content is either the text of the comment or the SVG of the
graphical overlay. The SVG content should be properly encoded to parse properly (see example). |
Request:
POST https://rory:9444/dm/comments
<?xml version="1.0" encoding="UTF-8"?> <comment xmlns="http://jazz.net/xmlns/rmps/comments/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/terms/" xmlns:rmps="https://www.ibm.com/rmps" rdf:about=""> <dc:title>RE: a comment</dc:title> <target-resource rdf:resource="https://rory:9444/dm/models/22" /> <target-revision>https://rory:9444/dm/streams/7</target-revision> <in-reply-to rdf:resource="https://rory:9444/dm/comments/_OTBjEMRsEeGtE_hscTgR5g" /> <target-range rdf:parseType="Literal"> </target-range> <content rdf:parseType="Resource"> <dc:format>text/plain</dc:format> <body>This is a sample comment response</body> </content> <content rdf:parseType="Resource"> <dc:format>image/svg+xml</dc:format> <body><?xml version='1.0'?><svg xmlns="http://www.w3.org/2000/svg" width='87' height='50' viewBox='201.88333129882812 112.63333129882812 87 50'><g transform = "translate(0,0)"><g><rect x='206.88333129882812' y='117.63333129882812' width='77' height='40' style='stroke-width:2;stroke:#DC143C;stroke-opacity:1;fill:#FFFFFF;fill-opacity:0;stroke-dasharray:none'/></g></g></svg> </body> </content> </comment>
Response:
201 Created
ETag: "_hEE1AcRxEeGNdK5r7R1T8w"
Location: https://rory:9444/dm/comments/_hDNSUMRxEeGNdK5r7R1T8w