roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1566457 - in /roller/trunk/app/src: main/java/org/apache/roller/weblogger/business/ main/java/org/apache/roller/weblogger/business/jpa/ main/java/org/apache/roller/weblogger/planet/business/ main/java/org/apache/roller/weblogger/pojos/ mai...
Date Sun, 09 Feb 2014 22:40:49 GMT
Author: gmazza
Date: Sun Feb  9 22:40:48 2014
New Revision: 1566457

URL: http://svn.apache.org/r1566457
Log:
getPath() removed from WeblogCategory, corresponding updates made to rest of code.  *URLStrategy.getWeblogCollectionURL()
presently relying on root category having a name of 'root' to determine it's the root category,
perhaps can be handled more elegantly.

Modified:
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/MultiWeblogURLStrategy.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/PreviewURLStrategy.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/planet/business/WebloggerRomeFeedFetcher.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.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/WeblogCategoryPathComparator.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/rendering/model/FeedModel.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/PageModel.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/URLModel.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomService.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java
    roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/CategoryAdd.jsp
    roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/CategoryEdit.jsp
    roller/trunk/app/src/main/webapp/WEB-INF/velocity/feeds.vm
    roller/trunk/app/src/main/webapp/WEB-INF/velocity/weblog.vm
    roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogCategoryFunctionalityTest.java

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/MultiWeblogURLStrategy.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/MultiWeblogURLStrategy.java?rev=1566457&r1=1566456&r2=1566457&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/MultiWeblogURLStrategy.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/MultiWeblogURLStrategy.java
Sun Feb  9 22:40:48 2014
@@ -174,10 +174,10 @@ public class MultiWeblogURLStrategy exte
         pathinfo.append(getWeblogURL(weblog, locale, absolute));
         
         String cat = null;
