roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r413136 - in /incubator/roller/branches/roller_3.0/sandbox/scripting/groovy: createuser.gy deleteuser.gy hibernate.cfg.xml listusers.gy
Date Fri, 09 Jun 2006 19:39:29 GMT
Author: snoopdave
Date: Fri Jun  9 12:39:29 2006
New Revision: 413136

URL: http://svn.apache.org/viewvc?rev=413136&view=rev
Log:
create, delete and list user work

Modified:
    incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/createuser.gy
    incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/deleteuser.gy
    incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/hibernate.cfg.xml
    incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/listusers.gy

Modified: incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/createuser.gy
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/createuser.gy?rev=413136&r1=413135&r2=413136&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/createuser.gy (original)
+++ incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/createuser.gy Fri Jun  9
12:39:29 2006
@@ -31,10 +31,13 @@
 user.setTimeZone(timeZone);
 user.setDateCreated(new java.util.Date());
 
-roller = org.apache.roller.model.RollerFactory.getRoller();
-roller.getUserManager().addUser(user);
-roller.flush();
-
+try {
+   roller = org.apache.roller.model.RollerFactory.getRoller();
+   roller.getUserManager().addUser(user);
+   roller.flush();
+} catch (org.apache.roller.RollerException re) {
+   re.printStackTrace();
+}
 user = roller.getUserManager().getUser(username);
-println "Created user ${user.userName} with id ${user.id}";
+println "Created user ${user.username} with id ${user.id}";
 

Modified: incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/deleteuser.gy
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/deleteuser.gy?rev=413136&r1=413135&r2=413136&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/deleteuser.gy (original)
+++ incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/deleteuser.gy Fri Jun  9
12:39:29 2006
@@ -15,11 +15,10 @@
 * copyright in this work, please see the NOTICE file in the top level
 * directory of this distribution.
 */
-username = "zebulon";
+username = "scratch";
 
 roller = org.apache.roller.model.RollerFactory.getRoller();
-roller.begin(org.apache.roller.pojos.UserData.SYSTEM_USER);
-user = roller.getUserManager().getUser(usename);
-user.remove();
-roller.commit();
+user = roller.getUserManager().getUserByUserName(username);
+roller.getUserManager().removeUser(user);
+roller.flush();
 

Modified: incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/hibernate.cfg.xml
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/hibernate.cfg.xml?rev=413136&r1=413135&r2=413136&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/hibernate.cfg.xml (original)
+++ incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/hibernate.cfg.xml Fri Jun
 9 12:39:29 2006
@@ -36,6 +36,9 @@
         <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
         -->     
    
+        <!-- use thread local Session context -->
+        <property name="hibernate.current_session_context_class">thread</property>
+        
         <!-- Hibernate L2 Caching -->
         <property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
         <property name="hibernate.generate_statistics">true</property>

Modified: incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/listusers.gy
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/listusers.gy?rev=413136&r1=413135&r2=413136&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/listusers.gy (original)
+++ incubator/roller/branches/roller_3.0/sandbox/scripting/groovy/listusers.gy Fri Jun  9
12:39:29 2006
@@ -28,12 +28,11 @@
 users = roller.getUserManager().getUsers(0, 10);
 for (u in users) {
    println "   User [${u.userName}] has password [${u.password}]";
-   weblogs = roller.getUserManager().getWebsites(u, Boolean.FALSE);
+   weblogs = roller.getUserManager().getWebsites(u, null, null, null, null, 0, Integer.MAX_VALUE);
    for (w in weblogs) {
       println "      Belongs to weblog [${w.handle}]";
    }
 } 
 println "\nDONE\n"
 
-roller.rollback();
 



Mime
View raw message