roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r544664 - in /roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger: ui/struts2/editor/Comments.java ui/struts2/editor/CommentsBean.java util/MailUtil.java
Date Tue, 05 Jun 2007 22:45:09 GMT
Author: agilliland
Date: Tue Jun  5 15:45:08 2007
New Revision: 544664

URL: http://svn.apache.org/viewvc?view=rev&rev=544664
Log:
weblog comment management action needs to support restricting view to only comments from a
single entry.  also fixing comment notification email so that it sends out the right url to
the comment managment action to view comments just from the commented entry.


Modified:
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/Comments.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/CommentsBean.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/util/MailUtil.java

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/Comments.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/Comments.java?view=diff&rev=544664&r1=544663&r2=544664
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/Comments.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/Comments.java
Tue Jun  5 15:45:08 2007
@@ -30,6 +30,7 @@
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.RollerFactory;
 import org.apache.roller.weblogger.business.WeblogManager;
+import org.apache.roller.weblogger.pojos.WeblogEntry;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
 import org.apache.roller.weblogger.pojos.WeblogPermission;
 import org.apache.roller.weblogger.ui.struts2.pagers.CommentsPager;
@@ -86,9 +87,17 @@
         boolean hasMore = false;
         try {
             WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+            
+            // lookup weblog entry if necessary
+            WeblogEntry queryEntry = null;
+            if(!StringUtils.isEmpty(getBean().getEntryId())) {
+                queryEntry = wmgr.getWeblogEntry(getBean().getEntryId());
+            }
+            
+            // query for comments
             comments = wmgr.getComments(
                     getActionWeblog(),
-                    null,
+                    queryEntry,
                     getBean().getSearchString(),
                     getBean().getStartDate(),
                     getBean().getEndDate(),
@@ -123,6 +132,9 @@
         
         Map<String, String> params = new HashMap();
         
+        if(!StringUtils.isEmpty(getBean().getEntryId())) {
+            params.put("bean.entryId", getBean().getEntryId());
+        }
         if(!StringUtils.isEmpty(getBean().getSearchString())) {
             params.put("bean.searchString", getBean().getSearchString());
         }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/CommentsBean.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/CommentsBean.java?view=diff&rev=544664&r1=544663&r2=544664
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/CommentsBean.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/CommentsBean.java
Tue Jun  5 15:45:08 2007
@@ -34,6 +34,7 @@
  */
 public class CommentsBean {
     
+    private String entryId = null;
     private String searchString = null;
     private String startDateString = null;
     private String endDateString = null;
@@ -201,6 +202,14 @@
 
     public void setEndDateString(String endDateString) {
         this.endDateString = endDateString;
+    }
+
+    public String getEntryId() {
+        return entryId;
+    }
+
+    public void setEntryId(String entryId) {
+        this.entryId = entryId;
     }
     
 }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/util/MailUtil.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/util/MailUtil.java?view=diff&rev=544664&r1=544663&r2=544664
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/util/MailUtil.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/util/MailUtil.java Tue
Jun  5 15:45:08 2007
@@ -403,7 +403,7 @@
         ownermsg.append((escapeHtml) ? "\n" : "<br />");
         
         Map<String, String> parameters = new HashMap();
-        parameters.put("entryId", entry.getId());
+        parameters.put("bean.entryId", entry.getId());
         String deleteURL = URLUtilities.getActionURL(
                 "comments", "/roller-ui/authoring", weblog.getHandle(), parameters, true);
         



Mime
View raw message