-        if(category != null && "/".equals(category)) {
+        if("root".equals(category)) {
             cat = null;
-        } else if(category != null && category.startsWith("/")) {
-            cat = category.substring(1);
+        } else {
+            cat = category;
         }
         
         if(cat != null && dateString == null) {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/PreviewURLStrategy.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/PreviewURLStrategy.java?rev=1566457&r1=1566456&r2=1566457&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/PreviewURLStrategy.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/PreviewURLStrategy.java
Sun Feb  9 22:40:48 2014
@@ -145,10 +145,10 @@ public class PreviewURLStrategy extends 
         }
 
         String cat = null;
-        if(category != null && "/".equals(category)) {
+        if("root".equals(category)) {
             cat = null;
-        } else if(category != null && category.startsWith("/")) {
-            cat = category.substring(1);
+        } else {
+            cat = category;
         }
         
         if(cat != null && dateString == null) {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java?rev=1566457&r1=1566456&r2=1566457&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java
Sun Feb  9 22:40:48 2014
@@ -67,7 +67,7 @@ public interface WeblogEntryManager {
      * @param user       User or null to get for all users.
      * @param startDate  Start date or null for no start date.
      * @param endDate    End date or null for no end date.
-     * @param catPath    Category path or null for all categories.
+     * @param catName    Category name or null for all categories.
      * @param status     Status of DRAFT, PENDING, PUBLISHED or null for all
      * @param text       Text appearing in the text or summary, or null for all
      * @param sortBy     Sort by either 'pubTime' or 'updateTime' (null for pubTime)
@@ -82,7 +82,7 @@ public interface WeblogEntryManager {
             User    user,
             Date        startDate,
             Date        endDate,
-            String      catPath,
+            String      catName,
             List        tags,
             String      status,
             String      text,
@@ -100,7 +100,7 @@ public interface WeblogEntryManager {
      * @param website    Weblog or null to get for all weblogs.
      * @param startDate  Start date or null for no start date.
      * @param endDate    End date or null for no end date.
-     * @param catPath    Category path or null for all categories.
+     * @param catName    Category name or null for all categories.
      * @param status     Status of DRAFT, PENDING, PUBLISHED or null for all
      * @param offset     Offset into results for paging
      * @param range
@@ -111,7 +111,7 @@ public interface WeblogEntryManager {
             Weblog website,
             Date        startDate,
             Date        endDate,
-            String      catPath,
+            String      catName,
             List        tags,            
             String      status,
             String      locale,
@@ -126,7 +126,7 @@ public interface WeblogEntryManager {
      * @param website    Weblog or null to get for all weblogs.
      * @param startDate  Start date or null for no start date.
      * @param endDate    End date or null for no end date.
-     * @param catPath    Category path or null for all categories.
+     * @param catName    Category name or null for all categories.
      * @param status     Status of DRAFT, PENDING, PUBLISHED or null for all
      * @param offset     Offset into results for paging
      * @param range
@@ -137,7 +137,7 @@ public interface WeblogEntryManager {
             Weblog website,
             Date        startDate,
             Date        endDate,
-            String      catPath,
+            String      catName,
             List        tags,            
             String      status,
             String      locale,

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java?rev=1566457&r1=1566456&r2=1566457&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
Sun Feb  9 22:40:48 2014
@@ -335,7 +335,7 @@ public class JPAWeblogEntryManagerImpl i
         this.entryAnchorToIdMap.remove(entry.getWebsite().getHandle()+":"+entry.getAnchor());
     }
     
-    public List getNextPrevEntries(WeblogEntry current, String catPath,
+    public List getNextPrevEntries(WeblogEntry current, String catName,
             String locale, int maxEntries, boolean next)
             throws WebloggerException {
 
@@ -370,13 +370,13 @@ public class JPAWeblogEntryManagerImpl i
             }
         }
         
-        if (catPath != null) {
-            category = getWeblogCategoryByName(current.getWebsite(), catPath);
+        if (catName != null) {
+            category = getWeblogCategoryByName(current.getWebsite(), catName);
             if (category != null) {
                 params.add(size++, category);
                 whereClause.append(" AND e.category = ?" + size);
             } else {
-                throw new WebloggerException("Cannot find category: " + catPath);
+                throw new WebloggerException("Cannot find category: " + catName);
             } 
         }
         
@@ -460,7 +460,7 @@ public class JPAWeblogEntryManagerImpl i
             User    user,
             Date        startDate,
             Date        endDate,
-            String      catPath,
+            String      catName,
             List        tags,
             String      status,
             String      text,
@@ -471,10 +471,10 @@ public class JPAWeblogEntryManagerImpl i
             int         length) throws WebloggerException {
         
         WeblogCategory cat = null;
-        if (StringUtils.isNotEmpty(catPath) && website != null) {
-            cat = getWeblogCategoryByName(website, catPath);
+        if (StringUtils.isNotEmpty(catName) && website != null) {
+            cat = getWeblogCategoryByName(website, catName);
             if (cat == null) {
-                catPath = null;
+                catName = null;
             }
         }
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/planet/business/WebloggerRomeFeedFetcher.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/planet/business/WebloggerRomeFeedFetcher.java?rev=1566457&r1=1566456&r2=1566457&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/planet/business/WebloggerRomeFeedFetcher.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/planet/business/WebloggerRomeFeedFetcher.java
Sun Feb  9 22:40:48 2014
@@ -156,7 +156,7 @@ public class WebloggerRomeFeedFetcher ex
                 entry.setPubTime(rollerEntry.getPubTime());
                 entry.setText(content);
                 entry.setPermalink(rollerEntry.getPermalink());
-                entry.setCategoriesString(rollerEntry.getCategory().getPath());
+                entry.setCategoriesString(rollerEntry.getCategory().getName());
                 
                 newSub.addEntry(entry);
             }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java?rev=1566457&r1=1566456&r2=1566457&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java Sun Feb 
9 22:40:48 2014
@@ -776,7 +776,7 @@ public class Weblog implements Serializa
     
     /**
      * 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.
      */

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=1566457&r1=1566456&r2=1566457&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 Sun
Feb  9 22:40:48 2014
@@ -159,15 +159,6 @@ public class WeblogCategory implements S
         this.image = image;
     }
     
-    
-    /**
-     * The full path to this category in the hierarchy.  Will be removed soon,
-     * as all categories are now top-level, use getName() going forward.
-     */
-    public String getPath() {
-        return this.parentCategory != null ? ("/" + name) : "/";
-    }
-
     /**
      * Get the weblog which owns this category.
      */

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategoryPathComparator.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategoryPathComparator.java?rev=1566457&r1=1566456&r2=1566457&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategoryPathComparator.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogCategoryPathComparator.java
Sun Feb  9 22:40:48 2014
@@ -22,14 +22,13 @@ import java.util.Comparator;
 
 
 /**
- * Compare weblog categories by path.
+ * Compare weblog categories by name.
  */
 public class WeblogCategoryPathComparator implements Comparator {
     
     public int compare(Object o1, Object o2) {
         WeblogCategory f1 = (WeblogCategory)o1;
         WeblogCategory f2 = (WeblogCategory)o2;
-        return f1.getPath().compareTo(f2.getPath());
+        return f1.getName().compareTo(f2.getName());
     }
-    
 }

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=1566457&r1=1566456&r2=1566457&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
Sun Feb  9 22:40:48 2014
@@ -75,13 +75,7 @@ public final class WeblogCategoryWrapper
     public String getImage() {
         return this.pojo.getImage();
     }
-    
-    
-    public String getPath() {
-        return this.pojo.getPath();
-    }
-    
-    
+
     public WeblogWrapper getWebsite() {
         return WeblogWrapper.wrap(this.pojo.getWebsite(), urlStrategy);
     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/FeedModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/FeedModel.java?rev=1566457&r1=1566456&r2=1566457&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/FeedModel.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/FeedModel.java
Sun Feb  9 22:40:48 2014
@@ -113,7 +113,7 @@ public class FeedModel implements Model 
     /**
      * Get category path or name specified by request.
      */
-    public String getCategoryPath() {
+    public String getCategoryName() {
         return feedRequest.getWeblogCategoryName();
     }
     

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/PageModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/PageModel.java?rev=1566457&r1=1566456&r2=1566457&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/PageModel.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/PageModel.java
Sun Feb  9 22:40:48 2014
@@ -175,7 +175,7 @@ public class PageModel implements Model 
     
     
     /**
-     * Get weblog category specified by request, or null if the category path
+     * Get weblog category specified by request, or null if the category name
      * found in the request does not exist in the current weblog.
      */
     public WeblogCategoryWrapper getWeblogCategory() {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/URLModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/URLModel.java?rev=1566457&r1=1566456&r2=1566457&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/URLModel.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/URLModel.java
Sun Feb  9 22:40:48 2014
@@ -197,13 +197,13 @@ public class URLModel implements Model {
     }
     
     
-    public String category(String catPath) {
-        return urlStrategy.getWeblogCollectionURL(weblog, locale, catPath, null, null, -1,
true);
+    public String category(String catName) {
+        return urlStrategy.getWeblogCollectionURL(weblog, locale, catName, null, null, -1,
true);
     }
     
     
-    public String category(String catPath, int pageNum) {
-        return urlStrategy.getWeblogCollectionURL(weblog, locale, catPath, null, null, pageNum,
true);
+    public String category(String catName, int pageNum) {
+        return urlStrategy.getWeblogCollectionURL(weblog, locale, catName, null, null, pageNum,
true);
     }
     
     

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomService.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomService.java?rev=1566457&r1=1566456&r2=1566457&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomService.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/RollerAtomService.java
Sun Feb  9 22:40:48 2014
@@ -94,7 +94,7 @@ public class RollerAtomService extends A
                     List<WeblogCategory> rollerCats = roller.getWeblogEntryManager().getWeblogCategories(weblog,
false);
                     for (WeblogCategory rollerCat : rollerCats) {
                         Category cat = new Category();
-                        cat.setTerm(rollerCat.getPath().substring(1));
+                        cat.setTerm(rollerCat.getName());
                         cat.setLabel(rollerCat.getName());
                         cats.addCategory(cat);
                     }

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java?rev=1566457&r1=1566456&r2=1566457&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/webservices/xmlrpc/MetaWeblogAPIHandler.java
Sun Feb  9 22:40:48 2014
@@ -503,11 +503,11 @@ public class MetaWeblogAPIHandler extend
         URLStrategy strategy = roller.getUrlStrategy();
         
         String catUrl = strategy.getWeblogCollectionURL(category.getWebsite(),
-        		null, category.getPath(), null, null, 0, true);
+        		null, category.getName(), null, null, 0, true);
         struct.put("htmlUrl", catUrl);
         
         String rssUrl = strategy.getWeblogFeedURL(category.getWebsite(),
-               null, "entries", "rss", category.getPath(), null, null, false, true);
+               null, "entries", "rss", category.getName(), null, null, false, true);
         struct.put("rssUrl",rssUrl);
         
         return struct;

Modified: roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/CategoryAdd.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/CategoryAdd.jsp?rev=1566457&r1=1566456&r2=1566457&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/CategoryAdd.jsp (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/CategoryAdd.jsp Sun Feb  9 22:40:48
2014
@@ -22,7 +22,7 @@
 </p>
 
 <p>
-    <b><s:text name="categoriesForm.path" /></b>:<s:property value="category.path"
/>
+    <b><s:text name="categoriesForm.name" /></b>:<s:property value="category.name"
/>
 </p>
 
 <s:form action="categoryAdd!save">

Modified: roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/CategoryEdit.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/CategoryEdit.jsp?rev=1566457&r1=1566456&r2=1566457&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/CategoryEdit.jsp (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/CategoryEdit.jsp Sun Feb  9 22:40:48
2014
@@ -22,7 +22,7 @@
 </p>
 
 <p>
-    <b><s:text name="categoriesForm.path" /></b>:<s:property value="category.path"
/>
+    <b><s:text name="categoriesForm.name" /></b>:<s:property value="category.name"
/>
 </p>
 
 <s:form action="categoryEdit!save">

Modified: roller/trunk/app/src/main/webapp/WEB-INF/velocity/feeds.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/velocity/feeds.vm?rev=1566457&r1=1566456&r2=1566457&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/velocity/feeds.vm (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/velocity/feeds.vm Sun Feb  9 22:40:48 2014
@@ -35,7 +35,7 @@
         <link rel="alternate" type="text/html" href="$entry.permalink"/>
         <published>$utils.formatIso8601Date($entry.pubTime)</published>
         <updated>$utils.formatIso8601Date($entry.updateTime)</updated> 
-        <category term="$utils.escapeXML($entry.category.path)" label="$utils.escapeXML($entry.category.name)"
/>
+        <category term="$utils.escapeXML($entry.category.name)" label="$utils.escapeXML($entry.category.name)"
/>
 #foreach($tag in $entry.tags)
         <category term="$utils.escapeXML($tag.name)" scheme="http://roller.apache.org/ns/tags/"
/>
 #end        

Modified: roller/trunk/app/src/main/webapp/WEB-INF/velocity/weblog.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/velocity/weblog.vm?rev=1566457&r1=1566456&r2=1566457&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/velocity/weblog.vm (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/velocity/weblog.vm Sun Feb  9 22:40:48 2014
@@ -93,12 +93,12 @@ Show RSS, Atom and RSD auto-discovery li
       <link rel="alternate" type="application/atom+xml" title="Entries tagged $model.tags.toString()
(Atom)"  href="$url.feed.entries.atomByTags($model.tags, false)" />
       <link rel="alternate" type="application/rss+xml"  title="Entries tagged $model.tags.toString()
(RSS)"   href="$url.feed.entries.rssByTags($model.tags, false)" />
     #elseif ($model.weblogCategory)
-      <link rel="alternate" type="application/atom+xml" title="Entries for category $model.weblogCategory.name
(Atom)"  href="$url.feed.entries.atom($model.weblogCategory.path, false)" />
-      <link rel="alternate" type="application/rss+xml"  title="Entries for category $model.weblogCategory.name
(RSS)"   href="$url.feed.entries.rss($model.weblogCategory.path, false)" />
+      <link rel="alternate" type="application/atom+xml" title="Entries for category $model.weblogCategory.name
(Atom)"  href="$url.feed.entries.atom($model.weblogCategory.name, false)" />
+      <link rel="alternate" type="application/rss+xml"  title="Entries for category $model.weblogCategory.name
(RSS)"   href="$url.feed.entries.rss($model.weblogCategory.name, false)" />
     #end
 
     #else
-    <link rel="alternate" type="application/rss+xml"  title="Search results for '$utils.escapeHTML($model.term)'"
 href="$utils.escapeHTML($url.feed.entries.search($model.term,$model.weblogCategory.path))"
/>
+    <link rel="alternate" type="application/rss+xml"  title="Search results for '$utils.escapeHTML($model.term)'"
 href="$utils.escapeHTML($url.feed.entries.search($model.term,$model.weblogCategory.name))"
/>
     #end
     #if ($site)
         <link rel="search"
@@ -560,16 +560,16 @@ Show weblog's categories in specified pa
     #if(!$expanding && !$subcats)
         <ul class="rCategory">
         #if ($model.weblogCategory || $model.permalink)
-            <li><a href="$url.category($categoryObject.path)">$text.get("macro.weblog.allcategories")</a></li>
+            <li><a href="$url.category($categoryObject.name)">$text.get("macro.weblog.allcategories")</a></li>
         #else
-            <li class="selected"><a href="$url.category($categoryObject.path)">$text.get("macro.weblog.allcategories")</a></li>
+            <li class="selected"><a href="$url.category($categoryObject.name)">$text.get("macro.weblog.allcategories")</a></li>
         #end
         #set($cats = $categoryObject.getWeblogCategories())
         #foreach($cat in $cats)
-            #if ($model.weblogCategory && $model.weblogCategory.path == $cat.path
|| ($model.permalink && $model.weblogEntry.category.path == $cat.path))
-                <li class="selected"><a href="$url.category($cat.path)">$cat.name</a></li>
+            #if ($model.weblogCategory && $model.weblogCategory.name == $cat.name
|| ($model.permalink && $model.weblogEntry.category.name == $cat.name))
+                <li class="selected"><a href="$url.category($cat.name)">$cat.name</a></li>
             #else
-                <li><a href="$url.category($cat.path)">$cat.name</a></li>
+                <li><a href="$url.category($cat.name)">$cat.name</a></li>
             #end
         #end
         </ul>
@@ -588,18 +588,18 @@ Show weblog's categories in specified pa
           <h2>Categories</h2>
           <ul data-role="listview">
             #if ($model.weblogCategory || $model.permalink)
-              <li><a href="$url.category($categoryObject.path)" data-transition="fade">$text.get("macro.weblog.allcategories")</a></li>
+              <li><a href="$url.category($categoryObject.name)" data-transition="fade">$text.get("macro.weblog.allcategories")</a></li>
             #else
-              <li class="ui-btn-active"><a href="$url.category($categoryObject.path)"
data-transition="fade">$text.get("macro.weblog.allcategories")</a></li>
+              <li class="ui-btn-active"><a href="$url.category($categoryObject.name)"
data-transition="fade">$text.get("macro.weblog.allcategories")</a></li>
             #end
             #set($active = $text.get("macro.weblog.allcategories"))
             #set($cats = $categoryObject.getWeblogCategories())
             #foreach($cat in $cats)
-              #if ($model.weblogCategory && $model.weblogCategory.path == $cat.path
|| ($model.permalink && $model.weblogEntry.category.path == $cat.path))
-                <li class="ui-btn-active"><a href="$url.category($cat.path)" data-transition="fade">$cat.name</a></li>
+              #if ($model.weblogCategory && $model.weblogCategory.name == $cat.name
|| ($model.permalink && $model.weblogEntry.category.name == $cat.name))
+                <li class="ui-btn-active"><a href="$url.category($cat.name)" data-transition="fade">$cat.name</a></li>
                 #set($active = $cat.name)
               #else
-                <li><a href="$url.category($cat.path)" data-transition="fade">$cat.name</a></li>
+                <li><a href="$url.category($cat.name)" data-transition="fade">$cat.name</a></li>
               #end
             #end
           </ul>
@@ -618,16 +618,16 @@ Recursively display a bookmark folder an
             #set($divId = "div_$categoryObject.name")
             <div class="rCategory">
             <li><a href="javascript:toggleFolder('$divId')">
-                <span id="i$divId">+</span></a><a href="$url.category($categoryObject.path)">$categoryObject.name</a></li>
+                <span id="i$divId">+</span></a><a href="$url.category($categoryObject.name)">$categoryObject.name</a></li>
             <ul id="$divId" class="rCategory" style="display:none">
         #elseif ($subcats && $categoryObject.weblogCategories.size() > 0)
-            <li><a href="$url.category($categoryObject.path)">$categoryObject.name</a></li>
+            <li><a href="$url.category($categoryObject.name)">$categoryObject.name</a></li>
             <ul class="rCategory">
         #else
-            #if ($model.weblogCategory && $model.weblogCategory.path == $categoryObject.path)
+            #if ($model.weblogCategory && $model.weblogCategory.name == $categoryObject.name)
                 <li class="selected">$categoryObject.name</li>
             #else
-                <li><a href="$url.category($categoryObject.path)">$categoryObject.name</a></li>
+                <li><a href="$url.category($categoryObject.name)">$categoryObject.name</a></li>
             #end
         #end
     #end

Modified: roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogCategoryFunctionalityTest.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogCategoryFunctionalityTest.java?rev=1566457&r1=1566456&r2=1566457&view=diff
==============================================================================
--- roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogCategoryFunctionalityTest.java
(original)
+++ roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogCategoryFunctionalityTest.java
Sun Feb  9 22:40:48 2014
@@ -199,12 +199,7 @@ public class WeblogCategoryFunctionality
         cat = mgr.getWeblogCategoryByName(testWeblog, "catTest-cat1");
         assertNotNull(cat);
         assertEquals(cat, cat1);
-        
-        // if no path is specified we should get the root category
-        cat = mgr.getWeblogCategoryByName(testWeblog, null);
-        assertNotNull(cat);
-        assertEquals(cat.getPath(), "/");
-        
+
         log.info("END");
     }
     



Mime
View raw message