roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r551036 - in /roller/trunk/apps/weblogger: src/java/org/apache/roller/weblogger/ui/struts2/editor/ web/WEB-INF/jsps/editor/
Date Wed, 27 Jun 2007 04:33:00 GMT
Author: agilliland
Date: Tue Jun 26 21:32:58 2007
New Revision: 551036

URL: http://svn.apache.org/viewvc?view=rev&rev=551036
Log:
category drop down on entry editor should include all categories, not just children of root
category.  we are also going to display the category name rather than path, since that is
nicer for users.


Modified:
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java
    roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/EntryAdd.jsp
    roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/EntryEdit.jsp

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java?view=diff&rev=551036&r1=551035&r2=551036
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java
Tue Jun 26 21:32:58 2007
@@ -19,9 +19,12 @@
 package org.apache.roller.weblogger.ui.struts2.editor;
 
 import java.sql.Timestamp;
+import java.util.Collections;
 import java.util.Date;
+import java.util.List;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.RollerFactory;
 import org.apache.roller.weblogger.business.WeblogManager;
 import org.apache.roller.weblogger.pojos.WeblogPermission;
@@ -30,6 +33,7 @@
 import org.apache.roller.weblogger.util.cache.CacheManager;
 import org.apache.roller.weblogger.util.MailUtil;
 import org.apache.commons.lang.StringUtils;
+import org.apache.roller.weblogger.pojos.WeblogCategory;
 import org.apache.roller.weblogger.util.MediacastResource;
 import org.apache.roller.weblogger.util.MediacastUtil;
 import org.apache.struts2.interceptor.validation.SkipValidation;
@@ -188,6 +192,20 @@
 
         
         return INPUT;
+    }
+    
+    
+    /**
+     * Get the list of all categories for the action weblog, not including root.
+     */
+    public List<WeblogCategory> getCategories() {
+        try {
+            WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+            return wmgr.getWeblogCategories(getActionWeblog(), false);
+        } catch (WebloggerException ex) {
+            log.error("Error getting category list for weblog - "+getWeblog(), ex);
+            return Collections.EMPTY_LIST;
+        }
     }
     
     

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java?view=diff&rev=551036&r1=551035&r2=551036
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java
Tue Jun 26 21:32:58 2007
@@ -20,14 +20,17 @@
 
 import java.sql.Timestamp;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.Date;
 import java.util.Iterator;
+import java.util.List;
 import org.apache.commons.lang.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.RollerFactory;
 import org.apache.roller.weblogger.business.WeblogManager;
+import org.apache.roller.weblogger.pojos.WeblogCategory;
 import org.apache.roller.weblogger.pojos.WeblogPermission;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
 import org.apache.roller.weblogger.util.cache.CacheManager;
@@ -254,6 +257,19 @@
         return INPUT;
     }
     
+    
+    /**
+     * Get the list of all categories for the action weblog, not including root.
+     */
+    public List<WeblogCategory> getCategories() {
+        try {
+            WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+            return wmgr.getWeblogCategories(getActionWeblog(), false);
+        } catch (WebloggerException ex) {
+            log.error("Error getting category list for weblog - "+getWeblog(), ex);
+            return Collections.EMPTY_LIST;
+        }
+    }
     
     public String getPreviewURL() {
         return URLUtilities.getPreviewWeblogEntryURL(getEntry().getAnchor(), getActionWeblog(),
null, true);

Modified: roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/EntryAdd.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/EntryAdd.jsp?view=diff&rev=551036&r1=551035&r2=551036
==============================================================================
--- roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/EntryAdd.jsp (original)
+++ roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/EntryAdd.jsp Tue Jun 26 21:32:58 2007
@@ -55,7 +55,7 @@
                 <label for="categoryId"><s:text name="weblogEdit.category" /></label>
             </td>
             <td>
-                <s:select name="bean.categoryId" list="actionWeblog.weblogCategories"
listKey="id" listValue="path" size="1" />
+                <s:select name="bean.categoryId" list="categories" listKey="id" listValue="name"
size="1" />
             </td>
         </tr>
         

Modified: roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/EntryEdit.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/EntryEdit.jsp?view=diff&rev=551036&r1=551035&r2=551036
==============================================================================
--- roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/EntryEdit.jsp (original)
+++ roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/EntryEdit.jsp Tue Jun 26 21:32:58
2007
@@ -86,7 +86,7 @@
                 <label for="categoryId"><s:text name="weblogEdit.category" /></label>
             </td>
             <td>
-                <s:select name="bean.categoryId" list="actionWeblog.weblogCategories"
listKey="id" listValue="path" size="1" />
+                <s:select name="bean.categoryId" list="categories" listKey="id" listValue="name"
size="1" />
             </td>
         </tr>
         



Mime
View raw message