Developer:CommentsResource

From myExperiment
Jump to: navigation, search

Comments Resource

Index of comments

URL: GET http://www.myexperiment.org/comments.xml

Example output:

<?xml version="1.0"?>
<comments>
  <comment uri="http://www.myexperiment.org/comment.xml?id=2" resource="http://www.myexperiment.org/workflows/7/comments/2"/>
  <comment uri="http://www.myexperiment.org/comment.xml?id=3" resource="http://www.myexperiment.org/workflows/1/comments/3"/>
  <comment uri="http://www.myexperiment.org/comment.xml?id=8" resource="http://www.myexperiment.org/workflows/32/comments/8"/>
  ...
</comments>


Create comment

URL: POST http://www.myexperiment.org/comment.xml

Example input:

<?xml version="1.0"?>
<comment>
  <comment>This is a new comment!</comment>
  <subject resource="http://www.myexperiment.org/workflows/20"/>
</comment>

Example output:

<?xml version="1.0" encoding="UTF-8"?>
<comment uri="http://www.myexperiment.org/comment.xml?id=1" resource="http://www.myexperiment.org/workflows/20/comments/1">
  <id>1</id>
  <author uri="http://www.myexperiment.org/user.xml?id=22" resource="http://www.myexperiment.org/users/22">Don Cruickshank</author>
  <subject uri="http://www.myexperiment.org/workflow.xml?id=20" resource="http://www.myexperiment.org/workflows/20"/>
  <comment>This is a new comment!</comment>
  <created-at>Fri Mar 27 15:48:06 +0000 2009</created-at>
</comment>


Read comment

URL: GET http://www.myexperiment.org/comment.xml?id=1

Example output:

<?xml version="1.0" encoding="UTF-8"?>
<comment uri="http://www.myexperiment.org/comment.xml?id=1" resource="http://www.myexperiment.org/workflows/20/comments/1">
  <id>1</id>
  <author uri="http://www.myexperiment.org/user.xml?id=22" resource="http://www.myexperiment.org/users/22">Don Cruickshank</author>
  <subject uri="http://www.myexperiment.org/workflow.xml?id=20" resource="http://www.myexperiment.org3500/workflows/20"/>
  <comment>This is a new comment!</comment>
  <created-at>Fri Mar 27 15:48:06 +0000 2009</created-at>
</comment>


Update comment

This is not currently supported since there is nothing to update. Comment edits aren't allowed on myExperiment.


Delete comment

URL: DELETE http://www.myexperiment.org/comment.xml?id=1

Example output:

<?xml version="1.0" encoding="UTF-8"?>
<comment uri="http://www.myexperiment.org/comment.xml?id=1" resource="http://www.myexperiment.org/workflows/20/comments/1">
  <id>1</id>
  <author uri="http://www.myexperiment.org/user.xml?id=22" resource="http://www.myexperiment.org/users/22">Don Cruickshank</author>
  <subject uri="http://www.myexperiment.org/workflow.xml?id=20" resource="http://www.myexperiment.org3500/workflows/20"/>
  <comment>This is a new comment!</comment>
  <created-at>Fri Mar 27 15:48:06 +0000 2009</created-at>
</comment>


Elements for comment

  • id - the id of the comment
  • author - the user who submitted the comment
  • subject - the subject of the comment (e.g. workflow, file, group, etc.)
  • comment - the main text of the comment
  • created-at - the date/time the comment was created