roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r353894 - in /incubator/roller/trunk: src/org/roller/business/hibernate/ src/org/roller/presentation/velocity/ src/org/roller/presentation/weblog/actions/ web/WEB-INF/classes/
Date Sun, 04 Dec 2005 19:10:26 GMT
Author: snoopdave
Date: Sun Dec  4 11:10:21 2005
New Revision: 353894

URL: http://svn.apache.org/viewcvs?rev=353894&view=rev
Log:
Couple more minor fixes in comment management/moderation

Modified:
    incubator/roller/trunk/src/org/roller/business/hibernate/HibernateWeblogManagerImpl.java
    incubator/roller/trunk/src/org/roller/presentation/velocity/ContextLoader.java
    incubator/roller/trunk/src/org/roller/presentation/velocity/PageModel.java
    incubator/roller/trunk/src/org/roller/presentation/weblog/actions/CommentManagementAction.java
    incubator/roller/trunk/web/WEB-INF/classes/comments.vm

Modified: incubator/roller/trunk/src/org/roller/business/hibernate/HibernateWeblogManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/business/hibernate/HibernateWeblogManagerImpl.java?rev=353894&r1=353893&r2=353894&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/business/hibernate/HibernateWeblogManagerImpl.java
(original)
+++ incubator/roller/trunk/src/org/roller/business/hibernate/HibernateWeblogManagerImpl.java
Sun Dec  4 11:10:21 2005
@@ -723,7 +723,7 @@
             criteria.addOrder(Order.desc("postTime"));
 
             List comments = criteria.list();
-            if (comments.size() < offset) {
+            if (offset==0 || comments.size() < offset) {
                 return comments;
             }
             List range = new ArrayList();

Modified: incubator/roller/trunk/src/org/roller/presentation/velocity/ContextLoader.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/velocity/ContextLoader.java?rev=353894&r1=353893&r2=353894&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/velocity/ContextLoader.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/velocity/ContextLoader.java Sun Dec
 4 11:10:21 2005
@@ -242,7 +242,7 @@
         
         WeblogEntryData entry = rreq.getWeblogEntry();
         if (entry.getStatus().equals(WeblogEntryData.PUBLISHED)) {
-            ctx.put("entry", WeblogEntryDataWrapper.wrap(entry));            
+            ctx.put("entry", WeblogEntryDataWrapper.wrap(entry));
         }
     }   
 

Modified: incubator/roller/trunk/src/org/roller/presentation/velocity/PageModel.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/velocity/PageModel.java?rev=353894&r1=353893&r2=353894&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/velocity/PageModel.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/velocity/PageModel.java Sun Dec  4
11:10:21 2005
@@ -31,6 +31,7 @@
 import org.roller.pojos.wrapper.TemplateWrapper;
 import org.roller.pojos.wrapper.WeblogCategoryDataWrapper;
 import org.roller.pojos.wrapper.WeblogEntryDataWrapper;
+import org.roller.pojos.wrapper.WebsiteDataWrapper;
 import org.roller.presentation.RollerRequest;
 import org.roller.presentation.RollerSession;
 import org.roller.util.StringUtils;
@@ -184,12 +185,13 @@
     //------------------------------------------------------------------------
      
     /** Get comments for weblog entry specified by request */
-    public List getComments(WeblogEntryData entry) {
+    public List getComments(WeblogEntryDataWrapper entry) {
         return getComments(entry, true, true);
     }
         
     /** Get comments for weblog entry specified by request */
-    public List getComments(WeblogEntryData entry, boolean noSpam, boolean approvedOnly)
{
+    public List getComments(WeblogEntryDataWrapper wrapper, boolean noSpam, boolean approvedOnly)
{
+        WeblogEntryData entry = wrapper.getPojo();
         List comments = new ArrayList();
         List unwrappped = entry.getComments(noSpam, approvedOnly);
         comments = new ArrayList(unwrappped.size());
@@ -237,8 +239,9 @@
     //------------------------------------------------------------------------
     
     /** Encapsulates UserManager.getPageByName() */
-    public TemplateWrapper getUsersPageByName(WebsiteData website, String pageName)
+    public TemplateWrapper getUsersPageByName(WebsiteDataWrapper wrapper, String pageName)
     {
+        WebsiteData website = wrapper.getPojo();
         TemplateWrapper page = null;
         try
         {

Modified: incubator/roller/trunk/src/org/roller/presentation/weblog/actions/CommentManagementAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/weblog/actions/CommentManagementAction.java?rev=353894&r1=353893&r2=353894&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/weblog/actions/CommentManagementAction.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/weblog/actions/CommentManagementAction.java
Sun Dec  4 11:10:21 2005
@@ -27,6 +27,7 @@
 import org.roller.presentation.BasePageModel;
 import org.roller.presentation.RollerRequest;
 import org.roller.presentation.RollerSession;
+import org.roller.presentation.cache.CacheManager;
 import org.roller.presentation.weblog.formbeans.CommentManagementForm;
 import org.roller.util.Utilities;
 
@@ -112,6 +113,7 @@
                 }    
                 // loop through IDs of all comments displayed on page
                 String[] ids = Utilities.stringToStringArray(queryForm.getIds(),",");
+                List flushList = new ArrayList();
                 for (int i=0; i<ids.length; i++) {                    
                     if (deletedList.contains(ids[i])) continue;                    
                     CommentData comment = mgr.retrieveComment(ids[i]);
@@ -143,8 +145,12 @@
                         }
                     }
                     comment.save();
+                    flushList.add(comment);
                 }               
                 RollerFactory.getRoller().commit();
+                for (Iterator comments=flushList.iterator(); comments.hasNext();) {
+                    CacheManager.invalidate((CommentData)comments.next());
+                }
                 ActionMessages msgs = new ActionMessages();
                 msgs.add(ActionMessages.GLOBAL_MESSAGE, 
                     new ActionMessage("commentManagement.updateSuccess"));

Modified: incubator/roller/trunk/web/WEB-INF/classes/comments.vm
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/WEB-INF/classes/comments.vm?rev=353894&r1=353893&r2=353894&view=diff
==============================================================================
--- incubator/roller/trunk/web/WEB-INF/classes/comments.vm (original)
+++ incubator/roller/trunk/web/WEB-INF/classes/comments.vm Sun Dec  4 11:10:21 2005
@@ -97,10 +97,13 @@
         <div class="comments-head">$text.get( "macro.weblog.preview" ):</div>
     #else
         <div class="comments-head">$text.get( "macro.weblog.comments" ):</div>
-        #set($comments = $pageModel.getComments($entry, true))
+        #set($comments = $pageModel.getComments($entry))
+        $comments
+        $comments.size()
     #end
     <br/>
     #foreach( $comment in $comments )
+        <!-- comment: $comment.id -->
         #if( $comment.approved )
             #set($content = $utilities.encodeEmail($comment.content))
             #if($escapeHtml)



Mime
View raw message