roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1583085 [1/2] - in /roller/trunk/app/src: main/java/org/apache/roller/planet/pojos/ main/java/org/apache/roller/weblogger/business/ main/java/org/apache/roller/weblogger/business/jpa/ main/java/org/apache/roller/weblogger/business/runnable...
Date Sun, 30 Mar 2014 00:05:39 GMT
Author: gmazza
Date: Sun Mar 30 00:05:38 2014
New Revision: 1583085

URL: http://svn.apache.org/r1583085
Log:
Introduction of new WeblogEntrySearchCriteria object to simplify and better document WeblogEntryManager.getWeblogEntries() calls, removal of older references to Category paths.

Added:
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntrySearchCriteria.java
Modified:
    roller/trunk/app/src/main/java/org/apache/roller/planet/pojos/Category.java
    roller/trunk/app/src/main/java/org/apache/roller/planet/pojos/SubscriptionEntry.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/WeblogEntryTag.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/model/SearchResultsFeedModel.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/URLModel.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/AbstractWeblogEntriesPager.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/rendering/pagers/WeblogEntriesPreviewPager.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/EntriesBean.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/WeblogExport.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/webapp/WEB-INF/jsps/editor/EntriesSidebar.jsp
    roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-atom.vm
    roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-rss.vm
    roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-atom.vm
    roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-rss.vm
    roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-search-atom.vm
    roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-atom.vm
    roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-rss.vm
    roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-atom.vm
    roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-rss.vm
    roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-search-atom.vm
    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/planet/pojos/Category.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/planet/pojos/Category.java?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/planet/pojos/Category.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/planet/pojos/Category.java Sun Mar 30 00:05:38 2014
@@ -24,8 +24,6 @@ package org.apache.roller.planet.pojos;
 public class Category {
     
     private String name = null;
-    private String path = null;
-    
 
     public String getName() {
         return name;
@@ -35,12 +33,4 @@ public class Category {
         this.name = name;
     }
 
-    public String getPath() {
-        return path;
-    }
-
-    public void setPath(String path) {
-        this.path = path;
-    }
-    
 }

Modified: roller/trunk/app/src/main/java/org/apache/roller/planet/pojos/SubscriptionEntry.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/planet/pojos/SubscriptionEntry.java?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/planet/pojos/SubscriptionEntry.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/planet/pojos/SubscriptionEntry.java Sun Mar 30 00:05:38 2014
@@ -212,7 +212,6 @@ public class SubscriptionEntry implement
             for (String catName : catArray) {
                 Category cat = new Category();
                 cat.setName(catName);
-                cat.setPath(catName);
                 list.add(cat);
             }
         }

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -24,11 +24,11 @@ import java.util.Map;
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.pojos.StatCount;
 import org.apache.roller.weblogger.pojos.TagStat;
-import org.apache.roller.weblogger.pojos.User;
 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.WeblogEntryComment;
