roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1604929 - in /roller/trunk/app/src: main/java/org/apache/roller/weblogger/ main/java/org/apache/roller/weblogger/business/ main/java/org/apache/roller/weblogger/business/jpa/ main/java/org/apache/roller/weblogger/pojos/ main/java/org/apach...
Date Mon, 23 Jun 2014 20:29:25 GMT
Author: gmazza
Date: Mon Jun 23 20:29:24 2014
New Revision: 1604929

URL: http://svn.apache.org/r1604929
Log:
Switched to enum for WeblogEntryComment approval status; changed effect of Admin un-spamming a comment to that of disapproval instead of approval; removed no spam search option until properly implemented (via checkbox or multi-select list) as it doesn't work well with enums.

Modified:
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/TestUtils.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/CommentSearchCriteria.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryComment.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/CommentServlet.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/TrackbackServlet.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalCommentManagement.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalCommentManagementBean.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Comments.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CommentsBean.java
    roller/trunk/app/src/main/resources/ApplicationResources.properties
    roller/trunk/app/src/main/resources/ApplicationResources_de.properties
    roller/trunk/app/src/main/resources/ApplicationResources_es.properties
    roller/trunk/app/src/main/resources/ApplicationResources_fr.properties
    roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties
    roller/trunk/app/src/main/resources/ApplicationResources_ko.properties
    roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/WeblogEntryComment.orm.xml
    roller/trunk/app/src/main/webapp/WEB-INF/jsps/admin/GlobalCommentManagement.jsp
    roller/trunk/app/src/main/webapp/WEB-INF/jsps/admin/GlobalCommentManagementSidebar.jsp
    roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Comments.jsp
    roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/CommentsSidebar.jsp
    roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Entries.jsp
    roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/CommentTest.java

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/TestUtils.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/TestUtils.java?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/TestUtils.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/TestUtils.java Mon Jun 23 20:29:24 2014
@@ -54,6 +54,7 @@ import org.apache.roller.weblogger.pojos
 import org.apache.roller.weblogger.pojos.WeblogEntry;
 import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
+import org.apache.roller.weblogger.pojos.WeblogEntryComment.ApprovalStatus;
 import org.apache.roller.weblogger.pojos.WeblogHitCount;
 import org.apache.roller.weblogger.pojos.WeblogPermission;
 
