roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r394185 - /incubator/roller/branches/roller-newbackend/src/org/roller/pojos/WeblogCategoryData.java
Date Fri, 14 Apr 2006 20:18:49 GMT
Author: agilliland
Date: Fri Apr 14 13:18:46 2006
New Revision: 394185

URL: http://svn.apache.org/viewcvs?rev=394185&view=rev
Log:
remove old save(), remove(), and moveContents() methods.


Modified:
    incubator/roller/branches/roller-newbackend/src/org/roller/pojos/WeblogCategoryData.java

Modified: incubator/roller/branches/roller-newbackend/src/org/roller/pojos/WeblogCategoryData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller-newbackend/src/org/roller/pojos/WeblogCategoryData.java?rev=394185&r1=394184&r2=394185&view=diff
==============================================================================
--- incubator/roller/branches/roller-newbackend/src/org/roller/pojos/WeblogCategoryData.java
(original)
+++ incubator/roller/branches/roller-newbackend/src/org/roller/pojos/WeblogCategoryData.java
Fri Apr 14 13:18:46 2006
@@ -76,47 +76,7 @@
             // why does this throw an exception?
         }
     }
-
-    public void save() throws RollerException
-    {   
-        if (RollerFactory.getRoller().getWeblogManager().isDuplicateWeblogCategoryName(this))
-        {
-            throw new RollerException("Duplicate category name");
-        }
-        super.save();
-    }
-   
-    /**
-     * Remove this category and recategorize all entries in this category and
-     * in all subcategories to a specified destination category (destCat).
-     * @param destCat New category for entries in remove categories (or null if none).
-     */
-    public void remove(WeblogCategoryData destCat) throws RollerException
-    {
-        WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
-        
-        // recategorize entries in this category
-        if (destCat != null) 
-        {
-            wmgr.moveWeblogCategoryContents(getId(), destCat.getId());
-        }
-        // delete this category
-        super.remove();
-        
-        if (getWebsite().getBloggerCategory().equals(this))
-        {
-            WeblogCategoryData rootCat = wmgr.getRootWeblogCategory(getWebsite());
-            getWebsite().setBloggerCategory(rootCat);
-        }
-        
-        if (getWebsite().getDefaultCategory().equals(this))
-        {
-            WeblogCategoryData rootCat = wmgr.getRootWeblogCategory(getWebsite());
-            getWebsite().setDefaultCategory(rootCat);
-        }
-        
-        getWebsite().save();
-    }
+    
     
     /** 
      * @see org.roller.pojos.HierarchicalPersistentObject#getAssocClass()
@@ -350,23 +310,7 @@
             (WeblogCategoryData)associatedObject, 
             relation);
     }
-
-    //------------------------------------------------------------------------
     
-    /** 
-     * Move all weblog entries that exist in this category and all
-     * subcategories of this category to a single new category.
-     */ 
-    public void moveContents(WeblogCategoryData dest) throws RollerException
-    {
-        Iterator entries = retrieveWeblogEntries(true).iterator();
-        while (entries.hasNext())
-        {
-            WeblogEntryData entry = (WeblogEntryData) entries.next();
-            entry.setCategory(dest);
-            entry.save();
-        }
-    }
     
     /** 
      * Retrieve all weblog entries in this category and, optionally, include



Mime
View raw message