roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [08/35] roller git commit: Get random blog data creator working again for 5.2 testing purposes.
Date Mon, 06 Nov 2017 22:17:09 GMT
Get random blog data creator working again for 5.2 testing purposes.


Project: http://git-wip-us.apache.org/repos/asf/roller/repo
Commit: http://git-wip-us.apache.org/repos/asf/roller/commit/76786112
Tree: http://git-wip-us.apache.org/repos/asf/roller/tree/76786112
Diff: http://git-wip-us.apache.org/repos/asf/roller/diff/76786112

Branch: refs/heads/master
Commit: 76786112daa4b4d6a28fc30681c6110b89c2ffa0
Parents: 959c3e1
Author: Dave Johnson <snoopdave@gmail.com>
Authored: Sun Aug 13 10:14:39 2017 -0400
Committer: Dave Johnson <snoopdave@gmail.com>
Committed: Sun Aug 13 10:14:39 2017 -0400

----------------------------------------------------------------------
 .../groovy/examples/rollerapi/createtestdata.gy | 31 ++++++++++----------
 .../scripting/groovy/examples/rollerapi/groovy  | 14 ++++-----
 .../groovy/examples/rollerapi/listusers.gy      |  8 ++---
 .../examples/rollerapi/roller-custom.properties |  8 ++---
 4 files changed, 30 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/roller/blob/76786112/docs/examples/scripting/groovy/examples/rollerapi/createtestdata.gy
----------------------------------------------------------------------
diff --git a/docs/examples/scripting/groovy/examples/rollerapi/createtestdata.gy b/docs/examples/scripting/groovy/examples/rollerapi/createtestdata.gy
index bdf785b..6dfc4f7 100644
--- a/docs/examples/scripting/groovy/examples/rollerapi/createtestdata.gy
+++ b/docs/examples/scripting/groovy/examples/rollerapi/createtestdata.gy
@@ -133,19 +133,18 @@ nisi. Duis lacinia enim id dui. Maecenas a leo. Duis lacus.""" ]
         try {
             def website = new org.apache.roller.weblogger.pojos.Weblog(
                 handle, 
-                user,
+                user.getUserName(),
                 name,
                 desc,
                 user.getEmailAddress(),
-                user.getEmailAddress(),
                 theme,
                 user.getLocale(),
                 user.getTimeZone());
             def cat = new org.apache.roller.weblogger.pojos.WeblogCategory(
-                website, null, "cat1", "cat1", null);
-            roller.getWeblogManager().saveWeblogCategory(cat);
-            website.setDefaultCategory(cat);
-            roller.getUserManager().addWebsite(website);
+                website, "cat1", "cat1", null);
+            roller.getWeblogEntryManager().saveWeblogCategory(cat);
+            //website.setDefaultCategory(cat);
+            roller.getUserManager().grantWeblogPermission(website, user, ["post", "admin"]);
             roller.flush();
             return website
         } catch (Exception e) {
@@ -158,17 +157,17 @@ nisi. Duis lacinia enim id dui. Maecenas a leo. Duis lacus.""" ]
         try {
             def entry = new org.apache.roller.weblogger.pojos.WeblogEntry();
             entry.setWebsite(blog);
-            entry.setCreator(blog.getCreator());
+            entry.setCreatorUserName(blog.getCreatorUserName());
             def catName = categories.get((int)(Math.random() * categories.size()))
-            def category = roller.getWeblogManager().getWeblogCategoryByPath(blog,catName)
+            def category = roller.getWeblogEntryManager().getWeblogCategoryByName(blog,catName)
             entry.setCategory(category);
-            entry.setPubTime(new java.sql.Timestamp(pubTime.getTime()));
-            entry.setUpdateTime(new java.sql.Timestamp(pubTime.getTime()));
-            entry.setStatus(org.apache.roller.weblogger.pojos.WeblogEntry.PUBLISHED);
+            entry.setPubTime( new java.sql.Timestamp(pubTime.getTime()));
+            entry.setUpdateTime( new java.sql.Timestamp(pubTime.getTime()));
+            entry.setStatus(org.apache.roller.weblogger.pojos.WeblogEntry.PubStatus.PUBLISHED);
             entry.setText(text);
             entry.setTitle(title);
             entry.setLocale("en_US");
-            roller.getWeblogManager().saveWeblogEntry(entry);
+            roller.getWeblogEntryManager().saveWeblogEntry(entry);
             roller.flush();
             return entry
         } catch (Exception e) {
@@ -185,8 +184,8 @@ nisi. Duis lacinia enim id dui. Maecenas a leo. Duis lacus.""" ]
             comment.setPostTime(new java.sql.Timestamp(new java.util.Date().getTime()));
             comment.setContent(content);
             comment.setNotify(Boolean.FALSE);
-            comment.setStatus(org.apache.roller.weblogger.pojos.WeblogEntryComment.APPROVED);
-            roller.getWeblogManager().saveComment(comment);
+            comment.setStatus(org.apache.roller.weblogger.pojos.WeblogEntryComment.ApprovalStatus.APPROVED);
+            roller.getWeblogEntryManager().saveComment(comment);
             roller.flush();
         } catch (Exception e) {
             e.printStackTrace()
@@ -205,12 +204,12 @@ nisi. Duis lacinia enim id dui. Maecenas a leo. Duis lacus.""" ]
         // drop any existing Roller tables
         ant.sql(onerror:"continue", driver:jdbcClass, url:jdbcUrl, 
             userid:jdbcUser, password:jdbcPassword,
-            src:"../../../../../apps/weblogger/build/webapp/WEB-INF/classes/dbscripts/droptables.sql")
  
