roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1604674 - 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/business/runnable/ main/ja...
Date Mon, 23 Jun 2014 01:38:19 GMT
Author: gmazza
Date: Mon Jun 23 01:38:18 2014
New Revision: 1604674

URL: http://svn.apache.org/r1604674
Log:
ROL-1997 Switch from a string to an enum for WeblogEntry.status

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/business/runnable/ScheduledEntriesTask.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/RebuildWebsiteIndexOperation.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/planet/business/WebloggerRomeFeedFetcher.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/WeblogCategory.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/WeblogEntrySearchCriteria.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/BigWeblogCalendarModel.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/WeblogCalendarModel.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesDayPager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesLatestPager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesListPager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesMonthPager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPermalinkPager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Entries.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryBase.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryBean.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogExport.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/pagers/EntriesPager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/EntryCollection.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/BloggerAPIHandler.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java
    roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/WeblogEntry.orm.xml
    roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Entries.jsp
    roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/IndexManagerTest.java
    roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/PlanetManagerLocalTest.java
    roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogCategoryFunctionalityTest.java
    roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogEntryTest.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=1604674&r1=1604673&r2=1604674&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 01:38:18 2014
@@ -52,6 +52,7 @@ import org.apache.roller.weblogger.pojos
 import org.apache.roller.weblogger.pojos.WeblogBookmarkFolder;
 import org.apache.roller.weblogger.pojos.WeblogCategory;
 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.WeblogHitCount;
 import org.apache.roller.weblogger.pojos.WeblogPermission;