@@ -438,7 +439,7 @@ public final class TestUtils {
         testComment.setPostTime(new java.sql.Timestamp(new java.util.Date()
                 .getTime()));
         testComment.setWeblogEntry(getManagedWeblogEntry(entry));
-        testComment.setStatus(WeblogEntryComment.APPROVED);
+        testComment.setStatus(ApprovalStatus.APPROVED);
 
         // store testComment
         WeblogEntryManager mgr = WebloggerFactory.getWeblogger()

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java Mon Jun 23 20:29:24 2014
@@ -29,6 +29,7 @@ import org.apache.roller.weblogger.pojos
 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.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.pojos.WeblogHitCount;
 
@@ -220,7 +221,7 @@ public interface WeblogEntryManager {
             String          searchString,
             Date            startDate,
             Date            endDate,
-            String          status
+            ApprovalStatus  status
             
             ) throws WebloggerException;
         

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java Mon Jun 23 20:29:24 2014
@@ -34,6 +34,7 @@ import org.apache.roller.weblogger.Weblo
 import org.apache.roller.weblogger.business.Weblogger;
 import org.apache.roller.weblogger.pojos.CommentSearchCriteria;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
+import org.apache.roller.weblogger.pojos.WeblogEntryComment.ApprovalStatus;
 import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.pojos.WeblogHitCount;
 import org.apache.roller.weblogger.pojos.StatCount;
@@ -656,18 +657,8 @@ public class JPAWeblogEntryManagerImpl i
         }
         
         if (csc.getStatus() != null) {
-            String comparisonOperator;
-            if("ALL_IGNORE_SPAM".equals(csc.getStatus())) {
-                // we want all comments, except spam
-                // so that means where status != SPAM
-                csc.setStatus(WeblogEntryComment.SPAM);
-                comparisonOperator = " <> ";
-            } else {
-                comparisonOperator = " = ";
-            }
             params.add(size++, csc.getStatus());
-            appendConjuctionToWhereclause(whereClause, "c.status ")
-                .append(comparisonOperator).append('?').append(size);
+            appendConjuctionToWhereclause(whereClause, "c.status = ?").append(size);
         }
         
         if(whereClause.length() != 0) {
@@ -703,7 +694,7 @@ public class JPAWeblogEntryManagerImpl i
             String  searchString,
             Date    startDate,
             Date    endDate,
-            String status) throws WebloggerException {
+            ApprovalStatus status) throws WebloggerException {
         
         // TODO dynamic bulk delete query: I'd MUCH rather use a bulk delete,
         // but MySQL says "General error, message from server: "You can't
@@ -1310,7 +1301,7 @@ public class JPAWeblogEntryManagerImpl i
     public long getCommentCount() throws WebloggerException {
         Query q = strategy.getNamedQuery(
                 "WeblogEntryComment.getCountAllDistinctByStatus");
-        q.setParameter(1, WeblogEntryComment.APPROVED);
+        q.setParameter(1, ApprovalStatus.APPROVED);
         List results = q.getResultList();
         return ((Long)results.get(0));
     }
@@ -1322,7 +1313,7 @@ public class JPAWeblogEntryManagerImpl i
         Query q = strategy.getNamedQuery(
                 "WeblogEntryComment.getCountDistinctByWebsite&Status");
         q.setParameter(1, website);
-        q.setParameter(2, WeblogEntryComment.APPROVED);
+        q.setParameter(2, ApprovalStatus.APPROVED);
         List results = q.getResultList();
         return ((Long)results.get(0));
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/CommentSearchCriteria.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/CommentSearchCriteria.java?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/CommentSearchCriteria.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/CommentSearchCriteria.java Mon Jun 23 20:29:24 2014
@@ -18,11 +18,10 @@
 package org.apache.roller.weblogger.pojos;
 
 import java.util.Date;
+import org.apache.roller.weblogger.pojos.WeblogEntryComment.ApprovalStatus;
 
 public class CommentSearchCriteria {
 
-    // TODO: Change status to an enum (either here or in WeblogEntryComment)
-
     // Weblog or null to get comments on all blogs
     private Weblog weblog;
     // Entry or null to include all comments
@@ -34,7 +33,7 @@ public class CommentSearchCriteria {
     // End date or null for no restriction
     private Date endDate;
     // Comment status as defined in WeblogEntryComment, or null for any
-    private String status;
+    private ApprovalStatus status;
     // True for results in reverse chrono order
     private boolean reverseChrono = false;
     // Offset into results for paging
@@ -82,11 +81,11 @@ public class CommentSearchCriteria {
         this.endDate = endDate;
     }
 
-    public String getStatus() {
+    public ApprovalStatus getStatus() {
         return status;
     }
 
-    public void setStatus(String status) {
+    public void setStatus(ApprovalStatus status) {
         this.status = status;
     }
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java Mon Jun 23 20:29:24 2014
@@ -844,7 +844,7 @@ public class Weblog implements Serializa
             WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
             CommentSearchCriteria csc = new CommentSearchCriteria();
             csc.setWeblog(this);
-            csc.setStatus(WeblogEntryComment.APPROVED);
+            csc.setStatus(WeblogEntryComment.ApprovalStatus.APPROVED);
             csc.setReverseChrono(true);
             csc.setMaxResults(length);
             recentComments = wmgr.getComments(csc);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java Mon Jun 23 20:29:24 2014
@@ -738,7 +738,7 @@ public class WeblogEntry implements Seri
             CommentSearchCriteria csc = new CommentSearchCriteria();
             csc.setWeblog(getWebsite());
             csc.setEntry(this);
-            csc.setStatus(approvedOnly ? WeblogEntryComment.APPROVED : null);
+            csc.setStatus(approvedOnly ? WeblogEntryComment.ApprovalStatus.APPROVED : null);
             return wmgr.getComments(csc);
         } catch (WebloggerException alreadyLogged) {}
         return list;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryComment.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryComment.java?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryComment.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryComment.java Mon Jun 23 20:29:24 2014
@@ -32,12 +32,9 @@ public class WeblogEntryComment implemen
     
     public static final long serialVersionUID = -6668122596726478462L;
     
-    // status options
-    public static final String APPROVED = "APPROVED";
-    public static final String DISAPPROVED = "DISAPPROVED";
-    public static final String SPAM = "SPAM";
-    public static final String PENDING = "PENDING";
-    
+    // approval status states
+    public enum ApprovalStatus {APPROVED, DISAPPROVED, SPAM, PENDING}
+
     // attributes
     private String    id = UUIDGenerator.generateUUID();
     private String    name = null;
@@ -45,7 +42,7 @@ public class WeblogEntryComment implemen
     private String    url = null;
     private String    content = null;
     private Timestamp postTime = null;
-    private String    status = APPROVED;
+    private ApprovalStatus status = ApprovalStatus.APPROVED;
     private Boolean   notify = Boolean.FALSE;
     private String    remoteHost = null;
     private String    referrer = null;
@@ -169,14 +166,14 @@ public class WeblogEntryComment implemen
     /**
      * Status of the comment, i.e. APPROVED, SPAM, PENDING, etc.
      */
-    public String getStatus() {
+    public ApprovalStatus getStatus() {
         return status;
     }
 
     /**
      * Status of the comment, i.e. APPROVED, SPAM, PENDING, etc.
      */
-    public void setStatus(String status) {
+    public void setStatus(ApprovalStatus status) {
         this.status = status;
     }
     
@@ -277,7 +274,7 @@ public class WeblogEntryComment implemen
      * Indicates that weblog owner considers this comment to be spam.
      */
     public Boolean getSpam() {
-        return SPAM.equals(getStatus());
+        return ApprovalStatus.SPAM.equals(getStatus());
     }
     
     
@@ -285,7 +282,7 @@ public class WeblogEntryComment implemen
      * True if comment has is pending moderator approval.
      */
     public Boolean getPending() {
-        return PENDING.equals(getStatus());
+        return ApprovalStatus.PENDING.equals(getStatus());
     }
     
     
@@ -293,7 +290,7 @@ public class WeblogEntryComment implemen
      * Indicates that comment has been approved for display on weblog.
      */
     public Boolean getApproved() {
-        return APPROVED.equals(getStatus());
+        return ApprovalStatus.APPROVED.equals(getStatus());
     }
     
     

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper.java?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper.java Mon Jun 23 20:29:24 2014
@@ -24,6 +24,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.plugins.PluginManager;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
+import org.apache.roller.weblogger.pojos.WeblogEntryComment.ApprovalStatus;
 import org.apache.roller.weblogger.util.Utilities;
 
 
@@ -130,7 +131,7 @@ public final class WeblogEntryCommentWra
     }
     
     
-    public String getStatus() {
+    public ApprovalStatus getStatus() {
         return this.pojo.getStatus();
     }
     

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager.java?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager.java Mon Jun 23 20:29:24 2014
@@ -31,6 +31,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.WeblogEntryManager;
 import org.apache.roller.weblogger.pojos.CommentSearchCriteria;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
+import org.apache.roller.weblogger.pojos.WeblogEntryComment.ApprovalStatus;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.pojos.wrapper.WeblogEntryCommentWrapper;
 
@@ -97,7 +98,7 @@ public class CommentsPager extends Abstr
                 CommentSearchCriteria csc = new CommentSearchCriteria();
                 csc.setWeblog(weblog);
                 csc.setStartDate(startDate);
-                csc.setStatus(WeblogEntryComment.APPROVED);
+                csc.setStatus(ApprovalStatus.APPROVED);
                 csc.setReverseChrono(true);
                 csc.setOffset(offset);
                 csc.setMaxResults(length + 1);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/CommentServlet.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/CommentServlet.java?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/CommentServlet.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/CommentServlet.java Mon Jun 23 20:29:24 2014
@@ -40,6 +40,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.WeblogEntryManager;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
+import org.apache.roller.weblogger.pojos.WeblogEntryComment.ApprovalStatus;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentAuthenticator;
@@ -313,18 +314,18 @@ public class CommentServlet extends Http
 
             if (validationScore == RollerConstants.PERCENT_100 && weblog.getCommentModerationRequired()) {
                 // Valid comments go into moderation if required
-                comment.setStatus(WeblogEntryComment.PENDING);
+                comment.setStatus(ApprovalStatus.PENDING);
                 message = messageUtils
                         .getString("commentServlet.submittedToModerator");
             } else if (validationScore == RollerConstants.PERCENT_100) {
                 // else they're approved
-                comment.setStatus(WeblogEntryComment.APPROVED);
+                comment.setStatus(ApprovalStatus.APPROVED);
                 message = messageUtils
                         .getString("commentServlet.commentAccepted");
             } else {
                 // Invalid comments are marked as spam
                 log.debug("Comment marked as spam");
-                comment.setStatus(WeblogEntryComment.SPAM);
+                comment.setStatus(ApprovalStatus.SPAM);
                 error = messageUtils
                         .getString("commentServlet.commentMarkedAsSpam");
 
@@ -355,7 +356,7 @@ public class CommentServlet extends Http
             }
 
             try {
-                if (!WeblogEntryComment.SPAM.equals(comment.getStatus())
+                if (!ApprovalStatus.SPAM.equals(comment.getStatus())
                         || !WebloggerRuntimeConfig
                                 .getBooleanProperty("comments.ignoreSpam.enabled")) {
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/TrackbackServlet.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/TrackbackServlet.java?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/TrackbackServlet.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/TrackbackServlet.java Mon Jun 23 20:29:24 2014
@@ -35,6 +35,7 @@ import org.apache.roller.weblogger.confi
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.WeblogEntryManager;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
+import org.apache.roller.weblogger.pojos.WeblogEntryComment.ApprovalStatus;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager;
@@ -165,17 +166,17 @@ public class TrackbackServlet extends Ht
                 
                 if (validationScore == RollerConstants.PERCENT_100 && weblog.getCommentModerationRequired()) {
                     // Valid comments go into moderation if required
-                    comment.setStatus(WeblogEntryComment.PENDING);
+                    comment.setStatus(ApprovalStatus.PENDING);
                 } else if (validationScore == RollerConstants.PERCENT_100) {
                     // else they're approved
-                    comment.setStatus(WeblogEntryComment.APPROVED);
+                    comment.setStatus(ApprovalStatus.APPROVED);
                 } else {
                     // Invalid comments are marked as spam
-                    comment.setStatus(WeblogEntryComment.SPAM);
+                    comment.setStatus(ApprovalStatus.SPAM);
                 }
                 
                 // save, commit, send response
-                if(!WeblogEntryComment.SPAM.equals(comment.getStatus()) ||
+                if (!ApprovalStatus.SPAM.equals(comment.getStatus()) ||
                         !WebloggerRuntimeConfig.getBooleanProperty("trackbacks.ignoreSpam.enabled")) {
                     
                     WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
@@ -193,7 +194,7 @@ public class TrackbackServlet extends Ht
                             I18nMessages.getMessages(trackbackRequest.getLocaleInstance()),
                             validationScore == RollerConstants.PERCENT_100);
                     
-                    if(WeblogEntryComment.PENDING.equals(comment.getStatus())) {
+                    if (ApprovalStatus.PENDING.equals(comment.getStatus())) {
                         pw.println(this.getSuccessResponse("Trackback submitted to moderator"));
                     } else {
                         pw.println(this.getSuccessResponse("Trackback accepted"));

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalCommentManagement.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalCommentManagement.java?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalCommentManagement.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalCommentManagement.java Mon Jun 23 20:29:24 2014
@@ -35,6 +35,7 @@ import org.apache.roller.weblogger.pojos
 import org.apache.roller.weblogger.pojos.GlobalPermission;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
+import org.apache.roller.weblogger.pojos.WeblogEntryComment.ApprovalStatus;
 import org.apache.roller.weblogger.ui.struts2.pagers.CommentsPager;
 import org.apache.roller.weblogger.ui.struts2.util.KeyValueObject;
 import org.apache.roller.weblogger.util.cache.CacheManager;
@@ -149,10 +150,7 @@ public class GlobalCommentManagement ext
         if(!StringUtils.isEmpty(getBean().getApprovedString())) {
             params.put("bean.approvedString", getBean().getApprovedString());
         }
-        if(!StringUtils.isEmpty(getBean().getSpamString())) {
-            params.put("bean.spamString", getBean().getSpamString());
-        }
-        
+
         return WebloggerFactory.getWeblogger().getUrlStrategy().getActionURL("globalCommentManagement", "/roller-ui/admin", 
                 null, params, false);
     }
@@ -282,15 +280,18 @@ public class GlobalCommentManagement ext
                 
                 // mark/unmark spam
                 if (spamIds.contains(id) &&
-                        !WeblogEntryComment.SPAM.equals(comment.getStatus())) {
-                    log.debug("Marking as spam - "+comment.getId());
-                    comment.setStatus(WeblogEntryComment.SPAM);
+                        !ApprovalStatus.SPAM.equals(comment.getStatus())) {
+                    log.debug("Marking as spam - " + comment.getId());
+                    comment.setStatus(ApprovalStatus.SPAM);
                     wmgr.saveComment(comment);
                     
                     flushList.add(comment.getWeblogEntry().getWebsite());
-                } else if(WeblogEntryComment.SPAM.equals(comment.getStatus())) {
-                    log.debug("Marking as approved - "+comment.getId());
-                    comment.setStatus(WeblogEntryComment.APPROVED);
+                } else if(!spamIds.contains(id) &&
+                        ApprovalStatus.SPAM.equals(comment.getStatus())) {
+                    // Administrator unmarked as spam, so changing to DISAPPROVED
+                    // as blogger still needs to approve it.
+                    log.debug("Marking as disapproved - " + comment.getId());
+                    comment.setStatus(ApprovalStatus.DISAPPROVED);
                     wmgr.saveComment(comment);
                     
                     flushList.add(comment.getWeblogEntry().getWebsite());
@@ -328,22 +329,10 @@ public class GlobalCommentManagement ext
         opts.add(new KeyValueObject("ONLY_PENDING", getText("commentManagement.onlyPending")));
         opts.add(new KeyValueObject("ONLY_APPROVED", getText("commentManagement.onlyApproved")));
         opts.add(new KeyValueObject("ONLY_DISAPPROVED", getText("commentManagement.onlyDisapproved")));
-        
-        return opts;
-    }
-    
-    public List<KeyValueObject> getSpamStatusOptions() {
-        
-        List<KeyValueObject> opts = new ArrayList<KeyValueObject>();
-        
-        opts.add(new KeyValueObject("ALL", getText("commentManagement.all")));
-        opts.add(new KeyValueObject("NO_SPAM", getText("commentManagement.noSpam")));
         opts.add(new KeyValueObject("ONLY_SPAM", getText("commentManagement.onlySpam")));
-        
         return opts;
     }
-    
-    
+
     public GlobalCommentManagementBean getBean() {
         return bean;
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalCommentManagementBean.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalCommentManagementBean.java?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalCommentManagementBean.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalCommentManagementBean.java Mon Jun 23 20:29:24 2014
@@ -26,6 +26,7 @@ import java.util.List;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.roller.util.DateUtil;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
+import org.apache.roller.weblogger.pojos.WeblogEntryComment.ApprovalStatus;
 import org.apache.roller.weblogger.util.Utilities;
 
 
@@ -37,7 +38,6 @@ public class GlobalCommentManagementBean
     private String searchString = null;
     private String startDateString = null;
     private String endDateString = null;
-    private String spamString = "ALL";
     private String approvedString = "ALL";
     private int page = 0;
     
@@ -56,7 +56,7 @@ public class GlobalCommentManagementBean
         for (WeblogEntryComment comment : comments) {
             allComments.add(comment.getId());
 
-            if (WeblogEntryComment.SPAM.equals(comment.getStatus())) {
+            if (ApprovalStatus.SPAM.equals(comment.getStatus())) {
                 spamList.add(comment.getId());
             }
         }
@@ -68,19 +68,15 @@ public class GlobalCommentManagementBean
     }
     
     
-    public String getStatus() {
+    public ApprovalStatus getStatus() {
         if (approvedString.equals("ONLY_APPROVED")) {
-            return WeblogEntryComment.APPROVED;
+            return ApprovalStatus.APPROVED;
         } else if (approvedString.equals("ONLY_DISAPPROVED")) {
-            return WeblogEntryComment.DISAPPROVED;
+            return ApprovalStatus.DISAPPROVED;
         } else if (approvedString.equals("ONLY_PENDING")) {
-            return WeblogEntryComment.PENDING;
-        } else if (spamString.equals("ONLY_SPAM")) {
-            return WeblogEntryComment.SPAM;
-        } else if (spamString.equals("NO_SPAM")) {
-            // all status' except spam
-            // special situation, so this doesn't map to a persisted comment status
-            return "ALL_IGNORE_SPAM";
+            return ApprovalStatus.PENDING;
+        } else if (approvedString.equals("ONLY_SPAM")) {
+            return ApprovalStatus.SPAM;
         } else {
             // shows *all* comments, regardless of status
             return null;
@@ -107,16 +103,7 @@ public class GlobalCommentManagementBean
         }
         return null;
     }
-    
-    
-    public String getSpamString() {
-        return spamString;
-    }
-    
-    public void setSpamString(String spamString) {
-        this.spamString = spamString;
-    }
-    
+
     public String getPendingString() {
         return approvedString;
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Comments.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Comments.java?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Comments.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Comments.java Mon Jun 23 20:29:24 2014
@@ -38,6 +38,7 @@ import org.apache.roller.weblogger.confi
 import org.apache.roller.weblogger.pojos.CommentSearchCriteria;
 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.ui.struts2.pagers.CommentsPager;
 import org.apache.roller.weblogger.ui.struts2.util.KeyValueObject;
@@ -158,9 +159,6 @@ public class Comments extends UIAction {
         if (!StringUtils.isEmpty(getBean().getApprovedString())) {
             params.put("bean.approvedString", getBean().getApprovedString());
         }
-        if (!StringUtils.isEmpty(getBean().getSpamString())) {
-            params.put("bean.spamString", getBean().getSpamString());
-        }
 
         return WebloggerFactory
                 .getWeblogger()
@@ -342,13 +340,13 @@ public class Comments extends UIAction {
                     if (approvedIds.contains(ids[i])) {
                         // if a comment was previously PENDING then this is
                         // its first approval, so track it for notification
-                        if (WeblogEntryComment.PENDING.equals(comment
+                        if (ApprovalStatus.PENDING.equals(comment
                                 .getStatus())) {
                             approvedComments.add(comment);
                         }
 
                         log.debug("Marking as approved - " + comment.getId());
-                        comment.setStatus(WeblogEntryComment.APPROVED);
+                        comment.setStatus(ApprovalStatus.APPROVED);
                         wmgr.saveComment(comment);
 
                         flushList.add(comment);
@@ -356,16 +354,16 @@ public class Comments extends UIAction {
 
                     } else if (spamIds.contains(ids[i])) {
                         log.debug("Marking as spam - " + comment.getId());
-                        comment.setStatus(WeblogEntryComment.SPAM);
+                        comment.setStatus(ApprovalStatus.SPAM);
                         wmgr.saveComment(comment);
 
                         flushList.add(comment);
                         reindexList.add(comment.getWeblogEntry());
 
-                    } else if (!WeblogEntryComment.DISAPPROVED.equals(comment
+                    } else if (!ApprovalStatus.DISAPPROVED.equals(comment
                             .getStatus())) {
                         log.debug("Marking as disapproved - " + comment.getId());
-                        comment.setStatus(WeblogEntryComment.DISAPPROVED);
+                        comment.setStatus(ApprovalStatus.DISAPPROVED);
                         wmgr.saveComment(comment);
 
                         flushList.add(comment);
@@ -408,7 +406,6 @@ public class Comments extends UIAction {
             freshBean.setEndDateString(getBean().getEndDateString());
             freshBean.setSearchString(getBean().getSearchString());
             freshBean.setApprovedString(getBean().getApprovedString());
-            freshBean.setSpamString(getBean().getSpamString());
 
             // but if we're editing an entry's comments stick with that entry
             if (bean.getEntryId() != null) {
@@ -437,17 +434,6 @@ public class Comments extends UIAction {
                 getText("commentManagement.onlyApproved")));
         opts.add(new KeyValueObject("ONLY_DISAPPROVED",
                 getText("commentManagement.onlyDisapproved")));
-
-        return opts;
-    }
-
-    public List<KeyValueObject> getSpamStatusOptions() {
-
-        List<KeyValueObject> opts = new ArrayList<KeyValueObject>();
-
-        opts.add(new KeyValueObject("ALL", getText("commentManagement.all")));
-        opts.add(new KeyValueObject("NO_SPAM",
-                getText("commentManagement.noSpam")));
         opts.add(new KeyValueObject("ONLY_SPAM",
                 getText("commentManagement.onlySpam")));
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CommentsBean.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CommentsBean.java?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CommentsBean.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CommentsBean.java Mon Jun 23 20:29:24 2014
@@ -26,6 +26,7 @@ import java.util.List;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.roller.util.DateUtil;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
+import org.apache.roller.weblogger.pojos.WeblogEntryComment.ApprovalStatus;
 import org.apache.roller.weblogger.util.Utilities;
 
 
@@ -38,7 +39,6 @@ public class CommentsBean {
     private String searchString = null;
     private String startDateString = null;
     private String endDateString = null;
-    private String spamString = "ALL";
     private String approvedString = "ALL";
     private int page = 0;
     
@@ -59,9 +59,9 @@ public class CommentsBean {
         for (WeblogEntryComment comment : comments) {
             allComments.add(comment.getId());
             
-            if(WeblogEntryComment.APPROVED.equals(comment.getStatus())) {
+            if(ApprovalStatus.APPROVED.equals(comment.getStatus())) {
                 approvedList.add(comment.getId());
-            } else if(WeblogEntryComment.SPAM.equals(comment.getStatus())) {
+            } else if(ApprovalStatus.SPAM.equals(comment.getStatus())) {
                 spamList.add(comment.getId());
             }
         }
@@ -78,19 +78,15 @@ public class CommentsBean {
     }
     
     
-    public String getStatus() {
+    public ApprovalStatus getStatus() {
         if (approvedString.equals("ONLY_APPROVED")) {
-            return WeblogEntryComment.APPROVED;
+            return ApprovalStatus.APPROVED;
         } else if (approvedString.equals("ONLY_DISAPPROVED")) {
-            return WeblogEntryComment.DISAPPROVED;
+            return ApprovalStatus.DISAPPROVED;
         } else if (approvedString.equals("ONLY_PENDING")) {
-            return WeblogEntryComment.PENDING;
-        } else if (spamString.equals("ONLY_SPAM")) {
-            return WeblogEntryComment.SPAM;
-        } else if (spamString.equals("NO_SPAM")) {
-            // all status' except spam
-            // special situation, so this doesn't map to a persisted comment status
-            return "ALL_IGNORE_SPAM";
+            return ApprovalStatus.PENDING;
+        } else if (approvedString.equals("ONLY_SPAM")) {
+            return ApprovalStatus.SPAM;
         } else {
             // shows *all* comments, regardless of status
             return null;
@@ -117,16 +113,7 @@ public class CommentsBean {
         }
         return null;
     }
-    
-    
-    public String getSpamString() {
-        return spamString;
-    }
-    
-    public void setSpamString(String spamString) {
-        this.spamString = spamString;
-    }
-    
+
     public String getIds() {
         return ids;
     }

Modified: roller/trunk/app/src/main/resources/ApplicationResources.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources.properties?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources.properties Mon Jun 23 20:29:24 2014
@@ -313,11 +313,10 @@ commentManagement.deleteError=Bulk delet
 commentManagement.pendingStatus=Pending status
 commentManagement.onlyPending=Pending only
 commentManagement.onlyApproved=Approved only
-commentManagement.onlyDisapproved=Disappoved only
+commentManagement.onlyDisapproved=Disapproved only
+commentManagement.onlySpam=Spam only
+commentManagement.noSpam=No Spam
 
-commentManagement.spamStatus=Spam status
-commentManagement.noSpam=No spam
-commentManagement.onlySpam=Only spam
 commentManagement.columnApproved=Approved
 commentManagement.columnSpam=Spam
 commentManagement.columnDelete=Delete

Modified: roller/trunk/app/src/main/resources/ApplicationResources_de.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_de.properties?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_de.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_de.properties Mon Jun 23 20:29:24 2014
@@ -244,7 +244,6 @@ commentManagement.sendingApprovalNotific
 commentManagement.sidebarDescription=Filtern Sie die Kommentare \u00FCber einen Suchbegriff, den Freigabestatus und/oder das Datum
 commentManagement.sidebarTitle=Kommentare filtern
 commentManagement.spam=Spam
-commentManagement.spamStatus=Spamstatus
 commentManagement.startDate=Startdatum
 commentManagement.subtitle=Verwalten Sie die Kommentare aller Weblogs im System
 commentManagement.tip=Sie haben Kommentare. Sie k\u00F6nnen die Freigabe und den Spamstatus \u00FCber die Checkboxen unten einstellen und Kommentare l\u00F6schen.  Falls Sie \u00C4nderungen machen vergessen Sie nicht, diese durch Anklicken von <em>\u00C4nderungen speichern</em> am Ende der Seite zu sichern.

Modified: roller/trunk/app/src/main/resources/ApplicationResources_es.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_es.properties?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_es.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_es.properties Mon Jun 23 20:29:24 2014
@@ -122,7 +122,6 @@ commentManagement.pendingStatus = Estado
 commentManagement.onlyPending = S\u00F3lo pendientes
 commentManagement.onlyApproved = S\u00F3lo aprobados
 commentManagement.onlyDisapproved = S\u00F3lo no aprobados 
-commentManagement.spamStatus = Estado de spam
 commentManagement.noSpam = Sin spam
 commentManagement.onlySpam = S\u00F3lo spam
 commentManagement.columnApproved = Aprobado

Modified: roller/trunk/app/src/main/resources/ApplicationResources_fr.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_fr.properties?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_fr.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_fr.properties Mon Jun 23 20:29:24 2014
@@ -278,11 +278,10 @@ commentManagement.pendingStatus=En atten
 commentManagement.onlyPending=En attente seulement
 commentManagement.onlyApproved=Approuvé seulement
 commentManagement.onlyDisapproved=Désapprouvé seulement
+commentManagement.onlySpam=Spam seulement
+commentManagement.noSpam=Aucun spam
 
-commentManagement.spamStatus=Spam
 commentManagement.all=Tous les commentaires
-commentManagement.noSpam=Aucun spam
-commentManagement.onlySpam=Spam seulement
 commentManagement.columnApproved=Approuvé
 commentManagement.columnSpam=Spam
 commentManagement.columnDelete=Effacer

Modified: roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties Mon Jun 23 20:29:24 2014
@@ -226,8 +226,6 @@ commentManagement.pendingStatus=\u4E2D\u
 commentManagement.onlyPending=\u4E2D\u9014\u30A8\u30F3\u30C8\u30EA\u306E\u307F
 commentManagement.onlyApproved=\u627F\u8A8D\u3055\u308C\u305F\u30B3\u30E1\u30F3\u30C8\u306E\u307F
 commentManagement.onlyDisapproved=\u62D2\u7D76\u3055\u308C\u305F\u30B3\u30E1\u30F3\u30C8\u306E\u307F
-
-commentManagement.spamStatus=\u30B9\u30D1\u30E0\u30B9\u30C6\u30FC\u30BF\u30B9
 commentManagement.noSpam=\u975E\u30B9\u30D1\u30E0
 commentManagement.onlySpam=\u30B9\u30D1\u30E0\u306E\u307F
 commentManagement.columnApproved=\u627F\u8A8D

Modified: roller/trunk/app/src/main/resources/ApplicationResources_ko.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_ko.properties?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_ko.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_ko.properties Mon Jun 23 20:29:24 2014
@@ -287,11 +287,10 @@ commentManagement.pendingStatus=\ub300\u
 commentManagement.onlyPending=\ub300\uae30 \uc0c1\ud0dc\ub9cc
 commentManagement.onlyApproved=\uc2b9\uc778 \uc0c1\ud0dc\ub9cc
 commentManagement.onlyDisapproved=\ubd88\uc2b9\uc778 \uc0c1\ud0dc\ub9cc
+commentManagement.onlySpam=\uc2a4\ud338\ub9cc
+commentManagement.noSpam=\uc2a4\ud338\uc774 \uc5c6\uc2b5\ub2c8\ub2e4.
 
-commentManagement.spamStatus=\uc2a4\ud338 \uc0c1\ud0dc
 commentManagement.all=\ubaa8\ub4e0 \uc758\uacac
-commentManagement.noSpam=\uc2a4\ud338\uc774 \uc5c6\uc2b5\ub2c8\ub2e4.
-commentManagement.onlySpam=\uc2a4\ud338\ub9cc
 commentManagement.columnApproved=\uc2b9\uc778
 commentManagement.columnSpam=\uc2a4\ud338
 commentManagement.columnDelete=\uc0ad\uc81c

Modified: roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/WeblogEntryComment.orm.xml
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/WeblogEntryComment.orm.xml?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/WeblogEntryComment.orm.xml (original)
+++ roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/WeblogEntryComment.orm.xml Mon Jun 23 20:29:24 2014
@@ -79,6 +79,7 @@
             </basic>
             <basic name="status">
                 <column name="status" insertable="true" updatable="true" unique="false"/>
+                <enumerated>STRING</enumerated>
             </basic>
             <basic name="notify">
                 <column name="notify" insertable="true" updatable="true" unique="false"/>

Modified: roller/trunk/app/src/main/webapp/WEB-INF/jsps/admin/GlobalCommentManagement.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/jsps/admin/GlobalCommentManagement.jsp?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/jsps/admin/GlobalCommentManagement.jsp (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/jsps/admin/GlobalCommentManagement.jsp Mon Jun 23 20:29:24 2014
@@ -98,7 +98,7 @@ function handleCommentResponse() {
     <s:hidden name="bean.startDateString" />
     <s:hidden name="bean.endDateString" />
     <s:hidden name="bean.pendingString" />
-    <s:hidden name="bean.spamString" />
+
     
 <%-- ============================================================= --%>
 <%-- Number of comments and date message --%>
@@ -242,10 +242,10 @@ function handleCommentResponse() {
     <%-- Display comment details and text --%>
            
     <%-- <td> with style if comment is spam or pending --%>               
-    <s:if test="#comment.status == 'SPAM'">
+    <s:if test="#comment.status.name() == 'SPAM'">
         <td class="spamcomment"> 
     </s:if>
-    <s:elseif test="#comment.status == 'PENDING'">
+    <s:elseif test="#comment.status.name() == 'PENDING'">
         <td class="pendingcomment"> 
     </s:elseif>
     <s:else>

Modified: roller/trunk/app/src/main/webapp/WEB-INF/jsps/admin/GlobalCommentManagementSidebar.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/jsps/admin/GlobalCommentManagementSidebar.jsp?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/jsps/admin/GlobalCommentManagementSidebar.jsp (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/jsps/admin/GlobalCommentManagementSidebar.jsp Mon Jun 23 20:29:24 2014
@@ -92,20 +92,6 @@
     </div> 
     <br />
 
-    <div class="sideformrow">
-        <label for="spamString" class="sideformrow">
-            <s:text name="commentManagement.spamStatus" />   
-            <br />
-            <br />
-            <br />
-            <br />
-        </label>
-        <div>
-            <s:radio theme="roller" name="bean.spamString" list="spamStatusOptions" listKey="key" listValue="value" />
-        </div>
-    </div>
-    <br />
-    
     <s:submit value="%{getText('commentManagement.query')}" />
             
 </s:form>

Modified: roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Comments.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Comments.jsp?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Comments.jsp (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Comments.jsp Mon Jun 23 20:29:24 2014
@@ -84,7 +84,6 @@
         <s:hidden name="bean.startDateString" />
         <s:hidden name="bean.endDateString" />
         <s:hidden name="bean.approvedString" />
-        <s:hidden name="bean.spamString" />
 
 <%-- ============================================================= --%>
 <%-- Number of comments and date message --%>
@@ -236,10 +235,10 @@
     <%-- Display comment details and text --%>
 
     <%-- <td> with style if comment is spam or pending --%>
-                    <s:if test="#comment.status == 'SPAM'">
+                    <s:if test="#comment.status.name() == 'SPAM'">
                         <td class="spamcomment">
                     </s:if>
-                    <s:elseif test="#comment.status == 'PENDING'">
+                    <s:elseif test="#comment.status.name() == 'PENDING'">
                         <td class="pendingcomment">
                     </s:elseif>
                     <s:else>

Modified: roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/CommentsSidebar.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/CommentsSidebar.jsp?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/CommentsSidebar.jsp (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/CommentsSidebar.jsp Mon Jun 23 20:29:24 2014
@@ -93,20 +93,6 @@
     </div> 
     <br />
 
-    <div class="sideformrow">
-        <label for="spamString" class="sideformrow">
-            <s:text name="commentManagement.spamStatus" />   
-            <br />
-            <br />
-            <br />
-            <br />
-        </label>
-        <div>
-            <s:radio theme="roller" name="bean.spamString" list="spamStatusOptions" listKey="key" listValue="value" />
-        </div>
-    </div>
-    <br />
-    
     <s:submit value="%{getText('commentManagement.query')}" />
             
 </s:form>

Modified: roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Entries.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Entries.jsp?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Entries.jsp (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Entries.jsp Mon Jun 23 20:29:24 2014
@@ -153,7 +153,7 @@
     </td>
     
     <td>
-        <s:if test="#post.status == 'PUBLISHED'">
+        <s:if test="#post.status.name() == 'PUBLISHED'">
             <a href='<s:property value="#post.permalink" />'><s:text name="weblogEntryQuery.view" /></a>
         </s:if>
     </td>

Modified: roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/CommentTest.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/CommentTest.java?rev=1604929&r1=1604928&r2=1604929&view=diff
==============================================================================
--- roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/CommentTest.java (original)
+++ roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/CommentTest.java Mon Jun 23 20:29:24 2014
@@ -30,6 +30,7 @@ import org.apache.roller.weblogger.Weblo
 import org.apache.roller.weblogger.TestUtils;
 import org.apache.roller.weblogger.pojos.CommentSearchCriteria;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
+import org.apache.roller.weblogger.pojos.WeblogEntryComment.ApprovalStatus;
 import org.apache.roller.weblogger.pojos.User;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
 import org.apache.roller.weblogger.pojos.Weblog;
@@ -107,7 +108,7 @@ public class CommentTest extends TestCas
         comment.setContent("this is a test comment");
         comment.setPostTime(new java.sql.Timestamp(new java.util.Date().getTime()));
         comment.setWeblogEntry(TestUtils.getManagedWeblogEntry(testEntry));
-        comment.setStatus(WeblogEntryComment.APPROVED);
+        comment.setStatus(ApprovalStatus.APPROVED);
         
         // create a comment
         mgr.saveComment(comment);
@@ -169,19 +170,19 @@ public class CommentTest extends TestCas
         
         // make some changes
         comment3 = mgr.getComment(comment3.getId());
-        comment3.setStatus(WeblogEntryComment.PENDING);
+        comment3.setStatus(ApprovalStatus.PENDING);
         mgr.saveComment(comment3);
         TestUtils.endSession(true);
         
         // get pending comments
         csc.setEntry(null);
-        csc.setStatus(WeblogEntryComment.PENDING);
+        csc.setStatus(ApprovalStatus.PENDING);
         comments = mgr.getComments(csc);
         assertNotNull(comments);
         assertEquals(1, comments.size());
         
         // get approved comments
-        csc.setStatus(WeblogEntryComment.APPROVED);
+        csc.setStatus(ApprovalStatus.APPROVED);
         comments = mgr.getComments(csc);
         assertNotNull(comments);
         assertEquals(2, comments.size());



Mime
View raw message