+            src:"../../../../../../app/target/roller/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:"../../../../../apps/weblogger/build/webapp/WEB-INF/classes/dbscripts/derby/createdb.sql")

+            src:"../../../../../../app/target/roller/WEB-INF/classes/dbscripts/mysql/createdb.sql")
 
         bootstrap()
 

http://git-wip-us.apache.org/repos/asf/roller/blob/76786112/docs/examples/scripting/groovy/examples/rollerapi/groovy
----------------------------------------------------------------------
diff --git a/docs/examples/scripting/groovy/examples/rollerapi/groovy b/docs/examples/scripting/groovy/examples/rollerapi/groovy
index 62909ad..737484b 100755
--- a/docs/examples/scripting/groovy/examples/rollerapi/groovy
+++ b/docs/examples/scripting/groovy/examples/rollerapi/groovy
@@ -3,22 +3,22 @@
 # -- ENSURE THESE ARE CORRECT ---
 
 # Directory where Groovy release is installed
-export GROOVY_HOME=/Applications/Java/groovy
+export GROOVY_HOME=/Applications/Java/groovy-2.4.8
 
 # Directory of Roller webapp context
-export WEBAPP_DIR=../../../../../apps/weblogger/build/webapp
+export WEBAPP_DIR=../../../../../../app/target/roller
 
 # Directory of additional jars
-export JARS_DIR=/Applications/Java/tomcat/common/lib
+export JARS_DIR=/Applications/Java/lib
 
 
 # --- SHOULD NOT NEED TO EDIT BELOW THIS LINE ---
 
 RGPATH=${WEBAPP_DIR}/WEB-INF/classes:\
-${GROOVY_HOME}/embeddable/groovy-all-1.0.jar:\
-${GROOVY_HOME}/lib/commons-cli-1.0.jar:\
-${GROOVY_HOME}/lib/ant-1.6.5.jar:\
-${GROOVY_HOME}/lib/ant-launcher.1.6.5.jar
+${GROOVY_HOME}/embeddable/groovy-all-2.4.8.jar:\
+${GROOVY_HOME}/lib/commons-cli-1.2.jar:\
+${GROOVY_HOME}/lib/ant-1.9.4.jar:\
+${GROOVY_HOME}/lib/ant-launcher-1.9.4.jar
 
 for i in "$WEBAPP_DIR"/WEB-INF/lib/*.jar; do
   RGPATH="$RGPATH":"$i"

http://git-wip-us.apache.org/repos/asf/roller/blob/76786112/docs/examples/scripting/groovy/examples/rollerapi/listusers.gy
----------------------------------------------------------------------
diff --git a/docs/examples/scripting/groovy/examples/rollerapi/listusers.gy b/docs/examples/scripting/groovy/examples/rollerapi/listusers.gy
index 6de967d..f908a6a 100644
--- a/docs/examples/scripting/groovy/examples/rollerapi/listusers.gy
+++ b/docs/examples/scripting/groovy/examples/rollerapi/listusers.gy
@@ -21,12 +21,12 @@ try {
     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);
+    users = roller.getUserManager().getUsers(null, null, null, 0, -1);
     for (u in users) {
        println "   User [${u.userName}] has password [${u.password}]";
-       weblogs = roller.getUserManager().getWebsites(u, null, null, null, null, 0, Integer.MAX_VALUE);
-       for (w in weblogs) {
-          println "      Belongs to weblog [${w.handle}]";
+        permissions = roller.getUserManager().getWeblogPermissions(u)
+       for (p in permissions) {
+          println "      Belongs to weblog [${p.getWeblog().getHandle()}]";
        }
     } 
 } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/roller/blob/76786112/docs/examples/scripting/groovy/examples/rollerapi/roller-custom.properties
----------------------------------------------------------------------
diff --git a/docs/examples/scripting/groovy/examples/rollerapi/roller-custom.properties b/docs/examples/scripting/groovy/examples/rollerapi/roller-custom.properties
index 04317de..202603d 100644
--- a/docs/examples/scripting/groovy/examples/rollerapi/roller-custom.properties
+++ b/docs/examples/scripting/groovy/examples/rollerapi/roller-custom.properties
@@ -1,9 +1,9 @@
 
 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
+database.jdbc.driverClass=com.mysql.jdbc.Driver
+database.jdbc.connectionURL=jdbc:mysql://localhost/roller520new?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&mysqlEncoding=utf&useFastDateParsing=false
+database.jdbc.username=scott
+database.jdbc.password=tiger
 
 log4j.category.org.apache.roller=DEBUG
 


Mime
View raw message