@@ -353,7 +354,7 @@ public final class TestUtils {
     public static WeblogEntry setupWeblogEntry(String anchor,
             WeblogCategory cat, Weblog weblog, User user) throws Exception {
 
-        return TestUtils.setupWeblogEntry(anchor, cat, WeblogEntry.PUBLISHED,
+        return TestUtils.setupWeblogEntry(anchor, cat, PubStatus.PUBLISHED,
                 weblog, user);
     }
 
@@ -362,7 +363,7 @@ public final class TestUtils {
      */
     public static WeblogEntry setupWeblogEntry(String anchor, Weblog weblog, User user) throws Exception {
 
-        return TestUtils.setupWeblogEntry(anchor, weblog.getDefaultCategory(), WeblogEntry.PUBLISHED,
+        return TestUtils.setupWeblogEntry(anchor, weblog.getDefaultCategory(), PubStatus.PUBLISHED,
                 weblog, user);
     }
 
@@ -370,7 +371,7 @@ public final class TestUtils {
      * Convenience method for creating a weblog entry
      */
     public static WeblogEntry setupWeblogEntry(String anchor,
-            WeblogCategory cat, String status, Weblog weblog, User user)
+            WeblogCategory cat, PubStatus status, Weblog weblog, User user)
             throws Exception {
 
         WeblogEntry testEntry = new WeblogEntry();

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=1604674&r1=1604673&r2=1604674&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 01:38:18 2014
@@ -258,7 +258,7 @@ public interface WeblogEntryManager {
      * @param website       Weblog or null to get for all weblogs.
      * @param startDate     Date or null of the most recent time a tag was used.
      * @param limit         Max TagStats to return (or -1 for no limit)
-     * @return
+     * @return List of most popular tags.
      * @throws WebloggerException
      */
     List<TagStat> getPopularTags(Weblog website, Date startDate, int offset, int limit)
@@ -270,7 +270,7 @@ public interface WeblogEntryManager {
      * @param sortBy        Sort by either 'name' or 'count' (null for name) 
      * @param startsWith    Prefix for tags to be returned (null or a string of length > 0)
      * @param limit         Max TagStats to return (or -1 for no limit)
-     * @return
+     * @return List of tags matching the criteria.
      * @throws WebloggerException
      */
     List<TagStat> getTags(Weblog website, String sortBy, String startsWith, int offset, int limit)

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=1604674&r1=1604673&r2=1604674&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 01:38:18 2014
@@ -42,6 +42,7 @@ import org.apache.roller.weblogger.pojos
 import org.apache.roller.weblogger.pojos.TagStatCountComparator;
 import org.apache.roller.weblogger.pojos.WeblogCategory;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.WeblogEntryTagAggregate;
 import org.apache.roller.weblogger.pojos.WeblogEntryTag;
 import org.apache.roller.weblogger.pojos.Weblog;
@@ -206,9 +207,9 @@ public class JPAWeblogEntryManagerImpl i
         // if the entry was published to future, set status as SCHEDULED
         // we only consider an entry future published if it is scheduled
         // more than 1 minute into the future
-        if ("PUBLISHED".equals(entry.getStatus()) &&
+        if (PubStatus.PUBLISHED.equals(entry.getStatus()) &&
                 entry.getPubTime().after(new Date(System.currentTimeMillis() + RollerConstants.MIN_IN_MS))) {
-            entry.setStatus(WeblogEntry.SCHEDULED);
+            entry.setStatus(PubStatus.SCHEDULED);
         }
         
         // Store value object (creates new or updates existing)
@@ -295,7 +296,7 @@ public class JPAWeblogEntryManagerImpl i
         params.add(size++, current.getWebsite());
         whereClause.append("e.website = ?").append(size);
         
-        params.add(size++, WeblogEntry.PUBLISHED);
+        params.add(size++, PubStatus.PUBLISHED);
         whereClause.append(" AND e.status = ?").append(size);
                 
         if (next) {
@@ -467,7 +468,7 @@ public class JPAWeblogEntryManagerImpl i
         Query query = strategy.getNamedQuery(
                 "WeblogEntry.getByPinnedToMain&statusOrderByPubTimeDesc");
         query.setParameter(1, Boolean.TRUE);
-        query.setParameter(2, WeblogEntry.PUBLISHED);
+        query.setParameter(2, PubStatus.PUBLISHED);
         if (max != null) {
             query.setMaxResults(max);
         }
@@ -1332,7 +1333,7 @@ public class JPAWeblogEntryManagerImpl i
     public long getEntryCount() throws WebloggerException {
         Query q = strategy.getNamedQuery(
                 "WeblogEntry.getCountDistinctByStatus");
-        q.setParameter(1, "PUBLISHED");
+        q.setParameter(1, PubStatus.PUBLISHED);
         List results = q.getResultList();
         return ((Long)results.get(0));
     }
@@ -1343,7 +1344,7 @@ public class JPAWeblogEntryManagerImpl i
     public long getEntryCount(Weblog website) throws WebloggerException {
         Query q = strategy.getNamedQuery(
                 "WeblogEntry.getCountDistinctByStatus&Website");
-        q.setParameter(1, "PUBLISHED");
+        q.setParameter(1, PubStatus.PUBLISHED);
         q.setParameter(2, website);
         List results = q.getResultList();
         return ((Long)results.get(0));

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/ScheduledEntriesTask.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/ScheduledEntriesTask.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/ScheduledEntriesTask.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/runnable/ScheduledEntriesTask.java Mon Jun 23 01:38:18 2014
@@ -28,6 +28,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.WeblogEntryManager;
 import org.apache.roller.weblogger.business.search.IndexManager;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.util.cache.CacheManager;
 
@@ -135,17 +136,17 @@ public class ScheduledEntriesTask extend
             
             Date now = new Date();
             
-            log.debug("looking up scheduled entries older than "+now);
+            log.debug("looking up scheduled entries older than " + now);
             
             // get all published entries older than current time
             WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
             wesc.setEndDate(now);
-            wesc.setStatus(WeblogEntry.SCHEDULED);
+            wesc.setStatus(PubStatus.SCHEDULED);
             List<WeblogEntry> scheduledEntries = wMgr.getWeblogEntries(wesc);
             log.debug("promoting "+scheduledEntries.size()+" entries to PUBLISHED state");
             
             for (WeblogEntry entry : scheduledEntries) {
-                entry.setStatus(WeblogEntry.PUBLISHED);
+                entry.setStatus(PubStatus.PUBLISHED);
                 wMgr.saveWeblogEntry(entry);
             }
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/RebuildWebsiteIndexOperation.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/RebuildWebsiteIndexOperation.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/RebuildWebsiteIndexOperation.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/search/operations/RebuildWebsiteIndexOperation.java Mon Jun 23 01:38:18 2014
@@ -35,6 +35,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.search.IndexUtil;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 
 /**
@@ -119,7 +120,7 @@ public class RebuildWebsiteIndexOperatio
                         .getWeblogEntryManager();
                 WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
                 wesc.setWeblog(website);
-                wesc.setStatus(WeblogEntry.PUBLISHED);
+                wesc.setStatus(PubStatus.PUBLISHED);
                 List<WeblogEntry> entries = weblogManager.getWeblogEntries(wesc);
 
                 mLogger.debug("Entries to index: " + entries.size());

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/planet/business/WebloggerRomeFeedFetcher.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/planet/business/WebloggerRomeFeedFetcher.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/planet/business/WebloggerRomeFeedFetcher.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/planet/business/WebloggerRomeFeedFetcher.java Mon Jun 23 01:38:18 2014
@@ -34,6 +34,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.WeblogEntryManager;
 import org.apache.roller.weblogger.config.WebloggerRuntimeConfig;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 
@@ -124,7 +125,7 @@ public class WebloggerRomeFeedFetcher ex
             WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
             WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
             wesc.setWeblog(localWeblog);
-            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setStatus(PubStatus.PUBLISHED);
             wesc.setMaxResults(entryCount);
             List<WeblogEntry> entries = wmgr.getWeblogEntries(wesc);
             log.debug("Found " + entries.size());

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=1604674&r1=1604673&r2=1604674&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 01:38:18 2014
@@ -34,6 +34,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.Weblogger;
 import org.apache.roller.weblogger.business.themes.ThemeManager;
 import org.apache.roller.weblogger.business.WeblogEntryManager;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.util.UUIDGenerator;
 import org.apache.roller.weblogger.business.UserManager;
 import org.apache.roller.weblogger.util.I18nUtils;
@@ -782,7 +783,7 @@ public class Weblog implements Serializa
             WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
             wesc.setWeblog(this);
             wesc.setCatName(cat);
-            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setStatus(PubStatus.PUBLISHED);
             wesc.setMaxResults(length);
             recentEntries = wmgr.getWeblogEntries(wesc);
         } catch (WebloggerException e) {
@@ -817,7 +818,7 @@ public class Weblog implements Serializa
             WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
             wesc.setWeblog(this);
             wesc.setTags(tags);
-            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setStatus(PubStatus.PUBLISHED);
             wesc.setMaxResults(length);
             recentEntries = wmgr.getWeblogEntries(wesc);
         } catch (WebloggerException e) {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java Mon Jun 23 01:38:18 2014
@@ -25,6 +25,7 @@ import org.apache.commons.lang3.builder.
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.WeblogEntryManager;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.util.UUIDGenerator;
 
 
@@ -193,7 +194,7 @@ public class WeblogCategory implements S
         wesc.setWeblog(weblog);
         wesc.setCatName(this.getName());
         if (publishedOnly) {
-            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setStatus(PubStatus.PUBLISHED);
         }
         return wmgr.getWeblogEntries(wesc);
     }

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=1604674&r1=1604673&r2=1604674&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 01:38:18 2014
@@ -64,11 +64,8 @@ public class WeblogEntry implements Seri
             LogFactory.getFactory().getInstance(WeblogEntry.class);
     
     public static final long serialVersionUID = 2341505386843044125L;
-    
-    public static final String DRAFT     = "DRAFT";
-    public static final String PUBLISHED = "PUBLISHED";
-    public static final String PENDING   = "PENDING";
-    public static final String SCHEDULED = "SCHEDULED";
+
+    public enum PubStatus {DRAFT, PUBLISHED, PENDING, SCHEDULED}
 
     private static final char TITLE_SEPARATOR =
         WebloggerConfig.getBooleanProperty("weblogentry.title.useUnderscoreSeparator") ? '_' : '-';
@@ -89,7 +86,7 @@ public class WeblogEntry implements Seri
     private Integer   commentDays   = 7;
     private Boolean   rightToLeft   = Boolean.FALSE;
     private Boolean   pinnedToMain  = Boolean.FALSE;
-    private String    status        = DRAFT;
+    private PubStatus status        = PubStatus.DRAFT;
     private String    locale        = null;
     private String    creatorUserName = null;      
     private String    searchDescription = null;      
@@ -121,7 +118,7 @@ public class WeblogEntry implements Seri
             String anchor,
             Timestamp pubTime,
             Timestamp updateTime,
-            String status) {
+            PubStatus status) {
         //this.id = id;
         this.category = category;
         this.website = website;
@@ -424,11 +421,11 @@ public class WeblogEntry implements Seri
         this.updateTime = updateTime;
     }
     
-    public String getStatus() {
+    public PubStatus getStatus() {
         return this.status;
     }
     
-    public void setStatus(String status) {
+    public void setStatus(PubStatus status) {
         this.status = status;
     }
     
@@ -895,17 +892,17 @@ public class WeblogEntry implements Seri
     
     /** Convenience method for checking status */
     public boolean isDraft() {
-        return getStatus().equals(DRAFT);
+        return getStatus().equals(PubStatus.DRAFT);
     }
 
     /** Convenience method for checking status */
     public boolean isPending() {
-        return getStatus().equals(PENDING);
+        return getStatus().equals(PubStatus.PENDING);
     }
 
     /** Convenience method for checking status */
     public boolean isPublished() {
-        return getStatus().equals(PUBLISHED);
+        return getStatus().equals(PubStatus.PUBLISHED);
     }
 
     /**

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntrySearchCriteria.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntrySearchCriteria.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntrySearchCriteria.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntrySearchCriteria.java Mon Jun 23 01:38:18 2014
@@ -19,6 +19,7 @@ package org.apache.roller.weblogger.pojo
 
 import java.util.Date;
 import java.util.List;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 
 public class WeblogEntrySearchCriteria {
 
@@ -26,7 +27,6 @@ public class WeblogEntrySearchCriteria {
     public enum SortBy {PUBLICATION_TIME, UPDATE_TIME}
 
     // TODO: See if can switch from name of Category to Category object
-    // TODO: Change status to an enum (either here or in WeblogEntry)
 
     // Weblog or null to get for all weblogs.
     private Weblog weblog;
@@ -40,8 +40,8 @@ public class WeblogEntrySearchCriteria {
     private String catName;
     // If provided, array of tags to search blog entries for, just one needs to match to retrieve entry
     private List<String> tags;
-    // WeblogEntry constants of DRAFT, PENDING, PUBLISHED, SCHEDULED
-    private String status;
+    // Publication status of the weblog entry (DRAFT, PUBLISHED, etc.)
+    private PubStatus status;
     // Text appearing in the text or summary, or null for all
     private String text;
     // Date field to sort by
@@ -103,11 +103,11 @@ public class WeblogEntrySearchCriteria {
         this.tags = tags;
     }
 
-    public String getStatus() {
+    public PubStatus getStatus() {
         return status;
     }
 
-    public void setStatus(String status) {
+    public void setStatus(PubStatus status) {
         this.status = status;
     }
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java Mon Jun 23 01:38:18 2014
@@ -28,6 +28,7 @@ import java.util.TreeSet;
 import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.pojos.WeblogCategory;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.WeblogEntryAttribute;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
 import org.apache.roller.weblogger.pojos.WeblogEntryTag;
@@ -166,7 +167,7 @@ public final class WeblogEntryWrapper {
     }
     
     
-    public String getStatus() {
+    public PubStatus getStatus() {
         return this.pojo.getStatus();
     }
     

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/BigWeblogCalendarModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/BigWeblogCalendarModel.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/BigWeblogCalendarModel.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/BigWeblogCalendarModel.java Mon Jun 23 01:38:18 2014
@@ -60,7 +60,7 @@ public class BigWeblogCalendarModel exte
             wesc.setStartDate(startDate);
             wesc.setEndDate(endDate);
             wesc.setCatName(catName);
-            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setStatus(WeblogEntry.PubStatus.PUBLISHED);
             wesc.setLocale(locale);
             monthMap = mgr.getWeblogEntryObjectMap(wesc);
         } catch (WebloggerException e) {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/WeblogCalendarModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/WeblogCalendarModel.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/WeblogCalendarModel.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/WeblogCalendarModel.java Mon Jun 23 01:38:18 2014
@@ -35,6 +35,7 @@ import org.apache.roller.weblogger.Weblo
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.WeblogEntryManager;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.ui.rendering.util.WeblogPageRequest;
@@ -110,7 +111,7 @@ public class WeblogCalendarModel impleme
             // since we need an entry.pubTime < startDate, but the method uses endDate
             wesc.setEndDate(new Date(startDate.getTime()-1));
             wesc.setCatName(cat);
-            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setStatus(PubStatus.PUBLISHED);
             wesc.setSortOrder(WeblogEntrySearchCriteria.SortOrder.DESCENDING);
             wesc.setLocale(locale);
             wesc.setMaxResults(1);
@@ -134,7 +135,7 @@ public class WeblogCalendarModel impleme
             // since we need an entry.pubTime > endDate, but the method uses startDate
             wesc.setStartDate(new Date(startDate.getTime()-1));
             wesc.setCatName(cat);
-            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setStatus(PubStatus.PUBLISHED);
             wesc.setSortOrder(WeblogEntrySearchCriteria.SortOrder.ASCENDING);
             wesc.setLocale(locale);
             wesc.setMaxResults(1);
@@ -165,7 +166,7 @@ public class WeblogCalendarModel impleme
             wesc.setStartDate(startDate);
             wesc.setEndDate(endDate);
             wesc.setCatName(catName);
-            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setStatus(PubStatus.PUBLISHED);
             wesc.setLocale(locale);
             monthMap = mgr.getWeblogEntryStringMap(wesc);
         } catch (WebloggerException e) {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesDayPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesDayPager.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesDayPager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesDayPager.java Mon Jun 23 01:38:18 2014
@@ -119,7 +119,7 @@ public class WeblogEntriesDayPager exten
                 wesc.setEndDate(endDate);
                 wesc.setCatName(catName);
                 wesc.setTags(tags);
-                wesc.setStatus(WeblogEntry.PUBLISHED);
+                wesc.setStatus(WeblogEntry.PubStatus.PUBLISHED);
                 wesc.setLocale(locale);
                 wesc.setOffset(offset);
                 wesc.setMaxResults(length+1);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesLatestPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesLatestPager.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesLatestPager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesLatestPager.java Mon Jun 23 01:38:18 2014
@@ -76,7 +76,7 @@ public class WeblogEntriesLatestPager ex
                 wesc.setEndDate(new Date());
                 wesc.setCatName(catName);
                 wesc.setTags(tags);
-                wesc.setStatus(WeblogEntry.PUBLISHED);
+                wesc.setStatus(WeblogEntry.PubStatus.PUBLISHED);
                 wesc.setLocale(locale);
                 wesc.setOffset(offset);
                 wesc.setMaxResults(length+1);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesListPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesListPager.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesListPager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesListPager.java Mon Jun 23 01:38:18 2014
@@ -111,7 +111,7 @@ public class WeblogEntriesListPager exte
                 wesc.setStartDate(startDate);
                 wesc.setCatName(queryCat);
                 wesc.setTags(queryTags);
-                wesc.setStatus(WeblogEntry.PUBLISHED);
+                wesc.setStatus(WeblogEntry.PubStatus.PUBLISHED);
                 wesc.setLocale(locale);
                 wesc.setOffset(offset);
                 wesc.setMaxResults(length+1);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesMonthPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesMonthPager.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesMonthPager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesMonthPager.java Mon Jun 23 01:38:18 2014
@@ -115,7 +115,7 @@ public class WeblogEntriesMonthPager ext
                 wesc.setEndDate(endDate);
                 wesc.setCatName(catName);
                 wesc.setTags(tags);
-                wesc.setStatus(WeblogEntry.PUBLISHED);
+                wesc.setStatus(WeblogEntry.PubStatus.PUBLISHED);
                 wesc.setLocale(locale);
                 wesc.setOffset(offset);
                 wesc.setMaxResults(length+1);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPermalinkPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPermalinkPager.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPermalinkPager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPermalinkPager.java Mon Jun 23 01:38:18 2014
@@ -31,6 +31,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.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.pojos.wrapper.WeblogEntryWrapper;
 import org.apache.roller.weblogger.util.Utilities;
@@ -74,7 +75,7 @@ public class WeblogEntriesPermalinkPager
                 Weblogger roller = WebloggerFactory.getWeblogger();
                 WeblogEntryManager wmgr = roller.getWeblogEntryManager();
                 currEntry = wmgr.getWeblogEntryByAnchor(weblog, entryAnchor);
-                if (currEntry != null && currEntry.getStatus().equals(WeblogEntry.PUBLISHED)) {
+                if (currEntry != null && currEntry.getStatus().equals(PubStatus.PUBLISHED)) {
                     entries = new TreeMap();
                     entries.put(new Date(currEntry.getPubTime().getTime()),Collections.singletonList(WeblogEntryWrapper.wrap(currEntry, urlStrategy)));
                 }
@@ -141,7 +142,7 @@ public class WeblogEntriesPermalinkPager
                 nextEntry = wmgr.getNextEntry(currEntry, null, locale);
                 // make sure that entry is published and not to future
                 if (nextEntry != null && nextEntry.getPubTime().after(new Date())
-                        && nextEntry.getStatus().equals(WeblogEntry.PUBLISHED)) {
+                        && nextEntry.getStatus().equals(PubStatus.PUBLISHED)) {
                     nextEntry = null;
                 }
             } catch (WebloggerException e) {
@@ -161,7 +162,7 @@ public class WeblogEntriesPermalinkPager
                 prevEntry = wmgr.getPreviousEntry(currEntry, null, locale);
                 // make sure that entry is published and not to future
                 if (prevEntry != null && prevEntry.getPubTime().after(new Date())
-                        && prevEntry.getStatus().equals(WeblogEntry.PUBLISHED)) {
+                        && prevEntry.getStatus().equals(PubStatus.PUBLISHED)) {
                     prevEntry = null;
                 }
             } catch (WebloggerException e) {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Entries.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Entries.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Entries.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Entries.java Mon Jun 23 01:38:18 2014
@@ -92,7 +92,7 @@ public class Entries extends UIAction {
             wesc.setEndDate(getBean().getEndDate());
             wesc.setCatName(getBean().getCategoryName());
             wesc.setTags(getBean().getTags());
-            wesc.setStatus("ALL".equals(status) ? null : status);
+            wesc.setStatus("ALL".equals(status) ? null : WeblogEntry.PubStatus.valueOf(status));
             wesc.setText(getBean().getText());
             wesc.setSortBy(getBean().getSortBy());
             wesc.setOffset(getBean().getPage() * COUNT);
@@ -173,7 +173,7 @@ public class Entries extends UIAction {
             WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
             weblogCats = wmgr.getWeblogCategories(getActionWeblog());
         } catch (WebloggerException ex) {
-            log.error("Error getting category list for weblog - "+getWeblog(), ex);
+            log.error("Error getting category list for weblog - " + getWeblog(), ex);
         }
         
         cats.addAll(weblogCats);
@@ -185,8 +185,8 @@ public class Entries extends UIAction {
     public List<KeyValueObject> getSortByOptions() {
         List<KeyValueObject> opts = new ArrayList<KeyValueObject>();
         
-        opts.add(new KeyValueObject(WeblogEntrySearchCriteria.SortBy.PUBLICATION_TIME.toString(), getText("weblogEntryQuery.label.pubTime")));
-        opts.add(new KeyValueObject(WeblogEntrySearchCriteria.SortBy.UPDATE_TIME.toString(), getText("weblogEntryQuery.label.updateTime")));
+        opts.add(new KeyValueObject(WeblogEntrySearchCriteria.SortBy.PUBLICATION_TIME.name(), getText("weblogEntryQuery.label.pubTime")));
+        opts.add(new KeyValueObject(WeblogEntrySearchCriteria.SortBy.UPDATE_TIME.name(), getText("weblogEntryQuery.label.updateTime")));
         
         return opts;
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java Mon Jun 23 01:38:18 2014
@@ -26,6 +26,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.UserManager;
@@ -84,9 +85,9 @@ public final class EntryAdd extends Entr
 
 		if (perm != null && perm.hasAction(WeblogPermission.ADMIN)
 				&& perm.hasAction(WeblogPermission.POST)) {
-			getBean().setStatus(WeblogEntry.PUBLISHED);
+			getBean().setStatus(PubStatus.PUBLISHED.name());
 		} else {
-			getBean().setStatus(WeblogEntry.PENDING);
+			getBean().setStatus(PubStatus.PENDING.name());
 		}
 
 		// set entry locale based on weblog locale
@@ -143,7 +144,7 @@ public final class EntryAdd extends Entr
                     // status
                     if (!getActionWeblog().hasUserPermission(
                             getAuthenticatedUser(), WeblogPermission.POST)) {
-                        entry.setStatus(WeblogEntry.PENDING);
+                        entry.setStatus(PubStatus.PENDING);
                     }
                 }
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryBase.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryBase.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryBase.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryBase.java Mon Jun 23 01:38:18 2014
@@ -31,6 +31,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.plugins.entry.WeblogEntryPlugin;
 import org.apache.roller.weblogger.business.search.IndexManager;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.pojos.WeblogPermission;
 import org.apache.roller.weblogger.ui.core.RollerContext;
@@ -85,7 +86,7 @@ public abstract class EntryBase extends 
         try {
             WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
             wesc.setWeblog(getActionWeblog());
-            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setStatus(PubStatus.PUBLISHED);
             wesc.setMaxResults(20);
             entries = WebloggerFactory.getWeblogger().getWeblogEntryManager()
                     .getWeblogEntries(wesc);
@@ -106,7 +107,7 @@ public abstract class EntryBase extends 
         try {
             WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
             wesc.setWeblog(getActionWeblog());
-            wesc.setStatus(WeblogEntry.SCHEDULED);
+            wesc.setStatus(PubStatus.SCHEDULED);
             wesc.setMaxResults(20);
             entries = WebloggerFactory.getWeblogger().getWeblogEntryManager()
                     .getWeblogEntries(wesc);
@@ -127,7 +128,7 @@ public abstract class EntryBase extends 
         try {
             WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
             wesc.setWeblog(getActionWeblog());
-            wesc.setStatus(WeblogEntry.DRAFT);
+            wesc.setStatus(PubStatus.DRAFT);
             wesc.setSortBy(WeblogEntrySearchCriteria.SortBy.UPDATE_TIME);
             wesc.setMaxResults(20);
             entries = WebloggerFactory.getWeblogger().getWeblogEntryManager()
@@ -149,7 +150,7 @@ public abstract class EntryBase extends 
         try {
             WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
             wesc.setWeblog(getActionWeblog());
-            wesc.setStatus(WeblogEntry.PENDING);
+            wesc.setStatus(PubStatus.PENDING);
             wesc.setSortBy(WeblogEntrySearchCriteria.SortBy.UPDATE_TIME);
             wesc.setMaxResults(20);
             entries = WebloggerFactory.getWeblogger().getWeblogEntryManager()

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryBean.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryBean.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryBean.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryBean.java Mon Jun 23 01:38:18 2014
@@ -26,6 +26,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.pojos.WeblogCategory;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.WeblogEntryAttribute;
 
 import java.sql.Timestamp;
@@ -269,25 +270,25 @@ public class EntryBean {
     }
     
     public boolean isDraft() {
-        return status.equals(WeblogEntry.DRAFT);
+        return status.equals(PubStatus.DRAFT.name());
     }
     
     public boolean isPending() {
-        return status.equals(WeblogEntry.PENDING);
+        return status.equals(PubStatus.PENDING.name());
     }
     
     public boolean isPublished() {
-        return status.equals(WeblogEntry.PUBLISHED);
+        return status.equals(PubStatus.PUBLISHED.name());
     }
     
     public boolean isScheduled() {
-        return status.equals(WeblogEntry.SCHEDULED);
+        return status.equals(PubStatus.SCHEDULED.name());
     }
     
     public void copyTo(WeblogEntry entry) throws WebloggerException {
         
         entry.setTitle(getTitle());
-        entry.setStatus(getStatus());
+        entry.setStatus(PubStatus.valueOf(getStatus()));
         entry.setLocale(getLocale());
         entry.setSummary(getSummary());
         entry.setText(getText());
@@ -335,7 +336,7 @@ public class EntryBean {
         setId(entry.getId());
         setTitle(entry.getTitle());
         setLocale(entry.getLocale());
-        setStatus(entry.getStatus());
+        setStatus(entry.getStatus().name());
         setSummary(entry.getSummary());
         setText(entry.getText());
         setCategoryId(entry.getCategory().getId());

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java Mon Jun 23 01:38:18 2014
@@ -33,6 +33,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.pojos.GlobalPermission;
 import org.apache.roller.weblogger.pojos.WeblogCategory;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.WeblogPermission;
 import org.apache.roller.weblogger.util.cache.CacheManager;
 import org.apache.roller.weblogger.util.MailUtil;
@@ -151,7 +152,7 @@ public final class EntryEdit extends Ent
                     // status
                     if (!getActionWeblog().hasUserPermission(
                             getAuthenticatedUser(), WeblogPermission.POST)) {
-                        weblogEntry.setStatus(WeblogEntry.PENDING);
+                        weblogEntry.setStatus(PubStatus.PENDING);
                     }
 
                     // If the entry was published to future, set status as
@@ -159,7 +160,7 @@ public final class EntryEdit extends Ent
                     // it is scheduled more than 1 minute into the future
                     if (weblogEntry.getPubTime().after(
                             new Date(System.currentTimeMillis() + MINUTE_IN_MILLIS))) {
-                        getBean().setStatus(WeblogEntry.SCHEDULED);
+                        getBean().setStatus(PubStatus.SCHEDULED.name());
                     }
 
                 }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java Mon Jun 23 01:38:18 2014
@@ -76,8 +76,8 @@ public class EntryRemove extends EntryBa
 				try {
 					// remove the entry from the search index
 					// TODO: can we do this in a better way?
-					String originalStatus = entry.getStatus();
-					entry.setStatus(WeblogEntry.DRAFT);
+					WeblogEntry.PubStatus originalStatus = entry.getStatus();
+					entry.setStatus(WeblogEntry.PubStatus.DRAFT);
 					IndexManager manager = WebloggerFactory.getWeblogger()
 							.getIndexManager();
 					manager.addEntryReIndexOperation(entry);

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogExport.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogExport.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogExport.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogExport.java Mon Jun 23 01:38:18 2014
@@ -551,7 +551,7 @@ public final class WeblogExport extends 
 
             // Date
             result.append("DATE: ");
-            if (entry.getStatus().equals(WeblogEntry.PUBLISHED)) {
+            if (entry.getStatus().equals(WeblogEntry.PubStatus.PUBLISHED)) {
                 result.append(MT_DATE_FORMAT.format(entry.getPubTime()));
             } else {
                 result.append(MT_DATE_FORMAT.format(entry.getUpdateTime()));
@@ -565,7 +565,7 @@ public final class WeblogExport extends 
 
             // Status
             result.append("STATUS: ");
-            if (entry.getStatus().equals(WeblogEntry.PUBLISHED)) {
+            if (entry.getStatus().equals(WeblogEntry.PubStatus.PUBLISHED)) {
                 result.append("publish");
             } else {
                 result.append("draft");

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/pagers/EntriesPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/pagers/EntriesPager.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/pagers/EntriesPager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/pagers/EntriesPager.java Mon Jun 23 01:38:18 2014
@@ -65,7 +65,7 @@ public class EntriesPager {
     public String getPrevLink() {
         if (pageNum > 0) {
             int prevPage = pageNum - 1;
-            Map<String, String> params = new HashMap();
+            Map<String, String> params = new HashMap<String, String>();
             params.put("bean.page", ""+prevPage);
             return createURL(baseUrl, params);
         }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/EntryCollection.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/EntryCollection.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/EntryCollection.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/EntryCollection.java Mon Jun 23 01:38:18 2014
@@ -54,6 +54,7 @@ import org.apache.roller.weblogger.pojos
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.pojos.WeblogCategory;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.pojos.WeblogEntryTag;
 import org.apache.roller.weblogger.pojos.WeblogEntryTagComparator;
@@ -375,7 +376,7 @@ public class EntryCollection {
         
         List<Module> modules = new ArrayList<Module>();
         AppModule app = new AppModuleImpl();
-        app.setDraft(!WeblogEntry.PUBLISHED.equals(entry.getStatus()));
+        app.setDraft(!WeblogEntry.PubStatus.PUBLISHED.equals(entry.getStatus()));
         app.setEdited(entry.getUpdateTime());
         modules.add(app);
         atomEntry.setModules(modules);
@@ -399,7 +400,7 @@ public class EntryCollection {
         }
         rollerEntry.setTitle(entry.getTitle());
         if (entry.getContents() != null && entry.getContents().size() > 0) {
-            Content content = (Content)entry.getContents().get(0);
+            Content content = entry.getContents().get(0);
             rollerEntry.setText(content.getValue());
         }
         if (entry.getSummary() != null) {
@@ -411,9 +412,9 @@ public class EntryCollection {
         AppModule control =
                 (AppModule)entry.getModule(AppModule.URI);
         if (control!=null && control.getDraft()) {
-            rollerEntry.setStatus(WeblogEntry.DRAFT);
+            rollerEntry.setStatus(PubStatus.DRAFT);
         } else {
-            rollerEntry.setStatus(WeblogEntry.PUBLISHED);
+            rollerEntry.setStatus(PubStatus.PUBLISHED);
         }
                 
         // Process incoming categories:

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/BloggerAPIHandler.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/BloggerAPIHandler.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/BloggerAPIHandler.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/BloggerAPIHandler.java Mon Jun 23 01:38:18 2014
@@ -37,6 +37,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.WeblogEntryManager;
 import org.apache.roller.weblogger.pojos.User;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.pojos.WeblogTemplate;
 import org.apache.roller.weblogger.pojos.Weblog;
@@ -329,9 +330,9 @@ public class BloggerAPIHandler extends B
                 entry.setText(content);
                 entry.setUpdateTime(current);
                 if (publish) {
-                    entry.setStatus(WeblogEntry.PUBLISHED);
+                    entry.setStatus(PubStatus.PUBLISHED);
                 } else {
-                    entry.setStatus(WeblogEntry.DRAFT);
+                    entry.setStatus(PubStatus.DRAFT);
                 }
                 
                 // save the entry
@@ -408,9 +409,9 @@ public class BloggerAPIHandler extends B
             entry.setCategory(website.getBloggerCategory());
             entry.setCommentDays(website.getDefaultCommentDays());
             if (publish) {
-                entry.setStatus(WeblogEntry.PUBLISHED);
+                entry.setStatus(PubStatus.PUBLISHED);
             } else {
-                entry.setStatus(WeblogEntry.DRAFT);
+                entry.setStatus(PubStatus.DRAFT);
             }
             
             // save the entry

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java Mon Jun 23 01:38:18 2014
@@ -41,6 +41,7 @@ import org.apache.roller.weblogger.pojos
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.pojos.WeblogCategory;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.util.RollerMessages;
 import org.apache.roller.weblogger.util.Utilities;
@@ -165,9 +166,9 @@ public class MetaWeblogAPIHandler extend
             entry.setText(description);
             entry.setUpdateTime(current);
             if (publish) {
-                entry.setStatus(WeblogEntry.PUBLISHED);
+                entry.setStatus(PubStatus.PUBLISHED);
             } else {
-                entry.setStatus(WeblogEntry.DRAFT);
+                entry.setStatus(PubStatus.DRAFT);
             }
             if (dateCreated != null) {
                 entry.setPubTime(new Timestamp(dateCreated.getTime()));
@@ -271,9 +272,9 @@ public class MetaWeblogAPIHandler extend
             }
             
             if (publish) {
-                entry.setStatus(WeblogEntry.PUBLISHED);
+                entry.setStatus(PubStatus.PUBLISHED);
             } else {
-                entry.setStatus(WeblogEntry.DRAFT);
+                entry.setStatus(PubStatus.DRAFT);
             }
             
             // MetaWeblog supports multiple cats, Weblogger supports one/entry

Modified: roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/WeblogEntry.orm.xml
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/WeblogEntry.orm.xml?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/WeblogEntry.orm.xml (original)
+++ roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/WeblogEntry.orm.xml Mon Jun 23 01:38:18 2014
@@ -6,51 +6,12 @@
     <entity metadata-complete="true" name="WeblogEntry"
             class="org.apache.roller.weblogger.pojos.WeblogEntry" access="PROPERTY">
         <table name="weblogentry"/>
-        <named-query name="WeblogEntry.getByStatus&amp;Category">
-            <query>SELECT w FROM WeblogEntry w WHERE w.status = ?1 AND w.category = ?2</query>
-        </named-query>
         <named-query name="WeblogEntry.getByCategory">
             <query>SELECT w FROM WeblogEntry w WHERE w.category = ?1</query>
         </named-query>
         <named-query name="WeblogEntry.getByPinnedToMain&amp;statusOrderByPubTimeDesc">
             <query>SELECT w FROM WeblogEntry w WHERE w.pinnedToMain = ?1 AND w.status = ?2 ORDER BY w.pubTime DESC</query>
         </named-query>
-        <named-query name="WeblogEntry.getByWebsite&amp;Status&amp;PubTimeGreater&amp;CategoryOrderByPubTimeAsc">
-            <query>SELECT w FROM WeblogEntry w WHERE w.website = ?1 AND w.status = ?2 AND w.pubTime &gt; ?3 AND w.category = ?4
-                                                   ORDER BY w.pubTime ASC</query>
-        </named-query>
-        <named-query name="WeblogEntry.getByWebsite&amp;Status&amp;PubTimeGreater&amp;Category&amp;LocaleLikeOrderByPubTimeAsc">
-            <query>SELECT w FROM WeblogEntry w WHERE w.website = ?1 AND w.status = ?2 AND w.pubTime &gt; ?3 AND w.category = ?4
-                                                     AND UPPER(w.locale) LIKE ?5
-                                                   ORDER BY w.pubTime ASC</query>
-        </named-query>
-        <named-query name="WeblogEntry.getByWebsite&amp;Status&amp;PubTimeGreaterOrderByPubTimeAsc">
-            <query>SELECT w FROM WeblogEntry w WHERE w.website = ?1 AND w.status = ?2 AND w.pubTime &gt; ?3
-                                                   ORDER BY w.pubTime ASC</query>
-        </named-query>
-        <named-query name="WeblogEntry.getByWebsite&amp;Status&amp;PubTimeGreater&amp;LocaleLikeOrderByPubTimeAsc">
-            <query>SELECT w FROM WeblogEntry w WHERE w.website = ?1 AND w.status = ?2 AND w.pubTime &gt; ?3
-                                                     AND UPPER(w.locale) LIKE ?4
-                                                   ORDER BY w.pubTime ASC</query>
-        </named-query>
-        <named-query name="WeblogEntry.getByWebsite&amp;Status&amp;PubTimeLessOrderByPubTimeDesc">
-            <query>SELECT w FROM WeblogEntry w WHERE w.website = ?1 AND w.status = ?2 AND w.pubTime &lt; ?3
-                                                   ORDER BY w.pubTime DESC</query>
-        </named-query>
-        <named-query name="WeblogEntry.getByWebsite&amp;Status&amp;PubTimeLess&amp;CategoryOrderByPubTimeDesc">
-            <query>SELECT w FROM WeblogEntry w WHERE w.website = ?1 AND w.status = ?2 AND w.pubTime &lt; ?3 AND w.category = ?4
-                                                   ORDER BY w.pubTime DESC</query>
-        </named-query>
-        <named-query name="WeblogEntry.getByWebsite&amp;Status&amp;PubTimeLess&amp;Category&amp;LocaleLikeOrderByPubTimeDesc">
-            <query>SELECT w FROM WeblogEntry w WHERE w.website = ?1 AND w.status = ?2 AND w.pubTime &lt; ?3  AND w.category = ?4
-                                                     AND UPPER(w.locale) LIKE ?5
-                                                   ORDER BY w.pubTime DESC</query>
-        </named-query>
-        <named-query name="WeblogEntry.getByWebsite&amp;Status&amp;PubTimeLess&amp;LocaleLikeOrderByPubTimeDesc">
-            <query>SELECT w FROM WeblogEntry w WHERE w.website = ?1 AND w.status = ?2 AND w.pubTime &lt; ?3
-                                                     AND UPPER(w.locale) LIKE ?4
-                                                   ORDER BY w.pubTime DESC</query>
-        </named-query>
         <named-query name="WeblogEntry.getByWebsite&amp;AnchorOrderByPubTimeDesc">
             <query>SELECT w FROM WeblogEntry w WHERE w.website = ?1 AND w.anchor = ?2 ORDER BY w.pubTime DESC</query>
         </named-query>
@@ -104,6 +65,7 @@
             </basic>
             <basic name="status">
                 <column name="status" insertable="true" updatable="true" unique="false"/>
+                <enumerated>STRING</enumerated>
             </basic>
             <basic name="link">
                 <column name="link" insertable="true" updatable="true" unique="false"/>

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=1604674&r1=1604673&r2=1604674&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 01:38:18 2014
@@ -123,13 +123,13 @@
 
 <s:iterator id="post" value="pager.items">
     <%-- <td> with style if comment is spam or pending --%>
-    <s:if test="#post.status == 'DRAFT'">
+    <s:if test="#post.status.name() == 'DRAFT'">
         <tr class="draftentry"> 
     </s:if>
-    <s:elseif test="#post.status == 'PENDING'">
+    <s:elseif test="#post.status.name() == 'PENDING'">
         <tr class="pendingentry"> 
     </s:elseif>
-    <s:elseif test="#post.status == 'SCHEDULED'">
+    <s:elseif test="#post.status.name() == 'SCHEDULED'">
         <tr class="scheduledentry"> 
     </s:elseif>
     <s:else>

Modified: roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/IndexManagerTest.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/IndexManagerTest.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/IndexManagerTest.java (original)
+++ roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/IndexManagerTest.java Mon Jun 23 01:38:18 2014
@@ -29,6 +29,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.search.IndexManager;
 import org.apache.roller.weblogger.pojos.User;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.pojos.WeblogCategory;
 import org.apache.commons.logging.Log;
@@ -96,7 +97,7 @@ public class IndexManagerTest extends Te
         +"begin to lose power, and Spock reports strange sensor readings.");
         wd1.setAnchor("dummy1");
         wd1.setCreatorUserName(testUser.getUserName());
-        wd1.setStatus(WeblogEntry.PUBLISHED);
+        wd1.setStatus(PubStatus.PUBLISHED);
         wd1.setUpdateTime(new Timestamp(System.currentTimeMillis()));
         wd1.setPubTime(new Timestamp(System.currentTimeMillis()));
         wd1.setWebsite(TestUtils.getManagedWebsite(testWeblog));
@@ -119,7 +120,7 @@ public class IndexManagerTest extends Te
           +"the inhabitants of planet Sigma Iotia II, and Uhura puts Kirk "
           +"in communication with Boss Oxmyx.");
         wd2.setAnchor("dummy2");
-        wd2.setStatus(WeblogEntry.PUBLISHED);
+        wd2.setStatus(PubStatus.PUBLISHED);
         wd2.setCreatorUserName(testUser.getUserName());
         wd2.setUpdateTime(new Timestamp(System.currentTimeMillis()));
         wd2.setPubTime(new Timestamp(System.currentTimeMillis()));

Modified: roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/PlanetManagerLocalTest.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/PlanetManagerLocalTest.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/PlanetManagerLocalTest.java (original)
+++ roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/PlanetManagerLocalTest.java Mon Jun 23 01:38:18 2014
@@ -30,6 +30,7 @@ import org.apache.roller.planet.pojos.Pl
 import org.apache.roller.weblogger.TestUtils;
 import org.apache.roller.weblogger.pojos.User;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.planet.tasks.RefreshRollerPlanetTask;
 import org.apache.roller.weblogger.planet.tasks.SyncWebsitesTask;
@@ -75,7 +76,7 @@ public class PlanetManagerLocalTest exte
             testEntry1.setWebsite(testWeblog);
             testEntry1.setCreatorUserName(testUser.getUserName());
             testEntry1.setCategory(testWeblog.getDefaultCategory());
-            testEntry1.setStatus(WeblogEntry.PUBLISHED);
+            testEntry1.setStatus(PubStatus.PUBLISHED);
             WebloggerFactory.getWeblogger().getWeblogEntryManager().saveWeblogEntry(testEntry1);
 
             WeblogEntry testEntry2 = new WeblogEntry();
@@ -88,7 +89,7 @@ public class PlanetManagerLocalTest exte
             testEntry2.setWebsite(testWeblog);
             testEntry2.setCreatorUserName(testUser.getUserName());
             testEntry2.setCategory(testWeblog.getDefaultCategory());
-            testEntry2.setStatus(WeblogEntry.PUBLISHED);
+            testEntry2.setStatus(PubStatus.PUBLISHED);
             WebloggerFactory.getWeblogger().getWeblogEntryManager().saveWeblogEntry(testEntry2);
 
             WeblogEntry testEntry3 = new WeblogEntry();
@@ -101,7 +102,7 @@ public class PlanetManagerLocalTest exte
             testEntry3.setWebsite(testWeblog);
             testEntry3.setCreatorUserName(testUser.getUserName());
             testEntry3.setCategory(testWeblog.getDefaultCategory());           
-            testEntry3.setStatus(WeblogEntry.PUBLISHED);
+            testEntry3.setStatus(PubStatus.PUBLISHED);
             WebloggerFactory.getWeblogger().getWeblogEntryManager().saveWeblogEntry(testEntry3);
 
             TestUtils.endSession(true);

Modified: roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogCategoryFunctionalityTest.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogCategoryFunctionalityTest.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogCategoryFunctionalityTest.java (original)
+++ roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogCategoryFunctionalityTest.java Mon Jun 23 01:38:18 2014
@@ -18,9 +18,7 @@
 
 package org.apache.roller.weblogger.business;
 
-import java.util.Iterator;
 import java.util.List;
-import java.util.Set;
 import junit.framework.TestCase;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -28,6 +26,7 @@ import org.apache.roller.weblogger.TestU
 import org.apache.roller.weblogger.pojos.User;
 import org.apache.roller.weblogger.pojos.WeblogCategory;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.Weblog;
 
 
@@ -194,7 +193,7 @@ public class WeblogCategoryFunctionality
             testWeblog = TestUtils.getManagedWebsite(testWeblog);
             testUser = TestUtils.getManagedUser(testUser);
             e1 = TestUtils.setupWeblogEntry("e1", c1, testWeblog, testUser);
-            e2 = TestUtils.setupWeblogEntry("e2", c1, WeblogEntry.DRAFT, testWeblog, testUser);
+            e2 = TestUtils.setupWeblogEntry("e2", c1, PubStatus.DRAFT, testWeblog, testUser);
 
             TestUtils.endSession(true);
 

Modified: roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogEntryTest.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogEntryTest.java?rev=1604674&r1=1604673&r2=1604674&view=diff
==============================================================================
--- roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogEntryTest.java (original)
+++ roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogEntryTest.java Mon Jun 23 01:38:18 2014
@@ -38,6 +38,7 @@ import org.apache.roller.weblogger.pojos
 import org.apache.roller.weblogger.pojos.User;
 import org.apache.roller.weblogger.pojos.WeblogCategory;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus;
 import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.pojos.WeblogEntryTag;
 import org.apache.roller.weblogger.pojos.Weblog;
@@ -174,17 +175,17 @@ public class WeblogEntryTest extends Tes
         
         // make a couple changes
         entry1.setLocale("en_US");
-        entry1.setStatus(WeblogEntry.PUBLISHED);
+        entry1.setStatus(PubStatus.PUBLISHED);
         entry1.setPinnedToMain(Boolean.TRUE);
         mgr.saveWeblogEntry(entry1);
         
         entry2.setLocale("ja_JP");
-        entry2.setStatus(WeblogEntry.PUBLISHED);
+        entry2.setStatus(PubStatus.PUBLISHED);
         entry2.setUpdateTime(new java.sql.Timestamp(entry2.getUpdateTime().getTime()+8822384));
         entry2.setPubTime(entry2.getUpdateTime());
         mgr.saveWeblogEntry(entry2);
-        
-        entry3.setStatus(WeblogEntry.DRAFT);
+
+        entry3.setStatus(PubStatus.DRAFT);
         entry3.setUpdateTime(new java.sql.Timestamp(entry3.getUpdateTime().getTime()+348829384));
         entry3.setPubTime(entry3.getUpdateTime());
         mgr.saveWeblogEntry(entry3);
@@ -229,7 +230,7 @@ public class WeblogEntryTest extends Tes
         WeblogEntrySearchCriteria wesc9 = new WeblogEntrySearchCriteria();
         wesc9.setWeblog(testWeblog);
         wesc9.setCatName(testWeblog.getDefaultCategory().getName());
-        wesc9.setStatus(WeblogEntry.PUBLISHED);
+        wesc9.setStatus(PubStatus.PUBLISHED);
         entries = mgr.getWeblogEntries(wesc9);
         assertNotNull(entries);
         assertEquals(3, entries.size());
@@ -237,7 +238,7 @@ public class WeblogEntryTest extends Tes
         // get all (non-future) PUBLISHED entries only 
         WeblogEntrySearchCriteria wesc2 = new WeblogEntrySearchCriteria();
         wesc2.setWeblog(testWeblog);
-        wesc2.setStatus(WeblogEntry.PUBLISHED);
+        wesc2.setStatus(PubStatus.PUBLISHED);
         entries = mgr.getWeblogEntries(wesc2);
         assertNotNull(entries);
         assertEquals(3, entries.size());



Mime
View raw message