[Yanel-commits] rev 60749 - public/yanel/trunk/src/resources/comment/src/java/org/wyona/yanel/impl/resources/comment
michi at wyona.com
michi at wyona.com
Fri Sep 16 08:27:04 CEST 2011
Author: michi
Date: 2011-09-16 08:27:03 +0200 (Fri, 16 Sep 2011)
New Revision: 60749
Modified:
public/yanel/trunk/src/resources/comment/src/java/org/wyona/yanel/impl/resources/comment/CommentResource.java
Log:
comments added and javadoc improved
Modified: public/yanel/trunk/src/resources/comment/src/java/org/wyona/yanel/impl/resources/comment/CommentResource.java
===================================================================
--- public/yanel/trunk/src/resources/comment/src/java/org/wyona/yanel/impl/resources/comment/CommentResource.java 2011-09-15 22:11:07 UTC (rev 60748)
+++ public/yanel/trunk/src/resources/comment/src/java/org/wyona/yanel/impl/resources/comment/CommentResource.java 2011-09-16 06:27:03 UTC (rev 60749)
@@ -15,7 +15,7 @@
import org.apache.log4j.Logger;
/**
- * A resource in order to create and edit comments
+ * A resource in order to create and edit comments of a commentable resource (which is referenced by a path parameter)
*/
public class CommentResource extends BasicXMLResource {
@@ -55,7 +55,11 @@
String name = getEnvironment().getRequest().getParameter("name");
if (name != null) comment.setAuthorName(name);
+ // TODO: Validate fields (e.g. email should be mandatory)!
cMan.addComment(getRealm(), path, comment);
+ log.warn("TODO: Send an email to administrator that a new comment has been added to : " + path);
+
+ // INFO: Return content of comment as confirmation of what has been saved
sb.append("<comment path=\"" + path + "\">");
sb.append(body);
sb.append("</comment>");
@@ -73,7 +77,7 @@
sb.append("<exception status=\"no-such-resource\">" + message + "</exception>");
}
} else {
- String message = "No path!";
+ String message = "No path of commentable resource specified!";
log.error(message);
sb.append("<exception status=\"no-path\">" + message + "</exception>");
}
More information about the Yanel-commits
mailing list