roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1583085 [2/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
Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntriesBean.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntriesBean.java?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntriesBean.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntriesBean.java Sun Mar 30 00:05:38 2014
@@ -23,6 +23,7 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.util.Utilities;
 
 
@@ -33,11 +34,11 @@ public class EntriesBean {
     
     private String endDateString = null;
     private String startDateString = null;
-    private String categoryPath = null;
+    private String categoryName = null;
     private String tagsAsString = null;
     private String text = null;
     private String status = "ALL";
-    private String sortBy = "updateTime";
+    private WeblogEntrySearchCriteria.SortBy sortBy = WeblogEntrySearchCriteria.SortBy.UPDATE_TIME;
     private int page = 0;
     
     
@@ -74,12 +75,12 @@ public class EntriesBean {
     }
     
     
-    public String getCategoryPath() {
-        return categoryPath;
+    public String getCategoryName() {
+        return categoryName;
     }
     
-    public void setCategoryPath(String categoryId) {
-        this.categoryPath = categoryId;
+    public void setCategoryName(String categoryId) {
+        this.categoryName = categoryId;
     }
     
     public String getTagsAsString() {
@@ -106,14 +107,10 @@ public class EntriesBean {
         this.status = status;
     }
     
-    public String getSortBy() {
+    public WeblogEntrySearchCriteria.SortBy getSortBy() {
         return sortBy;
     }
     
-    public void setSortBy(String sortBy) {
-        this.sortBy = sortBy;
-    }
-    
     public int getPage() {
         return page;
     }
@@ -130,7 +127,7 @@ public class EntriesBean {
         buf.append("endDate = ").append(getEndDate()).append("\n");
         buf.append("status = ").append(getStatus()).append("\n");
         buf.append("sortBy = ").append(getSortBy()).append("\n");
-        buf.append("catPath = ").append(getCategoryPath()).append("\n");
+        buf.append("catName = ").append(getCategoryName()).append("\n");
         buf.append("tags = ").append(getTagsAsString()).append("\n");
         buf.append("text = ").append(getText()).append("\n");
         buf.append("page = ").append(getPage()).append("\n");

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -22,6 +22,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.WebloggerException;
@@ -30,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.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.pojos.WeblogPermission;
 import org.apache.roller.weblogger.ui.core.RollerContext;
 import org.apache.roller.weblogger.ui.core.plugins.UIPluginManager;
@@ -41,165 +43,156 @@ import org.apache.roller.weblogger.ui.st
  */
 public abstract class EntryBase extends UIAction {
 
-	private static Log log = LogFactory.getLog(EntryBase.class);
+    private static Log log = LogFactory.getLog(EntryBase.class);
 
-	/**
-	 * Trigger reindexing of modified entry.
-	 * 
-	 * @param entry
-	 *            the entry
-	 */
-	protected void reindexEntry(WeblogEntry entry) {
-		IndexManager manager = WebloggerFactory.getWeblogger()
-				.getIndexManager();
-		try {
-			manager.addEntryReIndexOperation(entry);
-		} catch (WebloggerException ex) {
-			log.warn("Trouble triggering entry indexing", ex);
-		}
-	}
-
-	/**
-	 * Trigger reindexing of modified entry.
-	 */
-	protected void removeEntryIndex(WeblogEntry entry) {
-		IndexManager manager = WebloggerFactory.getWeblogger()
-				.getIndexManager();
-		try {
-			manager.removeEntryIndexOperation(entry);
-		} catch (WebloggerException ex) {
-			log.warn("Trouble triggering entry indexing", ex);
-		}
-
-	}
-
-	/**
-	 * Get recent weblog entries using request parameters to determine username,
-	 * date, and category name parameters.
-	 * 
-	 * @return List of WeblogEntryData objects.
-	 */
-	public List<WeblogEntry> getRecentPublishedEntries() {
-		List<WeblogEntry> entries = Collections.emptyList();
-		try {
-			entries = WebloggerFactory.getWeblogger().getWeblogEntryManager()
-					.getWeblogEntries(getActionWeblog(),
-							null, null, // startDate
-							null, // endDate
-							null, // catName
-							null, WeblogEntry.PUBLISHED,
-							null, // text
-							null, // sortby (null for pubTime)
-							null, null, 0, 20);
-		} catch (WebloggerException ex) {
-			log.error("Error getting entries list", ex);
-		}
-		return entries;
-	}
-
-	/**
-	 * Get recent weblog entries using request parameters to determine username,
-	 * date, and category name parameters.
-	 * 
-	 * @return List of WeblogEntryData objects.
-	 */
-	public List<WeblogEntry> getRecentScheduledEntries() {
-		List<WeblogEntry> entries = Collections.emptyList();
-		try {
-			entries = WebloggerFactory.getWeblogger().getWeblogEntryManager()
-					.getWeblogEntries(getActionWeblog(),
-							null, null, // startDate
-							null, // endDate
-							null, // catName
-							null, WeblogEntry.SCHEDULED,
-							null, // text
-							null, // sortby (null for pubTime)
-							null, null, 0, 20);
-		} catch (WebloggerException ex) {
-			log.error("Error getting entries list", ex);
-		}
-		return entries;
-	}
-
-	/**
-	 * Get recent weblog entries using request parameters to determine username,
-	 * date, and category name parameters.
-	 * 
-	 * @return List of WeblogEntryData objects.
-	 */
-	public List<WeblogEntry> getRecentDraftEntries() {
-		List<WeblogEntry> entries = Collections.emptyList();
-		try {
-			entries = WebloggerFactory.getWeblogger().getWeblogEntryManager()
-					.getWeblogEntries(getActionWeblog(), null, null,
-							null, // endDate
-							null, // catName
-							null, WeblogEntry.DRAFT,
-							null, // text
-							"updateTime",
-							null, null, 0, 20); // maxEntries
-		} catch (WebloggerException ex) {
-			log.error("Error getting entries list", ex);
-		}
-		return entries;
-	}
-
-	/**
-	 * Get recent weblog entries using request parameters to determine username,
-	 * date, and category name parameters.
-	 * 
-	 * @return List of WeblogEntryData objects.
-	 */
-	public List<WeblogEntry> getRecentPendingEntries() {
-		List<WeblogEntry> entries = Collections.emptyList();
-		try {
-			entries = WebloggerFactory.getWeblogger().getWeblogEntryManager()
-					.getWeblogEntries(getActionWeblog(), null, null,
-							null, // endDate
-							null, // catName
-							null, WeblogEntry.PENDING,
-							null, // text
-							"updateTime",
-							null, null, 0, 20);
-		} catch (WebloggerException ex) {
-			log.error("Error getting entries list", ex);
-		}
-		return entries;
-	}
-
-	public List<WeblogEntryPlugin> getEntryPlugins() {
-		List<WeblogEntryPlugin> availablePlugins = Collections.emptyList();
-		try {
-			PluginManager ppmgr = WebloggerFactory.getWeblogger()
-					.getPluginManager();
-			Map<String, WeblogEntryPlugin> plugins = ppmgr
-					.getWeblogEntryPlugins(getActionWeblog());
-
-			if (plugins.size() > 0) {
-				availablePlugins = new ArrayList<WeblogEntryPlugin>();
-				for (WeblogEntryPlugin plugin : plugins.values()) {
-					availablePlugins.add(plugin);
-				}
-			}
-		} catch (Exception ex) {
-			log.error("Error getting plugins list", ex);
-		}
-		return availablePlugins;
-	}
-
-	public WeblogEntryEditor getEditor() {
-		UIPluginManager pmgr = RollerContext.getUIPluginManager();
-		return pmgr.getWeblogEntryEditor(getActionWeblog().getEditorPage());
-	}
-
-	public boolean isUserAnAuthor() {
-		return getActionWeblog().hasUserPermission(getAuthenticatedUser(),
-				WeblogPermission.POST);
-	}
-
-	public String getJsonAutocompleteUrl() {
-		return WebloggerFactory.getWeblogger().getUrlStrategy()
-				.getWeblogTagsJsonURL(getActionWeblog(), false, 0);
-	}
+    /**
+     * Trigger reindexing of modified entry.
+     *
+     * @param entry the entry
+     */
+    protected void reindexEntry(WeblogEntry entry) {
+        IndexManager manager = WebloggerFactory.getWeblogger()
+                .getIndexManager();
+        try {
+            manager.addEntryReIndexOperation(entry);
+        } catch (WebloggerException ex) {
+            log.warn("Trouble triggering entry indexing", ex);
+        }
+    }
+
+    /**
+     * Trigger reindexing of modified entry.
+     */
+    protected void removeEntryIndex(WeblogEntry entry) {
+        IndexManager manager = WebloggerFactory.getWeblogger()
+                .getIndexManager();
+        try {
+            manager.removeEntryIndexOperation(entry);
+        } catch (WebloggerException ex) {
+            log.warn("Trouble triggering entry indexing", ex);
+        }
+
+    }
+
+    /**
+     * Get recent weblog entries using request parameters to determine username,
+     * date, and category name parameters.
+     *
+     * @return List of WeblogEntryData objects.
+     */
+    public List<WeblogEntry> getRecentPublishedEntries() {
+        List<WeblogEntry> entries = Collections.emptyList();
+        try {
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(getActionWeblog());
+            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setMaxResults(20);
+            entries = WebloggerFactory.getWeblogger().getWeblogEntryManager()
+                    .getWeblogEntries(wesc);
+        } catch (WebloggerException ex) {
+            log.error("Error getting entries list", ex);
+        }
+        return entries;
+    }
+
+    /**
+     * Get recent weblog entries using request parameters to determine username,
+     * date, and category name parameters.
+     *
+     * @return List of WeblogEntryData objects.
+     */
+    public List<WeblogEntry> getRecentScheduledEntries() {
+        List<WeblogEntry> entries = Collections.emptyList();
+        try {
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(getActionWeblog());
+            wesc.setStatus(WeblogEntry.SCHEDULED);
+            wesc.setMaxResults(20);
+            entries = WebloggerFactory.getWeblogger().getWeblogEntryManager()
+                    .getWeblogEntries(wesc);
+        } catch (WebloggerException ex) {
+            log.error("Error getting entries list", ex);
+        }
+        return entries;
+    }
+
+    /**
+     * Get recent weblog entries using request parameters to determine username,
+     * date, and category name parameters.
+     *
+     * @return List of WeblogEntryData objects.
+     */
+    public List<WeblogEntry> getRecentDraftEntries() {
+        List<WeblogEntry> entries = Collections.emptyList();
+        try {
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(getActionWeblog());
+            wesc.setStatus(WeblogEntry.DRAFT);
+            wesc.setSortBy(WeblogEntrySearchCriteria.SortBy.UPDATE_TIME);
+            wesc.setMaxResults(20);
+            entries = WebloggerFactory.getWeblogger().getWeblogEntryManager()
+                    .getWeblogEntries(wesc);
+        } catch (WebloggerException ex) {
+            log.error("Error getting entries list", ex);
+        }
+        return entries;
+    }
+
+    /**
+     * Get recent weblog entries using request parameters to determine username,
+     * date, and category name parameters.
+     *
+     * @return List of WeblogEntryData objects.
+     */
+    public List<WeblogEntry> getRecentPendingEntries() {
+        List<WeblogEntry> entries = Collections.emptyList();
+        try {
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(getActionWeblog());
+            wesc.setStatus(WeblogEntry.PENDING);
+            wesc.setSortBy(WeblogEntrySearchCriteria.SortBy.UPDATE_TIME);
+            wesc.setMaxResults(20);
+            entries = WebloggerFactory.getWeblogger().getWeblogEntryManager()
+                    .getWeblogEntries(wesc);
+        } catch (WebloggerException ex) {
+            log.error("Error getting entries list", ex);
+        }
+        return entries;
+    }
+
+    public List<WeblogEntryPlugin> getEntryPlugins() {
+        List<WeblogEntryPlugin> availablePlugins = Collections.emptyList();
+        try {
+            PluginManager ppmgr = WebloggerFactory.getWeblogger()
+                    .getPluginManager();
+            Map<String, WeblogEntryPlugin> plugins = ppmgr
+                    .getWeblogEntryPlugins(getActionWeblog());
+
+            if (plugins.size() > 0) {
+                availablePlugins = new ArrayList<WeblogEntryPlugin>();
+                for (WeblogEntryPlugin plugin : plugins.values()) {
+                    availablePlugins.add(plugin);
+                }
+            }
+        } catch (Exception ex) {
+            log.error("Error getting plugins list", ex);
+        }
+        return availablePlugins;
+    }
+
+    public WeblogEntryEditor getEditor() {
+        UIPluginManager pmgr = RollerContext.getUIPluginManager();
+        return pmgr.getWeblogEntryEditor(getActionWeblog().getEditorPage());
+    }
+
+    public boolean isUserAnAuthor() {
+        return getActionWeblog().hasUserPermission(getAuthenticatedUser(),
+                WeblogPermission.POST);
+    }
+
+    public String getJsonAutocompleteUrl() {
+        return WebloggerFactory.getWeblogger().getUrlStrategy()
+                .getWeblogTagsJsonURL(getActionWeblog(), false, 0);
+    }
 
 }

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -22,6 +22,7 @@ import java.io.InputStream;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.LinkedHashMap;
@@ -51,6 +52,7 @@ import org.apache.roller.weblogger.confi
 import org.apache.roller.weblogger.pojos.MediaFile;
 import org.apache.roller.weblogger.pojos.MediaFileDirectory;
 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.pojos.wrapper.WeblogEntryCommentWrapper;
 import org.apache.roller.weblogger.pojos.wrapper.WeblogEntryWrapper;
@@ -198,9 +200,10 @@ public final class WeblogExport extends 
             URLStrategy urlStrategy;
             urlStrategy = WebloggerFactory.getWeblogger().getUrlStrategy();
 
-            List rawEntries;
-            rawEntries = wmgr.getWeblogEntries(getActionWeblog(), null, null,
-                    null, null, null, null, null, null, null, null, 0, -1);
+            List<WeblogEntry> rawEntries;
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(getActionWeblog());
+            rawEntries = wmgr.getWeblogEntries(wesc);
 
             List<WeblogEntryWrapper> entries;
             entries = new ArrayList<WeblogEntryWrapper>();

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -51,6 +51,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.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.pojos.WeblogEntryTag;
 import org.apache.roller.weblogger.pojos.WeblogEntryTagComparator;
 import org.apache.roller.weblogger.util.Utilities;
@@ -170,20 +171,12 @@ public class EntryCollection {
             if (!RollerAtomHandler.canView(user, website)) {
                 throw new AtomNotAuthorizedException("Not authorized to access website: " + handle);
             }
-            List<WeblogEntry> entries = roller.getWeblogEntryManager().getWeblogEntries(
-                    website,
-                    null,              // user
-                    null,              // startDate
-                    null,              // endDate
-                    null,              // catName
-                    null,              // tags
-                    null,              // status
-                    null,              // text
-                    "updateTime",      // sortby
-                    null,
-                    null,              // locale
-                    start,             // offset (for range paging)
-                    max + 1);          // MAX_ENTRIES
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(website);
+            wesc.setSortBy(WeblogEntrySearchCriteria.SortBy.UPDATE_TIME);
+            wesc.setOffset(start);
+            wesc.setMaxResults(max + 1);
+            List<WeblogEntry> entries = roller.getWeblogEntryManager().getWeblogEntries(wesc);
             Feed feed = new Feed();
             feed.setId(atomURL
                 +"/"+website.getHandle() + "/entries/" + start);

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -38,6 +38,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.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.pojos.WeblogTemplate;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.util.Utilities;
@@ -454,21 +455,18 @@ public class BloggerAPIHandler extends B
         mLogger.debug("     UserId: " + userid);
         mLogger.debug("     Number: " + numposts);
         
-        Weblog website = validate(blogid, userid,password);
+        Weblog weblog = validate(blogid, userid,password);
         
         try {
             Vector results = new Vector();
             
             Weblogger roller = WebloggerFactory.getWeblogger();
             WeblogEntryManager weblogMgr = roller.getWeblogEntryManager();
-            if (website != null) {
-                Map<Date, List<WeblogEntry>> entries = weblogMgr.getWeblogEntryObjectMap(
-                        website,
-                        null,                   // startDate
-                        new Date(),             // endDate
-                        null,                   // catName
-                        null,                   // tags
-                        null, null, 0, -1);
+            if (weblog != null) {
+                WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+                wesc.setWeblog(weblog);
+                wesc.setEndDate(new Date());
+                Map<Date, List<WeblogEntry>> entries = weblogMgr.getWeblogEntryObjectMap(wesc);
 
                 for (List<WeblogEntry> weList : entries.values()) {
                     for (WeblogEntry entry : weList) {

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 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.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.util.RollerMessages;
 import org.apache.roller.weblogger.util.Utilities;
 import org.apache.xmlrpc.XmlRpcException;
@@ -436,20 +437,12 @@ public class MetaWeblogAPIHandler extend
             Weblogger roller = WebloggerFactory.getWeblogger();
             WeblogEntryManager weblogMgr = roller.getWeblogEntryManager();
             if (website != null) {
-                List<WeblogEntry> entries = weblogMgr.getWeblogEntries(
-                        website,
-                        null,
-                        null,              // startDate
-                        null,              // endDate
-                        null,              // catName
-                        null,              // tags
-                        null,              // status
-                        null,              // text
-                        "updateTime",      // sortby
-                        null,
-                        null,
-                        0, numposts);
-                
+                WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+                wesc.setWeblog(website);
+                wesc.setSortBy(WeblogEntrySearchCriteria.SortBy.UPDATE_TIME);
+                wesc.setMaxResults(numposts);
+                List<WeblogEntry> entries = weblogMgr.getWeblogEntries(wesc);
+
                 for (WeblogEntry entry : entries) {
                     results.addElement(createPostStruct(entry, userid));
                 }

Modified: roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntriesSidebar.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntriesSidebar.jsp?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntriesSidebar.jsp (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntriesSidebar.jsp Sun Mar 30 00:05:38 2014
@@ -45,7 +45,7 @@
                     <div class="sideformrow">
                         <label for="categoryId" class="sideformrow">
                         <s:text name="weblogEntryQuery.label.category" /></label>
-                        <s:select name="bean.categoryPath" list="categories" listKey="path" listValue="name" size="1" />
+                        <s:select name="bean.categoryName" list="categories" listKey="path" listValue="name" size="1" />
                     </div>
                     <br />
                     <br />

Modified: roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-atom.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-atom.vm?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-atom.vm (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-atom.vm Sun Mar 30 00:05:38 2014
@@ -22,8 +22,8 @@
     <title type="html">$utils.escapeXML($config.siteName) (Comments)</title>
     <id>$url.feed.comments.atom</id>
     <link rel="alternate" type="text/html" href="$url.home" />
-    <id>$url.feed.comments.atom($model.categoryPath, $model.excerpts)</id>
-    <link rel="self" type="application/atom+xml" href="$url.feed.comments.atom($model.categoryPath, $model.excerpts)" />
+    <id>$url.feed.comments.atom($model.categoryName, $model.excerpts)</id>
+    <link rel="self" type="application/atom+xml" href="$url.feed.comments.atom($model.categoryName, $model.excerpts)" />
     #if($config.feedHistoryEnabled)
         #showFeedHistory($pager)
     #end    

Modified: roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-rss.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-rss.vm?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-rss.vm (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-comments-rss.vm Sun Mar 30 00:05:38 2014
@@ -23,7 +23,7 @@
 <channel>
   <title>$utils.escapeXML($config.siteName) (Comments)</title>
   <link>$url.absoluteSite</link>
-  <atom:link rel="self" type="application/rss+xml" href="$url.feed.comments.rss($model.categoryPath, $model.excerpts)" />
+  <atom:link rel="self" type="application/rss+xml" href="$url.feed.comments.rss($model.categoryName, $model.excerpts)" />
   <description>$utils.escapeXML($config.siteDescription)</description>
   <language>en-us</language>
   #set($pager = $site.getCommentsPager(-1, $config.feedSize))

Modified: roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-atom.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-atom.vm?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-atom.vm (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-atom.vm Sun Mar 30 00:05:38 2014
@@ -25,8 +25,8 @@
     <link rel="alternate" type="text/html" href="$url.absoluteSite" />
     #if($model.tags)
         <link rel="self" type="application/atom+xml" href="$url.feed.entries.atomByTags($model.tags, $model.excerpts)" />
-    #elseif($model.categoryPath)
-        <link rel="self" type="application/atom+xml" href="$url.feed.entries.atom($model.categoryPath, $model.excerpts)" />
+    #elseif($model.categoryName)
+        <link rel="self" type="application/atom+xml" href="$url.feed.entries.atom($model.categoryName, $model.excerpts)" />
     #else
         <link rel="self" type="application/atom+xml" href="$url.feed.entries.atom" />
     #end

Modified: roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-rss.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-rss.vm?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-rss.vm (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-entries-rss.vm Sun Mar 30 00:05:38 2014
@@ -25,8 +25,8 @@
   <link>$url.absoluteSite</link>
   #if($model.tags)
     <atom:link rel="self" type="application/rss+xml" href="$url.feed.entries.rssByTags($model.tags, $model.excerpts)" />
-  #elseif($model.categoryPath)
-    <atom:link rel="self" type="application/rss+xml" href="$url.feed.entries.rss($model.categoryPath, $model.excerpts)" />
+  #elseif($model.categoryName)
+    <atom:link rel="self" type="application/rss+xml" href="$url.feed.entries.rss($model.categoryName, $model.excerpts)" />
   #else
     <atom:link rel="self" type="application/rss+xml" href="$url.feed.entries.rss" />
   #end

Modified: roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-search-atom.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-search-atom.vm?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-search-atom.vm (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/site-search-atom.vm Sun Mar 30 00:05:38 2014
@@ -24,13 +24,13 @@
 
     <title type="html">Search for [$model.term] in site $utils.escapeXML($config.siteName)</title>
     <subtitle type="html">Search results for [$model.term] within site $utils.escapeXML($config.siteName)</subtitle>
-    <id>$utils.escapeXML($url.feed.entries.search($model.term, $model.categoryPath))</id>
+    <id>$utils.escapeXML($url.feed.entries.search($model.term, $model.categoryName))</id>
 
     <link rel="self" type="application/atom+xml" 
-        href="$utils.escapeXML($url.feed.entries.search($model.term, $model.categoryPath))" />
+        href="$utils.escapeXML($url.feed.entries.search($model.term, $model.categoryName))" />
     
     <link rel="alternate" type="text/html" 
-        href="$utils.escapeXML($url.absoluteSearch($model.term, $model.categoryPath, $model.page))" />
+        href="$utils.escapeXML($url.absoluteSearch($model.term, $model.categoryName, $model.page))" />
     
     <link rel="search" type="application/opensearchdescription+xml" 
         href="$utils.escapeXML($url.openSearchSite)" />

Modified: roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-atom.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-atom.vm?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-atom.vm (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-atom.vm Sun Mar 30 00:05:38 2014
@@ -22,7 +22,7 @@
     <title type="html">$utils.escapeXML($model.weblog.name) (Comments)</title>
     <id>$url.feed.comments.atom</id>
     <link rel="alternate" type="text/html" href="$url.home" />
-    <link rel="self" type="application/atom+xml" href="$url.feed.comments.atom($model.categoryPath, $model.excerpts)" />
+    <link rel="self" type="application/atom+xml" href="$url.feed.comments.atom($model.categoryName, $model.excerpts)" />
     #if($config.feedHistoryEnabled)
         #showFeedHistory($pager)
     #end

Modified: roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-rss.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-rss.vm?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-rss.vm (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-comments-rss.vm Sun Mar 30 00:05:38 2014
@@ -23,7 +23,7 @@
 <channel>
   <title>$utils.escapeXML($utils.removeHTML($model.weblog.name)) (Comments)</title>
   <link>$url.home</link>
-  <atom:link rel="self" type="application/rss+xml" href="$url.feed.comments.rss($model.categoryPath, $model.excerpts)" />
+  <atom:link rel="self" type="application/rss+xml" href="$url.feed.comments.rss($model.categoryName, $model.excerpts)" />
   <description>$utils.escapeXML($model.weblog.description)</description>
   <language>en-us</language>
   <copyright>Copyright $utils.formatDate($model.weblog.lastModified, "yyyy")</copyright>

Modified: roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-atom.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-atom.vm?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-atom.vm (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-atom.vm Sun Mar 30 00:05:38 2014
@@ -24,8 +24,8 @@
     <id>$url.feed.entries.atom</id>
     #if($model.tags)
         <link rel="self" type="application/atom+xml" href="$url.feed.entries.atomByTags($model.tags, $model.excerpts)" />
-    #elseif($model.categoryPath)
-        <link rel="self" type="application/atom+xml" href="$url.feed.entries.atom($model.categoryPath, $model.excerpts)" />
+    #elseif($model.categoryName)
+        <link rel="self" type="application/atom+xml" href="$url.feed.entries.atom($model.categoryName, $model.excerpts)" />
     #else
         <link rel="self" type="application/atom+xml" href="$url.feed.entries.atom" />
     #end

Modified: roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-rss.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-rss.vm?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-rss.vm (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-entries-rss.vm Sun Mar 30 00:05:38 2014
@@ -25,8 +25,8 @@
   <link>$url.home</link>
   #if($model.tags)
     <atom:link rel="self" type="application/rss+xml" href="$url.feed.entries.rssByTags($model.tags, $model.excerpts)" />
-  #elseif($model.categoryPath)
-    <atom:link rel="self" type="application/rss+xml" href="$url.feed.entries.rss($model.categoryPath, $model.excerpts)" />
+  #elseif($model.categoryName)
+    <atom:link rel="self" type="application/rss+xml" href="$url.feed.entries.rss($model.categoryName, $model.excerpts)" />
   #else
     <atom:link rel="self" type="application/rss+xml" href="$url.feed.entries.rss" />
   #end

Modified: roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-search-atom.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-search-atom.vm?rev=1583085&r1=1583084&r2=1583085&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-search-atom.vm (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/velocity/templates/feeds/weblog-search-atom.vm Sun Mar 30 00:05:38 2014
@@ -24,13 +24,13 @@
 
     <title type="html">Search for [$model.term] in weblog $model.weblog.handle</title>
     <subtitle type="html">Search results for [$model.term] within weblog $utils.escapeXML($model.weblog.name)</subtitle>
-    <id>$utils.escapeXML($url.feed.entries.search($model.term, $model.categoryPath))</id>
+    <id>$utils.escapeXML($url.feed.entries.search($model.term, $model.categoryName))</id>
 
     <link rel="self" type="application/atom+xml" 
-        href="$utils.escapeXML($url.feed.entries.search($model.term, $model.categoryPath))" />
+        href="$utils.escapeXML($url.feed.entries.search($model.term, $model.categoryName))" />
 
     <link rel="alternate" type="text/html" 
-        href="$utils.escapeXML($url.absoluteSearch($model.term, $model.categoryPath, $model.page))" />
+        href="$utils.escapeXML($url.absoluteSearch($model.term, $model.categoryName, $model.page))" />
 
     <link rel="search" type="application/opensearchdescription+xml" 
         href="$utils.escapeXML($url.openSearchWeblog)" />

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 2014
@@ -123,7 +123,7 @@ public class WeblogCategoryFunctionality
     
     
     /**
-     * Lookup category by path.
+     * Lookup category by name.
      */
     public void testLookupCategoryByName() throws Exception {
         

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=1583085&r1=1583084&r2=1583085&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 Sun Mar 30 00:05:38 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.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.pojos.WeblogEntryTag;
 import org.apache.roller.weblogger.pojos.Weblog;
 
@@ -107,7 +108,7 @@ public class WeblogEntryTest extends Tes
     public void testWeblogEntryCRUD() throws Exception {
         
         WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-        WeblogEntry entry = null;
+        WeblogEntry entry;
         
         WeblogEntry testEntry = new WeblogEntry();
         testEntry.setTitle("entryTestEntry");
@@ -138,7 +139,6 @@ public class WeblogEntryTest extends Tes
         TestUtils.endSession(true);
         
         // make sure entry was updated
-        entry = null;
         entry = mgr.getWeblogEntry(id);
         assertNotNull(entry);
         assertEquals("testtest", entry.getTitle());
@@ -148,7 +148,6 @@ public class WeblogEntryTest extends Tes
         TestUtils.endSession(true);
         
         // make sure entry was deleted
-        entry = null;
         entry = mgr.getWeblogEntry(id);
         assertNull(entry);
     }
@@ -160,9 +159,9 @@ public class WeblogEntryTest extends Tes
     public void testWeblogEntryLookups() throws Exception {
         
         WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-        WeblogEntry entry = null;
-        List entries = null;
-        Map entryMap = null;
+        WeblogEntry entry;
+        List entries;
+        Map entryMap;
 
         // setup some test entries to use
         testWeblog = TestUtils.getManagedWebsite(testWeblog);
@@ -209,97 +208,110 @@ public class WeblogEntryTest extends Tes
         entry5 = TestUtils.getManagedWeblogEntry(entry5);
         
         // get entry by id
-        entry = null;
         entry = mgr.getWeblogEntry(entry1.getId());
         assertNotNull(entry);
         assertEquals(entry1.getAnchor(), entry.getAnchor());
         
         // get entry by anchor
-        entry = null;
         entry = mgr.getWeblogEntryByAnchor(testWeblog, entry1.getAnchor());
         assertNotNull(entry);
         assertEquals(entry1.getTitle(), entry.getTitle());
         
         // get all entries for weblog
-        entries = null;
-        entries = mgr.getWeblogEntries(testWeblog, null, null, null, null, null, null, null, null, null, null, 0, -1);
+        WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+        wesc.setWeblog(testWeblog);
+        entries = mgr.getWeblogEntries(wesc);
         assertNotNull(entries);
         assertEquals(5, entries.size());
         assertEquals(entry3, entries.get(0));
         
         // get all (non-future) PUBLISHED entries in category 
-        entries = null;
-        entries = mgr.getWeblogEntries(testWeblog.getDefaultCategory(), true);
+        WeblogEntrySearchCriteria wesc9 = new WeblogEntrySearchCriteria();
+        wesc9.setWeblog(testWeblog);
+        wesc9.setCatName(testWeblog.getDefaultCategory().getName());
+        wesc9.setStatus(WeblogEntry.PUBLISHED);
+        entries = mgr.getWeblogEntries(wesc9);
         assertNotNull(entries);
         assertEquals(3, entries.size());
         
         // get all (non-future) PUBLISHED entries only 
-        entries = null;
-        entries = mgr.getWeblogEntries(testWeblog, null, null, null, null, null, WeblogEntry.PUBLISHED, null, null, null, null, 0, -1);
+        WeblogEntrySearchCriteria wesc2 = new WeblogEntrySearchCriteria();
+        wesc2.setWeblog(testWeblog);
+        wesc2.setStatus(WeblogEntry.PUBLISHED);
+        entries = mgr.getWeblogEntries(wesc2);
         assertNotNull(entries);
         assertEquals(3, entries.size());
         
         // get all entries in date range
-        entries = null;
-        entries = mgr.getWeblogEntries(testWeblog, null, entry2.getPubTime(), entry2.getPubTime(), null, null, null, null, null, null, null, 0, -1);
+        WeblogEntrySearchCriteria wesc3 = new WeblogEntrySearchCriteria();
+        wesc3.setWeblog(testWeblog);
+        wesc3.setStartDate(entry2.getPubTime());
+        wesc3.setEndDate(entry2.getPubTime());
+        entries = mgr.getWeblogEntries(wesc3);
         assertNotNull(entries);
         assertEquals(1, entries.size());
         assertEquals(entry2, entries.get(0));
         
         // get all entries, limited to maxSize
-        entries = null;
-        entries = mgr.getWeblogEntries(testWeblog, null, null, null, null, null, null, null, null, null, null, 0, 2);
+        WeblogEntrySearchCriteria wesc4 = new WeblogEntrySearchCriteria();
+        wesc4.setWeblog(testWeblog);
+        wesc4.setMaxResults(2);
+        entries = mgr.getWeblogEntries(wesc4);
         assertNotNull(entries);
         assertEquals(2, entries.size());
         
         // get all entries in category
-        entries = null;
-        entries = mgr.getWeblogEntries(testWeblog, null, null, null, testWeblog.getDefaultCategory().getName(), null, null, null, null, null, null, 0, -1);
+        WeblogEntrySearchCriteria wesc5 = new WeblogEntrySearchCriteria();
+        wesc5.setWeblog(testWeblog);
+        wesc5.setCatName(testWeblog.getDefaultCategory().getName());
+        entries = mgr.getWeblogEntries(wesc5);
         assertNotNull(entries);
         assertEquals(5, entries.size());
         
         // get all entries, limited by offset/range
-        entries = null;
-        entries = mgr.getWeblogEntries(testWeblog, null, null, null, null, null, null, null, null, null, null, 1, 1);
+        WeblogEntrySearchCriteria wesc6 = new WeblogEntrySearchCriteria();
+        wesc6.setWeblog(testWeblog);
+        wesc6.setOffset(1);
+        wesc6.setMaxResults(1);
+        entries = mgr.getWeblogEntries(wesc6);
         assertNotNull(entries);
         assertEquals(1, entries.size());
         assertEquals(entry2, entries.get(0));
         
         // get all entries, limited by locale
-        entries = null;
-        entries = mgr.getWeblogEntries(testWeblog, null, null, null, null, null, null, null, null, null, "en_US", 0, -1);
+        WeblogEntrySearchCriteria wesc7 = new WeblogEntrySearchCriteria();
+        wesc7.setWeblog(testWeblog);
+        wesc7.setLocale("en_US");
+        entries = mgr.getWeblogEntries(wesc7);
         assertNotNull(entries);
         assertEquals(4, entries.size());
         assertEquals(entry3, entries.get(0));
         
         // get pinned entries only
-        entries = null;
         entries = mgr.getWeblogEntriesPinnedToMain(5);
         assertNotNull(entries);
         assertEquals(1, entries.size());
         assertEquals(entry1, entries.get(0));
         
         // get next entry
-        entry = null;
         entry = mgr.getNextEntry(entry4, null, null);
         assertNotNull(entry);
         assertEquals(entry5, entry);
         
         // get previous entry
-        entry = null;
         entry = mgr.getPreviousEntry(entry5, null, null);
         assertNotNull(entry);
         assertEquals(entry4, entry);
         
         // get object map
-        entryMap = null;
-        entryMap = mgr.getWeblogEntryObjectMap(testWeblog, null, null, null, null, null, null, 0, -1);
+        WeblogEntrySearchCriteria wesc8 = new WeblogEntrySearchCriteria();
+        wesc8.setWeblog(testWeblog);
+        entryMap = mgr.getWeblogEntryObjectMap(wesc8);
         assertNotNull(entryMap);
         assertTrue(entryMap.keySet().size() > 1);
         
         // get string map
-        entryMap = null;
-        entryMap = mgr.getWeblogEntryStringMap(testWeblog, null, null, null, null, null, null, 0, -1);
+        entryMap = mgr.getWeblogEntryStringMap(wesc8);
         assertNotNull(entryMap);
         assertTrue(entryMap.keySet().size() > 1);
                 
@@ -316,9 +328,7 @@ public class WeblogEntryTest extends Tes
     public void testCreateAnchor() throws Exception {
         
         WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-        WeblogEntry entry = null;
-        List entries = null;
-        
+
         // setup some test entries to use
         testWeblog = TestUtils.getManagedWebsite(testWeblog);
         testUser = TestUtils.getManagedUser(testUser);
@@ -347,7 +357,7 @@ public class WeblogEntryTest extends Tes
     public void testCreateAnEntryWithTagsShortcut() throws Exception {
         try {
             WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-            WeblogEntry entry = null;
+            WeblogEntry entry;
             testWeblog = TestUtils.getManagedWebsite(testWeblog);
             testUser = TestUtils.getManagedUser(testUser);
 
@@ -378,7 +388,7 @@ public class WeblogEntryTest extends Tes
             assertEquals(testEntry, entry);
             assertNotNull(entry.getTags());
             assertEquals(1, entry.getTags().size());
-            assertEquals("testtag", ((WeblogEntryTag) entry.getTags()
+            assertEquals("testtag", (entry.getTags()
                     .iterator().next()).getName());
             TestUtils.endSession(true);
 
@@ -511,22 +521,22 @@ public class WeblogEntryTest extends Tes
         TestUtils.endSession(true);
         
         // we'll need these
-        List tags1 = new ArrayList();
+        List<String> tags1 = new ArrayList<String>();
         tags1.add("nonExistTag");
         
-        List tags2 = new ArrayList();
+        List<String> tags2 = new ArrayList<String>();
         tags2.add("blahtag");
         
         // test site-wide
-        this.assertTrue(mgr.getTagComboExists(tags2, null));
-        this.assertFalse(mgr.getTagComboExists(tags1, null));
+        assertTrue(mgr.getTagComboExists(tags2, null));
+        assertFalse(mgr.getTagComboExists(tags1, null));
         
         // test weblog specific
         testWeblog = TestUtils.getManagedWebsite(testWeblog);
         weblog = TestUtils.getManagedWebsite(weblog);
-        this.assertTrue(mgr.getTagComboExists(tags2, testWeblog));
-        this.assertFalse(mgr.getTagComboExists(tags1, testWeblog));
-        this.assertFalse(mgr.getTagComboExists(tags2, weblog));
+        assertTrue(mgr.getTagComboExists(tags2, testWeblog));
+        assertFalse(mgr.getTagComboExists(tags1, testWeblog));
+        assertFalse(mgr.getTagComboExists(tags2, weblog));
         
         // teardown our test data
         TestUtils.teardownWeblogEntry(id1);
@@ -552,8 +562,11 @@ public class WeblogEntryTest extends Tes
 
             testWeblog = TestUtils.getManagedWebsite(testWeblog);
 
-            List results = mgr.getWeblogEntries(testWeblog, null, null, null, null,
-                Arrays.asList(new String[] { "testtag" }), null, null, null, null, null, 0, -1);
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(testWeblog);
+            // tags are always saved lowercase (testTag -> testtag)
+            wesc.setTags(Arrays.asList("testtag"));
+            List results = mgr.getWeblogEntries(wesc);
             assertEquals(1, results.size());
             WeblogEntry testEntry = (WeblogEntry) results.iterator().next();
             assertEquals(entry, testEntry);
@@ -585,8 +598,11 @@ public class WeblogEntryTest extends Tes
         TestUtils.endSession(true);
 
         testWeblog = TestUtils.getManagedWebsite(testWeblog);
-        List results = mgr.getWeblogEntries(testWeblog, null, null, null, null,
-        Arrays.asList(new String[] { "testtag" }), null, null, null, null, null, 0, -1);
+        WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+        wesc.setWeblog(testWeblog);
+        // tags are always saved lowercase (testTag -> testtag)
+        wesc.setTags(Arrays.asList("testtag"));
+        List results = mgr.getWeblogEntries(wesc);
         assertEquals(1, results.size());
         WeblogEntry testEntry = (WeblogEntry) results.iterator().next();
         assertEquals(entry, testEntry);
@@ -596,8 +612,7 @@ public class WeblogEntryTest extends Tes
         TestUtils.endSession(true);
 
         testWeblog = TestUtils.getManagedWebsite(testWeblog);
-        results = mgr.getWeblogEntries(testWeblog, null, null, null, null,
-        Arrays.asList(new String[] { "testtag" }), null, null, null, null, null, 0, -1);
+        results = mgr.getWeblogEntries(wesc);
         assertEquals(0, results.size());
 
         // terminate
@@ -620,7 +635,7 @@ public class WeblogEntryTest extends Tes
         entry = mgr.getWeblogEntry(id);
         assertEquals(2, entry.getTags().size());
 
-        List updateTags = new ArrayList();
+        List<String> updateTags = new ArrayList<String>();
         updateTags.add("testwillstaytag");
         updateTags.add("testnewtag");
         updateTags.add("testnewtag3");
@@ -753,7 +768,7 @@ public class WeblogEntryTest extends Tes
                 if (!expectedWeblogTags.containsKey(stat.getName())) {
                     fail("Unexpected tagName.");
                 }
-                Integer expectedCount = (Integer)expectedWeblogTags.get(stat.getName());
+                Integer expectedCount = expectedWeblogTags.get(stat.getName());
                 assertEquals(expectedCount.intValue(), stat.getCount());
             }
 
@@ -782,7 +797,7 @@ public class WeblogEntryTest extends Tes
                 if (!expectedSiteTags.containsKey(stat.getName()))
                     fail("Unexpected tagName.");
 
-                Integer expectedCount = (Integer) expectedSiteTags.get(stat.getName());
+                Integer expectedCount = expectedSiteTags.get(stat.getName());
                 assertEquals(expectedCount.intValue(), stat.getCount());
             }
 
@@ -814,7 +829,7 @@ public class WeblogEntryTest extends Tes
                     fail("Unexpected tagName.");
                 }
                 Integer expectedCount =
-                        (Integer)expectedWeblogTags.get(stat.getName());
+                        expectedWeblogTags.get(stat.getName());
                 assertEquals(stat.getName(),
                         expectedCount.intValue(), stat.getCount());
             }
@@ -833,7 +848,7 @@ public class WeblogEntryTest extends Tes
                 if (!expectedSiteTags.containsKey(stat.getName())) {
                     fail("Unexpected tagName.");
                 }
-                Integer expectedCount = (Integer)expectedSiteTags.get(stat.getName());
+                Integer expectedCount = expectedSiteTags.get(stat.getName());
                 assertEquals(stat.getName(), expectedCount.intValue(), stat.getCount());
             }
 
@@ -894,7 +909,7 @@ public class WeblogEntryTest extends Tes
             if (!expectedWeblogTags.containsKey(stat.getName()))
                 fail("Unexpected tagName.");
 
-            Integer expectedCount = (Integer) expectedWeblogTags.get(stat.getName());
+            Integer expectedCount = expectedWeblogTags.get(stat.getName());
             assertEquals(expectedCount.intValue(), stat.getCount());
         }
 
@@ -919,7 +934,7 @@ public class WeblogEntryTest extends Tes
             if (!expectedSiteTags.containsKey(stat.getName()))
                 fail("Unexpected tagName.");
 
-            Integer expectedCount = (Integer) expectedSiteTags.get(stat.getName());
+            Integer expectedCount = expectedSiteTags.get(stat.getName());
             assertEquals(expectedCount.intValue(), stat.getCount());
         }
 
@@ -937,9 +952,8 @@ public class WeblogEntryTest extends Tes
      */
      public void testEntryAttributeCRUD() throws Exception {
         
-        WeblogManager mgr = WebloggerFactory.getWeblogger().getWeblogManager();
         WeblogEntryManager emgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-        WeblogEntry entry = null;
+        WeblogEntry entry;
         
         WeblogEntry testEntry = new WeblogEntry();
         testEntry.setTitle("entryTestEntry");
@@ -985,7 +999,6 @@ public class WeblogEntryTest extends Tes
         TestUtils.endSession(true);
         
         // make sure entry was updated
-        entry = null;
         entry = emgr.getWeblogEntry(id);
         assertNotNull(entry);
         assertEquals("testtest", entry.getTitle());
@@ -995,7 +1008,6 @@ public class WeblogEntryTest extends Tes
         TestUtils.endSession(true);
         
         // make sure entry was deleted
-        entry = null;
         entry = emgr.getWeblogEntry(id);
         assertNull(entry);
     }



Mime
View raw message