[Yanel-commits] rev 57345 - public/yanel/trunk/src/resources/comment/src/java/org/wyona/yanel/impl/resources/comment

michi at wyona.com michi at wyona.com
Wed Mar 16 11:57:18 CET 2011


Author: michi
Date: 2011-03-16 11:57:18 +0100 (Wed, 16 Mar 2011)
New Revision: 57345

Modified:
   public/yanel/trunk/src/resources/comment/src/java/org/wyona/yanel/impl/resources/comment/CommentResource.java
Log:
create ID

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-03-16 10:56:34 UTC (rev 57344)
+++ public/yanel/trunk/src/resources/comment/src/java/org/wyona/yanel/impl/resources/comment/CommentResource.java	2011-03-16 10:57:18 UTC (rev 57345)
@@ -44,7 +44,12 @@
                         CommentV1 comment = new CommentV1();
                         comment.setCommentText(body);
                         String title = getEnvironment().getRequest().getParameter("title");
-                        if (title != null) comment.setTitle(title);
+                        if (title != null && title.trim().length() > 0) {
+                            comment.setTitle(title);
+                            comment.setId(title.replace(" ", "_"));
+                        } else {
+                            log.warn("No title set!");
+                        }
                         String email = getEnvironment().getRequest().getParameter("email");
                         if (email != null) comment.setAuthorMail(email);
                         String name = getEnvironment().getRequest().getParameter("name");



More information about the Yanel-commits mailing list