roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r588331 - in /roller/trunk/sandbox/scripting/groovy/examples/rollerapi: checkuser.gy createblog.gy createcomment.gy createentry.gy createtestdata.gy createuser.gy groovy listusers.gy removeuser.gy
Date Thu, 25 Oct 2007 20:02:45 GMT
Author: snoopdave
Date: Thu Oct 25 13:02:44 2007
New Revision: 588331

URL: http://svn.apache.org/viewvc?rev=588331&view=rev
Log:
adding correct 4.0 bootstrapping code

Modified:
    roller/trunk/sandbox/scripting/groovy/examples/rollerapi/checkuser.gy
    roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createblog.gy
    roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createcomment.gy
    roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createentry.gy
    roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createtestdata.gy
    roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createuser.gy
    roller/trunk/sandbox/scripting/groovy/examples/rollerapi/groovy
    roller/trunk/sandbox/scripting/groovy/examples/rollerapi/listusers.gy
    roller/trunk/sandbox/scripting/groovy/examples/rollerapi/removeuser.gy

Modified: roller/trunk/sandbox/scripting/groovy/examples/rollerapi/checkuser.gy
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/examples/rollerapi/checkuser.gy?rev=588331&r1=588330&r2=588331&view=diff
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/checkuser.gy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/checkuser.gy Thu Oct 25 13:02:44
2007
@@ -21,7 +21,10 @@
     return;
 }
 
+org.apache.roller.weblogger.business.startup.WebloggerStartup.prepare();
+org.apache.roller.weblogger.business.WebloggerFactory.bootstrap();
 roller = org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger();
+
 user = roller.getUserManager().getUserByUserName(args[0]);
 
 if (user == null) {

Modified: roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createblog.gy
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createblog.gy?rev=588331&r1=588330&r2=588331&view=diff
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createblog.gy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createblog.gy Thu Oct 25 13:02:44
2007
@@ -28,6 +28,8 @@
 description = handle;
 theme =       "basic";
 
+org.apache.roller.weblogger.business.startup.WebloggerStartup.prepare();
+org.apache.roller.weblogger.business.WebloggerFactory.bootstrap();
 roller = org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger();
 
 user = roller.getUserManager().getUserByUserName(username);

Modified: roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createcomment.gy
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createcomment.gy?rev=588331&r1=588330&r2=588331&view=diff
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createcomment.gy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createcomment.gy Thu Oct 25 13:02:44
2007
@@ -23,6 +23,8 @@
 email =   "test@example.com";
 content = "Testing 1 2 3 <em>Hello World!</em>";
  
+org.apache.roller.weblogger.business.startup.WebloggerStartup.prepare();
+org.apache.roller.weblogger.business.WebloggerFactory.bootstrap();
 roller = org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger();
 
 blog = roller.getUserManager().getWebsiteByHandle(handle);

Modified: roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createentry.gy
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createentry.gy?rev=588331&r1=588330&r2=588331&view=diff
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createentry.gy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createentry.gy Thu Oct 25 13:02:44
2007
@@ -27,7 +27,10 @@
 text =     args[3];
 catpath =  args[4];
  
+org.apache.roller.weblogger.business.startup.WebloggerStartup.prepare();
+org.apache.roller.weblogger.business.WebloggerFactory.bootstrap();
 roller = org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger();
+
 user = roller.getUserManager().getUser(username);
 if (user == null) {
    println "ERROR: user ${username} not found";

Modified: roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createtestdata.gy
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createtestdata.gy?rev=588331&r1=588330&r2=588331&view=diff
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createtestdata.gy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createtestdata.gy Thu Oct 25
13:02:44 2007
@@ -15,10 +15,10 @@
 
     def roller = null;
 
-    def userCount = 30 
+    def userCount = 10 
     def blogCount = 2*userCount
-    def entryCount = 50 
-    def commentCount = 6
+    def entryCount = 10 
+    def commentCount = 3
 
     def users = []
 

Modified: roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createuser.gy
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createuser.gy?rev=588331&r1=588330&r2=588331&view=diff
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createuser.gy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createuser.gy Thu Oct 25 13:02:44
2007
@@ -39,7 +39,10 @@
 user.setTimeZone(timeZone);
 user.setDateCreated(new java.util.Date());
 
+org.apache.roller.weblogger.business.startup.WebloggerStartup.prepare();
+org.apache.roller.weblogger.business.WebloggerFactory.bootstrap();
 roller = org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger();
+
 roller.getUserManager().addUser(user);
 roller.flush();
 

Modified: roller/trunk/sandbox/scripting/groovy/examples/rollerapi/groovy
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/examples/rollerapi/groovy?rev=588331&r1=588330&r2=588331&view=diff
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/groovy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/groovy Thu Oct 25 13:02:44 2007
@@ -3,13 +3,13 @@
 # -- ENSURE THESE ARE CORRECT ---
 
 # Directory where Groovy release is installed
-export GROOVY_HOME=/usr/local/groovy
+export GROOVY_HOME=/Applications/Java/groovy
 
 # Directory of Roller webapp context
 export WEBAPP_DIR=../../../../../apps/weblogger/build/webapp
 
 # Directory of additional jars
-export JARS_DIR=/usr/local/tomcat/common/lib
+export JARS_DIR=/Applications/Java/tomcat/common/lib
 
 
 # --- SHOULD NOT NEED TO EDIT BELOW THIS LINE ---

Modified: roller/trunk/sandbox/scripting/groovy/examples/rollerapi/listusers.gy
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/examples/rollerapi/listusers.gy?rev=588331&r1=588330&r2=588331&view=diff
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/listusers.gy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/listusers.gy Thu Oct 25 13:02:44
2007
@@ -17,7 +17,10 @@
 */
 
 try {
+    org.apache.roller.weblogger.business.startup.WebloggerStartup.prepare();
+    org.apache.roller.weblogger.business.WebloggerFactory.bootstrap();
     roller = org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger();
+    
     users = roller.getUserManager().getUsers(null, null, null, null, 0, -1);
     for (u in users) {
        println "   User [${u.userName}] has password [${u.password}]";

Modified: roller/trunk/sandbox/scripting/groovy/examples/rollerapi/removeuser.gy
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/examples/rollerapi/removeuser.gy?rev=588331&r1=588330&r2=588331&view=diff
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/removeuser.gy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/removeuser.gy Thu Oct 25 13:02:44
2007
@@ -16,10 +16,22 @@
 * directory of this distribution.
 */
 
-username = "scratch";
+if (args.length < 2) {
+    println "USAGE: groovy removeuser.gy <username>"; 
+    return;
+}
 
+username = args[0];
+
+org.apache.roller.weblogger.business.startup.WebloggerStartup.prepare();
+org.apache.roller.weblogger.business.WebloggerFactory.bootstrap();
 roller = org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger();
+
 user = roller.getUserManager().getUserByUserName(username);
+if (user == null) {
+    println "User ${username} not found";
+    return;
+}
 roller.getUserManager().removeUser(user);
 roller.flush();
 



Mime
View raw message