roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r501657 - in /incubator/roller/trunk/src/org/apache/roller: business/ business/hibernate/ pojos/ ui/core/ ui/rendering/velocity/deprecated/
Date Wed, 31 Jan 2007 00:35:49 GMT
Author: agilliland
Date: Tue Jan 30 16:35:48 2007
New Revision: 501657

URL: http://svn.apache.org/viewvc?view=rev&rev=501657
Log:
small backend cleanup.  remove unnecessary method getWeblogCategoryByPath(website, category,
pathString) from WeblogManager.  that method provides no functionality not available via the
existing method getWeblogCategoryByPath(website, pathString) and none of it's callers were
using the category arguement anyways.


Modified:
    incubator/roller/trunk/src/org/apache/roller/business/WeblogManager.java
    incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java
    incubator/roller/trunk/src/org/apache/roller/pojos/WebsiteData.java
    incubator/roller/trunk/src/org/apache/roller/ui/core/RollerRequest.java
    incubator/roller/trunk/src/org/apache/roller/ui/rendering/velocity/deprecated/OldWeblogPageModel.java

Modified: incubator/roller/trunk/src/org/apache/roller/business/WeblogManager.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/business/WeblogManager.java?view=diff&rev=501657&r1=501656&r2=501657
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/business/WeblogManager.java (original)
+++ incubator/roller/trunk/src/org/apache/roller/business/WeblogManager.java Tue Jan 30 16:35:48
2007
@@ -256,15 +256,6 @@
     public WeblogCategoryData getWeblogCategoryByPath(WebsiteData website, 
             String categoryPath) throws RollerException;
     
-    /**
-     * Get sub-category by path relative to specified category.
-     * @param category  Root of path or null to start at top of category tree.
-     * @param path      Path of category to be located.
-     * @param website   Website of categories.
-     * @return          Category specified by path or null if not found.
-     */
-    public WeblogCategoryData getWeblogCategoryByPath(WebsiteData wd, 
-            WeblogCategoryData category, String string) throws RollerException;  
     
     /** 
      * Get WebLogCategory objects for a website. 

Modified: incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java?view=diff&rev=501657&r1=501656&r2=501657
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java
(original)
+++ incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java
Tue Jan 30 16:35:48 2007
@@ -373,7 +373,7 @@
         
         if (catName != null && !catName.trim().equals("/")) {
             WeblogCategoryData category =
-                    getWeblogCategoryByPath(current.getWebsite(), null, catName);
+                    getWeblogCategoryByPath(current.getWebsite(), catName);
             if (category != null) {
                 conjunction.add(Expression.eq("category", category));
             } else {
@@ -927,20 +927,14 @@
     
     //--------------------------------------------- WeblogCategoryData Queries
     
-    public WeblogCategoryData getWeblogCategoryByPath(
-            WebsiteData website, String categoryPath) throws RollerException {
-        return getWeblogCategoryByPath(website, null, categoryPath);
-    }
-    
-    // TODO: ditch this method in favor of getWeblogCategoryByPath(weblog, path)
-    public WeblogCategoryData getWeblogCategoryByPath(
-            WebsiteData website, WeblogCategoryData category, String path)
+    public WeblogCategoryData getWeblogCategoryByPath(WebsiteData website, 
+                                                      String categoryPath) 
             throws RollerException {
         
-        if (path == null || path.trim().equals("/")) {
+        if (categoryPath == null || categoryPath.trim().equals("/")) {
             return getRootWeblogCategory(website);
         } else {
-            String catPath = path;
+            String catPath = categoryPath;
             
             // all cat paths must begin with a '/'
             if(!catPath.startsWith("/")) {
@@ -956,6 +950,7 @@
             return (WeblogCategoryData) criteria.uniqueResult();
         }
     }
+    
         
     public CommentData getComment(String id) throws RollerException {
         return (CommentData) this.strategy.load(id, CommentData.class);

Modified: incubator/roller/trunk/src/org/apache/roller/pojos/WebsiteData.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/pojos/WebsiteData.java?view=diff&rev=501657&r1=501656&r2=501657
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/pojos/WebsiteData.java (original)
+++ incubator/roller/trunk/src/org/apache/roller/pojos/WebsiteData.java Tue Jan 30 16:35:48
2007
@@ -1116,7 +1116,7 @@
             WeblogManager wmgr = roller.getWeblogManager();            
             WeblogCategoryData category = null;
             if (categoryPath != null && !categoryPath.equals("nil")) {
-                category = wmgr.getWeblogCategoryByPath(this, null, categoryPath);
+                category = wmgr.getWeblogCategoryByPath(this, categoryPath);
             } else {
                 category = this.getDefaultCategory();
             }
@@ -1137,7 +1137,7 @@
             Roller roller = RollerFactory.getRoller();
             WeblogManager wmgr = roller.getWeblogManager();
             if (categoryPath != null && !categoryPath.equals("nil")) {
-                category = wmgr.getWeblogCategoryByPath(this, null, categoryPath);
+                category = wmgr.getWeblogCategoryByPath(this, categoryPath);
             } else {
                 category = this.getDefaultCategory();
             }

Modified: incubator/roller/trunk/src/org/apache/roller/ui/core/RollerRequest.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/ui/core/RollerRequest.java?view=diff&rev=501657&r1=501656&r2=501657
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/ui/core/RollerRequest.java (original)
+++ incubator/roller/trunk/src/org/apache/roller/ui/core/RollerRequest.java Tue Jan 30 16:35:48
2007
@@ -608,7 +608,7 @@
                     mWeblogCategory = 
                         RollerFactory.getRoller()
                             .getWeblogManager().getWeblogCategoryByPath(
-                                    getWebsite(), null, id);
+                                    getWebsite(), id);
                 }
                 catch (RollerException e)
                 {

Modified: incubator/roller/trunk/src/org/apache/roller/ui/rendering/velocity/deprecated/OldWeblogPageModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/ui/rendering/velocity/deprecated/OldWeblogPageModel.java?view=diff&rev=501657&r1=501656&r2=501657
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/ui/rendering/velocity/deprecated/OldWeblogPageModel.java
(original)
+++ incubator/roller/trunk/src/org/apache/roller/ui/rendering/velocity/deprecated/OldWeblogPageModel.java
Tue Jan 30 16:35:48 2007
@@ -618,7 +618,7 @@
                 WeblogCategoryData category = null;
                 if (categoryName != null) {
                     category = mWeblogMgr.getWeblogCategoryByPath(
-                            mWebsite, null, categoryName);
+                            mWebsite, categoryName);
                 } else {
                     category = mWebsite.getDefaultCategory();
                 }



Mime
View raw message