+import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.pojos.WeblogHitCount;
 
 
@@ -37,9 +37,6 @@ import org.apache.roller.weblogger.pojos
  */
 public interface WeblogEntryManager {
 
-    String DESCENDING = "DESCENDING";
-    String ASCENDING = "ASCENDING";
-       
     /**
      * Save weblog entry.
      */
@@ -64,99 +61,35 @@ public interface WeblogEntryManager {
     /**
      * Get WeblogEntries by offset/length as list in reverse chronological order.
      * The range offset and list arguments enable paging through query results.
-     * @param website    Weblog or null to get for all weblogs.
-     * @param user       User or null to get for all users.
-     * @param startDate  Start date or null for no start date.
-     * @param endDate    End date or null for no end date.
-     * @param catName    Category name or null for all categories.
-     * @param status     Status of DRAFT, PENDING, PUBLISHED or null for all
-     * @param text       Text appearing in the text or summary, or null for all
-     * @param sortBy     Sort by either 'pubTime' or 'updateTime' (null for pubTime)
-     * @param sortOrder  Sort order of ASCENDING or DESCENDING (null for DESCENDING)
-     * @param offset     Offset into results for paging
-     * @param range
-     * @return List of WeblogEntryData objects in reverse chrono order.
+     * @param wesc WeblogEntrySearchCriteria object listing desired search parameters
+     * @return List of WeblogEntry objects in order specified by search criteria
      * @throws WebloggerException
      */
-    List<WeblogEntry> getWeblogEntries(
-            Weblog website,
-            User user,
-            Date        startDate,
-            Date        endDate,
-            String      catName,
-            List        tags,
-            String      status,
-            String      text,
-            String      sortBy, 
-            String      sortOrder,
-            String      locale,             
-            int         offset,
-            int         range)
+    List<WeblogEntry> getWeblogEntries(WeblogEntrySearchCriteria wesc)
             throws WebloggerException;
-       
+
     /**
-     * Get Weblog Entries grouped by day. This method returns a Map that
-     * contains Lists, each List contains WeblogEntryData objects, and the
-     * Lists are keyed by Date objects.
-     * @param website    Weblog or null to get for all weblogs.
-     * @param startDate  Start date or null for no start date.
-     * @param endDate    End date or null for no end date.
-     * @param catName    Category name or null for all categories.
-     * @param status     Status of DRAFT, PENDING, PUBLISHED or null for all
-     * @param offset     Offset into results for paging
-     * @param range
-     * @return Map of Lists, keyed by Date, and containing WeblogEntry objects.
+     * Get Weblog Entries grouped by day.
+     * @param wesc WeblogEntrySearchCriteria object listing desired search parameters
+     * @return Map of Lists of WeblogEntries keyed by calendar day
      * @throws WebloggerException
      */
-    Map<Date, List<WeblogEntry>> getWeblogEntryObjectMap(
-            Weblog website,
-            Date        startDate,
-            Date        endDate,
-            String      catName,
-            List        tags,            
-            String      status,
-            String      locale,
-            int         offset,
-            int         range)
+    Map<Date, List<WeblogEntry>> getWeblogEntryObjectMap(WeblogEntrySearchCriteria wesc)
             throws WebloggerException;
-        
+
     /**
      * Get Weblog Entry date strings grouped by day. This method returns a Map
-     * that contains YYYYMMDD date strings object, keyed by Date objects
-     *
-     * @param website    Weblog or null to get for all weblogs.
-     * @param startDate  Start date or null for no start date.
-     * @param endDate    End date or null for no end date.
-     * @param catName    Category name or null for all categories.
-     * @param status     Status of DRAFT, PENDING, PUBLISHED or null for all
-     * @param offset     Offset into results for paging
-     * @param range
+     * that contains one YYYYMMDD date string object for each calendar day having
+     * one or more blog entries.
+     * @param wesc WeblogEntrySearchCriteria object listing desired search parameters
      * @return Map of date strings keyed by Date
      * @throws WebloggerException
      */
-    Map<Date, String> getWeblogEntryStringMap(
-            Weblog website,
-            Date        startDate,
-            Date        endDate,
-            String      catName,
-            List        tags,            
-            String      status,
-            String      locale,
-            int         offset,
-            int         range)
-            throws WebloggerException;    
+    Map<Date, String> getWeblogEntryStringMap(WeblogEntrySearchCriteria wesc)
+            throws WebloggerException;
     
     /**
-     * Get weblog entries with given category or, optionally, any sub-category
-     * of that category.
-     * @param cat     Category
-     * @return        List of weblog entries in category
-     */
-    List<WeblogEntry> getWeblogEntries(WeblogCategory cat, boolean subcats)
-            throws WebloggerException; 
-    
-    /** 
-     * Get weblog enties ordered by descending number of comments.
+     * Get weblog entries ordered by descending number of comments.
      * @param website    Weblog or null to get for all weblogs.
      * @param startDate  Start date or null for no start date.
      * @param endDate    End date or null for no end date.

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -33,6 +33,7 @@ import org.apache.roller.util.RollerCons
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.Weblogger;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
+import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.pojos.WeblogHitCount;
 import org.apache.roller.weblogger.pojos.StatCount;
 import org.apache.roller.weblogger.pojos.TagStat;
@@ -45,7 +46,6 @@ import org.apache.roller.weblogger.pojos
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.pojos.WeblogEntryAttribute;
 import org.apache.roller.weblogger.pojos.StatCountCountComparator;
-import org.apache.roller.weblogger.pojos.User;
 import org.apache.roller.util.DateUtil;
 import org.apache.roller.weblogger.business.WeblogEntryManager;
 
@@ -367,92 +367,76 @@ public class JPAWeblogEntryManagerImpl i
         q.setParameter(1, website);
         return q.getResultList();
     }
-    
+
     /**
      * @inheritDoc
      */
-    public List<WeblogEntry> getWeblogEntries(
-            Weblog website,
-            User    user,
-            Date        startDate,
-            Date        endDate,
-            String      catName,
-            List        tags,
-            String      status,
-            String      text,
-            String      sortby,
-            String      sortOrder,
-            String      locale,
-            int         offset,
-            int         length) throws WebloggerException {
-        
+    public List<WeblogEntry> getWeblogEntries(WeblogEntrySearchCriteria wesc) throws WebloggerException {
+
         WeblogCategory cat = null;
-        if (StringUtils.isNotEmpty(catName) && website != null) {
-            cat = getWeblogCategoryByName(website, catName);
-            if (cat == null) {
-                catName = null;
-            }
+        if (StringUtils.isNotEmpty(wesc.getCatName()) && wesc.getWeblog() != null) {
+            cat = getWeblogCategoryByName(wesc.getWeblog(), wesc.getCatName());
         }
 
         List<Object> params = new ArrayList<Object>();
         int size = 0;
         StringBuilder queryString = new StringBuilder();
         
-        if (tags == null || tags.size()==0) {
+        if (wesc.getTags() == null || wesc.getTags().size()==0) {
             queryString.append("SELECT e FROM WeblogEntry e WHERE ");
         } else {
             queryString.append("SELECT e FROM WeblogEntry e JOIN e.tags t WHERE ");
             queryString.append("(");
-            for (int i = 0; i < tags.size(); i++) {
+            for (int i = 0; i < wesc.getTags().size(); i++) {
                 if (i != 0) {
                     queryString.append(" OR ");
                 }
-                params.add(size++, tags.get(i));
+                params.add(size++, wesc.getTags().get(i));
                 queryString.append(" t.name = ?").append(size);                
             }
             queryString.append(") AND ");
         }
         
-        if (website != null) {
-            params.add(size++, website.getId());
+        if (wesc.getWeblog() != null) {
+            params.add(size++, wesc.getWeblog().getId());
             queryString.append("e.website.id = ?").append(size);
         } else {
             params.add(size++, Boolean.TRUE);
             queryString.append("e.website.enabled = ?").append(size);
         }
         
-        /*if (tags != null && tags.size() > 0) {
-            // A JOIN with WeblogEntryTag in parent quert will cause a DISTINCT in SELECT clause
+        /*if (wesc.getTags() != null && wesc.getTags().size() > 0) {
+            // A JOIN with WeblogEntryTag in parent query will cause a DISTINCT in SELECT clause
             // WeblogEntry has a clob field and many databases do not link DISTINCT for CLOB fields
             // Hence as a workaround using corelated EXISTS query.
             queryString.append(" AND EXISTS (SELECT t FROM WeblogEntryTag t WHERE "
                     + " t.weblogEntry = e AND t.name IN (");
-            final String PARAM_SEPERATOR = ", ";
-            for (int i = 0; i < tags.size(); i++) {
-                params.add(size++, tags.get(i));
-                queryString.append("?").append(size).append(PARAM_SEPERATOR);
+            final String PARAM_SEPARATOR = ", ";
+            for (int i = 0; i < wesc.getTags().size(); i++) {
+                params.add(size++, wesc.getTags().get(i));
+                queryString.append("?").append(size).append(PARAM_SEPARATOR);
             }
-            // Remove the trailing PARAM_SEPERATOR
-            queryString.delete(queryString.length() - PARAM_SEPERATOR.length(),
+            // Remove the trailing PARAM_SEPARATOR
+            queryString.delete(queryString.length() - PARAM_SEPARATOR.length(),
                     queryString.length());
 
             // Close the brace FOR IN clause and EXIST clause
             queryString.append(" ) )");
         }*/
 
-        if (user != null) {
-            params.add(size++, user.getUserName());
+        if (wesc.getUser() != null) {
+            params.add(size++, wesc.getUser().getUserName());
             queryString.append(" AND e.creatorUserName = ?").append(size);
         }
         
-        if (startDate != null) {
-            Timestamp start = new Timestamp(startDate.getTime());
+        if (wesc.getStartDate() != null) {
+            Timestamp start = new Timestamp(wesc.getStartDate().getTime());
             params.add(size++, start);
             queryString.append(" AND e.pubTime >= ?").append(size);
         }
         
-        if (endDate != null) {
-            Timestamp end = new Timestamp(endDate.getTime());
+        if (wesc.getEndDate() != null) {
+            Timestamp end = new Timestamp(wesc.getEndDate().getTime());
             params.add(size++, end);
             queryString.append(" AND e.pubTime <= ?").append(size);
         }
@@ -462,31 +446,31 @@ public class JPAWeblogEntryManagerImpl i
             queryString.append(" AND e.category.id = ?").append(size);
         }
                 
-        if (status != null) {
-            params.add(size++, status);
+        if (wesc.getStatus() != null) {
+            params.add(size++, wesc.getStatus());
             queryString.append(" AND e.status = ?").append(size);
         }
         
-        if (locale != null) {
-            params.add(size++, locale + '%');
+        if (wesc.getLocale() != null) {
+            params.add(size++, wesc.getLocale() + '%');
             queryString.append(" AND e.locale like ?").append(size);
         }
         
-        if (StringUtils.isNotEmpty(text)) {
-            params.add(size++, '%' + text + '%');
+        if (StringUtils.isNotEmpty(wesc.getText())) {
+            params.add(size++, '%' + wesc.getText() + '%');
             queryString.append(" AND ( e.text LIKE ?").append(size);
             queryString.append("    OR e.summary LIKE ?").append(size);
             queryString.append("    OR e.title LIKE ?").append(size);
             queryString.append(") ");
         }
         
-        if (sortby != null && sortby.equals("updateTime")) {
+        if (wesc.getSortBy() != null && wesc.getSortBy().equals("updateTime")) {
             queryString.append(" ORDER BY e.updateTime ");
         } else {
             queryString.append(" ORDER BY e.pubTime ");
         }
         
-        if (sortOrder != null && sortOrder.equals(ASCENDING)) {
+        if (wesc.getSortOrder() != null && wesc.getSortOrder().equals(WeblogEntrySearchCriteria.SortOrder.ASCENDING)) {
             queryString.append("ASC ");
         } else {
             queryString.append("DESC ");
@@ -498,11 +482,11 @@ public class JPAWeblogEntryManagerImpl i
             query.setParameter(i+1, params.get(i));
         }
         
-        if (offset != 0) {
-            query.setFirstResult(offset);
+        if (wesc.getOffset() != 0) {
+            query.setFirstResult(wesc.getOffset());
         }
-        if (length != -1) {
-            query.setMaxResults(length);
+        if (wesc.getMaxResults() != -1) {
+            query.setMaxResults(wesc.getMaxResults());
         }
         
         return query.getResultList();
@@ -617,30 +601,6 @@ public class JPAWeblogEntryManagerImpl i
     /**
      * @inheritDoc
      */
-    // TODO: this method should be removed and its functionality moved to getWeblogEntries()
-    public List<WeblogEntry> getWeblogEntries(WeblogCategory cat, boolean publishedOnly)
-    throws WebloggerException {
-        List results;
-        
-        if (publishedOnly) {
-            Query q = strategy.getNamedQuery(
-                    "WeblogEntry.getByStatus&Category");
-            q.setParameter(1, WeblogEntry.PUBLISHED);
-            q.setParameter(2, cat);
-            results = q.getResultList();
-        } else {
-            Query q = strategy.getNamedQuery(
-                    "WeblogEntry.getByCategory");
-            q.setParameter(1, cat);
-            results = q.getResultList();
-        }
-        
-        return results;
-    }
-    
-    /**
-     * @inheritDoc
-     */
     public String createAnchor(WeblogEntry entry) throws WebloggerException {
         // Check for uniqueness of anchor
         String base = entry.createAnchorBase();
@@ -846,88 +806,26 @@ public class JPAWeblogEntryManagerImpl i
     /**
      * @inheritDoc
      */
-    public Map<Date, List<WeblogEntry>> getWeblogEntryObjectMap(
-            Weblog website,
-            Date    startDate,
-            Date    endDate,
-            String  catName,
-            List    tags,
-            String  status,
-            String  locale,
-            int     offset,
-            int     length) throws WebloggerException {
-        return getWeblogEntryMap(
-                website,
-                startDate,
-                endDate,
-                catName,
-                tags,
-                status,
-                false,
-                locale,
-                offset,
-                length);
+    public Map<Date, List<WeblogEntry>> getWeblogEntryObjectMap(WeblogEntrySearchCriteria wesc) throws WebloggerException {
+        return getWeblogEntryMap(wesc, false);
     }
-    
+
     /**
      * @inheritDoc
      */
-    public Map<Date, String> getWeblogEntryStringMap(
-            Weblog website,
-            Date    startDate,
-            Date    endDate,
-            String  catName,
-            List    tags,
-            String  status,
-            String  locale,
-            int     offset,
-            int     length
-            ) throws WebloggerException {
-        return getWeblogEntryMap(
-                website,
-                startDate,
-                endDate,
-                catName,
-                tags,
-                status,
-                true,
-                locale,
-                offset,
-                length);
+    public Map<Date, String> getWeblogEntryStringMap(WeblogEntrySearchCriteria wesc) throws WebloggerException {
+        return getWeblogEntryMap(wesc, true);
     }
     
-    private Map getWeblogEntryMap(
-            Weblog website,
-            Date    startDate,
-            Date    endDate,
-            String  catName,
-            List    tags,
-            String  status,
-            boolean stringsOnly,
-            String  locale,
-            int     offset,
-            int     length) throws WebloggerException {
-        
+    private Map getWeblogEntryMap(WeblogEntrySearchCriteria wesc, boolean stringsOnly) throws WebloggerException {
+
         TreeMap map = new TreeMap(REVERSE_COMPARATOR);
-        
-        List<WeblogEntry> entries = getWeblogEntries(
-                website,
-                null, // user
-                startDate,
-                endDate,
-                catName,
-                tags,
-                status,
-                null, // text
-                null, // sortBy
-                null, // sortOrder
-                locale,
-                offset,
-                length);
-        
+
+        List<WeblogEntry> entries = getWeblogEntries(wesc);
+
         Calendar cal = Calendar.getInstance();
-        if (website != null) {
-            cal.setTimeZone(website.getTimeZoneInstance());
+        if (wesc.getWeblog() != null) {
+            cal.setTimeZone(wesc.getWeblog().getTimeZoneInstance());
         }
         
         SimpleDateFormat formatter = DateUtil.get8charDateFormat();

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 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.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.util.cache.CacheManager;
 
 
@@ -137,20 +138,10 @@ public class ScheduledEntriesTask extend
             log.debug("looking up scheduled entries older than "+now);
             
             // get all published entries older than current time
-            List<WeblogEntry> scheduledEntries = wMgr.getWeblogEntries(
-                    
-                    null,   // website
-                    null,   // user
-                    null,   // startDate
-                    now,    // endDate
-                    null,   // catName
-                    null,WeblogEntry.SCHEDULED,
-                    null,   // text
-                    null,   // sortBy
-                    null,   // sortOrder
-                    null,   // locale
-                    0, -1); // offset, length
-                    
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setEndDate(now);
+            wesc.setStatus(WeblogEntry.SCHEDULED);
+            List<WeblogEntry> scheduledEntries = wMgr.getWeblogEntries(wesc);
             log.debug("promoting "+scheduledEntries.size()+" entries to PUBLISHED state");
             
             for (WeblogEntry entry : scheduledEntries) {

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 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.WeblogEntrySearchCriteria;
 
 /**
  * An index operation that rebuilds a given users index (or all indexes).
@@ -116,14 +117,10 @@ public class RebuildWebsiteIndexOperatio
                 // Add Doc
                 WeblogEntryManager weblogManager = roller
                         .getWeblogEntryManager();
-                List<WeblogEntry> entries = weblogManager.getWeblogEntries(website,
-                        null, null, // startDate
-                        null, // endDate
-                        null, // catName
-                        null, WeblogEntry.PUBLISHED,
-                        null, // text
-                        null, // sortby (null means pubTime)
-                        null, null, 0, -1); // offset, length, locale
+                WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+                wesc.setWeblog(website);
+                wesc.setStatus(WeblogEntry.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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -35,6 +35,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.config.WebloggerRuntimeConfig;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
 import org.apache.roller.weblogger.pojos.Weblog;
+import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 
 
 /**
@@ -121,21 +122,11 @@ public class WebloggerRomeFeedFetcher ex
             
             // grab recent entries for this weblog
             WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-            List<WeblogEntry> entries = wmgr.getWeblogEntries(
-                    localWeblog,
-                    null,                        // user
-                    null,                        // startDate
-                    null,                        // endDate
-                    null,                        // catName
-                    null,                        // tags
-                    WeblogEntry.PUBLISHED,
-                    null,                        // text
-                    null,                        // sortby (null means pubTime)
-                    null,                        // sortOrder
-                    null,                        // locale
-                    0,                           // offset
-                    entryCount);                 // range
-            
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(localWeblog);
+            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setMaxResults(entryCount);
+            List<WeblogEntry> entries = wmgr.getWeblogEntries(wesc);
             log.debug("Found " + entries.size());
 
             // Populate subscription object with new entries

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -768,20 +768,12 @@ public class Weblog implements Serializa
         }
         try {
             WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-            recentEntries = wmgr.getWeblogEntries(
-                    
-                    this, 
-                    null,       // user
-                    null,       // startDate
-                    null,       // endDate
-                    cat,        // cat or null
-                    null,WeblogEntry.PUBLISHED, 
-                    null,       // text
-                    "pubTime",  // sortby
-                    null,
-                    null, 
-                    0,
-                    length); 
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(this);
+            wesc.setCatName(cat);
+            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setMaxResults(length);
+            recentEntries = wmgr.getWeblogEntries(wesc);
         } catch (WebloggerException e) {
             log.error("ERROR: getting recent entries", e);
         }
@@ -801,8 +793,8 @@ public class Weblog implements Serializa
         if (length > 100) {
             length = 100;
         }
-        List recentEntries = new ArrayList();
-        List tags = new ArrayList();
+        List<WeblogEntry> recentEntries = new ArrayList<WeblogEntry>();
+        List<String> tags = new ArrayList<String>();
         if (tag != null) {
             tags.add(tag);
         }
@@ -811,20 +803,12 @@ public class Weblog implements Serializa
         }
         try {
             WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-            recentEntries = wmgr.getWeblogEntries(
-                    
-                    this, 
-                    null,       // user
-                    null,       // startDate
-                    null,       // endDate
-                    null,       // cat or null
-                    tags,WeblogEntry.PUBLISHED, 
-                    null,       // text
-                    "pubTime",  // sortby
-                    null,
-                    null, 
-                    0,
-                    length); 
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(this);
+            wesc.setTags(tags);
+            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setMaxResults(length);
+            recentEntries = wmgr.getWeblogEntries(wesc);
         } catch (WebloggerException e) {
             log.error("ERROR: getting recent entries", e);
         }
@@ -840,7 +824,7 @@ public class Weblog implements Serializa
         if (length > 100) {
             length = 100;
         }
-        List recentComments = new ArrayList();
+        List<WeblogEntryComment> recentComments = new ArrayList<WeblogEntryComment>();
         if (length < 1) {
             return recentComments;
         }

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -193,7 +193,13 @@ public class WeblogCategory implements S
      */
     public List<WeblogEntry> retrieveWeblogEntries(boolean publishedOnly) throws WebloggerException {
         WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-        return wmgr.getWeblogEntries(this, publishedOnly);
+        WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+        wesc.setWeblog(weblog);
+        wesc.setCatName(this.getName());
+        if (publishedOnly) {
+            wesc.setStatus(WeblogEntry.PUBLISHED);
+        }
+        return wmgr.getWeblogEntries(wesc);
     }
     
     /**

Added: 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=1583085&view=auto
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntrySearchCriteria.java (added)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntrySearchCriteria.java Sun Mar 30 00:05:38 2014
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.roller.weblogger.pojos;
+
+import java.util.Date;
+import java.util.List;
+
+public class WeblogEntrySearchCriteria {
+
+    public enum SortOrder {ASCENDING, DESCENDING}
+    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;
+    // User or null to get for all users.
+    private User user;
+    // Start date or null for no start date.
+    private Date startDate;
+    // End date or null for no end date.
+    private Date endDate;
+    // Category name or null for all categories.
+    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;
+    // Text appearing in the text or summary, or null for all
+    private String text;
+    // Date field to sort by
+    private SortBy sortBy = SortBy.PUBLICATION_TIME;
+    // Order of sort
+    private SortOrder sortOrder = SortOrder.DESCENDING;
+
+    private String locale;
+    // Offset into results for paging
+    private int offset = 0;
+
+    private int maxResults = -1;
+
+    public Weblog getWeblog() {
+        return weblog;
+    }
+
+    public void setWeblog(Weblog weblog) {
+        this.weblog = weblog;
+    }
+
+    public User getUser() {
+        return user;
+    }
+
+    public void setUser(User user) {
+        this.user = user;
+    }
+
+    public Date getStartDate() {
+        return startDate;
+    }
+
+    public void setStartDate(Date startDate) {
+        this.startDate = startDate;
+    }
+
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
+
+    public String getCatName() {
+        return catName;
+    }
+
+    public void setCatName(String catName) {
+        this.catName = catName;
+    }
+
+    public List<String> getTags() {
+        return tags;
+    }
+
+    public void setTags(List<String> tags) {
+        this.tags = tags;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getText() {
+        return text;
+    }
+
+    public void setText(String text) {
+        this.text = text;
+    }
+
+    public SortBy getSortBy() {
+        return sortBy;
+    }
+
+    public void setSortBy(SortBy sortBy) {
+        this.sortBy = sortBy;
+    }
+
+    public SortOrder getSortOrder() {
+        return sortOrder;
+    }
+
+    public void setSortOrder(SortOrder sortOrder) {
+        this.sortOrder = sortOrder;
+    }
+
+    public String getLocale() {
+        return locale;
+    }
+
+    public void setLocale(String locale) {
+        this.locale = locale;
+    }
+
+    public int getOffset() {
+        return offset;
+    }
+
+    public void setOffset(int offset) {
+        this.offset = offset;
+    }
+
+    public int getMaxResults() {
+        return maxResults;
+    }
+
+    public void setMaxResults(int maxResults) {
+        this.maxResults = maxResults;
+    }
+
+}

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java Sun Mar 30 00:05:38 2014
@@ -1,6 +1,6 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  The ASF licenses this file to You
+ * contributor license agreements.  The ASF licenses this file to You
  * under the Apache License, Version 2.0 (the "License"); you may not
  * use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -15,7 +15,6 @@
  * copyright in this work, please see the NOTICE file in the top level
  * directory of this distribution.
  */
-
 package org.apache.roller.weblogger.pojos;
 
 import java.io.Serializable;

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -28,6 +28,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.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.ui.rendering.util.WeblogPageRequest;
 import org.apache.roller.util.DateUtil;
 
@@ -54,14 +55,14 @@ public class BigWeblogCalendarModel exte
     protected void loadWeblogEntries(Date startDate, Date endDate, String catName) {
         try {
             WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-            monthMap = mgr.getWeblogEntryObjectMap(
-                    weblog,
-                    startDate,
-                    endDate,
-                    catName,
-                    null,WeblogEntry.PUBLISHED,
-                    locale,
-                    0, -1);
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(weblog);
+            wesc.setStartDate(startDate);
+            wesc.setEndDate(endDate);
+            wesc.setCatName(catName);
+            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setLocale(locale);
+            monthMap = mgr.getWeblogEntryObjectMap(wesc);
         } catch (WebloggerException e) {
             mLogger.error(e);
             monthMap = new HashMap();

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -36,6 +36,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.WeblogEntryManager;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
 import org.apache.roller.weblogger.pojos.Weblog;
+import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.ui.rendering.util.WeblogPageRequest;
 import org.apache.roller.util.DateUtil;
 
@@ -53,7 +54,7 @@ public class WeblogCalendarModel impleme
     protected String            pageLink = null;
     protected String            locale = null;
     protected Calendar          calendar = null;
-    protected Weblog       weblog = null;
+    protected Weblog            weblog = null;
     protected Date              prevMonth = null;
     protected Date              nextMonth = null;
     protected WeblogPageRequest pageRequest = null;
@@ -104,20 +105,17 @@ public class WeblogCalendarModel impleme
         // Use entry's date as previous month
         try {
             WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-            List prevEntries = mgr.getWeblogEntries(
-                    
-                    weblog,
-                    null,                      // user
-                    null,                      // startDate
-                    // since we need an entry.pubTime<startDate, but the method use <=
-                    new Date(startDate.getTime()-1),                 // endDate 
-                    cat,                       // cat
-                    null,WeblogEntry.PUBLISHED,
-                    null,                      // text
-                    null,                      // sortby (null means pubTime)
-                    WeblogEntryManager.DESCENDING,
-                    locale,
-                    0, 1);                     // offset, range
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(weblog);
+            // 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.setSortOrder(WeblogEntrySearchCriteria.SortOrder.DESCENDING);
+            wesc.setLocale(locale);
+            wesc.setMaxResults(1);
+            List prevEntries = mgr.getWeblogEntries(wesc);
+
             if (prevEntries.size() > 0) {
                 WeblogEntry prevEntry = (WeblogEntry)prevEntries.get(0);
                 prevMonth = DateUtil.getStartOfMonth(new Date(prevEntry.getPubTime().getTime()),getCalendar());
@@ -131,20 +129,16 @@ public class WeblogCalendarModel impleme
         // Use entry's date as next month
         try {
             WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-            List nextEntries = mgr.getWeblogEntries(
-                    
-                    weblog,
-                    null,                      // user
-                    // since we need an entry.pubTime>endDate, but the method use >=
-                    new Date(endDate.getTime()+1),                   // startDate
-                    null,                      // endDate 
-                    cat,                       // cat
-                    null,WeblogEntry.PUBLISHED, // status
-                    null,                      // text
-                    null,                      // sortby (null means pubTime)
-                    WeblogEntryManager.ASCENDING,   // sortorder
-                    locale,                    // locale
-                    0, 1);                     // offset, range
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(weblog);
+            // 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.setSortOrder(WeblogEntrySearchCriteria.SortOrder.ASCENDING);
+            wesc.setLocale(locale);
+            wesc.setMaxResults(1);
+            List nextEntries = mgr.getWeblogEntries(wesc);
             if (nextEntries.size() > 0) {
                 WeblogEntry nextEntry = (WeblogEntry)nextEntries.get(0);
                 nextMonth = DateUtil.getStartOfMonth(new Date(nextEntry.getPubTime().getTime()),getCalendar());
@@ -166,21 +160,20 @@ public class WeblogCalendarModel impleme
     protected void loadWeblogEntries(Date startDate, Date endDate, String catName) {
         try {
             WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-            monthMap = mgr.getWeblogEntryStringMap(
-                    
-                    weblog,
-                    startDate,
-                    endDate,
-                    catName,
-                    null,WeblogEntry.PUBLISHED,
-                    locale,
-                    0, -1);
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(weblog);
+            wesc.setStartDate(startDate);
+            wesc.setEndDate(endDate);
+            wesc.setCatName(catName);
+            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setLocale(locale);
+            monthMap = mgr.getWeblogEntryStringMap(wesc);
         } catch (WebloggerException e) {
             log.error(e);
             monthMap = new HashMap<Date, String>();
         }
     }
-    
+
     public void setDay(String month) throws Exception {
         SimpleDateFormat fmt = DateUtil.get8charDateFormat();
         fmt.setCalendar(getCalendar());

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsFeedModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsFeedModel.java?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsFeedModel.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsFeedModel.java Sun Mar 30 00:05:38 2014
@@ -275,7 +275,7 @@ public class SearchResultsFeedModel impl
 		return websiteSpecificSearch;
 	}
 
-	public String getCategoryPath() {
+	public String getCategoryName() {
 		return feedRequest.getWeblogCategoryName();
 	}
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/URLModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/URLModel.java?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/URLModel.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/URLModel.java Sun Mar 30 00:05:38 2014
@@ -227,13 +227,13 @@ public class URLModel implements Model {
     }
     
     
-    public String collection(String dateString, String catPath) {
-        return urlStrategy.getWeblogCollectionURL(weblog, locale, catPath, dateString, null, -1, true);
+    public String collection(String dateString, String catName) {
+        return urlStrategy.getWeblogCollectionURL(weblog, locale, catName, dateString, null, -1, true);
     }
     
     
-    public String collection(String dateString, String catPath, int pageNum) {
-        return urlStrategy.getWeblogCollectionURL(weblog, locale, catPath, dateString, null, pageNum, true);
+    public String collection(String dateString, String catName, int pageNum) {
+        return urlStrategy.getWeblogCollectionURL(weblog, locale, catName, dateString, null, pageNum, true);
     }
     
     
@@ -246,12 +246,12 @@ public class URLModel implements Model {
     }
     
     
-    public String search(String query, String catPath, int pageNum) {
-        return urlStrategy.getWeblogSearchURL(weblog, locale, query, catPath, pageNum, false);
+    public String search(String query, String catName, int pageNum) {
+        return urlStrategy.getWeblogSearchURL(weblog, locale, query, catName, pageNum, false);
     }
     
-    public String absoluteSearch(String query, String catPath, int pageNum) {
-        return urlStrategy.getWeblogSearchURL(weblog, locale, query, catPath, pageNum, true);
+    public String absoluteSearch(String query, String catName, int pageNum) {
+        return urlStrategy.getWeblogSearchURL(weblog, locale, query, catName, pageNum, true);
     }        
     
     public String getOpenSearchSite() {
@@ -267,8 +267,8 @@ public class URLModel implements Model {
     }
     
     
-    public String page(String pageLink, String dateString, String catPath, int pageNum) {
-        return urlStrategy.getWeblogPageURL(weblog, locale, pageLink, null, catPath, dateString, null, pageNum, true);
+    public String page(String pageLink, String dateString, String catName, int pageNum) {
+        return urlStrategy.getWeblogPageURL(weblog, locale, pageLink, null, catName, dateString, null, pageNum, true);
     }
     
     
@@ -338,8 +338,8 @@ public class URLModel implements Model {
             return urlStrategy.getWeblogFeedURL(weblog, locale, "entries", "rss", null, null, null, false, true);
         }
         
-        public String rss(String catPath, boolean excerpts) {
-            return urlStrategy.getWeblogFeedURL(weblog, locale, "entries", "rss", catPath, null, null, excerpts, true);
+        public String rss(String catName, boolean excerpts) {
+            return urlStrategy.getWeblogFeedURL(weblog, locale, "entries", "rss", catName, null, null, excerpts, true);
         }
         
         public String rssByTags(List tags, boolean excerpts) {
@@ -350,12 +350,12 @@ public class URLModel implements Model {
             return urlStrategy.getWeblogFeedURL(weblog, locale, "entries", "atom", null, null, null, false, true);
         }
         
-        public String atom(String catPath, boolean excerpts) {
-            return urlStrategy.getWeblogFeedURL(weblog, locale, "entries", "atom", catPath, null, null, excerpts, true);
+        public String atom(String catName, boolean excerpts) {
+            return urlStrategy.getWeblogFeedURL(weblog, locale, "entries", "atom", catName, null, null, excerpts, true);
         }
         
-        public String search(String term, String catPath) {
-            return urlStrategy.getWeblogFeedURL(weblog, locale, "entries", "atom", catPath, term, null, false, true);
+        public String search(String term, String catName) {
+            return urlStrategy.getWeblogFeedURL(weblog, locale, "entries", "atom", catName, term, null, false, true);
         }        
         
         public String atomByTags(List tags, boolean excerpts) {
@@ -369,16 +369,16 @@ public class URLModel implements Model {
             return urlStrategy.getWeblogFeedURL(weblog, locale, "comments", "rss", null, null, null, false, true);
         }
         
-        public String rss(String catPath, boolean excerpts) {
-            return urlStrategy.getWeblogFeedURL(weblog, locale, "comments", "rss", catPath, null, null, excerpts, true);
+        public String rss(String catName, boolean excerpts) {
+            return urlStrategy.getWeblogFeedURL(weblog, locale, "comments", "rss", catName, null, null, excerpts, true);
         }
         
         public String getAtom() {
             return urlStrategy.getWeblogFeedURL(weblog, locale, "comments", "atom", null, null, null, false, true);
         }
         
-        public String atom(String catPath, boolean excerpts) {
-            return urlStrategy.getWeblogFeedURL(weblog, locale, "comments", "atom", catPath, null, null, excerpts, true);
+        public String atom(String catName, boolean excerpts) {
+            return urlStrategy.getWeblogFeedURL(weblog, locale, "comments", "atom", catName, null, null, excerpts, true);
         }
         
     }
@@ -389,16 +389,16 @@ public class URLModel implements Model {
             return urlStrategy.getWeblogFeedURL(weblog, locale, "files", "rss", null, null, null, false, true);
         }
         
-        public String rss(String catPath, boolean excerpts) {
-            return urlStrategy.getWeblogFeedURL(weblog, locale, "files", "rss", catPath, null, null, excerpts, true);
+        public String rss(String catName, boolean excerpts) {
+            return urlStrategy.getWeblogFeedURL(weblog, locale, "files", "rss", catName, null, null, excerpts, true);
         }
         
         public String getAtom() {
             return urlStrategy.getWeblogFeedURL(weblog, locale, "files", "atom", null, null, null, false, true);
         }
         
-        public String atom(String catPath, boolean excerpts) {
-            return urlStrategy.getWeblogFeedURL(weblog, locale, "files", "atom", catPath, null, null, excerpts, true);
+        public String atom(String catName, boolean excerpts) {
+            return urlStrategy.getWeblogFeedURL(weblog, locale, "files", "atom", catName, null, null, excerpts, true);
         }
         
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/AbstractWeblogEntriesPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/AbstractWeblogEntriesPager.java?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/AbstractWeblogEntriesPager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/AbstractWeblogEntriesPager.java Sun Mar 30 00:05:38 2014
@@ -52,7 +52,7 @@ public abstract class AbstractWeblogEntr
     String pageLink = null;
     String entryAnchor = null;
     String dateString = null;
-    String catPath = null;
+    String catName = null;
     List tags = new ArrayList();
     int offset = 0;
     int page = 0;
@@ -66,7 +66,7 @@ public abstract class AbstractWeblogEntr
             String             pageLink,
             String             entryAnchor,
             String             dateString,
-            String             catPath,
+            String             catName,
             List               tags,
             int                page) {
         
@@ -77,7 +77,7 @@ public abstract class AbstractWeblogEntr
         this.pageLink = pageLink;
         this.entryAnchor = entryAnchor;
         this.dateString = dateString;
-        this.catPath = catPath;
+        this.catName = catName;
         
         if (tags != null) {
             this.tags = tags;
@@ -117,7 +117,7 @@ public abstract class AbstractWeblogEntr
     
     
     public String getHomeLink() {
-        return createURL(0, 0, weblog, locale, pageLink, entryAnchor, dateString, catPath, tags);
+        return createURL(0, 0, weblog, locale, pageLink, entryAnchor, dateString, catName, tags);
     }
     
     
@@ -128,7 +128,7 @@ public abstract class AbstractWeblogEntr
     
     public String getNextLink() {
         if (hasMoreEntries()) {
-            return createURL(page, 1, weblog, locale, pageLink, entryAnchor, dateString, catPath, tags);
+            return createURL(page, 1, weblog, locale, pageLink, entryAnchor, dateString, catName, tags);
         }
         return null;
     }
@@ -144,7 +144,7 @@ public abstract class AbstractWeblogEntr
     
     public String getPrevLink() {
         if (page > 0) {
-            return createURL(page, -1, weblog, locale, pageLink, entryAnchor, dateString, catPath, tags);
+            return createURL(page, -1, weblog, locale, pageLink, entryAnchor, dateString, catName, tags);
         }
         return null;
     }
@@ -241,18 +241,18 @@ public abstract class AbstractWeblogEntr
             String             pageLink,
             String             entryAnchor,
             String             dateString,
-            String             catPath,
+            String             catName,
             List               tags) {
         
         int pageNum = page + pageAdd;
         
         if (pageLink != null) {
-            return urlStrategy.getWeblogPageURL(website, locale, pageLink, entryAnchor, catPath, dateString, tags, pageNum, false);
+            return urlStrategy.getWeblogPageURL(website, locale, pageLink, entryAnchor, catName, dateString, tags, pageNum, false);
         } else if (entryAnchor != null) {
             return urlStrategy.getWeblogEntryURL(website, locale, entryAnchor, true);
         }
         
-        return urlStrategy.getWeblogCollectionURL(website, locale, catPath, dateString, tags, pageNum, false);
+        return urlStrategy.getWeblogCollectionURL(website, locale, catName, dateString, tags, pageNum, false);
     }
     
 }

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -31,6 +31,7 @@ import org.apache.commons.logging.LogFac
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
 import org.apache.roller.weblogger.pojos.Weblog;
+import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.pojos.wrapper.WeblogEntryWrapper;
 import org.apache.roller.util.DateUtil;
 import org.apache.roller.weblogger.business.URLStrategy;
@@ -63,11 +64,11 @@ public class WeblogEntriesDayPager exten
             String             pageLink,
             String             entryAnchor,
             String             dateString,
-            String             catPath,
+            String             catName,
             List               tags,
             int                page) {
         
-        super(strat, weblog, locale, pageLink, entryAnchor, dateString, catPath, tags, page);
+        super(strat, weblog, locale, pageLink, entryAnchor, dateString, catName, tags, page);
         
         dayFormat = new SimpleDateFormat(
             messageUtils.getString("weblogEntriesPager.day.dateFormat"));
@@ -112,17 +113,19 @@ public class WeblogEntriesDayPager exten
         if (entries == null) {
             entries = new TreeMap<Date, List<WeblogEntryWrapper>>(new ReverseComparator());
             try {
+                WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+                wesc.setWeblog(weblog);
+                wesc.setStartDate(startDate);
+                wesc.setEndDate(endDate);
+                wesc.setCatName(catName);
+                wesc.setTags(tags);
+                wesc.setStatus(WeblogEntry.PUBLISHED);
+                wesc.setLocale(locale);
+                wesc.setOffset(offset);
+                wesc.setMaxResults(length+1);
                 Map<Date, List<WeblogEntry>> mmap =
-                        WebloggerFactory.getWeblogger().getWeblogEntryManager().getWeblogEntryObjectMap(
-                        weblog,
-                        startDate,
-                        endDate,
-                        catPath,
-                        tags,WeblogEntry.PUBLISHED, 
-                        locale,
-                        offset,  
-                        length + 1);
-                
+                        WebloggerFactory.getWeblogger().getWeblogEntryManager().getWeblogEntryObjectMap(wesc);
+
                 // need to wrap pojos
                 int count = 0;
                 for (Map.Entry<Date, List<WeblogEntry>> entry : mmap.entrySet()) {
@@ -153,7 +156,7 @@ public class WeblogEntriesDayPager exten
     
     
     public String getHomeLink() {
-        return createURL(0, 0, weblog, locale, pageLink, null, null, catPath, tags);
+        return createURL(0, 0, weblog, locale, pageLink, null, null, catName, tags);
     }
     
     
@@ -164,7 +167,7 @@ public class WeblogEntriesDayPager exten
     
     public String getNextLink() {
         if (more) {
-            return createURL(page, 1, weblog, locale, pageLink, null, dateString, catPath, tags);
+            return createURL(page, 1, weblog, locale, pageLink, null, dateString, catName, tags);
         }
         return null;
     }
@@ -180,7 +183,7 @@ public class WeblogEntriesDayPager exten
     
     public String getPrevLink() {
         if (page > 0) {
-            return createURL(page, -1, weblog, locale, pageLink, null, dateString, catPath, tags);
+            return createURL(page, -1, weblog, locale, pageLink, null, dateString, catName, tags);
         }
         return null;
     }
@@ -197,7 +200,7 @@ public class WeblogEntriesDayPager exten
     public String getNextCollectionLink() {
         if (nextDay != null) {
             String next = DateUtil.format8chars(nextDay);
-            return createURL(0, 0, weblog, locale, pageLink, null, next, catPath, tags);
+            return createURL(0, 0, weblog, locale, pageLink, null, next, catName, tags);
         }
         return null;
     }
@@ -214,7 +217,7 @@ public class WeblogEntriesDayPager exten
     public String getPrevCollectionLink() {
         if (prevDay != null) {
             String prev = DateUtil.format8chars(prevDay);
-            return createURL(0, 0, weblog, locale, pageLink, null, prev, catPath, tags);
+            return createURL(0, 0, weblog, locale, pageLink, null, prev, catName, tags);
         }
         return null;
     }

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -30,6 +30,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
 import org.apache.roller.weblogger.pojos.Weblog;
+import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.pojos.wrapper.WeblogEntryWrapper;
 
 
@@ -54,11 +55,11 @@ public class WeblogEntriesLatestPager ex
             String             pageLink,
             String             entryAnchor,
             String             dateString,
-            String             catPath,
+            String             catName,
             List               tags,
             int                page) {
         
-        super(strat, weblog, locale, pageLink, entryAnchor, dateString, catPath, tags, page);
+        super(strat, weblog, locale, pageLink, entryAnchor, dateString, catName, tags, page);
         
         // initialize the pager collection
         getEntries();
@@ -70,17 +71,17 @@ public class WeblogEntriesLatestPager ex
         if (entries == null) {
             entries = new TreeMap<Date, List<WeblogEntryWrapper>>(new ReverseComparator());
             try {
-                Map<Date, List<WeblogEntry>> mmap = WebloggerFactory.getWeblogger().getWeblogEntryManager().getWeblogEntryObjectMap(
-                        weblog,
-                        null,
-                        new Date(),
-                        catPath,
-                        tags,
-                        WeblogEntry.PUBLISHED,
-                        locale,
-                        offset,
-                        length + 1);
-                
+                WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+                wesc.setWeblog(weblog);
+                wesc.setEndDate(new Date());
+                wesc.setCatName(catName);
+                wesc.setTags(tags);
+                wesc.setStatus(WeblogEntry.PUBLISHED);
+                wesc.setLocale(locale);
+                wesc.setOffset(offset);
+                wesc.setMaxResults(length+1);
+                Map<Date, List<WeblogEntry>> mmap = WebloggerFactory.getWeblogger().getWeblogEntryManager().getWeblogEntryObjectMap(wesc);
+
                 // need to wrap pojos
                 int count = 0;
                 for (Map.Entry<Date, List<WeblogEntry>> entry : mmap.entrySet()) {

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -30,6 +30,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.pojos.User;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
 import org.apache.roller.weblogger.pojos.Weblog;
+import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.pojos.wrapper.WeblogEntryWrapper;
 
 
@@ -47,7 +48,7 @@ public class WeblogEntriesListPager exte
     private Weblog queryWeblog = null;
     private User queryUser = null;
     private String queryCat = null;
-    private List queryTags = null;
+    private List<String> queryTags = null;
     
     // entries for the pager
     private List<WeblogEntryWrapper> entries;
@@ -65,7 +66,7 @@ public class WeblogEntriesListPager exte
             Weblog         queryWeblog,
             User           queryUser,
             String         queryCat,
-            List           queryTags,
+            List<String>   queryTags,
             String         locale,
             int            sinceDays,
             int            pageNum,
@@ -104,21 +105,19 @@ public class WeblogEntriesListPager exte
             }
             
             try {
+                WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+                wesc.setWeblog(queryWeblog);
+                wesc.setUser(queryUser);
+                wesc.setStartDate(startDate);
+                wesc.setCatName(queryCat);
+                wesc.setTags(queryTags);
+                wesc.setStatus(WeblogEntry.PUBLISHED);
+                wesc.setLocale(locale);
+                wesc.setOffset(offset);
+                wesc.setMaxResults(length+1);
                 List<WeblogEntry> rawEntries = WebloggerFactory.getWeblogger()
-                        .getWeblogEntryManager().getWeblogEntries(
-                        queryWeblog,
-                        queryUser,
-                        startDate,
-                        null,
-                        queryCat,
-                        queryTags,WeblogEntry.PUBLISHED,
-                        null,
-                        "pubTime",
-                        null,
-                        locale,
-                        offset,
-                        length + 1);
-                                
+                        .getWeblogEntryManager().getWeblogEntries(wesc);
+
                 // wrap the results
                 int count = 0;
                 for (WeblogEntry entry : rawEntries) {

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -31,6 +31,7 @@ import org.apache.commons.logging.LogFac
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
 import org.apache.roller.weblogger.pojos.Weblog;
+import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.pojos.wrapper.WeblogEntryWrapper;
 import org.apache.roller.util.DateUtil;
 import org.apache.roller.weblogger.business.URLStrategy;
@@ -63,11 +64,11 @@ public class WeblogEntriesMonthPager ext
             String             pageLink,
             String             entryAnchor,
             String             dateString,
-            String             catPath,
+            String             catName,
             List               tags,
             int                page) {
         
-        super(strat, weblog, locale, pageLink, entryAnchor, dateString, catPath, tags, page);
+        super(strat, weblog, locale, pageLink, entryAnchor, dateString, catName, tags, page);
         
         monthFormat = new SimpleDateFormat(
             messageUtils.getString("weblogEntriesPager.month.dateFormat"));
@@ -108,17 +109,19 @@ public class WeblogEntriesMonthPager ext
         if (entries == null) {
             entries = new TreeMap<Date, List<WeblogEntryWrapper>>(new ReverseComparator());
             try {
+                WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+                wesc.setWeblog(weblog);
+                wesc.setStartDate(startDate);
+                wesc.setEndDate(endDate);
+                wesc.setCatName(catName);
+                wesc.setTags(tags);
+                wesc.setStatus(WeblogEntry.PUBLISHED);
+                wesc.setLocale(locale);
+                wesc.setOffset(offset);
+                wesc.setMaxResults(length+1);
                 Map<Date, List<WeblogEntry>> mmap = WebloggerFactory.getWeblogger()
-                        .getWeblogEntryManager().getWeblogEntryObjectMap(
-                        weblog,
-                        startDate,
-                        endDate,
-                        catPath,
-                        tags,WeblogEntry.PUBLISHED, 
-                        locale,
-                        offset,  
-                        length + 1);
-                              
+                        .getWeblogEntryManager().getWeblogEntryObjectMap(wesc);
+
                 // need to wrap pojos
                 int count = 0;
                 for (Map.Entry<Date, List<WeblogEntry>> entry : mmap.entrySet()) {
@@ -147,7 +150,7 @@ public class WeblogEntriesMonthPager ext
     
     
     public String getHomeLink() {
-        return createURL(0, 0, weblog, locale, pageLink, null, null, catPath, tags);
+        return createURL(0, 0, weblog, locale, pageLink, null, null, catName, tags);
     }
     
     
@@ -158,7 +161,7 @@ public class WeblogEntriesMonthPager ext
     
     public String getNextLink() {
         if (more) {
-            return createURL(page, 1, weblog, locale, pageLink, null, dateString, catPath, tags);
+            return createURL(page, 1, weblog, locale, pageLink, null, dateString, catName, tags);
         }
         return null;
     }
@@ -174,7 +177,7 @@ public class WeblogEntriesMonthPager ext
     
     public String getPrevLink() {
         if (offset > 0) {
-            return createURL(page, -1, weblog, locale, pageLink, null, dateString, catPath, tags);
+            return createURL(page, -1, weblog, locale, pageLink, null, dateString, catName, tags);
         }
         return null;
     }
@@ -191,7 +194,7 @@ public class WeblogEntriesMonthPager ext
     public String getNextCollectionLink() {
         if (nextMonth != null) {
             String next = DateUtil.format6chars(nextMonth);
-            return createURL(0, 0, weblog, locale, pageLink, null, next, catPath, tags);
+            return createURL(0, 0, weblog, locale, pageLink, null, next, catName, tags);
         }
         return null;
     }
@@ -208,7 +211,7 @@ public class WeblogEntriesMonthPager ext
     public String getPrevCollectionLink() {
         if (prevMonth != null) {
             String prev = DateUtil.format6chars(prevMonth);
-            return createURL(0, 0, weblog, locale, pageLink, null, prev, catPath, tags);
+            return createURL(0, 0, weblog, locale, pageLink, null, prev, catName, tags);
         }
         return null;
     }

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -58,11 +58,11 @@ public class WeblogEntriesPermalinkPager
             String             pageLink,
             String             entryAnchor,
             String             dateString,
-            String             catPath,
+            String             catName,
             List               tags,
             int                page) {
         
-        super(strat, weblog, locale, pageLink, entryAnchor, dateString, catPath, tags, page);
+        super(strat, weblog, locale, pageLink, entryAnchor, dateString, catName, tags, page);
         
         getEntries();
     }
@@ -90,7 +90,7 @@ public class WeblogEntriesPermalinkPager
     
     
     public String getHomeLink() {
-        return createURL(0, 0, weblog, locale, pageLink, null, dateString, catPath, tags);
+        return createURL(0, 0, weblog, locale, pageLink, null, dateString, catName, tags);
     }
     
     
@@ -101,7 +101,7 @@ public class WeblogEntriesPermalinkPager
     
     public String getNextLink() {
         if (getNextEntry() != null) {
-            return createURL(0, 0, weblog, locale, pageLink, nextEntry.getAnchor(), dateString, catPath, tags);
+            return createURL(0, 0, weblog, locale, pageLink, nextEntry.getAnchor(), dateString, catName, tags);
         }
         return null;
     }
@@ -118,7 +118,7 @@ public class WeblogEntriesPermalinkPager
     
     public String getPrevLink() {
         if (getPrevEntry() != null) {
-            return createURL(0, 0, weblog, locale, pageLink, prevEntry.getAnchor(), dateString, catPath, tags);
+            return createURL(0, 0, weblog, locale, pageLink, prevEntry.getAnchor(), dateString, catName, tags);
         }
         return null;
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPreviewPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPreviewPager.java?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPreviewPager.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPreviewPager.java Sun Mar 30 00:05:38 2014
@@ -53,11 +53,11 @@ public class WeblogEntriesPreviewPager e
             String             pageLink,
             String             entryAnchor,
             String             dateString,
-            String             catPath,
+            String             catName,
             List               tags,
             int                page) {
         
-        super(strat, weblog, locale, pageLink, entryAnchor, dateString, catPath, tags, page);
+        super(strat, weblog, locale, pageLink, entryAnchor, dateString, catName, tags, page);
     }
     
     

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -20,6 +20,7 @@ package org.apache.roller.weblogger.ui.s
 
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -31,6 +32,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.WeblogEntryManager;
 import org.apache.roller.weblogger.pojos.WeblogCategory;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.pojos.WeblogPermission;
 import org.apache.roller.weblogger.ui.struts2.pagers.EntriesPager;
 import org.apache.roller.weblogger.ui.struts2.util.KeyValueObject;
@@ -85,20 +87,18 @@ public class Entries extends UIAction {
             String status = getBean().getStatus();
             
             WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-            List<WeblogEntry> rawEntries = wmgr.getWeblogEntries(
-                    getActionWeblog(),
-                    null,
-                    getBean().getStartDate(),
-                    getBean().getEndDate(),
-                    getBean().getCategoryPath(),
-                    getBean().getTags(),
-                    ("ALL".equals(status)) ? null : status,
-                    getBean().getText(),
-                    getBean().getSortBy(),
-                    null,
-                    null,
-                    getBean().getPage() * COUNT,
-                    COUNT + 1);
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(getActionWeblog());
+            wesc.setStartDate(getBean().getStartDate());
+            wesc.setEndDate(getBean().getEndDate());
+            wesc.setCatName(getBean().getCategoryName());
+            wesc.setTags(getBean().getTags());
+            wesc.setStatus("ALL".equals(status) ? null : status);
+            wesc.setText(getBean().getText());
+            wesc.setSortBy(getBean().getSortBy());
+            wesc.setOffset(getBean().getPage() * COUNT);
+            wesc.setMaxResults(COUNT + 1);
+            List<WeblogEntry> rawEntries = wmgr.getWeblogEntries(wesc);
             entries = new ArrayList<WeblogEntry>();
             entries.addAll(rawEntries);
             if (entries.size() > 0) {
@@ -109,8 +109,8 @@ public class Entries extends UIAction {
                     hasMore = true;
                 }
                 
-                setFirstEntry((WeblogEntry)entries.get(0));
-                setLastEntry((WeblogEntry)entries.get(entries.size()-1));
+                setFirstEntry(entries.get(0));
+                setLastEntry(entries.get(entries.size()-1));
             }
         } catch (WebloggerException ex) {
             log.error("Error looking up entries", ex);
@@ -131,8 +131,8 @@ public class Entries extends UIAction {
         
         Map<String, String> params = new HashMap<String, String>();
         
-        if(!StringUtils.isEmpty(getBean().getCategoryPath())) {
-            params.put("bean.categoryPath", getBean().getCategoryPath());
+        if(!StringUtils.isEmpty(getBean().getCategoryName())) {
+            params.put("bean.categoryPath", getBean().getCategoryName());
         }
         if(!StringUtils.isEmpty(getBean().getTagsAsString())) {
             params.put("bean.tagsAsString", getBean().getTagsAsString());
@@ -149,10 +149,10 @@ public class Entries extends UIAction {
         if(!StringUtils.isEmpty(getBean().getStatus())) {
             params.put("bean.status", getBean().getStatus());
         }
-        if(!StringUtils.isEmpty(getBean().getSortBy())) {
-            params.put("bean.sortBy", getBean().getSortBy());
+        if(getBean().getSortBy() != null) {
+            params.put("bean.sortBy", getBean().getSortBy().toString());
         }
-        
+
         return WebloggerFactory.getWeblogger().getUrlStrategy().getActionURL("entries", "/roller-ui/authoring", 
                 getActionWeblog().getHandle(), params, false);
     }
@@ -187,8 +187,8 @@ public class Entries extends UIAction {
     public List<KeyValueObject> getSortByOptions() {
         List<KeyValueObject> opts = new ArrayList<KeyValueObject>();
         
-        opts.add(new KeyValueObject("pubTime", getText("weblogEntryQuery.label.pubTime")));
-        opts.add(new KeyValueObject("updateTime", getText("weblogEntryQuery.label.updateTime")));
+        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")));
         
         return opts;
     }



Mime
View raw message