roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r1588757 [7/25] - in /roller/branches/rome2/app/src: main/java/org/apache/roller/ main/java/org/apache/roller/planet/business/ main/java/org/apache/roller/planet/business/fetcher/ main/java/org/apache/roller/planet/business/jpa/ main/java/o...
Date Sun, 20 Apr 2014 13:39:01 GMT
Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/Theme.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/Theme.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/Theme.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/Theme.java Sun Apr 20 13:38:51 2014
@@ -62,7 +62,7 @@ public interface Theme {
     /**
      * Get the list of all templates associated with this Theme.
      */
-    List getTemplates() throws WebloggerException;
+    List<ThemeTemplate> getTemplates() throws WebloggerException;
     
     
     /**

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/Theme.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Theme.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/ThemeResource.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/ThemeResource.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/ThemeResource.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/ThemeResource.java Sun Apr 20 13:38:51 2014
@@ -22,7 +22,7 @@ package org.apache.roller.weblogger.pojo
 /**
  * A Resource that is attached to a Theme.
  */
-public interface ThemeResource extends Resource {
+public interface ThemeResource extends Resource, Comparable<ThemeResource> {
     
     /**
      * Does this resource represent a directory?  True if yes, False otherwise.

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/ThemeResource.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/ThemeResource.java:r1546818-1588713

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/ThemeTemplate.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/ThemeTemplate.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/User.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/User.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/User.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/User.java Sun Apr 20 13:38:51 2014
@@ -22,8 +22,8 @@ import java.io.Serializable;
 import java.util.Collections;
 import java.util.Date;
 import java.util.List;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.config.WebloggerConfig;
 import org.apache.roller.util.UUIDGenerator;

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/User.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/User.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/UserAttribute.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/UserAttribute.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/UserAttribute.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/UserAttribute.java Sun Apr 20 13:38:51 2014
@@ -19,8 +19,8 @@
 package org.apache.roller.weblogger.pojos;
 
 import java.io.Serializable;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.roller.util.UUIDGenerator;
 
 

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/UserAttribute.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/UserAttribute.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/UserRole.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/UserRole.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/UserRole.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/UserRole.java Sun Apr 20 13:38:51 2014
@@ -19,8 +19,8 @@
 package org.apache.roller.weblogger.pojos;
 
 import java.io.Serializable;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.roller.util.UUIDGenerator;
 
 

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/UserRole.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/UserRole.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java Sun Apr 20 13:38:51 2014
@@ -19,20 +19,12 @@
 package org.apache.roller.weblogger.pojos;
 
 import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-import java.util.TimeZone;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import java.util.*;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.roller.weblogger.WebloggerException;
+import org.apache.roller.weblogger.business.plugins.entry.WeblogEntryPlugin;
 import org.apache.roller.weblogger.business.referrers.RefererManager;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.commons.logging.Log;
@@ -60,6 +52,8 @@ public class Weblog implements Serializa
     public static final long serialVersionUID = 206437645033737127L;
     
     private static Log log = LogFactory.getLog(Weblog.class);
+
+    private static final int MAX_ENTRIES = 100;
     
     // Simple properties
     private String  id               = UUIDGenerator.generateUUID();
@@ -97,11 +91,14 @@ public class Weblog implements Serializa
 
     // Associated objects
     private WeblogCategory bloggerCategory = null;
-    private WeblogCategory defaultCategory = null;
-    
-    private Map initializedPlugins = null;
-    
-    public Weblog() {    
+
+    private Map<String, WeblogEntryPlugin> initializedPlugins = null;
+
+    private List<WeblogCategory> weblogCategories = new ArrayList<WeblogCategory>();
+
+    private List<WeblogBookmarkFolder> bookmarkFolders = new ArrayList<WeblogBookmarkFolder>();
+
+    public Weblog() {
     }
     
     public Weblog(
@@ -160,14 +157,6 @@ public class Weblog implements Serializa
             .toHashCode();
     } 
     
-    /*public List getPermissions() {
-        return permissions;
-    }
-    public void setPermissions(List perms) {
-        permissions = perms;
-    }*/
-    
-    
     /**
      * Get the Theme object in use by this weblog, or null if no theme selected.
      */
@@ -299,6 +288,9 @@ public class Weblog implements Serializa
     }
     
     public WeblogCategory getBloggerCategory() {
+        if (bloggerCategory == null) {
+            bloggerCategory = getDefaultCategory();
+        }
         return bloggerCategory;
     }
     
@@ -306,19 +298,13 @@ public class Weblog implements Serializa
         this.bloggerCategory = bloggerCategory;
     }
     
-    /**
-     * By default,the default category for a weblog is the root and all macros
-     * work with the top level categories that are immediately under the root.
-     * Setting a different default category allows you to partition your weblog.
-     */
     public WeblogCategory getDefaultCategory() {
-        return defaultCategory;
-    }
-    
-    public void setDefaultCategory(WeblogCategory defaultCategory) {
-        this.defaultCategory = defaultCategory;
+        if (weblogCategories.size() == 0) {
+            return null;
+        }
+        return weblogCategories.iterator().next();
     }
-    
+
     public String getEditorPage() {
         return this.editorPage;
     }
@@ -465,7 +451,6 @@ public class Weblog implements Serializa
         this.setWeblogDayPageId(other.getWeblogDayPageId());
         this.setEnableBloggerApi(other.getEnableBloggerApi());
         this.setBloggerCategory(other.getBloggerCategory());
-        this.setDefaultCategory(other.getDefaultCategory());
         this.setEditorPage(other.getEditorPage());
         this.setBlacklist(other.getBlacklist());
         this.setAllowComments(other.getAllowComments());
@@ -481,6 +466,7 @@ public class Weblog implements Serializa
         this.setEntryDisplayCount(other.getEntryDisplayCount());
         this.setActive(other.getActive());
         this.setLastModified(other.getLastModified());
+        this.setWeblogCategories(other.getWeblogCategories());
     }
     
     
