roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1571648 - in /roller/trunk/app/src/main/java/org/apache/roller/weblogger: ./ pojos/ pojos/wrapper/ ui/struts2/editor/
Date Tue, 25 Feb 2014 11:10:11 GMT
Author: gmazza
Date: Tue Feb 25 11:10:11 2014
New Revision: 1571648

URL: http://svn.apache.org/r1571648
Log:
Updates to CategoryRemove, deleted no longer needed WeblogCategoryPathComparator.

Removed:
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategoryPathComparator.java
Modified:
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/TestUtils.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogCategoryWrapper.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Categories.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryRemove.java

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/TestUtils.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/TestUtils.java?rev=1571648&r1=1571647&r2=1571648&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/TestUtils.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/TestUtils.java Tue Feb 25 11:10:11
2014
@@ -26,7 +26,6 @@ package org.apache.roller.weblogger;
 import java.io.InputStream;
 import java.sql.Connection;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.roller.planet.business.PlanetManager;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java?rev=1571648&r1=1571647&r2=1571648&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategory.java Tue
Feb 25 11:10:11 2014
@@ -19,9 +19,7 @@
 package org.apache.roller.weblogger.pojos;
 
 import java.io.Serializable;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 import org.apache.commons.lang3.builder.EqualsBuilder;
 import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.commons.logging.Log;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogCategoryWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogCategoryWrapper.java?rev=1571648&r1=1571647&r2=1571648&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogCategoryWrapper.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogCategoryWrapper.java
Tue Feb 25 11:10:11 2014
@@ -21,7 +21,6 @@ package org.apache.roller.weblogger.pojo
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Set;
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.pojos.WeblogCategory;

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Categories.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Categories.java?rev=1571648&r1=1571647&r2=1571648&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Categories.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Categories.java
Tue Feb 25 11:10:11 2014
@@ -20,16 +20,12 @@ package org.apache.roller.weblogger.ui.s
 
 import java.util.Collections;
 import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.WeblogEntryManager;
 import org.apache.roller.weblogger.pojos.WeblogCategory;
-import org.apache.roller.weblogger.pojos.WeblogCategoryPathComparator;
 import org.apache.roller.weblogger.pojos.WeblogPermission;
 import org.apache.roller.weblogger.ui.struts2.util.UIAction;
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryRemove.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryRemove.java?rev=1571648&r1=1571647&r2=1571648&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryRemove.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryRemove.java
Tue Feb 25 11:10:11 2014
@@ -18,10 +18,9 @@
 
 package org.apache.roller.weblogger.ui.struts2.editor;
 
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -29,7 +28,6 @@ import org.apache.roller.weblogger.Weblo
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.WeblogEntryManager;
 import org.apache.roller.weblogger.pojos.WeblogCategory;
-import org.apache.roller.weblogger.pojos.WeblogCategoryPathComparator;
 import org.apache.roller.weblogger.pojos.WeblogPermission;
 import org.apache.roller.weblogger.ui.struts2.util.UIAction;
 import org.apache.roller.weblogger.util.cache.CacheManager;
@@ -50,9 +48,9 @@ public class CategoryRemove extends UIAc
     
     // category id of the category to move to
     private String targetCategoryId = null;
-    
+
     // all categories from the action weblog
-    private Set allCategories = Collections.EMPTY_SET;
+    private List<WeblogCategory> allCategories = new ArrayList<WeblogCategory>();
     
     
     public CategoryRemove() {
@@ -83,33 +81,22 @@ public class CategoryRemove extends UIAc
      * Display the remove template confirmation.
      */
     public String execute() {
-        
-        // build list of categories for display
-        TreeSet allCategoriesSet = new TreeSet(new WeblogCategoryPathComparator());
-        
         try {
-            // Build list of all categories, except for current one, sorted by path.
+            // Build list of categories that the removed category's blog entries (if any)
can be moved to
             WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
             List<WeblogCategory> cats = wmgr.getWeblogCategories(getActionWeblog());
             for(WeblogCategory cat : cats) {
                 if (!cat.getId().equals(getRemoveId())) {
-                    allCategoriesSet.add(cat);
+                    allCategories.add(cat);
                 }
             }
         } catch (WebloggerException ex) {
             log.error("Error building categories list", ex);
-            // TODO: i18n
             addError("Error building categories list");
         }
-        
-        if (allCategoriesSet.size() > 0) {
-            setAllCategories(allCategoriesSet);
-        }
-        
         return INPUT;
     }
-    
-    
+
     /**
      * Remove a new template.
      */
@@ -172,11 +159,11 @@ public class CategoryRemove extends UIAc
         this.targetCategoryId = targetCategoryId;
     }
 
-    public Set getAllCategories() {
+    public List<WeblogCategory> getAllCategories() {
         return allCategories;
     }
 
-    public void setAllCategories(Set allCategories) {
+    public void setAllCategories(List<WeblogCategory> allCategories) {
         this.allCategories = allCategories;
     }
     



Mime
View raw message