roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r398378 - /incubator/roller/trunk/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
Date Sun, 30 Apr 2006 16:58:32 GMT
Author: snoopdave
Date: Sun Apr 30 09:58:31 2006
New Revision: 398378

URL: http://svn.apache.org/viewcvs?rev=398378&view=rev
Log:
Use first cat (not root cat) as default Blogger API

Modified:
    incubator/roller/trunk/src/org/roller/business/hibernate/HibernateUserManagerImpl.java

Modified: incubator/roller/trunk/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/business/hibernate/HibernateUserManagerImpl.java?rev=398378&r1=398377&r2=398378&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
(original)
+++ incubator/roller/trunk/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
Sun Apr 30 09:58:31 2006
@@ -256,30 +256,36 @@
         
         // add default categories
         WeblogCategoryData rootCat = new WeblogCategoryData(
-                null, // id
+                null,      // id
                 newWeblog, // newWeblog
-                null,   // parent
-                "root",  // name
-                "root",  // description
-                null ); // image
+                null,      // parent
+                "root",    // name
+                "root",    // description
+                null );    // image
         this.strategy.store(rootCat);
         
         String cats = RollerConfig.getProperty("newuser.categories");
+        WeblogCategoryData firstCat = rootCat; 
         if (cats != null) {
             String[] splitcats = cats.split(",");
             for (int i=0; i<splitcats.length; i++) {
                 WeblogCategoryData c = new WeblogCategoryData(
-                        null,            // id
-                        newWeblog,         // newWeblog
-                        rootCat,         // parent
-                        splitcats[i],    // name
-                        splitcats[i],    // description
-                        null );          // image
+                    null,            // id
+                    newWeblog,       // newWeblog
+                    rootCat,         // parent
+                    splitcats[i],    // name
+                    splitcats[i],    // description
+                    null );          // image
+                if (i == 0) firstCat = c;
                 this.strategy.store(c);
             }
         }
-        newWeblog.setBloggerCategory(rootCat);
+        // Use first category as default for Blogger API
+        newWeblog.setBloggerCategory(firstCat);
+        
+        // But default category for weblog itself should be  root
         newWeblog.setDefaultCategory(rootCat);
+
         this.strategy.store(newWeblog);
         
         // add default bookmarks



Mime
View raw message