@@ -537,12 +523,9 @@ public class Weblog implements Serializa
         int count = 0;
         try {
             UserManager umgr = WebloggerFactory.getWeblogger().getUserManager();
-            Iterator iter = umgr.getWeblogPermissions(this).iterator();
-            while (iter.hasNext()) {
-                iter.next();
+            for (WeblogPermission perm : umgr.getWeblogPermissions(this)) {
                 count++;
             }
-            
         } catch (WebloggerException ex) {
             // something is seriously wrong, not me we can do here
             log.error("ERROR error getting admin user count", ex);
@@ -550,19 +533,11 @@ public class Weblog implements Serializa
         return count;
     }
     
-    /** No-op needed to please XDoclet generated code */
-    private int userCount = 0;
-    public void setUserCount(int userCount) {
-        // no-op
-    }
-
     public int getAdminUserCount() {
         int count = 0;
         try {
             UserManager umgr = WebloggerFactory.getWeblogger().getUserManager();
-            Iterator iter = umgr.getWeblogPermissions(this).iterator();
-            while (iter.hasNext()) {
-                WeblogPermission perm = (WeblogPermission) iter.next();
+            for (WeblogPermission perm : umgr.getWeblogPermissions(this)) {
                 if (perm.hasAction(WeblogPermission.ADMIN)) {
                     count++;
                 }
@@ -575,12 +550,6 @@ public class Weblog implements Serializa
         return count;
     }
     
-    /** No-op needed to please XDoclet generated code */
-    private int adminUserCount = 0;
-    public void setAdminUserCount(int adminUserCount) {
-        // no-op
-    }
-
     public int getEntryDisplayCount() {
         return entryDisplayCount;
     }
@@ -629,7 +598,7 @@ public class Weblog implements Serializa
      * This includes a change to weblog settings, entries, themes, templates, 
      * comments, categories, bookmarks, folders, etc.
      *
-     * Pings and Referrers are explicitly not included because pings to not
+     * Pings and Referrers are explicitly not included because pings do not
      * affect visible changes to a weblog, and referrers change so often that
      * it would diminish the usefulness of the attribute.
      *
@@ -716,11 +685,11 @@ public class Weblog implements Serializa
 
     
     /**
-     * A short description about the weblog.
+     * A description for the weblog (its purpose, authors, etc.)
      *
-     * This field difers from the 'description' attribute in the sense that the
-     * description is meant to hold more of a tagline, while this attribute is
-     * more of a full paragraph (or two) about section.
+     * This field is meant to hold a paragraph or two describing the weblog, in contrast
+     * to the short sentence or two 'description' attribute meant for blog taglines
+     * and HTML header META description tags.
      *
      */
     public String getAbout() {
@@ -735,14 +704,14 @@ public class Weblog implements Serializa
     /**
      * Get initialized plugins for use during rendering process.
      */
-    public Map getInitializedPlugins() {
+    public Map<String, WeblogEntryPlugin> getInitializedPlugins() {
         if (initializedPlugins == null) {
             try {
                 Weblogger roller = WebloggerFactory.getWeblogger();
                 PluginManager ppmgr = roller.getPluginManager();
-                initializedPlugins = ppmgr.getWeblogEntryPlugins(this); 
+                initializedPlugins = ppmgr.getWeblogEntryPlugins(this);
             } catch (Exception e) {
-                this.log.error("ERROR: initializing plugins");
+                log.error("ERROR: initializing plugins");
             }
         }
         return initializedPlugins;
@@ -760,88 +729,53 @@ public class Weblog implements Serializa
             WeblogEntryManager wmgr = roller.getWeblogEntryManager();
             entry = wmgr.getWeblogEntryByAnchor(this, anchor);
         } catch (WebloggerException e) {
-            this.log.error("ERROR: getting entry by anchor");
+            log.error("ERROR: getting entry by anchor");
         }
         return entry;
     }
-    
-    /**
-     * Returns categories under the default category of the weblog.
-     */
-    public Set getWeblogCategories() {
-        WeblogCategory category = this.getDefaultCategory();
-        return category.getWeblogCategories();
-    }
-    
-    
-    public Set getWeblogCategories(String categoryPath) {
-        Set ret = new HashSet();
-        try {
-            Weblogger roller = WebloggerFactory.getWeblogger();
-            WeblogEntryManager wmgr = roller.getWeblogEntryManager();            
-            WeblogCategory category = null;
-            if (categoryPath != null && !categoryPath.equals("nil")) {
-                category = wmgr.getWeblogCategoryByPath(this, categoryPath);
-            } else {
-                category = this.getDefaultCategory();
-            }
-            ret = category.getWeblogCategories();
-        } catch (WebloggerException e) {
-            log.error("ERROR: fetching categories for path: " + categoryPath, e);
-        }
-        return ret;
-    }
 
-    public WeblogCategory getWeblogCategory(String categoryPath) {
+    public WeblogCategory getWeblogCategory(String categoryName) {
         WeblogCategory category = null;
         try {
             Weblogger roller = WebloggerFactory.getWeblogger();
             WeblogEntryManager wmgr = roller.getWeblogEntryManager();
-            if (categoryPath != null && !categoryPath.equals("nil")) {
-                category = wmgr.getWeblogCategoryByPath(this, categoryPath);
+            if (categoryName != null && !categoryName.equals("nil")) {
+                category = wmgr.getWeblogCategoryByName(this, categoryName);
             } else {
-                category = this.getDefaultCategory();
+                category = getWeblogCategories().iterator().next();
             }
         } catch (WebloggerException e) {
-            log.error("ERROR: fetching category at path: " + categoryPath, e);
+            log.error("ERROR: fetching category: " + categoryName, e);
         }
         return category;
     }
-    
+
     
     /**
      * Get up to 100 most recent published entries in weblog.
-     * @param cat Category path or null for no category restriction
+     * @param cat Category name or null for no category restriction
      * @param length Max entries to return (1-100)
      * @return List of weblog entry objects.
      */
-    public List getRecentWeblogEntries(String cat, int length) {  
+    public List<WeblogEntry> getRecentWeblogEntries(String cat, int length) {
         if (cat != null && "nil".equals(cat)) {
             cat = null;
         }
-        if (length > 100) {
-            length = 100;
+        if (length > MAX_ENTRIES) {
+            length = MAX_ENTRIES;
         }
-        List recentEntries = new ArrayList();
+        List<WeblogEntry> recentEntries = new ArrayList<WeblogEntry>();
         if (length < 1) {
             return recentEntries;
         }
         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);
         }
@@ -854,15 +788,15 @@ public class Weblog implements Serializa
      * @param length Max entries to return (1-100)
      * @return List of weblog entry objects.
      */
-    public List getRecentWeblogEntriesByTag(String tag, int length) {  
+    public List<WeblogEntry> getRecentWeblogEntriesByTag(String tag, int length) {
         if (tag != null && "nil".equals(tag)) {
             tag = null;
         }
-        if (length > 100) {
-            length = 100;
+        if (length > MAX_ENTRIES) {
+            length = MAX_ENTRIES;
         }
-        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);
         }
@@ -871,20 +805,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);
         }
@@ -896,26 +822,22 @@ public class Weblog implements Serializa
      * @param length Max entries to return (1-100)
      * @return List of comment objects.
      */
-    public List getRecentComments(int length) {   
-        if (length > 100) {
-            length = 100;
+    public List<WeblogEntryComment> getRecentComments(int length) {
+        if (length > MAX_ENTRIES) {
+            length = MAX_ENTRIES;
         }
-        List recentComments = new ArrayList();
+        List<WeblogEntryComment> recentComments = new ArrayList<WeblogEntryComment>();
         if (length < 1) {
             return recentComments;
         }
         try {
             WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-            recentComments = wmgr.getComments(
-                    
-                    this,
-                    null,          // weblog entry
-                    null,          // search String
-                    null,          // startDate
-                    null,WeblogEntryComment.APPROVED, // approved comments only
-                    true,          // we want reverse chrono order
-                    0,             // offset
-                    length);       // length
+            CommentSearchCriteria csc = new CommentSearchCriteria();
+            csc.setWeblog(this);
+            csc.setStatus(WeblogEntryComment.APPROVED);
+            csc.setReverseChrono(true);
+            csc.setMaxResults(length);
+            recentComments = wmgr.getComments(csc);
         } catch (WebloggerException e) {
             log.error("ERROR: getting recent comments", e);
         }
@@ -934,7 +856,7 @@ public class Weblog implements Serializa
             Weblogger roller = WebloggerFactory.getWeblogger();
             BookmarkManager bmgr = roller.getBookmarkManager();
             if (folderName == null || folderName.equals("nil") || folderName.trim().equals("/")) {
-                return bmgr.getRootFolder(this);
+                return bmgr.getDefaultFolder(this);
             } else {
                 return bmgr.getFolder(this, folderName);
             }
@@ -948,7 +870,7 @@ public class Weblog implements Serializa
     /** 
      * Return collection of referrers for current day.
      */
-    public List getTodaysReferrers() {
+    public List<WeblogReferrer> getTodaysReferrers() {
         try {
             Weblogger roller = WebloggerFactory.getWeblogger();
             RefererManager rmgr = roller.getRefererManager();
@@ -956,12 +878,9 @@ public class Weblog implements Serializa
         } catch (WebloggerException e) {
             log.error("PageModel getTodaysReferers()", e);
         }
-        return Collections.EMPTY_LIST;
+        return Collections.emptyList();
     }
     
-    /** No-op method to please XDoclet */
-    public void setTodaysReferrers(List ignored) {}
-    
     /**
      * Get number of hits counted today.
      */
@@ -978,11 +897,7 @@ public class Weblog implements Serializa
         }
         return 0;
     }
-    
-    /** No-op method to please XDoclet */
-    public void setTodaysHits(int ignored) {}
 
-        
     /**
      * Get a list of TagStats objects for the most popular tags
      *
@@ -1021,9 +936,6 @@ public class Weblog implements Serializa
         return count;
     }
     
-    /** No-op method to please XDoclet */
-    public void setCommentCount(int ignored) {}
-    
     public long getEntryCount() {
         long count = 0;
         try {
@@ -1036,9 +948,6 @@ public class Weblog implements Serializa
         return count;
     }
 
-    /** No-op method to please XDoclet */
-    public void setEntryCount(int ignored) {}
-
     /**
      * @return  mobileTheme
      */
@@ -1057,4 +966,82 @@ public class Weblog implements Serializa
         }
         return theme;
     }
+
+    /**
+     * Add a category as a child of this category.
+     */
+    public void addCategory(WeblogCategory category) {
+
+        // make sure category is not null
+        if(category == null || category.getName() == null) {
+            throw new IllegalArgumentException("Category cannot be null and must have a valid name");
+        }
+
+        // make sure we don't already have a category with that name
+        if(hasCategory(category.getName())) {
+            throw new IllegalArgumentException("Duplicate category name '"+category.getName()+"'");
+        }
+
+        // add it to our list of child categories
+        getWeblogCategories().add(category);
+    }
+
+    public List<WeblogCategory> getWeblogCategories() {
+        return weblogCategories;
+    }
+
+    public void setWeblogCategories(List<WeblogCategory> cats) {
+        this.weblogCategories = cats;
+    }
+
+    public boolean hasCategory(String name) {
+        for (WeblogCategory cat : getWeblogCategories()) {
+            if(name.equals(cat.getName())) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public List<WeblogBookmarkFolder> getBookmarkFolders() {
+        return bookmarkFolders;
+    }
+
+    public void setBookmarkFolders(List<WeblogBookmarkFolder> bookmarkFolders) {
+        this.bookmarkFolders = bookmarkFolders;
+    }
+
+    /**
+     * Add a bookmark folder to this weblog.
+     */
+    public void addBookmarkFolder(WeblogBookmarkFolder folder) {
+
+        // make sure folder is not null
+        if(folder == null || folder.getName() == null) {
+            throw new IllegalArgumentException("Folder cannot be null and must have a valid name");
+        }
+
+        // make sure we don't already have a folder with that name
+        if(this.hasBookmarkFolder(folder.getName())) {
+            throw new IllegalArgumentException("Duplicate folder name '" + folder.getName() + "'");
+        }
+
+        // add it to our list of child folder
+        getBookmarkFolders().add(folder);
+    }
+
+    /**
+     * Does this Weblog have a bookmark folder with the specified name?
+     *
+     * @param name The name of the folder to check for.
+     * @return boolean true if exists, false otherwise.
+     */
+    public boolean hasBookmarkFolder(String name) {
+        for (WeblogBookmarkFolder folder : this.getBookmarkFolders()) {
+            if(name.equals(folder.getName())) {
+                return true;
+            }
+        }
+        return false;
+    }
 }

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogBookmark.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogBookmark.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogBookmark.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogBookmark.java Sun Apr 20 13:38:51 2014
@@ -19,8 +19,8 @@
 package org.apache.roller.weblogger.pojos;
 
 import java.io.Serializable;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.roller.util.UUIDGenerator;
 
 
@@ -29,7 +29,7 @@ import org.apache.roller.util.UUIDGenera
  * Don't construct one of these yourself, instead use the create method in
  * the your BookmarkManager implementation.</p>
  */
-public class WeblogBookmark implements Serializable, Comparable {
+public class WeblogBookmark implements Serializable, Comparable<WeblogBookmark> {
     
     public static final long serialVersionUID = 2315131256728236003L;
     
@@ -39,7 +39,6 @@ public class WeblogBookmark implements S
     private String name;
     private String description;
     private String url;
-    private Integer weight;
     private Integer priority;
     private String image;
     private String feedUrl;
@@ -56,17 +55,21 @@ public class WeblogBookmark implements S
             String desc,
             String url,
             String feedUrl,
-            Integer weight,
-            Integer priority,
             String image) {
         this.folder = parent;
         this.name = name;
         this.description = desc;
         this.url = url;
         this.feedUrl = feedUrl;
-        this.weight = weight;
-        this.priority = priority;
         this.image = image;
+
+        folder.addBookmark(this);
+        int size = folder.getBookmarks().size();
+        if (size == 1) {
+            this.priority = 0;
+        } else {
+            this.priority = folder.getBookmarks().get(size - 2).getPriority() + 1;
+        }
     }
     
     //------------------------------------------------------------- Attributes
@@ -81,9 +84,6 @@ public class WeblogBookmark implements S
     
     /**
      * Name of bookmark.
-     *
-     * @struts.validator type="required" msgkey="errors.required"
-     * @struts.validator-args arg0resource="bookmarkForm.name"
      */
     public String getName() {
         return this.name;
@@ -116,26 +116,7 @@ public class WeblogBookmark implements S
     }
     
     /**
-     * Weight indicates prominence of link
-     *
-     * @struts.validator type="required" msgkey="errors.required"
-     * @struts.validator type="integer" msgkey="errors.integer"
-     * @struts.validator-args arg0resource="bookmarkForm.weight"
-     */
-    public java.lang.Integer getWeight() {
-        return this.weight;
-    }
-    
-    public void setWeight(java.lang.Integer weight) {
-        this.weight = weight;
-    }
-    
-    /**
      * Priority determines order of display
-     *
-     * @struts.validator type="required" msgkey="errors.required"
-     * @struts.validator type="integer" msgkey="errors.integer"
-     * @struts.validator-args arg0resource="bookmarkForm.priority"
      */
     public java.lang.Integer getPriority() {
         return this.priority;
@@ -193,6 +174,7 @@ public class WeblogBookmark implements S
         return new EqualsBuilder()
         .append(getName(), o.getName())
         .append(getFolder(), o.getFolder())
+        .append(getUrl(), o.getUrl())
         .isEquals();
     }
     
@@ -200,21 +182,19 @@ public class WeblogBookmark implements S
         return new HashCodeBuilder()
         .append(getName())
         .append(getFolder())
+        .append(getUrl())
         .toHashCode();
     }
-    
-    
+
     /**
      * @see java.lang.Comparable#compareTo(java.lang.Object)
      */
-    public int compareTo(Object o) {
-        return bookmarkComparator.compare(this, o);
+    public int compareTo(WeblogBookmark o) {
+        return priority.compareTo(o.getPriority());
     }
     
-    private BookmarkComparator bookmarkComparator = new BookmarkComparator();
-    
     public Weblog getWebsite() {
-        return getFolder().getWebsite();
+        return getFolder().getWeblog();
     }
     
 }

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogBookmark.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogBookmark.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogBookmarkFolder.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogBookmarkFolder.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogBookmarkFolder.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogBookmarkFolder.java Sun Apr 20 13:38:51 2014
@@ -19,14 +19,10 @@
 package org.apache.roller.weblogger.pojos;
 
 import java.io.Serializable;
-import java.util.Iterator;
+import java.util.ArrayList;
 import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.BookmarkManager;
@@ -35,54 +31,32 @@ import org.apache.roller.util.UUIDGenera
 
 
 /**
- * <p>Folder that holds Bookmarks and other Folders. A Roller Website has a
- * set of Folders (there is no one root folder) and each Folder may contain
- * Folders or Bookmarks. Don't construct one of these yourself, instead use
- * the create method in your BookmarkManager implementation.</p>
+ * <p>Folder that holds Bookmarks. A Roller Weblog has one or more Folders
+ * with one folder permanently labeled default.</p>
  */
-public class WeblogBookmarkFolder implements Serializable, Comparable {
+public class WeblogBookmarkFolder implements Serializable, Comparable<WeblogBookmarkFolder> {
     
     public static final long serialVersionUID = -6272468884763861944L;
-    
-    private static Log log = LogFactory.getLog(WeblogBookmarkFolder.class);
-    
-    
+
     // attributes
     private String id = UUIDGenerator.generateUUID();
     private String name = null;
-    private String description = null;
-    private String path = null;
-    
+
     // associations
-    private Weblog website = null;
-    private WeblogBookmarkFolder parentFolder = null;
-    private Set childFolders = new TreeSet();
-    private Set bookmarks = new TreeSet();
+    private Weblog weblog = null;
+    private List<WeblogBookmark> bookmarks = new ArrayList<WeblogBookmark>();
     
     
     public WeblogBookmarkFolder() {
     }
     
     public WeblogBookmarkFolder(
-            WeblogBookmarkFolder parent,
             String name,
-            String desc,
-            Weblog website) {
+            Weblog weblog) {
         
         this.name = name;
-        this.description = desc;
-        
-        this.website = website;
-        this.parentFolder = parent;
-        
-        // calculate path
-        if(parent == null) {
-            this.path = "/";
-        } else if("/".equals(parent.getPath())) {
-            this.path = "/"+name;
-        } else {
-            this.path = parent.getPath() + "/" + name;
-        }
+        this.weblog = weblog;
+        weblog.addBookmarkFolder(this);
     }
     
         
@@ -92,7 +66,7 @@ public class WeblogBookmarkFolder implem
         StringBuilder buf = new StringBuilder();
         buf.append("{");
         buf.append(getId());
-        buf.append(", ").append(getPath());
+        buf.append(", ").append(getName());
         buf.append("}");
         return buf.toString();
     }
@@ -106,8 +80,8 @@ public class WeblogBookmarkFolder implem
         if (other instanceof WeblogBookmarkFolder) {
             WeblogBookmarkFolder o = (WeblogBookmarkFolder) other;
             return new EqualsBuilder()
-                .append(getPath(), o.getPath()) 
-                //.append(getWebsite(), o.getWebsite()) 
+                .append(getName(), o.getName())
+                .append(getWeblog(), o.getWeblog())
                 .isEquals();
         }
         
@@ -117,16 +91,15 @@ public class WeblogBookmarkFolder implem
     
     public int hashCode() {
         return new HashCodeBuilder()
-            .append(getPath())
-            //.append(getWebsite())
+            .append(getName())
+            .append(getWeblog())
             .toHashCode();
     }
     
     /**
      * @see java.lang.Comparable#compareTo(java.lang.Object)
      */
-    public int compareTo(Object o) {
-        WeblogBookmarkFolder other = (WeblogBookmarkFolder)o;
+    public int compareTo(WeblogBookmarkFolder other) {
         return getName().compareTo(other.getName());
     }
     
@@ -149,11 +122,6 @@ public class WeblogBookmarkFolder implem
     
     /**
      * The short name for this folder.
-     *
-     * @struts.validator type="required" msgkey="errors.required"
-     * @struts.validator type="mask" msgkey="errors.noslashes"
-     * @struts.validator-var name="mask" value="${noslashes}"
-     * @struts.validator-args arg0resource="folderForm.name"
      */
     public String getName() {
         return this.name;
@@ -163,198 +131,63 @@ public class WeblogBookmarkFolder implem
         this.name = name;
     }
     
-    
-    /**
-     * A full description for this folder.
-     */
-    public String getDescription() {
-        return this.description;
-    }
-    
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    /**
-     * The full path to this folder in the hierarchy.
-     */
-    public String getPath() {
-        return this.path;
-    }
-    
-    public void setPath(String path) {
-        this.path = path;
-    }
-
     /**
      * Get the weblog which owns this folder.
      */
-    public Weblog getWebsite() {
-        return website;
+    public Weblog getWeblog() {
+        return weblog;
     }
     
-    public void setWebsite( Weblog website ) {
-        this.website = website;
+    public void setWeblog( Weblog website ) {
+        this.weblog = website;
     }
 
     /**
-     * Return parent folder, or null if folder is root of hierarchy.
-     */
-    public WeblogBookmarkFolder getParent() {
-        return this.parentFolder;
-    }
-    
-    public void setParent(WeblogBookmarkFolder parent) {
-        this.parentFolder = parent;
-    }
-    
-    
-    /**
-     * Get child folders of this folder.
-     */
-    public Set getFolders() {
-        return this.childFolders;
-    }
-    
-    private void setFolders(Set folders) {
-        this.childFolders = folders;
-    }
-    
-    
-    /**
      * Get bookmarks contained in this folder.
      */
-    public Set getBookmarks() {
+    public List<WeblogBookmark> getBookmarks() {
         return this.bookmarks;
     }
     
     // this is private to force the use of add/remove bookmark methods.
-    private void setBookmarks(Set bookmarks) {
+    private void setBookmarks(List<WeblogBookmark> bookmarks) {
         this.bookmarks = bookmarks;
     }
-    
-    
-    /**
-     * Add a folder as a child of this folder.
-     */
-    public void addFolder(WeblogBookmarkFolder folder) {
-        
-        // make sure folder is not null
-        if(folder == null || folder.getName() == null) {
-            throw new IllegalArgumentException("Folder cannot be null and must have a valid name");
-        }
-        
-        // make sure we don't already have a folder with that name
-        if(this.hasFolder(folder.getName())) {
-            throw new IllegalArgumentException("Duplicate folder name '"+folder.getName()+"'");
-        }
-        
-        // set ourselves as the parent of the folder
-        folder.setParent(this);
-        
-        // add it to our list of child folder
-        getFolders().add(folder);
-    }
-    
-    
+
     /** 
      * Add a bookmark to this folder.
      */
-    public void addBookmark(WeblogBookmark bookmark) throws WebloggerException {
+    public void addBookmark(WeblogBookmark bookmark) {
+        for (WeblogBookmark bookmarkItem : bookmarks) {
+            if (bookmarkItem.getId().equals(bookmark.getId())) {
+                // already in bookmark list
+                return;
+            }
+        }
         bookmark.setFolder(this);
         getBookmarks().add(bookmark);
     }
-    
-    
-    /**
-     * @param subfolders
-     */
-    public List retrieveBookmarks(boolean subfolders) throws WebloggerException {
-        BookmarkManager bmgr = WebloggerFactory.getWeblogger().getBookmarkManager();
-        return bmgr.getBookmarks(this, subfolders);
-    }
-    
-    
-    /**
-     * Does this folder have a child folder with the specified name?
-     *
-     * @param name The name of the folder to check for.
-     * @return boolean true if child folder exists, false otherwise.
-     */
-    public boolean hasFolder(String name) {
-        Iterator folders = this.getFolders().iterator();
-        WeblogBookmarkFolder folder = null;
-        while(folders.hasNext()) {
-            folder = (WeblogBookmarkFolder) folders.next();
-            if(name.equals(folder.getName())) {
+
+    public boolean hasBookmarkOfName(String bookmarkName) {
+        for (WeblogBookmark bookmark : bookmarks) {
+            if (bookmark.getName().equals(bookmarkName)) {
                 return true;
             }
         }
         return false;
     }
     
-    
     /**
-     * Is this folder a descendent of the other folder?
      */
-    public boolean descendentOf(WeblogBookmarkFolder ancestor) {
-        
-        // if this is a root node then we can't be a descendent
-        if(getParent() == null) {
-            return false;
-        } else {
-            // if our path starts with our parents path then we are a descendent
-            return getPath().startsWith(ancestor.getPath());
-        }
+    public List<WeblogBookmark> retrieveBookmarks() throws WebloggerException {
+        BookmarkManager bmgr = WebloggerFactory.getWeblogger().getBookmarkManager();
+        return bmgr.getBookmarks(this);
     }
-    
-    
-    // convenience method for updating the folder name, which triggers a path tree rebuild
+
+    // convenience method for updating the folder name
     public void updateName(String newName) throws WebloggerException {
-        
-        // update name
         setName(newName);
-        
-        // calculate path
-        if(getParent() == null) {
-            setPath("/");
-        } else if("/".equals(getParent().getPath())) {
-            setPath("/"+getName());
-        } else {
-            setPath(getParent().getPath() + "/" + getName());
-        }
-        
-        // update path tree for all children
-        updatePathTree(this);
-    }
-    
-    
-    // update the path tree for a given folder
-    public static void updatePathTree(WeblogBookmarkFolder folder) 
-            throws WebloggerException {
-        
-        log.debug("Updating path tree for folder "+folder.getPath());
-        
-        WeblogBookmarkFolder childFolder = null;
-        Iterator childFolders = folder.getFolders().iterator();
-        while(childFolders.hasNext()) {
-            childFolder = (WeblogBookmarkFolder) childFolders.next();
-            
-            log.debug("OLD child folder path was "+childFolder.getPath());
-            
-            // update path and save
-            if("/".equals(folder.getPath())) {
-                childFolder.setPath("/" + childFolder.getName());
-            } else {
-                childFolder.setPath(folder.getPath() + "/" + childFolder.getName());
-            }
-            WebloggerFactory.getWeblogger().getBookmarkManager().saveFolder(childFolder);
-            
-            log.debug("NEW child folder path is "+ childFolder.getPath());
-            
-            // then make recursive call to update this folders children
-            updatePathTree(childFolder);
-        }
+        WebloggerFactory.getWeblogger().getBookmarkManager().saveFolder(this);
     }
     
 }

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogBookmarkFolder.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogBookmarkFolder.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java Sun Apr 20 13:38:51 2014
@@ -19,14 +19,9 @@
 package org.apache.roller.weblogger.pojos;
 
 import java.io.Serializable;
-import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
-import java.util.Set;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.WeblogEntryManager;
@@ -36,31 +31,25 @@ import org.apache.roller.util.UUIDGenera
 /**
  * Weblog Category.
  */
-public class WeblogCategory implements Serializable, Comparable {
+public class WeblogCategory implements Serializable, Comparable<WeblogCategory> {
     
     public static final long serialVersionUID = 1435782148712018954L;
     
-    private static Log log = LogFactory.getLog(WeblogCategory.class);
-    
     // attributes
     private String id = UUIDGenerator.generateUUID();
     private String name = null;
     private String description = null;
     private String image = null;
-    private String path = null;
-    
+    private int position;
+
     // associations
-    private Weblog website = null;
-    private WeblogCategory parentCategory = null;
-    private Set childCategories = new HashSet();
-    
-    
+    private Weblog weblog = null;
+
     public WeblogCategory() {
     }
     
     public WeblogCategory(
-            Weblog website,
-            WeblogCategory parent,
+            Weblog weblog,
             String name,
             String description,
             String image) {
@@ -69,16 +58,13 @@ public class WeblogCategory implements S
         this.description = description;
         this.image = image;
         
-        this.website = website;
-        this.parentCategory = parent;
-
-        // calculate path
-        if(parent == null) {
-            this.path = "/";
-        } else if("/".equals(parent.getPath())) {
-            this.path = "/"+name;
+        this.weblog = weblog;
+        weblog.getWeblogCategories().add(this);
+        int size = weblog.getWeblogCategories().size();
+        if (size == 1) {
+            this.position = 0;
         } else {
-            this.path = parent.getPath() + "/" + name;
+            this.position = weblog.getWeblogCategories().get(size - 2).getPosition() + 1;
         }
     }
     
@@ -89,11 +75,12 @@ public class WeblogCategory implements S
         StringBuilder buf = new StringBuilder();
         buf.append("{");
         buf.append(getId());
-        buf.append(", ").append(getPath());
+        buf.append(", ").append(getName());
         buf.append("}");
         return buf.toString();
     }
     
+    @Override
     public boolean equals(Object other) {
         
         if (other == null) {
@@ -101,31 +88,30 @@ public class WeblogCategory implements S
         }
         
         if (other instanceof WeblogCategory) {
-            WeblogCategory o = (WeblogCategory)other;
+            WeblogCategory o = (WeblogCategory) other;
             return new EqualsBuilder()
-                .append(getPath(), o.getPath()) 
-                //.append(getWebsite(), o.getWebsite()) 
+                .append(getName(), o.getName())
+                .append(getWeblog(), o.getWeblog())
                 .isEquals();
         }        
         return false;
     }
-        
+
+    @Override
     public int hashCode() {
         return new HashCodeBuilder()
-            .append(getPath())
-            //.append(getWebsite())
+            .append(getName())
+            .append(getWeblog())
             .toHashCode();
     }
     
     /**
      * @see java.lang.Comparable#compareTo(java.lang.Object)
      */
-    public int compareTo(Object o) {
-        WeblogCategory other = (WeblogCategory)o;
+    public int compareTo(WeblogCategory other) {
         return getName().compareTo(other.getName());
     }
-    
-    
+
     /**
      * Database surrogate key.
      */
@@ -160,8 +146,18 @@ public class WeblogCategory implements S
     public void setDescription(String description) {
         this.description = description;
     }
-    
-    
+
+    /**
+     * A 0-based position indicator for desired display order of that category.
+     */
+    public int getPosition() {
+        return position;
+    }
+
+    public void setPosition(int position) {
+        this.position = position;
+    }
+
     /**
      * An image icon to represent this category.
      */
@@ -173,129 +169,37 @@ public class WeblogCategory implements S
         this.image = image;
     }
     
-    
-    /**
-     * The full path to this category in the hierarchy.
-     */
-    public String getPath() {
-        return this.path;
-    }
-    
-    public void setPath(String path) {
-        this.path = path;
-    }
-    
-    
     /**
      * Get the weblog which owns this category.
      */
-    public Weblog getWebsite() {
-        return website;
+    public Weblog getWeblog() {
+        return weblog;
     }
     
-    public void setWebsite(Weblog website) {
-        this.website = website;
+    public void setWeblog(Weblog weblog) {
+        this.weblog = weblog;
     }
-    
-    
-    /**
-     * Get parent category, or null if category is root of hierarchy.
-     */
-    public WeblogCategory getParent() {
-        return this.parentCategory;
-    }
-    
-    public void setParent(WeblogCategory parent) {
-        this.parentCategory = parent;
-    }
-    
-    
-    /**
-     * Get child categories of this category.
-     */
-    public Set getWeblogCategories() {
-        return this.childCategories;
-    }
-    
-    private void setWeblogCategories(Set cats) {
-        this.childCategories = cats;
-    }
-    
-    
+
     /**
-     * Retrieve all weblog entries in this category and, optionally, include
-     * weblog entries all sub-categories.
+     * Retrieve all weblog entries in this category.
      *
-     * @param subcats True if entries from sub-categories are to be returned.
+     * @param publishedOnly True if desired to return only published entries
      * @return List of WeblogEntryData objects.
      * @throws WebloggerException
      */
-    public List retrieveWeblogEntries(boolean subcats) throws WebloggerException {
+    public List<WeblogEntry> retrieveWeblogEntries(boolean publishedOnly) throws WebloggerException {
         WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-        return wmgr.getWeblogEntries(this, subcats);
-    }
-    
-    
-    /**
-     * Add a category as a child of this category.
-     */
-    public void addCategory(WeblogCategory category) {
-        
-        // make sure category is not null
-        if(category == null || category.getName() == null) {
-            throw new IllegalArgumentException("Category cannot be null and must have a valid name");
+        WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+        wesc.setWeblog(weblog);
+        wesc.setCatName(this.getName());
+        if (publishedOnly) {
+            wesc.setStatus(WeblogEntry.PUBLISHED);
         }
-        
-        // make sure we don't already have a category with that name
-        if(this.hasCategory(category.getName())) {
-            throw new IllegalArgumentException("Duplicate category name '"+category.getName()+"'");
-        }
-        
-        // set ourselves as the parent of the category
-        category.setParent(this);
-        
-        // add it to our list of child categories
-        getWeblogCategories().add(category);
+        return wmgr.getWeblogEntries(wesc);
     }
     
-    
     /**
-     * Does this category have a child category with the specified name?
-     *
-     * @param name The name of the category to check for.
-     * @return boolean true if child category exists, false otherwise.
-     */
-    public boolean hasCategory(String name) {
-        Iterator cats = this.getWeblogCategories().iterator();
-        WeblogCategory cat = null;
-        while(cats.hasNext()) {
-            cat = (WeblogCategory) cats.next();
-            if(name.equals(cat.getName())) {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-    
-    /**
-     * Is this category a descendent of the other category?
-     */
-    public boolean descendentOf(WeblogCategory ancestor) {
-        
-        // if this is a root node then we can't be a descendent
-        if(getParent() == null) {
-            return false;
-        } else {
-            // if our path starts with our parents path then we are a descendent
-            return getPath().startsWith(ancestor.getPath());
-        }
-    }
-    
-    
-    /**
-     * Determine if category is in use. Returns true if any weblog entries
-     * use this category or any of it's subcategories.
+     * Returns true if category is in use.
      */
     public boolean isInUse() {
         try {
@@ -304,54 +208,12 @@ public class WeblogCategory implements S
             throw new RuntimeException(e);
         }
     }
-    
-    
-    // convenience method for updating the category name, which triggers a path tree rebuild
+
+    /**
+     * Convenience method for updating the category name
+     */
     public void updateName(String newName) throws WebloggerException {
-        
-        // update name
         setName(newName);
-        
-        // calculate path
-        if(getParent() == null) {
-            setPath("/");
-        } else if("/".equals(getParent().getPath())) {
-            setPath("/"+getName());
-        } else {
-            setPath(getParent().getPath() + "/" + getName());
-        }
-        
-        // update path tree for all children
-        updatePathTree(this);
+        WebloggerFactory.getWeblogger().getWeblogEntryManager().saveWeblogCategory(this);
     }
-    
-    
-    // updates the paths of all descendents of the given category
-    public static void updatePathTree(WeblogCategory cat) 
-            throws WebloggerException {
-        
-        log.debug("Updating path tree for category "+cat.getPath());
-        
-        WeblogCategory childCat = null;
-        Iterator childCats = cat.getWeblogCategories().iterator();
-        while(childCats.hasNext()) {
-            childCat = (WeblogCategory) childCats.next();
-            
-            log.debug("OLD child category path was "+childCat.getPath());
-            
-            // update path and save
-            if("/".equals(cat.getPath())) {
-                childCat.setPath("/" + childCat.getName());
-            } else {
-                childCat.setPath(cat.getPath() + "/" + childCat.getName());
-            }
-            WebloggerFactory.getWeblogger().getWeblogEntryManager().saveWeblogCategory(childCat);
-            
-            log.debug("NEW child category path is "+ childCat.getPath());
-            
-            // then make recursive call to update this cats children
-            updatePathTree(childCat);
-        }
-    }
-    
 }

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java Sun Apr 20 13:38:51 2014
@@ -29,7 +29,6 @@ import java.util.Calendar;
 import java.util.Collections;
 import java.util.Date;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -37,13 +36,14 @@ import java.util.Set;
 import java.util.StringTokenizer;
 import java.util.TreeSet;
 
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.util.DateUtil;
+import org.apache.roller.util.RollerConstants;
 import org.apache.roller.util.UUIDGenerator;
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.UserManager;
@@ -58,8 +58,6 @@ import org.apache.roller.weblogger.util.
 
 /**
  * Represents a Weblog Entry.
- *
- * @struts.form include-all="true"
  */
 public class WeblogEntry implements Serializable {
     private static Log mLogger =
@@ -101,11 +99,11 @@ public class WeblogEntry implements Seri
     private WeblogCategory category = null;
     
     // Collection of name/value entry attributes
-    private Set attSet = new TreeSet();
+    private Set<WeblogEntryAttribute> attSet = new TreeSet<WeblogEntryAttribute>();
     
-    private Set tagSet = new HashSet(); 
-    private Set removedTags = new HashSet();
-    private Set addedTags = new HashSet();
+    private Set<WeblogEntryTag> tagSet = new HashSet<WeblogEntryTag>();
+    private Set<String> removedTags = new HashSet<String>();
+    private Set<String> addedTags = new HashSet<String>();
     
     //----------------------------------------------------------- Construction
     
@@ -227,19 +225,14 @@ public class WeblogEntry implements Seri
        
     /**
      * Return collection of WeblogCategory objects of this entry.
-     * Added for symetry with PlanetEntryData object.
+     * Added for symmetry with PlanetEntryData object.
      */
-    public List getCategories() {
-        List cats = new ArrayList();
+    public List<WeblogCategory> getCategories() {
+        List<WeblogCategory> cats = new ArrayList<WeblogCategory>();
         cats.add(getCategory());
         return cats;
     }
     
-    /** No-op method to please XDoclet */
-    public void setCategories(List cats) {
-        // no-op
-    }
-    
     public Weblog getWebsite() {
         return this.website;
     }
@@ -352,10 +345,8 @@ public class WeblogEntry implements Seri
     }
     
     //-------------------------------------------------------------------------
-    /**
-     * Map attributes as set because XDoclet 1.2b4 map support is broken.
-     */
-    public Set getEntryAttributes() {
+
+    public Set<WeblogEntryAttribute> getEntryAttributes() {
         return attSet;
     }
 
@@ -363,13 +354,9 @@ public class WeblogEntry implements Seri
         this.attSet = atts;
     }
     
-    /**
-     * Would be named getEntryAttribute, but that would set off XDoclet
-     */
     public String findEntryAttribute(String name) {
         if (getEntryAttributes() != null) {
-            for (Iterator it = getEntryAttributes().iterator(); it.hasNext(); ) {
-                WeblogEntryAttribute att = (WeblogEntryAttribute) it.next();
+            for (WeblogEntryAttribute att : getEntryAttributes()) {
                 if (name.equals(att.getName())) {
                     return att.getValue();
                 }
@@ -380,8 +367,7 @@ public class WeblogEntry implements Seri
         
     public void putEntryAttribute(String name, String value) throws Exception {
         WeblogEntryAttribute att = null;
-        for (Iterator it = getEntryAttributes().iterator(); it.hasNext(); ) {
-            WeblogEntryAttribute o = (WeblogEntryAttribute) it.next();
+        for (WeblogEntryAttribute o : getEntryAttributes()) {
             if (name.equals(o.getName())) {
                 att = o; 
                 break;
@@ -537,7 +523,7 @@ public class WeblogEntry implements Seri
         this.locale = locale;
     }
     
-     public Set<WeblogEntryTag> getTags()
+    public Set<WeblogEntryTag> getTags()
      {
          return tagSet;
      }
@@ -563,8 +549,7 @@ public class WeblogEntry implements Seri
             return;
         }
         
-        for (Iterator it = getTags().iterator(); it.hasNext();) {
-            WeblogEntryTag tag = (WeblogEntryTag) it.next();
+        for (WeblogEntryTag tag : getTags()) {
             if (tag.getName().equals(name)) {
                 return;
             }
@@ -599,19 +584,17 @@ public class WeblogEntry implements Seri
             return;
         }
         
-        HashSet newTags = new HashSet(updatedTags.size());
+        Set<String> newTags = new HashSet<String>(updatedTags.size());
         Locale localeObject = getWebsite() != null ? getWebsite().getLocaleInstance() : Locale.getDefault();
         
-        for(Iterator<String> it = updatedTags.iterator(); it.hasNext();) {
-            String name = it.next();
+        for (String name : updatedTags) {
             newTags.add(Utilities.normalizeTag(name, localeObject));
         }
         
-        HashSet removeTags = new HashSet();
+        Set<String> removeTags = new HashSet<String>();
 
         // remove old ones no longer passed.
-        for (Iterator it = getTags().iterator(); it.hasNext();) {
-            WeblogEntryTag tag = (WeblogEntryTag) it.next();
+        for (WeblogEntryTag tag : getTags()) {
             if (!newTags.contains(tag.getName())) {
                 removeTags.add(tag.getName());
             } else {
@@ -619,13 +602,13 @@ public class WeblogEntry implements Seri
             }
         }
 
-        WeblogEntryManager weblogManager = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-        for (Iterator it = removeTags.iterator(); it.hasNext();) {
-            weblogManager.removeWeblogEntryTag((String) it.next(), this);
+        WeblogEntryManager weblogEntryManager = WebloggerFactory.getWeblogger().getWeblogEntryManager();
+        for (String removeTag : removeTags) {
+            weblogEntryManager.removeWeblogEntryTag(removeTag, this);
         }
         
-        for (Iterator it = newTags.iterator(); it.hasNext();) {
-            addTag((String) it.next());
+        for (String newTag : newTags) {
+            addTag(newTag);
         }
     }
    
@@ -634,8 +617,8 @@ public class WeblogEntry implements Seri
         // Sort by name
         Set<WeblogEntryTag> tmp = new TreeSet<WeblogEntryTag>(new WeblogEntryTagComparator());
         tmp.addAll(getTags());
-        for (Iterator it = tmp.iterator(); it.hasNext();) {
-            sb.append(((WeblogEntryTag) it.next()).getName()).append(" ");
+        for (WeblogEntryTag entryTag : tmp) {
+            sb.append(entryTag.getName()).append(" ");
         }
         if (sb.length() > 0) {
             sb.deleteCharAt(sb.length() - 1);
@@ -743,27 +726,23 @@ public class WeblogEntry implements Seri
     
     //------------------------------------------------------------------------
     
-    public List getComments() {
+    public List<WeblogEntryComment> getComments() {
         return getComments(true, true);
     }
     
     /**
      * TODO: why is this method exposed to users with ability to get spam/non-approved comments?
      */
-    public List getComments(boolean ignoreSpam, boolean approvedOnly) {
-        List list = new ArrayList();
+    public List<WeblogEntryComment> getComments(boolean ignoreSpam, boolean approvedOnly) {
+        List<WeblogEntryComment> list = new ArrayList<WeblogEntryComment>();
         try {
             WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-            return wmgr.getComments(
-                    getWebsite(),
-                    this,
-                    null,  // search String
-                    null,  // startDate
-                    null,
-                    approvedOnly ? WeblogEntryComment.APPROVED : null,
-                    false, // we want chrono order
-                    0,    // offset
-                    -1);   // no limit
+
+            CommentSearchCriteria csc = new CommentSearchCriteria();
+            csc.setWeblog(getWebsite());
+            csc.setEntry(this);
+            csc.setStatus(approvedOnly ? WeblogEntryComment.APPROVED : null);
+            return wmgr.getComments(csc);
         } catch (WebloggerException alreadyLogged) {}
         return list;
     }
@@ -773,11 +752,6 @@ public class WeblogEntry implements Seri
         return comments.size();
     }
     
-    /** No-op to please XDoclet */
-    public void setCommentCount(int ignored) {
-        // no-op
-    }
-    
     public List getReferers() {
         List referers = null;
         try {
@@ -819,13 +793,6 @@ public class WeblogEntry implements Seri
         return getPermaLink() + "#comments";
     }
     
-    /** 
-     * to please XDoclet 
-     * @deprecated Use commentLink() instead
-     */
-    public void setCommentsLink(String ignored) {}
-    
-    
     /**
      * Return the Title of this post, or the first 255 characters of the
      * entry's text.
@@ -834,7 +801,7 @@ public class WeblogEntry implements Seri
      */
     public String getDisplayTitle() {
         if ( getTitle()==null || getTitle().trim().equals("") ) {
-            return StringUtils.left(Utilities.removeHTML(getText()),255);
+            return StringUtils.left(Utilities.removeHTML(getText()), RollerConstants.TEXTWIDTH_255);
         }
         return Utilities.removeHTML(getTitle());
     }
@@ -850,7 +817,7 @@ public class WeblogEntry implements Seri
      * Return RSS 09x style description (escaped HTML version of entry text)
      */
     public String getRss09xDescription(int maxLength) {
-        String ret = StringEscapeUtils.escapeHtml(getText());
+        String ret = StringEscapeUtils.escapeHtml3(getText());
         if (maxLength != -1 && ret.length() > maxLength) {
             ret = ret.substring(0,maxLength-3)+"...";
         }
@@ -929,63 +896,42 @@ public class WeblogEntry implements Seri
      * Convenience method to transform mPlugins to a List
      * @return
      */
-    public List getPluginsList() {
+    public List<String> getPluginsList() {
         if (getPlugins() != null) {
             return Arrays.asList( StringUtils.split(getPlugins(), ",") );
         }
-        return new ArrayList();
+        return new ArrayList<String>();
     }    
     
     /** Convenience method for checking status */
     public boolean isDraft() {
         return getStatus().equals(DRAFT);
     }
-    /** no-op: needed only to satisfy XDoclet, use setStatus() instead */
-    public void setDraft(boolean value) {
-    }
-    
+
     /** Convenience method for checking status */
     public boolean isPending() {
         return getStatus().equals(PENDING);
     }
-    /** no-op: needed only to satisfy XDoclet, use setStatus() instead */
-    public void setPending(boolean value) {
-    }
-    
+
     /** Convenience method for checking status */
     public boolean isPublished() {
         return getStatus().equals(PUBLISHED);
     }
-    /** no-op: needed only to satisfy XDoclet, use setStatus() instead */
-    public void setPublished(boolean value) {
-    }
-  
+
     /**
      * Get entry text, transformed by plugins enabled for entry.
      */
     public String getTransformedText() {
         return render(getText());
     }
-    /**
-     * No-op to please XDoclet.
-     */
-    public void setTransformedText(String t) {
-        // no-op
-    }
-    
+
     /**
      * Get entry summary, transformed by plugins enabled for entry.
      */
     public String getTransformedSummary() {
         return render(getSummary());
     }
-    /**
-     * No-op to please XDoclet.
-     */
-    public void setTransformedSummary(String t) {
-        // no-op
-    }    
-    
+
     /**
      * Determine if the specified user has permissions to edit this entry.
      */
@@ -1028,7 +974,7 @@ public class WeblogEntry implements Seri
     private String render(String str) {
         String ret = str;
         mLogger.debug("Applying page plugins to string");
-        Map inPlugins = getWebsite().getInitializedPlugins();
+        Map<String, WeblogEntryPlugin> inPlugins = getWebsite().getInitializedPlugins();
         if (str != null && inPlugins != null) {
             List entryPlugins = getPluginsList();
             
@@ -1038,11 +984,9 @@ public class WeblogEntry implements Seri
                 // now loop over mPagePlugins, matching
                 // against Entry plugins (by name):
                 // where a match is found render Plugin.
-                Iterator iter = inPlugins.keySet().iterator();
-                while (iter.hasNext()) {
-                    String key = (String)iter.next();
-                    if (entryPlugins.contains(key)) {
-                        WeblogEntryPlugin pagePlugin = (WeblogEntryPlugin) inPlugins.get(key);
+                for (Map.Entry<String, WeblogEntryPlugin> entry : inPlugins.entrySet()) {
+                    if (entryPlugins.contains(entry.getKey())) {
+                        WeblogEntryPlugin pagePlugin = entry.getValue();
                         try {
                             ret = pagePlugin.render(this, ret);
                         } catch (Exception e) {
@@ -1084,7 +1028,7 @@ public class WeblogEntry implements Seri
                 displayContent = this.getTransformedSummary();
                 if(StringUtils.isNotEmpty(this.getText())) {
                     // add read more
-                    List args = new ArrayList();
+                    List<String> args = new ArrayList<String>();
                     args.add(readMoreLink);
                     
                     // TODO: we need a more appropriate way to get the view locale here
@@ -1108,6 +1052,4 @@ public class WeblogEntry implements Seri
         return displayContent(null);
     }
 
-    /** No-op method to please XDoclet */
-    public void setDisplayContent(String ignored) {}
 }

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryAttribute.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryAttribute.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryAttribute.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryAttribute.java Sun Apr 20 13:38:51 2014
@@ -18,15 +18,15 @@
 
 package org.apache.roller.weblogger.pojos;
 
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.roller.util.UUIDGenerator;
 
 
 /**
  * Weblog entry attribute.
  */
-public class WeblogEntryAttribute implements Comparable {
+public class WeblogEntryAttribute implements Comparable<WeblogEntryAttribute> {
     
     private String id = UUIDGenerator.generateUUID();
     private WeblogEntry entry;
@@ -107,8 +107,7 @@ public class WeblogEntryAttribute implem
         .toHashCode();
     }
     
-    public int compareTo(Object o) {
-        WeblogEntryAttribute att = (WeblogEntryAttribute)o;
+    public int compareTo(WeblogEntryAttribute att) {
         return getName().compareTo(att.getName());
     }
     

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryAttribute.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryAttribute.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryComment.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryComment.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryComment.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryComment.java Sun Apr 20 13:38:51 2014
@@ -20,8 +20,8 @@ package org.apache.roller.weblogger.pojo
 
 import java.io.Serializable;
 import java.sql.Timestamp;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.roller.util.UUIDGenerator;
 
 

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryComment.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryComment.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java Sun Apr 20 13:38:51 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,13 +15,12 @@
  * 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;
 import java.sql.Timestamp;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.util.UUIDGenerator;

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTag.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTagAggregate.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTagAggregate.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTagAggregate.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTagAggregate.java Sun Apr 20 13:38:51 2014
@@ -20,8 +20,8 @@ package org.apache.roller.weblogger.pojo
 
 import java.io.Serializable;
 import java.sql.Timestamp;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.roller.util.UUIDGenerator;
 
 

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTagAggregate.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryTagAggregate.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryWrapperComparator.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryWrapperComparator.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryWrapperComparator.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryWrapperComparator.java Sun Apr 20 13:38:51 2014
@@ -33,25 +33,20 @@ public class WeblogEntryWrapperComparato
 {
     static final long serialVersionUID = -9067148992322255150L;
     
-    public int compare(Object val1, Object val2)
-    throws ClassCastException
-    {
+    public int compare(Object val1, Object val2) {
         WeblogEntryWrapper entry1 = (WeblogEntryWrapper)val1;
         WeblogEntryWrapper entry2 = (WeblogEntryWrapper)val2;
         long pubTime1 = entry1.getPubTime().getTime();
         long pubTime2 = entry2.getPubTime().getTime();
 
-        if (pubTime1 > pubTime2)
-        {
+        if (pubTime1 > pubTime2) {
             return -1;
         }
-        else if (pubTime1 < pubTime2)
-        {
+        else if (pubTime1 < pubTime2) {
             return 1;
         }
 
-        // if pubTimes are the same, return
-        // results of String.compareTo() on Title
+        // if pubTimes are the same, return results of String.compareTo() on Title
         return entry1.getTitle().compareTo(entry2.getTitle());
     }
 }

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryWrapperComparator.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntryWrapperComparator.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogHitCount.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogHitCount.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogHitCount.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogHitCount.java Sun Apr 20 13:38:51 2014
@@ -19,7 +19,7 @@
 package org.apache.roller.weblogger.pojos;
 
 import java.io.Serializable;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.roller.util.UUIDGenerator;
 
 

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogHitCount.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogHitCount.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogPermission.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogPermission.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogPermission.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogPermission.java Sun Apr 20 13:38:51 2014
@@ -22,16 +22,14 @@ import java.io.Serializable;
 import java.security.Permission;
 import java.util.ArrayList;
 import java.util.List;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 
 
 /**
  * Permission for one specific weblog
- * @struts.form include-all="true"
- *
  * @author Dave Johnson
  */
 public class WeblogPermission extends ObjectPermission implements Serializable {

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogPermission.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogPermission.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogReferrer.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogReferrer.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogReferrer.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogReferrer.java Sun Apr 20 13:38:51 2014
@@ -19,9 +19,10 @@
 package org.apache.roller.weblogger.pojos;
 
 import java.io.Serializable;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.roller.util.RollerConstants;
 import org.apache.roller.util.UUIDGenerator;
 
 
@@ -75,8 +76,8 @@ public class WeblogReferrer implements S
         this.dayHits = dayHits;
         this.totalHits = totalHits;
 
-        if (this.refererUrl != null && this.refererUrl.length() > 255) {
-            this.refererUrl = this.refererUrl.substring(0, 254);
+        if (this.refererUrl != null && this.refererUrl.length() > RollerConstants.TEXTWIDTH_255) {
+            this.refererUrl = this.refererUrl.substring(0, RollerConstants.TEXTWIDTH_255);
         }
     }
     
@@ -135,8 +136,8 @@ public class WeblogReferrer implements S
     }
     
     public void setRefererUrl(String refererUrl) {
-        if (refererUrl != null && refererUrl.length() > 255) {
-            refererUrl = refererUrl.substring(0, 255);
+        if (refererUrl != null && refererUrl.length() > RollerConstants.TEXTWIDTH_255) {
+            refererUrl = refererUrl.substring(0, RollerConstants.TEXTWIDTH_255);
         }
         this.refererUrl = refererUrl;
     }
@@ -232,7 +233,7 @@ public class WeblogReferrer implements S
     public String getDisplayUrl(int maxWidth, boolean includeHits) {
         StringBuilder sb = new StringBuilder();
         
-        String url = StringEscapeUtils.escapeHtml(getUrl());
+        String url = StringEscapeUtils.escapeHtml4(getUrl());
         String displayUrl = url.trim();
         String restOfUrl = null;
         

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogReferrer.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogReferrer.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogTemplate.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogTemplate.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogTemplate.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogTemplate.java Sun Apr 20 13:38:51 2014
@@ -18,8 +18,8 @@
 
 package org.apache.roller.weblogger.pojos;
 
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.util.UUIDGenerator;

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogTemplate.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogTemplate.java:r1546818-1588713

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogTheme.java
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogTheme.java:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.java Sun Apr 20 13:38:51 2014
@@ -18,8 +18,8 @@
 
 package org.apache.roller.weblogger.pojos;
 
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.roller.util.UUIDGenerator;
 
 import java.io.Serializable;



Mime
View raw message