Status

Proposed

Target Release

4.1

Issue

ROL-1576

Original Authors

Dave Johnson

Abstract

Enhance Roller's existing AtomPub support to make it possible for an AtomPub client application to create, retrieve update and delete comments for each weblog entries.

Requirements

  • Create, retrieve, update and delete on weblog entry comments
  • Build on the Atom Threading Extension, hereinafter referred to as ATE

Issues

TBD: no issues raised yet.

Design

In summary: we will model Comments as Atom Entries. Each Weblog Entry will provide a link to it's Comment collection and each Comment will contain a link back to it's entry. In addition, Weblog Entry <entry> elements will include extension elements to indicate if/when comments are allowed and Comment <entry> elements will include extension elements to indicate approval/spam status.

New comment collections

Currently, these URIs are supported for entries collections:

/roller-services/app/[weblog-handle>/entries
Entry collection for a blog
 
/roller-services/app/[weblog-handle]/entries/[offset]
Entry collection for a blog, with offset

/roller-services/app/[weblog-handle]/entry/[id]
Individual entry (i.e. edit URI)

We will add these URIs for comment collections:

/roller-services/app/[weblog-handle]/entry/[id]/comments
Comments collection for entry with id

/roller-services/app/[weblog-handle]/entry/[id]/comments/[offset]
Comments collection for entry with id, with offset

/roller-services/app/[weblog-handle]/entry/[id]/comment/[id]
Individual comment

Entries link relation 'replies' to indicate comment collection

We will use the techniques defined in the ATE for indicating entry to comment relationships. Each entry will include a <link> with relation 'replies' that points to the entry's comment collection.

<entry> <!-- representing a weblog entry -->
   ...
   <link rel="replies" type="application/atom+xml"
      href="http://examples.com/roller/roller-services/app/myblog/entry/454/comments" />
</entry>

Comments will use <thr:in-reply-to> element to indicate entry

We'll use the ATE's <thr:in-reply-to> element in each comment to point back the the entry which the comment is in-reply-to.

<entry> <!-- representing a comment-->
   ...
   <thr:in-reply-to ref="545" type="application/atom+xml"
      href="http://examples.com/roller/roller-services/app/myblog/entry/454" />
</entry>

Entry <entry> extensions to indicate if/when comments are allowed

We will add new elements to Weblog Entry <entry> elements to indicate if and when comments are allowed. These are read/write elements that can be change by clients. First, the comments-allowed element will contain either 'true' or 'false' indicating if comments are allowed on this entry. Entries MAY contain this element but never more than once.

<rol:comments-allowed>true</rol:comments-allowed>

Second, the comment-days element will indicate the total number of days after the entry publication date that comments will be allowed on this entry. Entries MAY contain this element but never more than once.

<rol:comment-days>15</rol:comments-days>

Comment <entry> extensions to indicate spam/approval status

We will add new elements to Comment <entry> elements to indicate the status of each comment. This is a read/write element that can be changed by clients. Possible values are defined in the Roller WeblogEntryComment POJO: PENDING, UNAPPROVED, APPROVED and SPAM. Comments MAY contain this element but never more than once.

<rol:comment-status>SPAM</rol:comment-status>

That's all, folks.

Comments

Please comment on the Roller dev mailing list.

  • No labels