roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r564590 - 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 roller-custom.properties
Date Fri, 10 Aug 2007 13:48:42 GMT
Author: snoopdave
Date: Fri Aug 10 06:48:40 2007
New Revision: 564590

URL: http://svn.apache.org/viewvc?view=rev&rev=564590
Log:
Updated for new 4.0 package structure and boostrap

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
    roller/trunk/sandbox/scripting/groovy/examples/rollerapi/roller-custom.properties

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?view=diff&rev=564590&r1=564589&r2=564590
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/checkuser.gy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/checkuser.gy Fri Aug 10 06:48:40
2007
@@ -21,7 +21,7 @@
     return;
 }
 
-roller = org.apache.roller.business.RollerFactory.getRoller();
+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?view=diff&rev=564590&r1=564589&r2=564590
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createblog.gy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createblog.gy Fri Aug 10 06:48:40
2007
@@ -28,14 +28,14 @@
 description = handle;
 theme =       "basic";
 
-roller = org.apache.roller.business.RollerFactory.getRoller();
+roller = org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger();
 
 user = roller.getUserManager().getUserByUserName(username);
 if (user == null) {
     println "ERROR: user ${username} not found";
     System.exit(-1);
 } 
-website = new org.apache.roller.pojos.WebsiteData(
+website = new org.apache.roller.weblogger.pojos.Weblog(
    handle, 
    user,
    blogname,

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?view=diff&rev=564590&r1=564589&r2=564590
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createcomment.gy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createcomment.gy Fri Aug 10 06:48:40
2007
@@ -23,14 +23,14 @@
 email =   "test@example.com";
 content = "Testing 1 2 3 <em>Hello World!</em>";
  
-roller = org.apache.roller.business.RollerFactory.getRoller();
+roller = org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger();
 
 blog = roller.getUserManager().getWebsiteByHandle(handle);
 entry = roller.getWeblogManager().getWeblogEntryByAnchor(blog, anchor);
 
 println entry
 
-comment = new org.apache.roller.pojos.CommentData();
+comment = new org.apache.roller.weblogger.pojos.WeblogEntryComment();
 comment.setWeblogEntry(entry);
 comment.setName(name);
 comment.setUrl(url);

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?view=diff&rev=564590&r1=564589&r2=564590
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createentry.gy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createentry.gy Fri Aug 10 06:48:40
2007
@@ -27,7 +27,7 @@
 text =     args[3];
 catpath =  args[4];
  
-roller = org.apache.roller.business.RollerFactory.getRoller();
+roller = org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger();
 user = roller.getUserManager().getUser(username);
 if (user == null) {
    println "ERROR: user ${username} not found";
@@ -44,7 +44,7 @@
    return;
 }
 
-entry = new org.apache.roller.pojos.WeblogEntryData();
+entry = new org.apache.roller.weblogger.pojos.WeblogEntry();
 entry.setWebsite(blog);
 entry.setCreator(user);
 entry.setCategory(category);
@@ -52,7 +52,7 @@
 entry.setUpdateTime(new java.sql.Timestamp(new java.util.Date().getTime()));
 entry.setTitle(title);
 entry.setText(text);
-entry.setStatus(org.apache.roller.pojos.WeblogEntryData.PUBLISHED);
+entry.setStatus(org.apache.roller.weblogger.pojos.WeblogEntry.PUBLISHED);
 
 roller.getWeblogManager().save(entry);
 roller.flush();

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?view=diff&rev=564590&r1=564589&r2=564590
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createtestdata.gy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createtestdata.gy Fri Aug 10
06:48:40 2007
@@ -13,12 +13,12 @@
 
 class RollerDatabaseGenerator {
 
-    def roller = org.apache.roller.business.RollerFactory.getRoller();
+    def roller = null;
 
-    def userCount = 50
+    def userCount = 5
     def blogCount = 2*userCount
-    def entryCount = 50
-    def commentCount = 4
+    def entryCount = 10
+    def commentCount = 3
 
     def users = []
 
@@ -109,7 +109,7 @@
         println "Creating user: " + username
         def locale   = "en_US";
         def timeZone = "America/New_York";
-        def user = new org.apache.roller.pojos.UserData();
+        def user = new org.apache.roller.weblogger.pojos.User();
         user.setUserName(username);
         user.setScreenName(username);
         user.setPassword(password);
@@ -130,7 +130,7 @@
 
     def createBlog(user, handle, name, desc, theme) {
         println "Creating blog: " + handle
-        def website = new org.apache.roller.pojos.WebsiteData(
+        def website = new org.apache.roller.weblogger.pojos.Weblog(
             handle, 
             user,
             name,
@@ -140,7 +140,7 @@
             theme,
             user.getLocale(),
             user.getTimeZone());
-            def cat = new org.apache.roller.pojos.WeblogCategoryData(
+            def cat = new org.apache.roller.weblogger.pojos.WeblogCategory(
                 website, null, "cat1", "cat1", null);
         try {
             roller.getWeblogManager().saveWeblogCategory(cat);
@@ -155,7 +155,7 @@
 
     def createEntry(blog, title, text, pubTime) {
         println "Creating entry title: " + title
-        def entry = new org.apache.roller.pojos.WeblogEntryData();
+        def entry = new org.apache.roller.weblogger.pojos.WeblogEntry();
         entry.setWebsite(blog);
         entry.setCreator(blog.getCreator());
         def catName = categories.get((int)(Math.random() * categories.size()))
@@ -163,9 +163,10 @@
         entry.setCategory(category);
         entry.setPubTime(new java.sql.Timestamp(pubTime.getTime()));
         entry.setUpdateTime(new java.sql.Timestamp(pubTime.getTime()));
-        entry.setStatus(org.apache.roller.pojos.WeblogEntryData.PUBLISHED);
+        entry.setStatus(org.apache.roller.weblogger.pojos.WeblogEntry.PUBLISHED);
         entry.setText(text);
         entry.setTitle(title);
+        entry.setLocale("en_US");
         try {
             roller.getWeblogManager().saveWeblogEntry(entry);
             roller.flush();
@@ -177,13 +178,13 @@
 
     def createComment(entry, commentername, content) { 
         println "Creating comment from user: " + commentername
-        def comment = new org.apache.roller.pojos.CommentData();
+        def comment = new org.apache.roller.weblogger.pojos.WeblogEntryComment();
         comment.setWeblogEntry(entry);
         comment.setName(commentername);
         comment.setPostTime(new java.sql.Timestamp(new java.util.Date().getTime()));
         comment.setContent(content);
         comment.setNotify(Boolean.FALSE);
-        comment.setPending(Boolean.FALSE);
+        comment.setStatus(org.apache.roller.weblogger.pojos.WeblogEntryComment.APPROVED);
         try {
             roller.getWeblogManager().saveComment(comment);
             roller.flush();
@@ -195,27 +196,37 @@
     def createDatabase() {
         def properties = new Properties()
         properties.load(new FileInputStream("roller-custom.properties"))
-        def jdbcClass    = properties.get("jdbc.driverClass")
-        def jdbcUrl      = properties.get("jdbc.connectionURL")
-        def jdbcUser     = properties.get("jdbc.username")
-        def jdbcPassword = properties.get("jdbc.password")
+        def jdbcClass    = properties.get("database.jdbc.driverClass")
+        def jdbcUrl      = properties.get("database.jdbc.connectionURL")
+        def jdbcUser     = properties.get("database.jdbc.username")
+        def jdbcPassword = properties.get("database.jdbc.password")
         def ant = new AntBuilder()   
         
         // drop any existing Roller tables
         ant.sql(onerror:"continue", driver:jdbcClass, url:jdbcUrl, 
             userid:jdbcUser, password:jdbcPassword,
-            src:"../../../../../build/webapp/WEB-INF/dbscripts/droptables.sql")   
+            src:"../../../../../apps/weblogger/build/webapp/WEB-INF/classes/dbscripts/droptables.sql")
  
         
         // create fresh set of Roller tables
         ant.sql(onerror:"continue", driver:jdbcClass, url:jdbcUrl, 
             userid:jdbcUser, password:jdbcPassword,
-            src:"../../../../../build/webapp/WEB-INF/dbscripts/derby/createdb.sql") 
+            src:"../../../../../apps/weblogger/build/webapp/WEB-INF/classes/dbscripts/derby/createdb.sql")

+
+        bootstrap()
 
         // set database version to 400  
-        def propManager = roller.getPropertiesManager();
-        def versionProp = new org.apache.roller.pojos.RollerPropertyData(
-            "roller.database.version","400")
-        propManager.saveProperty(versionProp)
+        //def propManager = roller.getPropertiesManager();
+        //def versionProp = new org.apache.roller.weblogger.pojos.RuntimeConfigProperty(
+            //"roller.database.version","400")
+        //propManager.saveProperty(versionProp)
+    }
+
+    def bootstrap() {
+        org.apache.roller.weblogger.business.startup.WebloggerStartup.prepare();
+        org.apache.roller.weblogger.business.WebloggerFactory.bootstrap();
+        org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger().getPropertiesManager().initialize();
+        org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger().flush();
+        roller = org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger();
     }
 
     def createMainBlog() {
@@ -283,6 +294,7 @@
         }
     }
 }
+
 
 def generator = new RollerDatabaseGenerator()
 generator.createDatabase()

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?view=diff&rev=564590&r1=564589&r2=564590
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createuser.gy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/createuser.gy Fri Aug 10 06:48:40
2007
@@ -29,7 +29,7 @@
 locale   = "en_US";
 timeZone = "America/New_York";
 
-user = new org.apache.roller.pojos.UserData();
+user = new org.apache.roller.weblogger.pojos.User();
 user.setUserName(username);
 user.setScreenName(username);
 user.setPassword(password);
@@ -39,7 +39,7 @@
 user.setTimeZone(timeZone);
 user.setDateCreated(new java.util.Date());
 
-roller = org.apache.roller.business.RollerFactory.getRoller();
+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?view=diff&rev=564590&r1=564589&r2=564590
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/groovy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/groovy Fri Aug 10 06:48:40 2007
@@ -3,13 +3,13 @@
 # -- ENSURE THESE ARE CORRECT ---
 
 # Directory where Groovy release is installed
-export GROOVY_HOME=/Applications/Java/groovy
+export GROOVY_HOME=/usr/local/groovy
 
 # Directory of Roller webapp context
-export WEBAPP_DIR=../../../../../build/webapp
+export WEBAPP_DIR=../../../../../apps/weblogger/build/webapp
 
 # Directory of additional jars
-export JARS_DIR=/Applications/Java/tomcat/common/lib
+export JARS_DIR=/usr/local/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?view=diff&rev=564590&r1=564589&r2=564590
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/listusers.gy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/listusers.gy Fri Aug 10 06:48:40
2007
@@ -17,7 +17,7 @@
 */
 
 try {
-    roller = org.apache.roller.business.RollerFactory.getRoller();
+    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?view=diff&rev=564590&r1=564589&r2=564590
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/removeuser.gy (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/removeuser.gy Fri Aug 10 06:48:40
2007
@@ -18,7 +18,7 @@
 
 username = "scratch";
 
-roller = org.apache.roller.business.RollerFactory.getRoller();
+roller = org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger();
 user = roller.getUserManager().getUserByUserName(username);
 roller.getUserManager().removeUser(user);
 roller.flush();

Modified: roller/trunk/sandbox/scripting/groovy/examples/rollerapi/roller-custom.properties
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/examples/rollerapi/roller-custom.properties?view=diff&rev=564590&r1=564589&r2=564590
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/examples/rollerapi/roller-custom.properties (original)
+++ roller/trunk/sandbox/scripting/groovy/examples/rollerapi/roller-custom.properties Fri
Aug 10 06:48:40 2007
@@ -1,7 +1,10 @@
 
-jdbc.driverClass=org.apache.derby.jdbc.ClientDriver
-jdbc.connectionURL=jdbc:derby://localhost:1527/roller-jpa
-jdbc.username=APP 
-jdbc.password=APP 
+database.configurationType=jdbc
+database.jdbc.driverClass=org.apache.derby.jdbc.ClientDriver
+database.jdbc.connectionURL=jdbc:derby://localhost:1527/roller40test;create=true
+database.jdbc.username=APP
+database.jdbc.password=APP
 
-hibernate.dialect=org.hibernate.dialect.DerbyDialect
+log4j.category.org.apache.roller=DEBUG
+
+themes.dir=.
\ No newline at end of file



Mime
View raw message