This is an automated email from the ASF dual-hosted git repository.
snoopdave pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/roller.git
The following commit(s) were added to refs/heads/master by this push:
new b8dabb72a Remove comment management from the AtomPub service (#215)
b8dabb72a is described below
commit b8dabb72a6a3007d5a085fffd8bfd2629b5c3d84
Author: David M. Johnson <[email protected]>
AuthorDate: Mon Oct 12 15:35:57 2026 -0400
Remove comment management from the AtomPub service (#215)
The comments collection let an AtomPub client list, moderate and delete
comments. Comment text is written by anyone, and a client that reads it
with the same credentials that can edit templates is a poor combination,
especially for AI agents. Remove the collection until there is a better
way to scope credentials; comments are moderated in the web interface.
- Remove CommentCollection, its routes and its service document entry;
/{handle}/comments and /{handle}/comment/{id} now answer 404.
- Remove thr:in-reply-to support from the Atom reader and writer, which
only comments used.
- Remove the comment tests, examples, schema elements and the Comments
chapter of the AtomPub guide; update CHANGES.md and the user guide.
---
CHANGES.md | 3 +-
.../webservices/atomprotocol/AtomConstants.java | 5 +-
.../webservices/atomprotocol/AtomEntry.java | 24 +-
.../webservices/atomprotocol/AtomReader.java | 6 -
.../webservices/atomprotocol/AtomWriter.java | 12 +-
.../atomprotocol/CollectionSupport.java | 2 +-
.../atomprotocol/CommentCollection.java | 262 ---------------------
.../atomprotocol/RollerAtomHandler.java | 20 +-
.../atomprotocol/RollerAtomService.java | 8 +-
.../atomprotocol/AtomPubDocExamplesTest.java | 42 +---
.../webservices/atomprotocol/AtomReaderTest.java | 12 +-
.../atomprotocol/AtomSchemaValidationTest.java | 33 +--
.../webservices/atomprotocol/AtomWriterTest.java | 18 +-
.../atomprotocol/RollerAtomHandlerTest.java | 14 +-
.../atomprotocol/RollerAtomManagementTest.java | 64 +----
docs/atompub/examples/category-entry.xml | 2 +-
docs/atompub/examples/comment-entry.xml | 21 --
docs/atompub/examples/comment-status-request.xml | 10 -
docs/atompub/examples/comments-feed.xml | 27 ---
docs/atompub/examples/entries-feed.xml | 2 +-
docs/atompub/examples/entry-response.xml | 2 +-
docs/atompub/examples/media-link-entry.xml | 2 +-
docs/atompub/examples/service.xml | 4 -
docs/atompub/examples/template-entry.xml | 2 +-
docs/atompub/roller-atompub.rnc | 19 +-
docs/roller-atompub-guide.adoc | 74 +-----
docs/roller-user-guide.adoc | 5 +-
27 files changed, 56 insertions(+), 639 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index 16d19c725..5ef036e8d 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -4,14 +4,13 @@
### Improvements
-- **AtomPub can manage templates, categories and comments.** New collections
+- **AtomPub can manage templates and categories.** New collections
in each weblog's workspace, documented in the user guide:
- Templates (standard and mobile versions) for weblog administrators,
when the weblog uses a custom theme.
- Categories, including an RFC 5023 category document at
`/{handle}/categories.atomcat`. The entries collection lists its
categories inline, as before, and also references that document.
- - Comment moderation: list, change status, delete.
- **New AtomPub Guide** (`docs/roller-atompub-guide.adoc`). It documents
every AtomPub URI, permission, element and status code, with examples
diff --git
a/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomConstants.java
b/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomConstants.java
index 6cae60914..f9ec13426 100644
---
a/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomConstants.java
+++
b/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomConstants.java
@@ -31,12 +31,9 @@ public final class AtomConstants {
/** Atom Publishing Protocol namespace (RFC 5023). */
public static final String APP_NS = "http://www.w3.org/2007/app";
- /** Roller's AtomPub extension namespace (templates, categories,
comments). */
+ /** Roller's AtomPub extension namespace (templates and categories). */
public static final String ROLLER_NS =
"http://roller.apache.org/ns/atompub/1.0";
- /** Atom Threading Extensions namespace (RFC 4685). */
- public static final String THREAD_NS =
"http://purl.org/syndication/thread/1.0";
-
/** Media type for an APP category document. */
public static final String CATEGORIES_MEDIA_TYPE =
"application/atomcat+xml;charset=utf-8";
diff --git
a/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomEntry.java
b/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomEntry.java
index b9b7fa4b7..c6e78dcb7 100644
---
a/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomEntry.java
+++
b/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomEntry.java
@@ -27,8 +27,8 @@ import java.util.Map;
* An atom:entry. The {@code draft} and {@code edited} fields carry the APP
* control extension (app:control/app:draft and app:edited). Roller's own
* extension elements ({@link AtomConstants#ROLLER_NS}) are kept by local name
- * in {@link #getExtensions()}; the mobile template rendition and the
- * thr:in-reply-to link (RFC 4685) have their own fields.
+ * in {@link #getExtensions()}; the mobile template rendition has its own
+ * field.
*/
public class AtomEntry {
@@ -45,8 +45,6 @@ public class AtomEntry {
private List<AtomLink> links = new ArrayList<>();
private Map<String, String> extensions = new LinkedHashMap<>();
private String mobileRendition;
- private String inReplyToRef;
- private String inReplyToHref;
public String getId() {
return id;
@@ -162,24 +160,6 @@ public class AtomEntry {
this.mobileRendition = mobileRendition;
}
- /** The thr:in-reply-to ref (the parent's atom:id), or null. */
- public String getInReplyToRef() {
- return inReplyToRef;
- }
-
- public void setInReplyToRef(String inReplyToRef) {
- this.inReplyToRef = inReplyToRef;
- }
-
- /** The thr:in-reply-to href, or null. */
- public String getInReplyToHref() {
- return inReplyToHref;
- }
-
- public void setInReplyToHref(String inReplyToHref) {
- this.inReplyToHref = inReplyToHref;
- }
-
/** Return the href of the first link with the given rel, or null. */
public String getLinkHref(String rel) {
if (links != null) {
diff --git
a/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomReader.java
b/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomReader.java
index 78965e20f..1b62bfe8f 100644
---
a/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomReader.java
+++
b/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomReader.java
@@ -20,7 +20,6 @@ package org.apache.roller.weblogger.webservices.atomprotocol;
import static
org.apache.roller.weblogger.webservices.atomprotocol.AtomConstants.APP_NS;
import static
org.apache.roller.weblogger.webservices.atomprotocol.AtomConstants.ATOM_NS;
import static
org.apache.roller.weblogger.webservices.atomprotocol.AtomConstants.ROLLER_NS;
-import static
org.apache.roller.weblogger.webservices.atomprotocol.AtomConstants.THREAD_NS;
import java.io.InputStream;
import java.time.Instant;
@@ -174,11 +173,6 @@ public class AtomReader {
entry.setExtension(name, r.getElementText());
}
return;
- } else if (THREAD_NS.equals(ns) && "in-reply-to".equals(name)) {
- entry.setInReplyToRef(r.getAttributeValue(null, "ref"));
- entry.setInReplyToHref(r.getAttributeValue(null, "href"));
- skipElement(r);
- return;
}
skipElement(r);
}
diff --git
a/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomWriter.java
b/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomWriter.java
index 0d5e8b238..8ba6eefdb 100644
---
a/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomWriter.java
+++
b/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomWriter.java
@@ -20,7 +20,6 @@ package org.apache.roller.weblogger.webservices.atomprotocol;
import static
org.apache.roller.weblogger.webservices.atomprotocol.AtomConstants.APP_NS;
import static
org.apache.roller.weblogger.webservices.atomprotocol.AtomConstants.ATOM_NS;
import static
org.apache.roller.weblogger.webservices.atomprotocol.AtomConstants.ROLLER_NS;
-import static
org.apache.roller.weblogger.webservices.atomprotocol.AtomConstants.THREAD_NS;
import java.io.OutputStream;
import java.time.ZoneOffset;
@@ -124,11 +123,9 @@ public class AtomWriter {
w.writeDefaultNamespace(rootNs);
w.writeNamespace(prefix, otherNs);
if (ATOM_NS.equals(rootNs)) {
- // Extension namespaces used by entries (see writeEntryBody)
+ // Extension namespace used by entries (see writeEntryBody)
w.setPrefix("roller", ROLLER_NS);
- w.setPrefix("thr", THREAD_NS);
w.writeNamespace("roller", ROLLER_NS);
- w.writeNamespace("thr", THREAD_NS);
}
body.write(w);
w.writeEndElement();
@@ -202,13 +199,6 @@ public class AtomWriter {
for (AtomLink link : entry.getLinks()) {
writeLink(w, link);
}
- if (entry.getInReplyToRef() != null) {
- w.writeEmptyElement(THREAD_NS, "in-reply-to");
- w.writeAttribute("ref", xml(entry.getInReplyToRef()));
- if (entry.getInReplyToHref() != null) {
- w.writeAttribute("href", xml(entry.getInReplyToHref()));
- }
- }
if (entry.getMobileRendition() != null) {
w.writeStartElement(ROLLER_NS, "rendition");
w.writeAttribute("type", xml("mobile"));
diff --git
a/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/CollectionSupport.java
b/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/CollectionSupport.java
index d6c127ee9..2298a15fe 100644
---
a/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/CollectionSupport.java
+++
b/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/CollectionSupport.java
@@ -28,7 +28,7 @@ import org.apache.roller.weblogger.pojos.Weblog;
import org.apache.roller.weblogger.pojos.WeblogPermission;
/**
- * Helpers shared by the template, category and comment collections.
+ * Helpers shared by the template and category collections.
*/
final class CollectionSupport {
diff --git
a/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/CommentCollection.java
b/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/CommentCollection.java
deleted file mode 100644
index 8b865778c..000000000
---
a/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/CommentCollection.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. The ASF licenses this file to You
- * under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License. For additional information regarding
- * copyright in this work, please see the NOTICE file in the top level
- * directory of this distribution.
- */
-
-package org.apache.roller.weblogger.webservices.atomprotocol;
-
-import java.net.URLEncoder;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.roller.weblogger.WebloggerException;
-import org.apache.roller.weblogger.business.WeblogEntryManager;
-import org.apache.roller.weblogger.business.Weblogger;
-import org.apache.roller.weblogger.business.WebloggerFactory;
-import org.apache.roller.weblogger.pojos.CommentSearchCriteria;
-import org.apache.roller.weblogger.pojos.User;
-import org.apache.roller.weblogger.pojos.Weblog;
-import org.apache.roller.weblogger.pojos.WeblogEntry;
-import org.apache.roller.weblogger.pojos.WeblogEntryComment;
-import org.apache.roller.weblogger.pojos.WeblogEntryComment.ApprovalStatus;
-import org.apache.roller.weblogger.pojos.WeblogPermission;
-import org.apache.roller.weblogger.util.I18nMessages;
-import org.apache.roller.weblogger.util.MailUtil;
-import org.apache.roller.weblogger.util.cache.CacheManager;
-
-/**
- * The comments of a weblog as an AtomPub collection, for comment moderation
- * by users who may post to the weblog. Clients can list and read comments,
- * change a comment's roller:status, and delete comments; the collection does
- * not accept POST.
- *
- * <p>Each comment is an entry: atom:author is the commenter, atom:content
- * the comment text, atom:published the post time, thr:in-reply-to (RFC 4685)
- * the weblog entry, roller:status the approval status. The list can be
- * filtered with the {@code status} and {@code entry} (weblog entry id) query
- * parameters and paged like the entries collection.
- */
-public class CommentCollection {
-
- private static final Log log = LogFactory.getLog(CommentCollection.class);
-
- private static final int MAX_ENTRIES = 20;
-
- private final Weblogger roller;
- private final User user;
- private final String atomURL;
-
- public CommentCollection(User user, String atomURL) {
- this.user = user;
- this.atomURL = atomURL;
- this.roller = WebloggerFactory.getWeblogger();
- }
-
- public AtomFeed getCollection(AtomRequest areq) throws AtomException {
- String[] pathInfo = CollectionSupport.path(areq);
- Weblog weblog = requireWeblog(pathInfo);
- int start = CollectionSupport.offset(pathInfo);
- try {
- CommentSearchCriteria csc = new CommentSearchCriteria();
- csc.setWeblog(weblog);
- csc.setReverseChrono(true);
- csc.setOffset(start);
- csc.setMaxResults(MAX_ENTRIES + 1);
- String status = areq.getParameter("status");
- if (StringUtils.isNotEmpty(status)) {
- csc.setStatus(parseStatus(status));
- }
- String entryId = areq.getParameter("entry");
- if (StringUtils.isNotEmpty(entryId)) {
- WeblogEntry entry = manager().getWeblogEntry(weblog, entryId);
- if (entry == null) {
- throw new AtomNotFoundException("Cannot find weblog
entry");
- }
- csc.setEntry(entry);
- }
- List<WeblogEntryComment> comments = manager().getComments(csc);
-
- String base = atomURL + "/" + weblog.getHandle() + "/comments/";
- String query = queryString(status, entryId);
- AtomFeed feed = new AtomFeed();
- feed.setId(base + start);
- feed.setTitle(weblog.getName() + " comments");
- feed.setUpdated(new Date());
- int count = 0;
- for (WeblogEntryComment comment : comments) {
- if (count++ >= MAX_ENTRIES) {
- break;
- }
- feed.getEntries().add(createAtomEntry(weblog, comment));
- }
- if (comments.size() > MAX_ENTRIES) {
- feed.getLinks().add(CollectionSupport.link("next",
- base + (start + MAX_ENTRIES) + query));
- }
- if (start > 0) {
- feed.getLinks().add(CollectionSupport.link("previous",
- base + Math.max(0, start - MAX_ENTRIES) + query));
- }
- return feed;
- } catch (WebloggerException e) {
- throw new AtomException("Getting comment collection", e);
- }
- }
-
- public AtomEntry getEntry(AtomRequest areq) throws AtomException {
- String[] pathInfo = CollectionSupport.path(areq);
- Weblog weblog = requireWeblog(pathInfo);
- try {
- return createAtomEntry(weblog, requireComment(weblog, pathInfo));
- } catch (WebloggerException e) {
- throw new AtomException("Getting comment", e);
- }
- }
-
- /**
- * Changes the comment's approval status. Other fields are ignored. A
- * pending comment that is approved sends the approval notification, as
- * on the Comments page.
- */
- public void putEntry(AtomRequest areq, AtomEntry entry) throws
AtomException {
- String[] pathInfo = CollectionSupport.path(areq);
- Weblog weblog = requireWeblog(pathInfo);
- String status = entry.getExtension("status");
- if (StringUtils.isEmpty(status)) {
- throw CollectionSupport.badRequest("roller:status is required");
- }
- ApprovalStatus newStatus = parseStatus(status);
- try {
- WeblogEntryComment comment = requireComment(weblog, pathInfo);
- ApprovalStatus oldStatus = comment.getStatus();
- if (newStatus.equals(oldStatus)) {
- return;
- }
- comment.setStatus(newStatus);
- manager().saveComment(comment);
- roller.flush();
- CacheManager.invalidate(weblog);
-
- if (ApprovalStatus.PENDING.equals(oldStatus)
- && ApprovalStatus.APPROVED.equals(newStatus)
- && MailUtil.isMailConfigured()) {
- try {
-
MailUtil.sendEmailApprovalNotifications(Collections.singletonList(comment),
-
I18nMessages.getMessages(weblog.getLocaleInstance()));
- } catch (Exception e) {
- // The status change is saved; a mail failure must not
undo it
- log.error("Error sending comment approval notification",
e);
- }
- }
-
roller.getIndexManager().addEntryReIndexOperation(comment.getWeblogEntry());
- } catch (WebloggerException e) {
- throw new AtomException("Updating comment", e);
- }
- }
-
- public void deleteEntry(AtomRequest areq) throws AtomException {
- String[] pathInfo = CollectionSupport.path(areq);
- Weblog weblog = requireWeblog(pathInfo);
- try {
- WeblogEntryComment comment = requireComment(weblog, pathInfo);
- WeblogEntry entry = comment.getWeblogEntry();
- manager().removeComment(comment);
- roller.flush();
- // JPA clears a removed comment, so invalidate the whole weblog
- CacheManager.invalidate(weblog);
- roller.getIndexManager().addEntryReIndexOperation(entry);
- } catch (WebloggerException e) {
- throw new AtomException("Removing comment", e);
- }
- }
-
- private AtomEntry createAtomEntry(Weblog weblog, WeblogEntryComment
comment) {
- String editURI = atomURL + "/" + weblog.getHandle() + "/comment/" +
comment.getId();
- AtomEntry entry = new AtomEntry();
- entry.setId(editURI);
- WeblogEntry parent = comment.getWeblogEntry();
- entry.setTitle("Comment on " + parent.getTitle());
- entry.setPublished(comment.getPostTime());
- entry.setUpdated(comment.getPostTime() != null ? comment.getPostTime()
: new Date());
-
- AtomPerson author = new AtomPerson();
- author.setName(StringUtils.isNotEmpty(comment.getName()) ?
comment.getName() : "Anonymous");
- author.setEmail(StringUtils.trimToNull(comment.getEmail()));
- author.setUri(StringUtils.trimToNull(comment.getUrl()));
- entry.getAuthors().add(author);
-
- String type = "text/html".equals(comment.getContentType()) ? "html" :
"text";
- entry.setContent(CollectionSupport.text(type, comment.getContent()));
-
- entry.setInReplyToRef(parent.getPermalink());
- entry.setInReplyToHref(atomURL + "/" + weblog.getHandle() + "/entry/"
+ parent.getId());
-
- entry.setExtension("status",
comment.getStatus().name().toLowerCase(Locale.ROOT));
- entry.setExtension("remoteHost", comment.getRemoteHost());
- entry.setExtension("referrer", comment.getReferrer());
-
- List<AtomLink> links = new ArrayList<>();
- links.add(CollectionSupport.link("edit", editURI));
- links.add(CollectionSupport.link("related", parent.getPermalink()));
- entry.setLinks(links);
- return entry;
- }
-
- private static ApprovalStatus parseStatus(String value) throws
AtomException {
- try {
- return
ApprovalStatus.valueOf(value.trim().toUpperCase(Locale.ROOT));
- } catch (IllegalArgumentException e) {
- throw CollectionSupport.badRequest(
- "Unknown comment status (approved, disapproved, spam,
pending): " + value);
- }
- }
-
- private static String queryString(String status, String entryId) {
- List<String> params = new ArrayList<>();
- if (StringUtils.isNotEmpty(status)) {
- params.add("status=" + URLEncoder.encode(status,
StandardCharsets.UTF_8));
- }
- if (StringUtils.isNotEmpty(entryId)) {
- params.add("entry=" + URLEncoder.encode(entryId,
StandardCharsets.UTF_8));
- }
- return params.isEmpty() ? "" : "?" + String.join("&", params);
- }
-
- private Weblog requireWeblog(String[] pathInfo) throws AtomException {
- return CollectionSupport.requireWeblog(roller, user, pathInfo,
WeblogPermission.POST);
- }
-
- private WeblogEntryComment requireComment(Weblog weblog, String[] pathInfo)
- throws AtomException, WebloggerException {
- WeblogEntryComment comment = pathInfo.length > 2
- ? manager().getComment(weblog, pathInfo[2]) : null;
- if (comment == null) {
- throw new AtomNotFoundException("Cannot find comment");
- }
- return comment;
- }
-
- private WeblogEntryManager manager() {
- return roller.getWeblogEntryManager();
- }
-}
diff --git
a/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandler.java
b/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandler.java
index 67c2aa580..5a1447e01 100644
---
a/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandler.java
+++
b/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandler.java
@@ -178,9 +178,6 @@ public class RollerAtomHandler {
return new TemplateCollection(user, atomURL).postEntry(areq,
entry);
case "categories":
return new CategoryCollection(user, atomURL).postEntry(areq,
entry);
- case "comments":
- throw new AtomException("The comments collection does not
accept POST",
- HttpServletResponse.SC_METHOD_NOT_ALLOWED, null);
default:
EntryCollection ecol = new EntryCollection(user, atomURL);
return ecol.postEntry(areq, entry);
@@ -195,7 +192,7 @@ public class RollerAtomHandler {
/** True for the collections that hold only Atom entries, never media. */
private static boolean isEntryOnlyCollection(String name) {
- return "templates".equals(name) || "categories".equals(name) ||
"comments".equals(name);
+ return "templates".equals(name) || "categories".equals(name);
}
@@ -242,8 +239,6 @@ public class RollerAtomHandler {
} else if (pathInfo.length > 1 && pathInfo[1].equals("categories")) {
return new CategoryCollection(user, atomURL).getCollection(areq);
- } else if (pathInfo.length > 1 && pathInfo[1].equals("comments")) {
- return new CommentCollection(user, atomURL).getCollection(areq);
}
throw new AtomNotFoundException("Cannot find collection specified");
}
@@ -267,8 +262,6 @@ public class RollerAtomHandler {
return new TemplateCollection(user, atomURL).getEntry(areq);
} else if (pathInfo[1].equals("category")) {
return new CategoryCollection(user, atomURL).getEntry(areq);
- } else if (pathInfo[1].equals("comment")) {
- return new CommentCollection(user, atomURL).getEntry(areq);
}
}
throw new AtomNotFoundException("Cannot find specified
entry/resource");
@@ -296,9 +289,6 @@ public class RollerAtomHandler {
case "category":
new CategoryCollection(user, atomURL).putEntry(areq, entry);
return;
- case "comment":
- new CommentCollection(user, atomURL).putEntry(areq, entry);
- return;
default:
EntryCollection ecol = new EntryCollection(user, atomURL);
ecol.putEntry(areq, entry);
@@ -345,9 +335,6 @@ public class RollerAtomHandler {
} else if (pathInfo[1].equals("category")) {
new CategoryCollection(user, atomURL).deleteEntry(areq);
return;
- } else if (pathInfo[1].equals("comment")) {
- new CommentCollection(user, atomURL).deleteEntry(areq);
- return;
}
}
throw new AtomNotFoundException("cannot find specified
entry/resource");
@@ -381,7 +368,7 @@ public class RollerAtomHandler {
return false;
}
if (pathInfo.length > 2 && (pathInfo[1].equals("entry") ||
pathInfo[1].equals("template")
- || pathInfo[1].equals("category") ||
pathInfo[1].equals("comment"))) {
+ || pathInfo[1].equals("category"))) {
return true;
}
if (pathInfo.length > 2 && pathInfo[1].equals("resource") &&
pathInfo[pathInfo.length-1].endsWith(".media-link")) {
@@ -415,8 +402,7 @@ public class RollerAtomHandler {
if (pathInfo.length > 1 && pathInfo[1].equals("categories")) {
return true;
}
- if (pathInfo.length > 1 && (pathInfo[1].equals("templates")
- || pathInfo[1].equals("comments"))) {
+ if (pathInfo.length > 1 && pathInfo[1].equals("templates")) {
return true;
}
return false;
diff --git
a/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomService.java
b/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomService.java
index 4bd517c9b..8e734008a 100644
---
a/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomService.java
+++
b/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomService.java
@@ -122,9 +122,9 @@ public class RollerAtomService {
}
/**
- * Adds the template, category and comment collections that the user may
- * use. Templates need weblog ADMIN permission and a custom theme; the
- * others need POST permission.
+ * Adds the template and category collections that the user may use.
+ * Templates need weblog ADMIN permission and a custom theme; categories
+ * need POST permission.
*/
private static void addManagementCollections(AtomWorkspace workspace, User
user,
Weblog weblog, String atomURL) {
@@ -136,8 +136,6 @@ public class RollerAtomService {
if (CollectionSupport.hasPermission(user, weblog,
WeblogPermission.POST)) {
workspace.getCollections().add(collection("Categories", base +
"/categories",
"application/atom+xml;type=entry"));
- // An empty accept list means the collection does not accept POST
- workspace.getCollections().add(collection("Comments", base +
"/comments", ""));
}
}
diff --git
a/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomPubDocExamplesTest.java
b/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomPubDocExamplesTest.java
index 796f3a174..6043a8561 100644
---
a/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomPubDocExamplesTest.java
+++
b/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomPubDocExamplesTest.java
@@ -102,9 +102,6 @@ public class AtomPubDocExamplesTest {
AtomEntry template = read("template-request.xml");
assertEquals("custom", template.getExtension("action"));
assertTrue(template.getMobileRendition().contains("sidebar-mobile"));
-
- AtomEntry status = read("comment-status-request.xml");
- assertEquals("approved", status.getExtension("status"));
}
@Test
@@ -142,8 +139,6 @@ public class AtomPubDocExamplesTest {
examples.put("categories.xml", write(w -> w.writeCategoriesDoc(w.out,
categories())));
examples.put("category-entry.xml", write(w -> w.writeEntry(w.out,
categoryEntry())));
examples.put("template-entry.xml", write(w -> w.writeEntry(w.out,
templateEntry())));
- examples.put("comment-entry.xml", write(w -> w.writeEntry(w.out,
commentEntry())));
- examples.put("comments-feed.xml", write(w -> w.writeFeed(w.out,
commentsFeed())));
return examples;
}
@@ -171,7 +166,6 @@ public class AtomPubDocExamplesTest {
"application/atom+xml;type=entry"));
workspace.getCollections().add(collection("Categories", BLOG +
"/categories",
"application/atom+xml;type=entry"));
- workspace.getCollections().add(collection("Comments", BLOG +
"/comments", ""));
return service;
}
@@ -271,37 +265,6 @@ public class AtomPubDocExamplesTest {
return entry;
}
- private static AtomEntry commentEntry() {
- AtomEntry entry = new AtomEntry();
- entry.setId(BLOG + "/comment/8f0e2a6c");
- entry.setTitle("Comment on Hello AtomPub");
- entry.setPublished(PUBLISHED);
- entry.setUpdated(PUBLISHED);
- AtomPerson author = new AtomPerson();
- author.setName("Pat Reader");
- author.setEmail("[email protected]");
- author.setUri("https://pat.example.org/");
- entry.getAuthors().add(author);
- entry.setContent(CollectionSupport.text("text", "Nice post!"));
- entry.setInReplyToRef(ROLLER + "/myblog/entry/hello_atompub");
- entry.setInReplyToHref(BLOG + "/entry/4a7d1ed4");
- entry.setExtension("status", "pending");
- entry.setExtension("remoteHost", "192.0.2.10");
- entry.getLinks().add(link("edit", BLOG + "/comment/8f0e2a6c"));
- entry.getLinks().add(link("related", ROLLER +
"/myblog/entry/hello_atompub"));
- return entry;
- }
-
- private static AtomFeed commentsFeed() {
- AtomFeed feed = new AtomFeed();
- feed.setId(BLOG + "/comments/0");
- feed.setTitle("My Weblog comments");
- feed.setUpdated(UPDATED);
- feed.getLinks().add(link("next", BLOG +
"/comments/20?status=pending"));
- feed.getEntries().add(commentEntry());
- return feed;
- }
-
private static AtomCollection collection(String title, String href, String
accept) {
AtomCollection collection = new AtomCollection();
collection.setTitle(title);
@@ -448,7 +411,7 @@ public class AtomPubDocExamplesTest {
return attribute ? escaped.replace("\"", """) : escaped;
}
- /** Each roller:* or thr:* element, serialized alone with its namespace
declared. */
+ /** Each roller:* element, serialized alone with its namespace declared. */
private static List<byte[]> extensionElements(Node node) {
List<byte[]> found = new ArrayList<>();
collectExtensions(node, found);
@@ -461,8 +424,7 @@ public class AtomPubDocExamplesTest {
continue;
}
Node element = (Node) child;
- if (AtomConstants.ROLLER_NS.equals(element.namespace)
- || AtomConstants.THREAD_NS.equals(element.namespace)) {
+ if (AtomConstants.ROLLER_NS.equals(element.namespace)) {
StringBuilder xml = new StringBuilder();
String prefix = element.name.substring(0,
element.name.indexOf(':'));
xml.append('<').append(element.name).append("
xmlns:").append(prefix)
diff --git
a/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomReaderTest.java
b/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomReaderTest.java
index 705aceee1..433bb2484 100644
---
a/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomReaderTest.java
+++
b/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomReaderTest.java
@@ -180,7 +180,7 @@ public class AtomReaderTest {
}
@Test
- public void testRollerExtensionsAndInReplyTo() throws Exception {
+ public void testRollerExtensionsAndUnknownMarkup() throws Exception {
String xml =
"<entry xmlns='http://www.w3.org/2005/Atom'"
+ " xmlns:roller='http://roller.apache.org/ns/atompub/1.0'"
@@ -197,8 +197,8 @@ public class AtomReaderTest {
assertEquals("<div>mobile</div>", entry.getMobileRendition());
assertEquals("custom", entry.getExtension("action"));
assertEquals("true", entry.getExtension("navbar"));
- assertEquals("urn:parent", entry.getInReplyToRef());
- assertEquals("http://example.com/app/blog/entry/1",
entry.getInReplyToHref());
+ // foreign markup that Roller does not use is skipped
+ assertEquals(2, entry.getExtensions().size());
}
@Test
@@ -206,14 +206,12 @@ public class AtomReaderTest {
AtomEntry out = new AtomEntry();
out.setTitle("t");
out.setMobileRendition("<p>m & n</p>");
- out.setExtension("status", "spam");
- out.setInReplyToRef("urn:x");
+ out.setExtension("action", "custom");
java.io.ByteArrayOutputStream bytes = new
java.io.ByteArrayOutputStream();
new AtomWriter().writeEntry(bytes, out);
AtomEntry in = new AtomReader().parseEntry(new
ByteArrayInputStream(bytes.toByteArray()));
assertEquals("<p>m & n</p>", in.getMobileRendition());
- assertEquals("spam", in.getExtension("status"));
- assertEquals("urn:x", in.getInReplyToRef());
+ assertEquals("custom", in.getExtension("action"));
}
}
diff --git
a/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomSchemaValidationTest.java
b/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomSchemaValidationTest.java
index c51f3cdde..12022e3de 100644
---
a/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomSchemaValidationTest.java
+++
b/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomSchemaValidationTest.java
@@ -190,32 +190,7 @@ public class AtomSchemaValidationTest {
}
@Test
- public void testCommentEntryConformsToAtomSchema() throws Exception {
- AtomEntry entry = new AtomEntry();
- entry.setId("http://example.com/app/blog/comment/1");
- entry.setTitle("Comment on Hello");
- entry.setPublished(PUBLISHED);
- entry.setUpdated(PUBLISHED);
- AtomPerson author = new AtomPerson();
- author.setName("bob");
- author.setUri("http://bob.example.com/");
- author.setEmail("[email protected]");
- entry.getAuthors().add(author);
- AtomContent content = new AtomContent();
- content.setType("text");
- content.setValue("Nice post");
- entry.setContent(content);
- entry.setInReplyToRef("http://example.com/blog/entry/hello");
- entry.setInReplyToHref("http://example.com/app/blog/entry/42");
- entry.setExtension("status", "pending");
- entry.getLinks().add(new AtomLink("edit",
"http://example.com/app/blog/comment/1"));
-
- List<String> errors = validate("/atompub/atom.rnc", writeEntry(entry));
- assertTrue(errors.isEmpty(), "comment entry should be schema-valid
but: " + errors);
- }
-
- @Test
- public void
testOutOfLineCategoriesAndReadOnlyCollectionConformToAppSchema() throws
Exception {
+ public void testOutOfLineCategoriesConformToAppSchema() throws Exception {
AtomServiceDoc service = new AtomServiceDoc();
AtomWorkspace workspace = new AtomWorkspace();
workspace.setTitle("My Weblog");
@@ -236,12 +211,6 @@ public class AtomSchemaValidationTest {
entries.getCategories().add(byReference);
workspace.getCollections().add(entries);
- AtomCollection comments = new AtomCollection();
- comments.setTitle("Comments");
- comments.setHref("http://example.com/app/blog/comments");
- comments.setAccepts(Arrays.asList(""));
- workspace.getCollections().add(comments);
-
ByteArrayOutputStream out = new ByteArrayOutputStream();
new AtomWriter().writeServiceDoc(out, service);
diff --git
a/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomWriterTest.java
b/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomWriterTest.java
index ce200be5b..30a5e940a 100644
---
a/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomWriterTest.java
+++
b/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomWriterTest.java
@@ -278,15 +278,15 @@ public class AtomWriterTest {
@Test
public void testCharactersIllegalInXmlAreDropped() throws Exception {
- AtomEntry comment = new AtomEntry();
- comment.setId("urn:comment:1");
- comment.setTitle("Comment");
- comment.setUpdated(UPDATED);
- comment.setContent(text("text", "before\u0014after"));
+ AtomEntry first = new AtomEntry();
+ first.setId("urn:first:1");
+ first.setTitle("First");
+ first.setUpdated(UPDATED);
+ first.setContent(text("text", "before\u0014after"));
AtomPerson author = new AtomPerson();
author.setName("Pat\u0001");
- comment.getAuthors().add(author);
- comment.setExtension("referrer", "https://example.com/?q=\uFFFE");
+ first.getAuthors().add(author);
+ first.setExtension("referrer", "https://example.com/?q=\uFFFE");
AtomEntry entry = new AtomEntry();
entry.setId("urn:entry:1");
entry.setTitle("Title\u0000 with \uD800lone surrogate \uD83D\uDE00");
@@ -294,9 +294,9 @@ public class AtomWriterTest {
entry.getLinks().add(new AtomLink("alternate",
"https://example.com/a\u001Fb"));
AtomFeed feed = new AtomFeed();
feed.setId("urn:feed");
- feed.setTitle("Comments");
+ feed.setTitle("Feed");
feed.setUpdated(UPDATED);
- feed.getEntries().add(comment);
+ feed.getEntries().add(first);
feed.getEntries().add(entry);
ByteArrayOutputStream out = new ByteArrayOutputStream();
diff --git
a/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandlerTest.java
b/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandlerTest.java
index 4f735e8e6..9f47597b0 100644
---
a/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandlerTest.java
+++
b/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomHandlerTest.java
@@ -158,13 +158,16 @@ class RollerAtomHandlerTest {
factory.when(WebloggerFactory::getWeblogger).thenReturn(weblogger);
RollerAtomHandler handler = new RollerAtomHandler(request,
response);
- for (String collection : new String[] {"templates", "categories",
"comments"}) {
+ for (String collection : new String[] {"templates", "categories"})
{
assertTrue(handler.isCollectionURI(atomRequest("/blog/" +
collection)), collection);
}
- for (String member : new String[] {"template", "category",
"comment"}) {
+ for (String member : new String[] {"template", "category"}) {
assertTrue(RollerAtomHandler.isEntryPath("/blog/" + member +
"/abc"), member);
assertFalse(RollerAtomHandler.isEntryPath("/blog/" + member),
member);
}
+ // comments are not managed over AtomPub
+
assertFalse(handler.isCollectionURI(atomRequest("/blog/comments")));
+ assertFalse(RollerAtomHandler.isEntryPath("/blog/comment/abc"));
assertTrue(handler.isCategoriesDocURI(atomRequest("/blog/categories.atomcat")));
assertFalse(handler.isCategoriesDocURI(atomRequest("/blog/categories")));
assertFalse(handler.isCollectionURI(atomRequest("/blog/categories.atomcat")));
@@ -172,20 +175,17 @@ class RollerAtomHandlerTest {
}
@Test
- void entryOnlyCollectionsRefuseMediaAndCommentsRefusePost() {
+ void entryOnlyCollectionsRefuseMedia() {
try (MockedStatic<WebloggerFactory> factory =
mockStatic(WebloggerFactory.class);
MockedStatic<WebloggerRuntimeConfig> config =
mockStatic(WebloggerRuntimeConfig.class)) {
factory.when(WebloggerFactory::getWeblogger).thenReturn(weblogger);
RollerAtomHandler handler = new RollerAtomHandler(request,
response);
- for (String collection : new String[] {"templates", "categories",
"comments"}) {
+ for (String collection : new String[] {"templates", "categories"})
{
AtomException refused = assertThrows(AtomException.class, () ->
handler.postMedia(atomRequest("/blog/" + collection),
new AtomEntry()));
assertEquals(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE,
refused.getStatus());
}
- AtomException post = assertThrows(AtomException.class, () ->
- handler.postEntry(atomRequest("/blog/comments"), new
AtomEntry()));
- assertEquals(HttpServletResponse.SC_METHOD_NOT_ALLOWED,
post.getStatus());
}
}
diff --git
a/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomManagementTest.java
b/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomManagementTest.java
index c41ecdf1c..b99d64575 100644
---
a/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomManagementTest.java
+++
b/app/src/test/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomManagementTest.java
@@ -35,8 +35,6 @@ import org.apache.roller.weblogger.pojos.User;
import org.apache.roller.weblogger.pojos.Weblog;
import org.apache.roller.weblogger.pojos.WeblogCategory;
import org.apache.roller.weblogger.pojos.WeblogEntry;
-import org.apache.roller.weblogger.pojos.WeblogEntryComment;
-import org.apache.roller.weblogger.pojos.WeblogEntryComment.ApprovalStatus;
import org.apache.roller.weblogger.pojos.WeblogPermission;
import org.apache.roller.weblogger.pojos.WeblogTemplate;
import org.apache.roller.weblogger.pojos.WeblogTheme;
@@ -54,8 +52,7 @@ import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
/**
- * Integration tests for the AtomPub template, category and comment
- * collections against the in-memory test database.
+ * Integration tests for the AtomPub template and category collections against
the in-memory test database.
*/
public class RollerAtomManagementTest {
@@ -377,66 +374,13 @@ public class RollerAtomManagementTest {
.getCollection(request("/" + OTHER_HANDLE + "/categories")));
}
- // ------------------------------------------------------------- comments
-
- @Test
- public void commentModeration() throws Exception {
- WeblogEntry entry = TestUtils.setupWeblogEntry("commented",
managedWeblog(),
- TestUtils.getManagedUser(owner));
- WeblogEntryComment pending = TestUtils.setupComment("pending one",
entry);
- pending.setStatus(ApprovalStatus.PENDING);
- entryManager().saveComment(pending);
- WeblogEntryComment approved = TestUtils.setupComment("approved one",
entry);
- TestUtils.endSession(true);
-
- // list only pending comments
- AtomFeed feed = comments(author).getCollection(
- request("/" + HANDLE + "/comments", "status", "pending"));
- List<String> statuses = feed.getEntries().stream()
- .map(e ->
e.getExtension("status")).collect(Collectors.toList());
- assertEquals(List.of("pending"), statuses);
- AtomEntry listed = feed.getEntries().get(0);
- assertEquals(entry.getPermalink(), listed.getInReplyToRef());
- assertEquals("test", listed.getAuthors().get(0).getName());
-
- // approve it
- AtomEntry change = new AtomEntry();
- change.setExtension("status", "approved");
- comments(author).putEntry(request("/" + HANDLE + "/comment/" +
pending.getId()), change);
- TestUtils.endSession(true);
- assertEquals(ApprovalStatus.APPROVED,
entryManager().getComment(pending.getId()).getStatus());
-
- // an unknown status is refused
- AtomEntry bad = new AtomEntry();
- bad.setExtension("status", "maybe");
- AtomException invalid = assertThrows(AtomException.class, () ->
comments(author)
- .putEntry(request("/" + HANDLE + "/comment/" +
pending.getId()), bad));
- assertEquals(HttpServletResponse.SC_BAD_REQUEST, invalid.getStatus());
-
- // delete the other one
- comments(author).deleteEntry(request("/" + HANDLE + "/comment/" +
approved.getId()));
- TestUtils.endSession(true);
- assertNull(entryManager().getComment(approved.getId()));
- }
-
- @Test
- public void commentsOfAnotherWeblogAreNotFound() throws Exception {
- WeblogEntry entry = TestUtils.setupWeblogEntry("elsewhere",
managedOther(),
- TestUtils.getManagedUser(owner));
- WeblogEntryComment comment = TestUtils.setupComment("other", entry);
- TestUtils.endSession(true);
-
- assertThrows(AtomNotFoundException.class, () -> comments(author)
- .getEntry(request("/" + HANDLE + "/comment/" +
comment.getId())));
- }
-
// ------------------------------------------------------ service document
@Test
public void serviceDocumentListsTheCollectionsTheUserMayUse() throws
Exception {
List<String> authorHrefs = hrefs(author);
assertTrue(authorHrefs.contains(ATOM_URL + "/" + HANDLE +
"/categories"));
- assertTrue(authorHrefs.contains(ATOM_URL + "/" + HANDLE +
"/comments"));
+ assertFalse(authorHrefs.contains(ATOM_URL + "/" + HANDLE +
"/comments"));
assertFalse(authorHrefs.contains(ATOM_URL + "/" + HANDLE +
"/templates"));
// the owner sees templates only once the weblog uses a custom theme
@@ -479,10 +423,6 @@ public class RollerAtomManagementTest {
return new CategoryCollection(TestUtils.getManagedUser(user),
ATOM_URL);
}
- private CommentCollection comments(User user) throws Exception {
- return new CommentCollection(TestUtils.getManagedUser(user), ATOM_URL);
- }
-
private Weblog managedWeblog() throws Exception {
return weblogManager().getWeblogByHandle(HANDLE);
}
diff --git a/docs/atompub/examples/category-entry.xml
b/docs/atompub/examples/category-entry.xml
index f3cfac6c0..2c72fb0cb 100644
--- a/docs/atompub/examples/category-entry.xml
+++ b/docs/atompub/examples/category-entry.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app"
xmlns:roller="http://roller.apache.org/ns/atompub/1.0"
xmlns:thr="http://purl.org/syndication/thread/1.0">
+<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app"
xmlns:roller="http://roller.apache.org/ns/atompub/1.0">
<id>https://example.com/roller/roller-services/app/myblog/category/7c3e9a10</id>
<title>Travel</title>
<updated>2026-10-10T12:30:00Z</updated>
diff --git a/docs/atompub/examples/comment-entry.xml
b/docs/atompub/examples/comment-entry.xml
deleted file mode 100644
index e169b7094..000000000
--- a/docs/atompub/examples/comment-entry.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app"
xmlns:roller="http://roller.apache.org/ns/atompub/1.0"
xmlns:thr="http://purl.org/syndication/thread/1.0">
-
<id>https://example.com/roller/roller-services/app/myblog/comment/8f0e2a6c</id>
- <title>Comment on Hello AtomPub</title>
- <published>2026-10-10T12:00:00Z</published>
- <updated>2026-10-10T12:00:00Z</updated>
- <author>
- <name>Pat Reader</name>
- <uri>https://pat.example.org/</uri>
- <email>[email protected]</email>
- </author>
- <content type="text">Nice post!</content>
- <link rel="edit"
href="https://example.com/roller/roller-services/app/myblog/comment/8f0e2a6c"/>
- <link rel="related"
href="https://example.com/roller/myblog/entry/hello_atompub"/>
- <thr:in-reply-to ref="https://example.com/roller/myblog/entry/hello_atompub"
href="https://example.com/roller/roller-services/app/myblog/entry/4a7d1ed4"/>
- <roller:status>pending</roller:status>
- <roller:remoteHost>192.0.2.10</roller:remoteHost>
- <app:control>
- <app:draft>no</app:draft>
- </app:control>
-</entry>
diff --git a/docs/atompub/examples/comment-status-request.xml
b/docs/atompub/examples/comment-status-request.xml
deleted file mode 100644
index d74140ef2..000000000
--- a/docs/atompub/examples/comment-status-request.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:roller="http://roller.apache.org/ns/atompub/1.0">
-
<id>https://example.com/roller/roller-services/app/myblog/comment/8f0e2a6c</id>
- <title>Comment on Hello AtomPub</title>
- <updated>2026-10-10T12:00:00Z</updated>
- <author>
- <name>dave</name>
- </author>
- <roller:status>approved</roller:status>
-</entry>
diff --git a/docs/atompub/examples/comments-feed.xml
b/docs/atompub/examples/comments-feed.xml
deleted file mode 100644
index 4b4e5ba4e..000000000
--- a/docs/atompub/examples/comments-feed.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app"
xmlns:roller="http://roller.apache.org/ns/atompub/1.0"
xmlns:thr="http://purl.org/syndication/thread/1.0">
- <id>https://example.com/roller/roller-services/app/myblog/comments/0</id>
- <title>My Weblog comments</title>
- <updated>2026-10-10T12:30:00Z</updated>
- <link rel="next"
href="https://example.com/roller/roller-services/app/myblog/comments/20?status=pending"/>
- <entry>
-
<id>https://example.com/roller/roller-services/app/myblog/comment/8f0e2a6c</id>
- <title>Comment on Hello AtomPub</title>
- <published>2026-10-10T12:00:00Z</published>
- <updated>2026-10-10T12:00:00Z</updated>
- <author>
- <name>Pat Reader</name>
- <uri>https://pat.example.org/</uri>
- <email>[email protected]</email>
- </author>
- <content type="text">Nice post!</content>
- <link rel="edit"
href="https://example.com/roller/roller-services/app/myblog/comment/8f0e2a6c"/>
- <link rel="related"
href="https://example.com/roller/myblog/entry/hello_atompub"/>
- <thr:in-reply-to
ref="https://example.com/roller/myblog/entry/hello_atompub"
href="https://example.com/roller/roller-services/app/myblog/entry/4a7d1ed4"/>
- <roller:status>pending</roller:status>
- <roller:remoteHost>192.0.2.10</roller:remoteHost>
- <app:control>
- <app:draft>no</app:draft>
- </app:control>
- </entry>
-</feed>
diff --git a/docs/atompub/examples/entries-feed.xml
b/docs/atompub/examples/entries-feed.xml
index a9211a9aa..fbf4e9c44 100644
--- a/docs/atompub/examples/entries-feed.xml
+++ b/docs/atompub/examples/entries-feed.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app"
xmlns:roller="http://roller.apache.org/ns/atompub/1.0"
xmlns:thr="http://purl.org/syndication/thread/1.0">
+<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app"
xmlns:roller="http://roller.apache.org/ns/atompub/1.0">
<id>https://example.com/roller/roller-services/app/myblog/entries/0</id>
<title>My Weblog</title>
<updated>2026-10-10T12:30:00Z</updated>
diff --git a/docs/atompub/examples/entry-response.xml
b/docs/atompub/examples/entry-response.xml
index b513e743c..745ca06fd 100644
--- a/docs/atompub/examples/entry-response.xml
+++ b/docs/atompub/examples/entry-response.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app"
xmlns:roller="http://roller.apache.org/ns/atompub/1.0"
xmlns:thr="http://purl.org/syndication/thread/1.0">
+<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app"
xmlns:roller="http://roller.apache.org/ns/atompub/1.0">
<id>https://example.com/roller/myblog/entry/hello_atompub</id>
<title>Hello AtomPub</title>
<published>2026-10-10T12:00:00Z</published>
diff --git a/docs/atompub/examples/media-link-entry.xml
b/docs/atompub/examples/media-link-entry.xml
index 5427acd06..7efa153db 100644
--- a/docs/atompub/examples/media-link-entry.xml
+++ b/docs/atompub/examples/media-link-entry.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app"
xmlns:roller="http://roller.apache.org/ns/atompub/1.0"
xmlns:thr="http://purl.org/syndication/thread/1.0">
+<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app"
xmlns:roller="http://roller.apache.org/ns/atompub/1.0">
<id>https://example.com/roller/roller-services/app/myblog/resource/default/sunset.jpg</id>
<title>sunset.jpg</title>
<updated>2026-10-10T12:30:00Z</updated>
diff --git a/docs/atompub/examples/service.xml
b/docs/atompub/examples/service.xml
index f14322575..86cbdb796 100644
--- a/docs/atompub/examples/service.xml
+++ b/docs/atompub/examples/service.xml
@@ -26,9 +26,5 @@
<atom:title>Categories</atom:title>
<accept>application/atom+xml;type=entry</accept>
</collection>
- <collection
href="https://example.com/roller/roller-services/app/myblog/comments">
- <atom:title>Comments</atom:title>
- <accept/>
- </collection>
</workspace>
</service>
diff --git a/docs/atompub/examples/template-entry.xml
b/docs/atompub/examples/template-entry.xml
index b340626fe..9c53adc89 100644
--- a/docs/atompub/examples/template-entry.xml
+++ b/docs/atompub/examples/template-entry.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app"
xmlns:roller="http://roller.apache.org/ns/atompub/1.0"
xmlns:thr="http://purl.org/syndication/thread/1.0">
+<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app"
xmlns:roller="http://roller.apache.org/ns/atompub/1.0">
<id>https://example.com/roller/roller-services/app/myblog/template/0e5d8b62</id>
<title>sidebar</title>
<updated>2026-10-10T12:30:00Z</updated>
diff --git a/docs/atompub/roller-atompub.rnc b/docs/atompub/roller-atompub.rnc
index 2c7bb6f5e..cc53f5079 100644
--- a/docs/atompub/roller-atompub.rnc
+++ b/docs/atompub/roller-atompub.rnc
@@ -15,16 +15,14 @@
# directory of this distribution.
# RELAX NG Compact grammar for the extension elements that Roller's AtomPub
-# service adds to atom:entry: Roller's own elements and the thr:in-reply-to
-# element of the Atom Threading Extensions (RFC 4685). Atom allows these as
+# service adds to atom:entry. Atom allows these as
# foreign elements, so an entry that uses them is still valid against the
# RFC 4287 grammar. This grammar checks the elements themselves; its start
# pattern matches one extension element.
namespace roller = "http://roller.apache.org/ns/atompub/1.0"
-namespace thr = "http://purl.org/syndication/thread/1.0"
-start = rollerElement | thrInReplyTo
+start = rollerElement
boolean = "true" | "false"
@@ -43,16 +41,3 @@ rollerElement =
| element roller:image { text }
| element roller:position { xsd:nonNegativeInteger }
| element roller:inUse { boolean }
- # Comments
- | element roller:status { "approved" | "disapproved" | "spam" | "pending" }
- | element roller:remoteHost { text }
- | element roller:referrer { text }
-
-thrInReplyTo =
- element thr:in-reply-to {
- attribute ref { text },
- attribute href { text }?,
- attribute type { text }?,
- attribute source { text }?,
- empty
- }
diff --git a/docs/roller-atompub-guide.adoc b/docs/roller-atompub-guide.adoc
index e8e2376ac..5acc7c2a1 100644
--- a/docs/roller-atompub-guide.adoc
+++ b/docs/roller-atompub-guide.adoc
@@ -8,13 +8,13 @@ Apache Roller Weblogger
This is the reference for the Atom Publishing Protocol (AtomPub) interface of
the Apache Roller Weblogger. With it, a program can create and edit weblog
-entries, upload media files, and manage a weblog's categories, templates and
-comments over HTTP.
+entries, upload media files, and manage a weblog's categories and templates
+over HTTP. Comments are moderated in Roller's web interface, not over AtomPub.
Roller implements AtomPub as defined in
https://www.rfc-editor.org/rfc/rfc5023[RFC 5023], using the Atom format of
-https://www.rfc-editor.org/rfc/rfc4287[RFC 4287]. Categories, templates and
-comments are Roller extensions; they use ordinary Atom entries plus a few
+https://www.rfc-editor.org/rfc/rfc4287[RFC 4287]. Categories and templates
+are Roller extensions; they use ordinary Atom entries plus a few
extension elements, so any AtomPub client library can read and write them.
=== Copyright and trademark information
@@ -38,7 +38,6 @@ All trademarks within this document belong to legitimate
owners.
|(default) |`http://www.w3.org/2005/Atom` (Atom, RFC 4287)
|`app` |`http://www.w3.org/2007/app` (AtomPub, RFC 5023)
|`roller` |`http://roller.apache.org/ns/atompub/1.0` (Roller extensions)
-|`thr` |`http://purl.org/syndication/thread/1.0` (Atom Threading, RFC 4685)
|===
* Media types:
+
@@ -110,7 +109,7 @@ user is a member of, and lists only the collections the
user may use:
|Collection |Listed when
|Weblog Entries, Media Files (one per media directory)
|The user is a member of the weblog
-|Categories, Comments
+|Categories
|The user may post to the weblog (permission `POST` or higher)
|Templates
|The user is an administrator of the weblog (`ADMIN`), the weblog uses a custom
@@ -120,7 +119,6 @@ theme, and the site allows custom themes
The entries collection describes the weblog's categories twice: inline, for
older clients, and as a link to the weblog's category document. A third,
empty `app:categories` element says that any other term is accepted as a tag.
-The comments collection has an empty `app:accept`: it does not accept `POST`.
.Service document
[source,xml]
@@ -136,7 +134,7 @@ include::atompub/examples/service.xml[]
* A successful `POST` answers `201 Created` with the new member as the body and
its edit URI in the `Location` and `Content-Location` headers.
* A successful `PUT` or `DELETE` answers `200 OK` without a body.
-* The entries, media and comments collections return at most 20 members. When
+* The entries and media collections return at most 20 members. When
there are more, the feed has `next` and `previous` links; follow them to page
through. The categories and templates collections return all members.
@@ -365,53 +363,6 @@ include::atompub/examples/template-request.xml[]
include::atompub/examples/template-entry.xml[]
----
-== Comments
-
-The comments collection is for comment moderation. It does not accept new
-comments.
-
-[cols="2,1,4",options="header"]
-|===
-|URI |Method |Action
-|`/{h}/comments`, `/{h}/comments/{offset}` |GET
-|List comments, newest first. Filter with `?status=` (`approved`,
-`disapproved`, `spam`, `pending`) and `?entry={entryId}`.
-|`/{h}/comments` |POST |Not allowed (`405 Method Not Allowed`)
-|`/{h}/comment/{id}` |GET |Read a comment
-|`/{h}/comment/{id}` |PUT |Change the comment's status
-|`/{h}/comment/{id}` |DELETE |Delete a comment
-|===
-
-*Permission:* `POST` on the weblog.
-
-[cols="2,1,4",options="header"]
-|===
-|Element |Access |Meaning
-|`roller:status` |read/write
-|`approved`, `disapproved`, `spam` or `pending`. The only element a `PUT` uses.
-|`atom:author` |read |The commenter's name, email address and web site
-|`atom:content` |read |The comment text
-|`atom:published` |read |When the comment was posted
-|`thr:in-reply-to` |read |The weblog entry: its id (`ref`) and edit URI
-(`href`)
-|`roller:remoteHost`, `roller:referrer` |read |Where the comment came from
-|===
-
-When a `pending` comment is approved, Roller sends the same notification email
-as the *Comments* page, if mail is configured.
-
-.Changing a comment's status (request)
-[source,xml]
-----
-include::atompub/examples/comment-status-request.xml[]
-----
-
-.Comments collection
-[source,xml]
-----
-include::atompub/examples/comments-feed.xml[]
-----
-
== Errors
Errors carry a short message. Server errors (`5xx`) carry no detail; the cause
@@ -421,15 +372,14 @@ is in Roller's log.
|===
|Status |Meaning
|`400 Bad Request` |The entry is not well-formed, has a `DOCTYPE`, or has an
-invalid value (unknown action or status, invalid category name or image URL,
+invalid value (unknown action, invalid category name or image URL,
a value longer than 255 characters, bad `moveTo`)
|`401 Unauthorized` |Authentication failed, or the user lacks the permission
the
resource needs
|`404 Not Found` |AtomPub is off, the resource does not exist or belongs to
another weblog, or the collection is not available (for example templates of a
shared theme)
-|`405 Method Not Allowed` |The method is not supported, for example `POST` to
-the comments collection
+|`405 Method Not Allowed` |The method is not supported
|`409 Conflict` |The change conflicts with the weblog: duplicate name or link,
a template action that is taken, a required template, a category in use or the
last category
@@ -472,12 +422,6 @@ curl -u "$AUTH" -X POST "$APP/myblog/categories" \
curl -u "$AUTH" -X PUT "$APP/myblog/template/0e5d8b62" \
-H "Content-Type: application/atom+xml;type=entry" \
--data-binary @template-request.xml
-
-# 6. List pending comments, then approve one
-curl -u "$AUTH" "$APP/myblog/comments?status=pending"
-curl -u "$AUTH" -X PUT "$APP/myblog/comment/8f0e2a6c" \
- -H "Content-Type: application/atom+xml;type=entry" \
- --data-binary @comment-status-request.xml
----
== Schemas
@@ -486,7 +430,7 @@ curl -u "$AUTH" -X PUT "$APP/myblog/comment/8f0e2a6c" \
https://www.rfc-editor.org/rfc/rfc4287#appendix-B[RFC 4287, Appendix B].
* Service and category documents: the grammar in
https://www.rfc-editor.org/rfc/rfc5023#appendix-B[RFC 5023, Appendix B].
-* Roller's extension elements and `thr:in-reply-to`:
`atompub/roller-atompub.rnc`
+* Roller's extension elements: `atompub/roller-atompub.rnc`
in Roller's `docs` directory:
+
[source]
diff --git a/docs/roller-user-guide.adoc b/docs/roller-user-guide.adoc
index cb35bbb90..cd47d0d6e 100644
--- a/docs/roller-user-guide.adoc
+++ b/docs/roller-user-guide.adoc
@@ -630,10 +630,9 @@ URL is _http://jroller.com/fredsblog_), then your
parameters would be:
* *BlogID*: fredsblog
* *URL*: http://jroller.com/roller-services/xmlrpc
-==== Managing templates, categories and comments with AtomPub
+==== Managing templates and categories with AtomPub
-Roller's AtomPub service can also manage a weblog's templates, categories and
-comments. The AtomPub Guide (`roller-atompub-guide`) documents every URI,
+Roller's AtomPub service can also manage a weblog's templates and categories.
The AtomPub Guide (`roller-atompub-guide`) documents every URI,
permission and XML element, with examples.
== Working with comments