roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r279745 [1/4] - in /incubator/roller/branches/roller_2.0: ./ metadata/database/hibernate/ personal/testing/ sandbox/planetroller/test/ sandbox/standalone/tomcat/ src/org/roller/business/ src/org/roller/business/hibernate/ src/org/roller/poj...
Date Fri, 09 Sep 2005 11:54:07 GMT
Author: snoopdave
Date: Fri Sep  9 04:52:39 2005
New Revision: 279745

URL: http://svn.apache.org/viewcvs?rev=279745&view=rev
Log:
Hibernate3 replaces 2 and all backend unit tests working again

Added:
    incubator/roller/branches/roller_2.0/tools/hibernate-3.0/
    incubator/roller/branches/roller_2.0/tools/hibernate-3.0/changelog.txt
    incubator/roller/branches/roller_2.0/tools/hibernate-3.0/hibernate3.jar   (with props)
    incubator/roller/branches/roller_2.0/tools/hibernate-3.0/lgpl.txt
    incubator/roller/branches/roller_2.0/tools/hibernate-3.0/lib/
    incubator/roller/branches/roller_2.0/tools/hibernate-3.0/lib/_README.txt
    incubator/roller/branches/roller_2.0/tools/hibernate-3.0/lib/asm-attrs.jar   (with props)
    incubator/roller/branches/roller_2.0/tools/hibernate-3.0/lib/asm.jar   (with props)
    incubator/roller/branches/roller_2.0/tools/hibernate-3.0/lib/cglib-2.1.jar   (with props)
    incubator/roller/branches/roller_2.0/tools/hibernate-3.0/lib/dom4j-1.6.jar   (with props)
    incubator/roller/branches/roller_2.0/tools/hibernate-3.0/lib/ehcache-1.1.jar   (with props)
    incubator/roller/branches/roller_2.0/tools/hibernate-3.0/lib/jdbc2_0-stdext.jar   (with props)
    incubator/roller/branches/roller_2.0/tools/hibernate-3.0/lib/jdbc2_0-stdext.licence.txt
    incubator/roller/branches/roller_2.0/tools/hibernate-3.0/lib/jta.jar   (with props)
    incubator/roller/branches/roller_2.0/tools/hibernate-3.0/lib/jta.licence.txt
    incubator/roller/branches/roller_2.0/tools/hibernate-3.0/readme.txt
    incubator/roller/branches/roller_2.0/tools/lib/jdom.jar   (with props)
Removed:
    incubator/roller/branches/roller_2.0/tools/hibernate-2.1/
Modified:
    incubator/roller/branches/roller_2.0/.classpath
    incubator/roller/branches/roller_2.0/build.xml
    incubator/roller/branches/roller_2.0/metadata/database/hibernate/hibernate.cfg.xml
    incubator/roller/branches/roller_2.0/personal/testing/hibernate.cfg.xml
    incubator/roller/branches/roller_2.0/personal/testing/log4j.properties
    incubator/roller/branches/roller_2.0/personal/testing/roller.properties
    incubator/roller/branches/roller_2.0/properties.xmlf
    incubator/roller/branches/roller_2.0/sandbox/planetroller/test/log4j.properties
    incubator/roller/branches/roller_2.0/sandbox/standalone/tomcat/hibernate.cfg.xml
    incubator/roller/branches/roller_2.0/src/org/roller/business/PropertiesManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/WeblogManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateAutoPingManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateBookmarkManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateConfigManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePersistenceSession.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePingQueueManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePingTargetManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePlanetManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePropertiesManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateRefererManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateRollerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateStrategy.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateWeblogManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/pojos/HierarchicalPersistentObject.java
    incubator/roller/branches/roller_2.0/src/org/roller/pojos/UserData.java
    incubator/roller/branches/roller_2.0/src/org/roller/pojos/WeblogCategoryData.java
    incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteData.java
    incubator/roller/branches/roller_2.0/tests/org/roller/RollerTestBase.java
    incubator/roller/branches/roller_2.0/tests/org/roller/business/PermissionsTest.java
    incubator/roller/branches/roller_2.0/tests/org/roller/business/PlanetManagerTest.java
    incubator/roller/branches/roller_2.0/tests/org/roller/business/TestAll.java
    incubator/roller/branches/roller_2.0/tests/org/roller/business/UserManagerTest.java
    incubator/roller/branches/roller_2.0/tests/org/roller/business/WeblogManagerTest.java
    incubator/roller/branches/roller_2.0/web/WEB-INF/classes/log4j.properties

Modified: incubator/roller/branches/roller_2.0/.classpath
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/.classpath?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/.classpath (original)
+++ incubator/roller/branches/roller_2.0/.classpath Fri Sep  9 04:52:39 2005
@@ -22,16 +22,6 @@
 	<classpathentry kind="lib" path="tools/buildtime/ant-1.6.2/ant-junit.jar"/>
 	<classpathentry kind="lib" path="tools/buildtime/ant-1.6.2/ant-commons-net.jar"/>
 	<classpathentry kind="lib" path="tools/buildtime/ant-1.6.2/ant.jar"/>
-	<classpathentry kind="lib" path="tools/hibernate-2.1/hibernate2.jar"/>
-	<classpathentry kind="lib" path="tools/hibernate-2.1/lib/xalan-2.4.0.jar"/>
-	<classpathentry kind="lib" path="tools/hibernate-2.1/lib/proxool-0.8.3.jar"/>
-	<classpathentry kind="lib" path="tools/hibernate-2.1/lib/odmg-3.0.jar"/>
-	<classpathentry kind="lib" path="tools/hibernate-2.1/lib/jta.jar"/>
-	<classpathentry kind="lib" path="tools/hibernate-2.1/lib/jdom.jar"/>
-	<classpathentry kind="lib" path="tools/hibernate-2.1/lib/ehcache-0.7.jar"/>
-	<classpathentry kind="lib" path="tools/hibernate-2.1/lib/dom4j-1.4.jar"/>
-	<classpathentry kind="lib" path="tools/hibernate-2.1/lib/cglib-full-2.0.1.jar"/>
-	<classpathentry kind="lib" path="tools/hibernate-2.1/lib/c3p0-0.8.4.5.jar"/>
 	<classpathentry kind="lib" path="tools/lib/xmlrpc-2.0.jar"/>
 	<classpathentry kind="lib" path="tools/lib/xmlrpc-1.2-b1.jar"/>
 	<classpathentry kind="lib" path="tools/lib/velocity-tools-1.1.jar"/>
@@ -70,5 +60,14 @@
 	<classpathentry kind="lib" path="contrib/lib/jython.jar"/>
 	<classpathentry kind="lib" path="contrib/lib/JSPWiki.jar"/>
 	<classpathentry kind="lib" path="tools/buildtime/junit-3.8.1.jar"/>
+	<classpathentry sourcepath="/Applications/Java/hibernate-3.0/src" kind="lib" path="tools/hibernate-3.0/hibernate3.jar"/>
+	<classpathentry kind="lib" path="tools/hibernate-3.0/lib/jta.jar"/>
+	<classpathentry kind="lib" path="tools/hibernate-3.0/lib/jdbc2_0-stdext.jar"/>
+	<classpathentry kind="lib" path="tools/hibernate-3.0/lib/ehcache-1.1.jar"/>
+	<classpathentry kind="lib" path="tools/hibernate-3.0/lib/dom4j-1.6.jar"/>
+	<classpathentry kind="lib" path="tools/hibernate-3.0/lib/cglib-2.1.jar"/>
+	<classpathentry kind="lib" path="tools/hibernate-3.0/lib/asm-attrs.jar"/>
+	<classpathentry kind="lib" path="tools/hibernate-3.0/lib/asm.jar"/>
+	<classpathentry kind="lib" path="tools/lib/jdom.jar"/>
 	<classpathentry kind="output" path="classes.eclipse"/>
 </classpath>

Modified: incubator/roller/branches/roller_2.0/build.xml
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/build.xml?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/build.xml (original)
+++ incubator/roller/branches/roller_2.0/build.xml Fri Sep  9 04:52:39 2005
@@ -418,7 +418,6 @@
         <fileset refid="commons.jars" />
         <fileset refid="struts.jars" />
         <fileset refid="jstl.jars" />
-        <fileset refid="xml.jars" />
         &custom-jars;
         <fileset dir="${ro.tools}/lib">
             <include name="mm.mysql-2.0.14-bin.jar" if="resinServer"/>

Modified: incubator/roller/branches/roller_2.0/metadata/database/hibernate/hibernate.cfg.xml
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/metadata/database/hibernate/hibernate.cfg.xml?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/metadata/database/hibernate/hibernate.cfg.xml (original)
+++ incubator/roller/branches/roller_2.0/metadata/database/hibernate/hibernate.cfg.xml Fri Sep  9 04:52:39 2005
@@ -8,13 +8,13 @@
         <!-- By default Roller uses a JNDI DataSource and the MySQLDialect -->
         <property name="show_sql">false</property>
         <property name="connection.datasource">java:comp/env/jdbc/rollerdb</property>
-        <property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
+        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
         <!--
         If you want to use HSQLDB, PostgreSQL, DB2 or Derby, then use the right dialect   
-        <property name="dialect">net.sf.hibernate.dialect.HQLDBDialect</property> 
-        <property name="dialect">net.sf.hibernate.dialect.PostgreSQLDialect</property>
-        <property name="dialect">net.sf.hibernate.dialect.DB2SQLDialect</property>
-        <property name="dialect">net.sf.hibernate.dialect.DerbyDialect</property>
+        <property name="dialect">org.hibernate.dialect.HQLDBDialect</property> 
+        <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
+        <property name="dialect">org.hibernate.dialect.DB2SQLDialect</property>
+        <property name="dialect">org.hibernate.dialect.DerbyDialect</property>
         -->
 
         <!--
@@ -23,20 +23,20 @@
         <property name="hibernate.connection.url">jdbc:hsqldb:hsql://localhost:3219</property>
         <property name="hibernate.connection.username">sa</property>
         <property name="hibernate.connection.password"></property>
-        <property name="hibernate.dialect">net.sf.hibernate.dialect.HSQLDialect</property>
+        <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
 
         <property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property>
         <property name="hibernate.connection.url">
                         jdbc:mysql://localhost/roller?user=roller&amp;password=tiger</property>
         <property name="hibernate.connection.username">roller</property>
         <property name="hibernate.connection.password">tiger</property>
-        <property name="hibernate.dialect">net.sf.hibernate.dialect.MySQLDialect</property>
+        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
 
         <property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
         <property name="hibernate.connection.url">jdbc:postgresql://localhost/rollerdb</property>
         <property name="hibernate.connection.username">scott</property>
         <property name="hibernate.connection.password">tiger</property>
-        <property name="hibernate.dialect">net.sf.hibernate.dialect.PostgreSQLDialect</property>
+        <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
         -->
 
         <mapping resource="org/roller/business/HitCountData.hbm.xml" />

Modified: incubator/roller/branches/roller_2.0/personal/testing/hibernate.cfg.xml
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/personal/testing/hibernate.cfg.xml?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/personal/testing/hibernate.cfg.xml (original)
+++ incubator/roller/branches/roller_2.0/personal/testing/hibernate.cfg.xml Fri Sep  9 04:52:39 2005
@@ -10,7 +10,7 @@
         <property name="hibernate.connection.url">jdbc:hsqldb:hsql://localhost:3219</property>
         <property name="hibernate.connection.username">sa</property>
         <property name="hibernate.connection.password"></property>
-        <property name="hibernate.dialect">net.sf.hibernate.dialect.HSQLDialect</property>
+        <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
 <!--
         <property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property>
         <property name="hibernate.connection.url">

Modified: incubator/roller/branches/roller_2.0/personal/testing/log4j.properties
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/personal/testing/log4j.properties?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/personal/testing/log4j.properties (original)
+++ incubator/roller/branches/roller_2.0/personal/testing/log4j.properties Fri Sep  9 04:52:39 2005
@@ -28,7 +28,7 @@
 log4j.category.org.roller=ERROR
 log4j.category.com.ecyrd.jspwiki=ERROR
 log4j.category.com.opensymphony.oscache=ERROR
-log4j.category.net.sf.hibernate=ERROR
+log4j.category.org.hibernate=ERROR
 log4j.category.org.roller.business.utils=ERROR
 log4j.category.org.apache.struts=ERROR
 log4j.category.org.tuckey.web.filters.urlrewrite=DEBUG

Modified: incubator/roller/branches/roller_2.0/personal/testing/roller.properties
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/personal/testing/roller.properties?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/personal/testing/roller.properties (original)
+++ incubator/roller/branches/roller_2.0/personal/testing/roller.properties Fri Sep  9 04:52:39 2005
@@ -24,26 +24,44 @@
 # properties in this file are accessed like this ...
 #    RollerConfig.getProperty("propname");
 
+# User management settings
+
+# True to allow users to register themselves via a "register" link on the main
+# page. False to disable user self-registration entirely, allowing only global 
+# admins to create new users.
+users.registration.enabled=true
+
+# True to enable group blogging. False to prevent users from creating more 
+# than one weblog and from joining other weblogs.
+groupblogging.enabled=true
+
 #----------------------------------
+# Upload settings
 
-# upload settings
+# The directory in which Roller will upload files
 uploads.dir=${user.home}/roller_data/uploads
+
+# The context path under which resoures will be made available 
 uploads.url=/resources
 
 #----------------------------------
+# Search index settings
 
-# search index settings
+# Enables indexing of weblog entries and comments and enables search servlet
+search.enabled=true
+# Directory in which search index is to be created (delete this directory to
+# force Roller to recreate the entire search index)
 search.index.dir=${user.home}/roller_data/search-index
 
 #----------------------------------
+# Cache settings, remember ... times are in milliseconds
+# Default settings suitable for 100 user system
 
-# cache settings, remember ... times are in milliseconds
-
-# number of RSS feeds to cache  (and timeout)
+# Number of RSS feeds to cache (and timeout)
 cache.filter.rss.size=100
 cache.filter.rss.timeout=3600
 
-# number of if-modified dates to cache (and timeout)
+# Number of if-modified dates to cache (and timeout)
 cache.filter.ifmodified.size=100
 cache.filter.ifmodified.timeout=1800
 
@@ -52,27 +70,34 @@
 cache.filter.page.timeout=3600
 
 #----------------------------------
+# Secure login configs
 
-# secure login configs
+# Enables HTTPS for login page only
 securelogin.enabled=false
 
-# these are only used if secure login is enabled
+# These are only used if secure login is enabled
 securelogin.http.port=80
 securelogin.https.port=443
+
+# Header to be used to determine if HTTPS is active. Needed in cases where
+# request.isSecure() cannot be relied on (e.g if system is behind an SSL 
+# accelerator).
 #securelogin.https.headername=X-SSL
+# Header value to be used to determine if HTTPS is active. Leave this empty
+# to simply check for the existance of the header.
 #securelogin.https.headervalue=
 
-# password security setting
+# Password security settings. Warning enabling password encryption may make
+# if more difficult to support the Atom Protocol (due in Fall 2005).
 passwds.encryption.enabled=false
 passwds.encryption.algorithm=SHA
 
 #----------------------------------
+# Enabled plugins ... remember, order does matter!!
 
-# enabled plugins ... remember, order does matter!!
-
-# these are plugins available for a weblog
+# Weblog entry editor plugins (all are off by default).
 plugins.page=\
-,org.roller.presentation.velocity.plugins.topictag.TopicTagPlugin \
+org.roller.presentation.velocity.plugins.topictag.TopicTagPlugin \
 ,org.roller.presentation.velocity.plugins.textile.TextilePlugin \
 ,org.roller.presentation.velocity.plugins.acronyms.AcronymsPlugin \
 ,org.roller.presentation.velocity.plugins.bookmarks.BookmarkPlugin \
@@ -81,31 +106,37 @@
 ,org.roller.presentation.velocity.plugins.readmore.ReadMorePlugin
 
 #----------------------------------
-
 # scheduled tasks, each is comma separated list of classes
 
-tasks.daily=org.roller.presentation.BlacklistUpdateTask\
-,org.roller.presentation.TurnoverReferersTask\
+# Comma separated list of task classnames to be executed once per day
+tasks.daily=org.roller.presentation.TurnoverReferersTask\
+
+# Needed to enable nightly fetching of blacklist
+#,org.roller.presentation.BlacklistUpdateTask\
 
+# Daily Planet task: syncs weblog list with Roller, refreshes Technorati stats
 #,org.roller.presentation.planet.SyncWebsitesTask
 
+# Comma separated list of task classnames to be executed hourly
 tasks.hourly=\
 
+# Hourly Planet task: refresh latest entry list from all weblogs in list
 #org.roller.presentation.planet.RefreshEntriesTask
 
 #----------------------------------
+# Velocity settings
 
-# velocity settings
 velocity.properties=/WEB-INF/velocity.properties
 velocity.toolbox.file=/WEB-INF/toolbox.xml
 
 # Page model implementation
 velocity.pagemodel.classname=org.roller.presentation.velocity.PageModel
+# Experimental page model that allows user's access to Planet aggregations
 #velocity.pagemodel.classname=org.roller.presentation.velocity.planet.PlanetPageModel
 
 #----------------------------------
+# Persistence settings
 
-# persistence settings
 persistence.roller.classname=org.roller.business.hibernate.HibernateRollerImpl
 persistence.filemanager.classname=org.roller.business.FileManagerImpl
 
@@ -120,27 +151,126 @@
 comment.notification.hideCommenterAddresses=false
 
 #----------------------------------
+# ping settings
 
-# misc settings
-
+# The number of attempts to try to reach a ping target before refusing to 
+# requeue it for further retrials. If absent, this defaults to 3.
+pings.maxPingAttempts=3
+
+# The interval between ping queue processing runs in minutes.  Must be between 
+# 0 and 120. If set to 0, ping queue processing is disabled on this server; 
+# this is for clustered environments. Make sure it is nonzero on one host in 
+# a cluster.  Don't use the value 0 here to disable ping functionality, you 
+# will instead get an infinitely growing ping queue.  See the documentation on 
+# the properties below to disable ping functionality if you need to.
+# If absent, this defaults to 5.
+pings.queueProcessingIntervalMins=5
+
+# The set of initial common ping targets.  This is used to initialize the 
+# database if there are no common ping targets at startup.  Ping targets are 
+# specified as a comma-separated list, each target in the form {{name}{url}}.  
+# To disable initialization of common ping targets, comment this out, or set it
+# to the empty value.  Common targets can be edited in the UI; this is just 
+# used to set up some typical ones.
+pings.initialCommonTargets=\
+{{Technorati}{http://rpc.technorati.com/rpc/ping}}\
+,{{Weblogs.com}{http://rpc.weblogs.com/RPC2}}\
+,{{blo.gs}{http://ping.blo.gs/}}\
+,{{java.blogs}{http://javablogs.com/xmlrpc}}\
+,{{blogrolling.com}{http://rpc.blogrolling.com/pinger/}}
+
+# This controls whether users are allowed to add custom ping targets.  
+# Set this to false to disallow adding custom targets; if false, the 
+# Weblog:Custom Ping Targets menu item will not appear and associated actions 
+# will result in access denied messages.  Leave this false or commented for 
+# normal behavior. 
+# CAUTION: Setting this to true will cause the server to remove all users' 
+# existing custom targets on startup.
+pings.disallowCustomTargets=false
+
+# This controls whether the Weblog:Pings menu item and its associated actions 
+# are enabled.  Set this to false to disallow users from configuring autopings 
+# and doing manual pings.  If absent, this defaults to true.
+# NOTE: There is a separate runtime property (configurable from the 
+# Admin:Configuration page, that can be used to suspend ping processing without 
+# disabling the UI.
+# CAUTION: Setting this to true will cause the server to remove all users' 
+# existing autoping configurations on startup. Leave this false or commented 
+# for normal behavior.
+pings.disablePingUsage=false
+
+# Setting both pings.disallowCustomTarget=true and pings.disablePingUsage=true 
+# will effectively disable the ping functionality.
+
+# This is used for debugging the ping mechanism in Roller.  If this is set 
+# to true, pings that would normally be sent will cause log messages to be sent 
+# but will NOT actually result in real pings being sent.  Leave this false or 
+# commented for normal behavior.
+pings.logOnly=false
+
+#----------------------------------
+# Planet Aggregator settings
+
+# Set to true to enable the Planet aggregator. This will cause:
+# - The main page of Roller will become an aggregated view of all blogs in the 
+#   Roller database, plus those defined in the Planet group 'external'.
+# - A new menu tab will appear for Roller admin users. This allows admins to 
+#   add/remove newsfeed subscriptions in the 'external' group.
+# - Users can then subscribe to several newsfeeds:
+#      - http://localhost:8080/roller/rss
+#      - http://localhost:8080/roller/planetrss
+#      - http://localhost:8080/roller/planetrss?group=external
 planet.aggregator.enabled=false
 
+# Planet cache must exist and must be writable by Roller process
+planet.aggregator.cache.dir=/var/roller/planetcache
+
+#----------------------------------
+# user creation setttings: blogroll and cats for new users
+
+# list of links to include in root bookmark folder of each new blog
+# format is like so: linktitle2|linkurl2,linktitle2|linkurl2,linktitle3|linkurl3
+newuser.blogroll=\
+Dave Johnson|http://rollerweblogger.org/page/roller,\
+Matt Raible|http://raibledesigns.com/page/rd,\
+Lance Lavandowska|http://brainopolis.dnsalias.com/roller/page/lance,\
+Anil Gangolli|www.busybuddha.org/blog/page/anil,\
+Henri Yandell|http://blog.generationjava.com/roller/page/bayard,\
+Allen Gilliland|http://blogs.sun.com/gconf,\
+blogs.sun.com|http://blogs.sun.com,\
+jroller.com|http://jroller.com
+
+# comma-separated list of top-level categories to be created in each new weblog
+newuser.categories=\
+General,Status,Java,Music,Politics,Music
+
+#----------------------------------
+# misc settings
+
 loginfilter.rememberme.enabled=true
 breadcrumbs.stacksize=3
 debug.memory.enabled=false
 
-# settings for the rss aggregator (not related to planet stuff)
-aggregator.enabled=true
-aggregator.cache.enabled=true
-aggregator.cache.timeout=14400
+# editor theme to be used (corresponds to directory name under /theme)
+editor.theme=tan
 
 #---------------------------------
 # settings for various plugins
 
 # Optional site-wide customization settings for the TopicTag plugin.
-# n.b. these default settings match the coded default values that would be applied if these were omitted.
+# n.b. these default settings match the coded default values that would be 
+# applied if these were omitted.
 org.roller.presentation.velocity.plugins.topictag.TopicTagPlugin.defaultTopicBookmarkName=Default Topic Site
 org.roller.presentation.velocity.plugins.topictag.TopicTagPlugin.defaultTopicSite=http://www.technorati.com/tag
 org.roller.presentation.velocity.plugins.topictag.TopicTagPlugin.tagRegexWithBookmark=topic:\\{(.*?)\\}\\[(.*?)\\]
 org.roller.presentation.velocity.plugins.topictag.TopicTagPlugin.tagRegexWithoutBookmark=topic:\\[(.*?)\\]
 org.roller.presentation.velocity.plugins.topictag.TopicTagPlugin.linkFormatString=<a rel=\"tag\" href=\"{0}{1}\">{2}</a>
+
+#----------------------------------
+# legacy settings (thing that should be deprecated
+
+# settings for old #showNewseeds macro (not related to Planet stuff)
+aggregator.enabled=false
+aggregator.cache.enabled=
+aggregator.cache.timeout=14400
+

Modified: incubator/roller/branches/roller_2.0/properties.xmlf
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/properties.xmlf?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/properties.xmlf (original)
+++ incubator/roller/branches/roller_2.0/properties.xmlf Fri Sep  9 04:52:39 2005
@@ -14,7 +14,7 @@
 <property name="build.jspc"          value="${ro.build}/jspc"/>
 <property name="build.reports"       value="${ro.build}/reports"/>
 <property name="tools.struts"        value="${ro.tools}/struts-1.2.4" />
-<property name="tools.hibernate"     value="${ro.tools}/hibernate-2.1" />
+<property name="tools.hibernate"     value="${ro.tools}/hibernate-3.0" />
 <property name="tools.jstl"          value="${ro.tools}/standard-1.0.3" />
 <property name="tools.xdoclet"    value="${ro.tools}/buildtime/xdoclet-1.2" />
 <property name="tools.tomcat"     value="${ro.tools}/buildtime/tomcat-5.0.28" />
@@ -45,6 +45,7 @@
     <include name="commons-codec-1.1.jar" />
     <include name="concurrent-1.3.2.jar"/>
     <include name="jazzy-core.jar" />
+    <include name="jdom.jar"/>
     <include name="lucene-1.4.3.jar"/>
     <include name="log4j-1.2.4.jar"/>
     <include name="rome-0.6.jar"/>
@@ -61,11 +62,6 @@
     <include name="taglibs-string.jar"/>
 </fileset>
 
-<fileset id="xml.jars" dir="${tools.hibernate}/lib">
-    <include name="jdom.jar"/>
-    <include name="dom4j-1.4.jar"/>
-</fileset>
-
 <fileset id="commons.jars" dir="${tools.struts}/lib">
     <include name="commons-*.jar"/>
 </fileset>
@@ -91,24 +87,19 @@
 </fileset>
 
 <fileset id="hibernate.jar" dir="${tools.hibernate}">
-    <include name="hibernate2.jar"/>
+    <include name="hibernate3.jar"/>
 </fileset>
 
 <fileset id="hibernate.jars" dir="${tools.hibernate}/lib">
     <include name="*.jar"/>
 </fileset>
 
-<path id="xml.path">
-    <fileset refid="xml.jars" />
-</path>
-
 <!-- **************************************************************** -->
 <!-- Define path based on above filesets -->
 <!-- **************************************************************** -->
 
 <!-- Dependencies common to both presentation and business layers -->
 <path id="base.path">
-    <path refid="xml.path"/>
     <fileset refid="base.jars"/>
     <fileset refid="mail.jars"/>
     <fileset refid="commons.jars"/>

Modified: incubator/roller/branches/roller_2.0/sandbox/planetroller/test/log4j.properties
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/sandbox/planetroller/test/log4j.properties?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/sandbox/planetroller/test/log4j.properties (original)
+++ incubator/roller/branches/roller_2.0/sandbox/planetroller/test/log4j.properties Fri Sep  9 04:52:39 2005
@@ -26,7 +26,7 @@
 # Options are: DEBUG, INFO, WARN, ERROR, FATAL
 log4j.category.com.ecyrd.jspwiki=ERROR
 log4j.category.com.opensymphony.oscache=ERROR
-log4j.category.net.sf.hibernate=ERROR
+log4j.category.org.hibernate=ERROR
 log4j.category.org.roller=ERROR
 log4j.category.org.roller.business.utils=INFO
 log4j.category.org.apache.struts=ERROR

Modified: incubator/roller/branches/roller_2.0/sandbox/standalone/tomcat/hibernate.cfg.xml
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/sandbox/standalone/tomcat/hibernate.cfg.xml?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/sandbox/standalone/tomcat/hibernate.cfg.xml (original)
+++ incubator/roller/branches/roller_2.0/sandbox/standalone/tomcat/hibernate.cfg.xml Fri Sep  9 04:52:39 2005
@@ -10,7 +10,7 @@
         <property name="hibernate.connection.url">jdbc:hsqldb:hsql://localhost:7475</property>
         <property name="hibernate.connection.username">sa</property>
         <property name="hibernate.connection.password"></property>
-        <property name="hibernate.dialect">net.sf.hibernate.dialect.HSQLDialect</property>
+        <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
 
         <mapping resource="org/roller/business/HitCountData.hbm.xml" />
         <mapping resource="org/roller/pojos/BookmarkData.hbm.xml" />

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/PropertiesManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/PropertiesManagerImpl.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/PropertiesManagerImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/PropertiesManagerImpl.java Fri Sep  9 04:52:39 2005
@@ -6,23 +6,25 @@
 
 package org.roller.business;
 
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.roller.RollerException;
-import org.roller.model.PropertiesManager;
-import org.roller.model.Roller;
-import org.roller.model.RollerFactory;
-import org.roller.pojos.RollerConfigData;
-import org.roller.pojos.RollerPropertyData;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.HashMap;
+import org.roller.RollerPermissionsException;
 import org.roller.config.RollerRuntimeConfig;
 import org.roller.config.runtime.ConfigDef;
 import org.roller.config.runtime.DisplayGroup;
 import org.roller.config.runtime.PropertyDef;
 import org.roller.config.runtime.RuntimeConfigDefs;
+import org.roller.model.PropertiesManager;
+import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
+import org.roller.pojos.RollerConfigData;
+import org.roller.pojos.RollerPropertyData;
+import org.roller.pojos.UserData;
 
 /**
  * Abstract PropertiesManager implementation.
@@ -88,12 +90,19 @@
      */
     public void store(Map properties) throws RollerException
     {
+        UserData user = this.mStrategy.getUser();
+        if (!user.hasRole("admin") && !user.equals(UserData.SYSTEM_USER)) 
+        {
+            throw new RollerPermissionsException(
+                    "Only global admin or system user can save properties");
+        }
+                
         // just go through the list and store each property
         Iterator props = properties.values().iterator();
         while (props.hasNext())
         {
             try
-            {
+            {  
                 this.mStrategy.store((RollerPropertyData) props.next());
             }
             catch (RollerException re)

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/WeblogManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/WeblogManagerImpl.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/WeblogManagerImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/WeblogManagerImpl.java Fri Sep  9 04:52:39 2005
@@ -222,11 +222,10 @@
     public void removeCommentsForEntry(String entryId) throws RollerException
     {
 		List comments = getComments(entryId, false); // get all Comments
-		Iterator it = comments.iterator();
-		while (it.hasNext())
-		{
-			removeComment( ((CommentData)it.next()).getId() );
-		}
+        for (int i=comments.size()-1; i>=0; i--)
+        {
+            ((CommentData)comments.get(i)).remove();
+        }
 	}
 
     //---------------------------------------------------- CommentData Queries

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateAutoPingManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateAutoPingManagerImpl.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateAutoPingManagerImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateAutoPingManagerImpl.java Fri Sep  9 04:52:39 2005
@@ -8,10 +8,10 @@
 
 package org.roller.business.hibernate;
 
-import net.sf.hibernate.Criteria;
-import net.sf.hibernate.HibernateException;
-import net.sf.hibernate.Session;
-import net.sf.hibernate.expression.Expression;
+import org.hibernate.Criteria;
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
+import org.hibernate.criterion.Expression;
 import org.roller.RollerException;
 import org.roller.business.PersistenceStrategy;
 import org.roller.business.AutoPingManagerImpl;

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateBookmarkManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateBookmarkManagerImpl.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateBookmarkManagerImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateBookmarkManagerImpl.java Fri Sep  9 04:52:39 2005
@@ -2,10 +2,10 @@
  * Created on Jun 18, 2004
  */
 package org.roller.business.hibernate;
-import net.sf.hibernate.Criteria;
-import net.sf.hibernate.HibernateException;
-import net.sf.hibernate.Session;
-import net.sf.hibernate.expression.Expression;
+import org.hibernate.Criteria;
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
+import org.hibernate.criterion.Expression;
 import org.roller.RollerException;
 import org.roller.business.BookmarkManagerImpl;
 import org.roller.business.PersistenceStrategy;

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateConfigManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateConfigManagerImpl.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateConfigManagerImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateConfigManagerImpl.java Fri Sep  9 04:52:39 2005
@@ -3,9 +3,9 @@
  */
 package org.roller.business.hibernate;
 
-import net.sf.hibernate.Criteria;
-import net.sf.hibernate.HibernateException;
-import net.sf.hibernate.Session;
+import org.hibernate.Criteria;
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
 
 import org.roller.RollerException;
 import org.roller.business.ConfigManagerImpl;

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePersistenceSession.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePersistenceSession.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePersistenceSession.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePersistenceSession.java Fri Sep  9 04:52:39 2005
@@ -1,6 +1,6 @@
 package org.roller.business.hibernate;
 
-import net.sf.hibernate.Session;
+import org.hibernate.Session;
 
 import org.roller.model.PersistenceSession;
 import org.roller.pojos.UserData;

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePingQueueManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePingQueueManagerImpl.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePingQueueManagerImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePingQueueManagerImpl.java Fri Sep  9 04:52:39 2005
@@ -8,11 +8,11 @@
 
 package org.roller.business.hibernate;
 
-import net.sf.hibernate.Criteria;
-import net.sf.hibernate.HibernateException;
-import net.sf.hibernate.Session;
-import net.sf.hibernate.expression.Expression;
-import net.sf.hibernate.expression.Order;
+import org.hibernate.Criteria;
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
+import org.hibernate.criterion.Expression;
+import org.hibernate.criterion.Order;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.roller.RollerException;

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePingTargetManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePingTargetManagerImpl.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePingTargetManagerImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePingTargetManagerImpl.java Fri Sep  9 04:52:39 2005
@@ -8,11 +8,11 @@
 
 package org.roller.business.hibernate;
 
-import net.sf.hibernate.Criteria;
-import net.sf.hibernate.HibernateException;
-import net.sf.hibernate.Session;
-import net.sf.hibernate.expression.Expression;
-import net.sf.hibernate.expression.Order;
+import org.hibernate.Criteria;
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
+import org.hibernate.criterion.Expression;
+import org.hibernate.criterion.Order;
 import org.roller.RollerException;
 import org.roller.business.PersistenceStrategy;
 import org.roller.business.PingTargetManagerImpl;

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePlanetManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePlanetManagerImpl.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePlanetManagerImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePlanetManagerImpl.java Fri Sep  9 04:52:39 2005
@@ -23,12 +23,12 @@
 import java.util.List;
 import java.util.Map;
 
-import net.sf.hibernate.Criteria;
-import net.sf.hibernate.HibernateException;
-import net.sf.hibernate.Query;
-import net.sf.hibernate.Session;
-import net.sf.hibernate.expression.Expression;
-import net.sf.hibernate.expression.Order;
+import org.hibernate.Criteria;
+import org.hibernate.HibernateException;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.criterion.Expression;
+import org.hibernate.criterion.Order;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -256,7 +256,7 @@
                                     +((endTime-startTime)/1000.0)+" seconds");
             }
         }
-        catch (Exception e)
+        catch (Throwable e)
         {
             logger.error("ERROR: building aggregation for: "+group, e);
             throw new RollerException(e);
@@ -291,7 +291,7 @@
             List list = criteria.list();
             return list.iterator();
         }
-        catch (Exception e)
+        catch (Throwable e)
         {
             throw new RuntimeException(
                     "ERROR fetching subscription collection", e);
@@ -307,7 +307,7 @@
                 "select count(*) from org.roller.pojos.PlanetSubscriptionData").uniqueResult();
             return count.intValue();
         }
-        catch (Exception e)
+        catch (Throwable e)
         {
             throw new RuntimeException(
                     "ERROR fetching subscription count", e);

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePropertiesManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePropertiesManagerImpl.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePropertiesManagerImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePropertiesManagerImpl.java Fri Sep  9 04:52:39 2005
@@ -10,10 +10,10 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import net.sf.hibernate.Criteria;
-import net.sf.hibernate.HibernateException;
-import net.sf.hibernate.Session;
-import net.sf.hibernate.expression.Expression;
+import org.hibernate.Criteria;
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
+import org.hibernate.criterion.Expression;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.roller.RollerException;

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateRefererManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateRefererManagerImpl.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateRefererManagerImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateRefererManagerImpl.java Fri Sep  9 04:52:39 2005
@@ -11,18 +11,18 @@
 import java.util.Iterator;
 import java.util.List;
 
-import net.sf.hibernate.Criteria;
-import net.sf.hibernate.Hibernate;
-import net.sf.hibernate.HibernateException;
-import net.sf.hibernate.Session;
-import net.sf.hibernate.expression.Expression;
-import net.sf.hibernate.expression.Junction;
-import net.sf.hibernate.expression.Order;
-import net.sf.hibernate.type.Type;
-
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.hibernate.Criteria;
+import org.hibernate.Hibernate;
+import org.hibernate.HibernateException;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.criterion.Expression;
+import org.hibernate.criterion.Junction;
+import org.hibernate.criterion.Order;
+import org.hibernate.type.Type;
 import org.roller.RollerException;
 import org.roller.business.PersistenceStrategy;
 import org.roller.business.RefererManagerImpl;
@@ -289,11 +289,12 @@
         List results;
         try
         {
-            results = session.find(
+            Query q = session.createQuery(
                "select sum(h.dayHits),sum(h.totalHits) from h in class " +
                "org.roller.pojos.RefererData " +
-               "where h.website.enabled=? and h.website.id=? ",
-               args, types);
+               "where h.website.enabled=? and h.website.id=? ");
+            q.setParameters(args, types);
+            results = q.list();
         }
         catch (HibernateException e)
         {

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateRollerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateRollerImpl.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateRollerImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateRollerImpl.java Fri Sep  9 04:52:39 2005
@@ -3,9 +3,9 @@
  */
 package org.roller.business.hibernate;
 
-import net.sf.hibernate.HibernateException;
-import net.sf.hibernate.SessionFactory;
-import net.sf.hibernate.cfg.Configuration;
+import org.hibernate.HibernateException;
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Configuration;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.roller.RollerException;
@@ -121,7 +121,7 @@
 		{
 			mStrategy.rollback();
 		}
-		catch (Exception e)
+		catch (Throwable e)
 		{
 			mLogger.error(e);
 		}
@@ -283,7 +283,7 @@
         {
             if (mStrategy != null) mStrategy.release(); 
         }
-        catch (Exception e)
+        catch (Throwable e)
         {
             mLogger.error(
             "Exception with mSupport.release() [" + e + "]", e);

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateStrategy.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateStrategy.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateStrategy.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateStrategy.java Fri Sep  9 04:52:39 2005
@@ -5,14 +5,14 @@
 
 import java.util.List;
 
-import net.sf.hibernate.HibernateException;
-import net.sf.hibernate.ObjectNotFoundException;
-import net.sf.hibernate.Session;
-import net.sf.hibernate.SessionFactory;
-import net.sf.hibernate.type.Type;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.hibernate.HibernateException;
+import org.hibernate.ObjectNotFoundException;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.type.Type;
 import org.roller.RollerException;
 import org.roller.RollerPermissionsException;
 import org.roller.business.PersistenceStrategy;
@@ -106,7 +106,7 @@
                 Session hses = mSessionFactory.openSession();
                 ses = new HibernatePersistenceSession(user, hses);
             }
-            catch (Exception e)
+            catch (Throwable e)
             {
                 mLogger.error(Messages.getString(
                     "HibernateStrategy.exceptionOpeningSession"));
@@ -191,6 +191,7 @@
             if (obj.canSave()) 
             {
                 getSession().delete(obj);
+                getSession().flush();
             }
             else
             {
@@ -224,6 +225,7 @@
             if (po.getId() != null) // no need to delete transient object
             {
                 getSession().delete(po);
+                getSession().flush();
             }
         }
         catch (HibernateException e)
@@ -263,9 +265,9 @@
         Session ses = getSession();
         try
         {
-            obj = (PersistentObject)ses.load( clazz, id );
+            obj = (PersistentObject)ses.get( clazz, id );
         }
-        catch (Exception e)
+        catch (Throwable e)
         {
             if (mLogger.isDebugEnabled())
             {
@@ -375,9 +377,11 @@
               {
                   query = query.replaceAll("\\$\\d+", "\\?");
               }
-              return getSession().find(query,args,types);
+              Query q = getSession().createQuery(query);
+              q.setParameters(args,types);
+              return q.list();
           }
-          catch (Exception e)
+          catch (Throwable e)
           {
               String msg = Messages.getString("HibernateStrategy.duringQuery");
               mLogger.error(msg, e);
@@ -399,9 +403,10 @@
             {
                 query = query.replaceAll("\\$\\d+", "\\?");
             }
-            return getSession().find(query);
+            Query q = getSession().createQuery(query);
+            return q.list();
         }
-        catch (Exception e)
+        catch (Throwable e)
         {
             String msg = Messages.getString("HibernateStrategy.duringQuery");
             mLogger.error(msg, e);
@@ -429,7 +434,7 @@
                 }
             }
         }
-        catch (Exception he) // HibernateExeption or SQLException
+        catch (Throwable he) // HibernateExeption or SQLException
         {
             newSession();
             throw new RollerException(he);
@@ -450,7 +455,7 @@
                 getSession().connection().rollback();
             }
         }
-        catch (Exception he)
+        catch (Throwable he)
         {
             newSession();            
             if (mLogger.isDebugEnabled())

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateUserManagerImpl.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateUserManagerImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateUserManagerImpl.java Fri Sep  9 04:52:39 2005
@@ -8,13 +8,12 @@
 import java.util.Iterator;
 import java.util.List;
 
-import net.sf.hibernate.Criteria;
-import net.sf.hibernate.HibernateException;
-import net.sf.hibernate.Session;
-import net.sf.hibernate.expression.EqExpression;
-import net.sf.hibernate.expression.Expression;
-import net.sf.hibernate.expression.MatchMode;
-import net.sf.hibernate.expression.Order;
+import org.hibernate.Criteria;
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
+import org.hibernate.criterion.Expression;
+import org.hibernate.criterion.MatchMode;
+import org.hibernate.criterion.Order;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -159,14 +158,14 @@
             {
                 criteria.add(
                    Expression.conjunction()
-                       .add(new EqExpression("handle", handle, true))
+                       .add(Expression.eq("handle", handle))
                        .add(Expression.eq("enabled", enabled)));
             }
             else
             {
                 criteria.add(
                     Expression.conjunction()
-                        .add(new EqExpression("handle", handle, true)));
+                        .add(Expression.eq("handle", handle)));
             }        
             return (WebsiteData)criteria.uniqueResult();
         }
@@ -191,14 +190,14 @@
             {
                 criteria.add(
                    Expression.conjunction()
-                       .add(new EqExpression("userName", userName, true))
+                       .add(Expression.eq("userName", userName))
                        .add(Expression.eq("enabled", enabled)));
             }
             else
             {
                 criteria.add(
                     Expression.conjunction()
-                        .add(new EqExpression("userName", userName, true)));
+                        .add(Expression.eq("userName", userName)));
             }        
             return (UserData)criteria.uniqueResult();
         }
@@ -377,26 +376,6 @@
         }
     }
 
-//    public void removeUserWebsites(UserData user) throws RollerException
-//    {
-//        Session session = ((HibernateStrategy)mStrategy).getSession();
-//        Criteria criteria = session.createCriteria(WebsiteData.class);
-//        criteria.add(Expression.eq("user", user));
-//        try
-//        {
-//            List websites = criteria.list();
-//            for (Iterator iter = websites.iterator(); iter.hasNext();) 
-//            {
-//                WebsiteData website = (WebsiteData)iter.next();
-//                website.remove();
-//            }            
-//        }
-//        catch (HibernateException e)
-//        {
-//            throw new RollerException(e);
-//        }
-//    }
-
     /** 
      * @see org.roller.model.UserManager#removeWebsiteContents(org.roller.pojos.WebsiteData)
      */
@@ -410,24 +389,7 @@
             //UserManager umgr = RollerFactory.getRoller().getUserManager();
             BookmarkManager bmgr = RollerFactory.getRoller().getBookmarkManager();
             WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
-            //PersistenceStrategy pstrat = RollerFactory.getRoller().getPersistenceStrategy();
-            //QueryFactory factory = pstrat.getQueryFactory();
             
-            // remove folders (takes bookmarks with it)
-            FolderData rootFolder = bmgr.getRootFolder(website);
-            if (null != rootFolder)
-            { 
-                rootFolder.remove();
-                // Still cannot get all Bookmarks cleared!                
-//                Iterator allFolders = bmgr.getAllFolders(website).iterator();
-//                while (allFolders.hasNext()) 
-//                {
-//                    FolderData aFolder = (FolderData)allFolders.next();
-//                    bmgr.deleteFolderContents(aFolder);
-//                    aFolder.remove();
-//                }
-            }
-                        
             // remove entries
             Criteria entryQuery = session.createCriteria(WeblogEntryData.class);
             entryQuery.add(Expression.eq("website", website));
@@ -435,9 +397,25 @@
             for (Iterator iter = entries.iterator(); iter.hasNext();) 
             {
                 WeblogEntryData entry = (WeblogEntryData) iter.next();
+                System.out.println("Removing entry: " + entry.getId());
                 entry.remove();
             }
             
+            // remove folders (takes bookmarks with it)
+            FolderData rootFolder = bmgr.getRootFolder(website);
+            if (null != rootFolder)
+            { 
+                rootFolder.remove();
+                // Still cannot get all Bookmarks cleared!                
+                Iterator allFolders = bmgr.getAllFolders(website).iterator();
+                while (allFolders.hasNext()) 
+                {
+                    FolderData aFolder = (FolderData)allFolders.next();
+                    bmgr.deleteFolderContents(aFolder);
+                    aFolder.remove();
+                }
+            }
+                        
             // remove associated pages
             Criteria pageQuery = session.createCriteria(WeblogTemplate.class);
             pageQuery.add(Expression.eq("website", website));
@@ -463,11 +441,11 @@
             if (null != rootCat)
             {
                 rootCat.remove();
-                Iterator it = wmgr.getWeblogCategories(website).iterator();
-                while (it.hasNext()) 
-                {
-                     ((WeblogCategoryData)it.next()).remove();
-                }
+//                Iterator it = wmgr.getWeblogCategories(website).iterator();
+//                while (it.hasNext()) 
+//                {
+//                     ((WeblogCategoryData)it.next()).remove();
+//                }
             }
 
             // Remove the website's ping queue entries

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateWeblogManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateWeblogManagerImpl.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateWeblogManagerImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateWeblogManagerImpl.java Fri Sep  9 04:52:39 2005
@@ -3,12 +3,12 @@
  */
 package org.roller.business.hibernate;
 
-import net.sf.hibernate.Criteria;
-import net.sf.hibernate.HibernateException;
-import net.sf.hibernate.Session;
-import net.sf.hibernate.expression.Expression;
-import net.sf.hibernate.expression.Junction;
-import net.sf.hibernate.expression.Order;
+import org.hibernate.Criteria;
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
+import org.hibernate.criterion.Expression;
+import org.hibernate.criterion.Junction;
+import org.hibernate.criterion.Order;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -505,19 +505,7 @@
                 RefererData referer = (RefererData) iter.next();
                 referer.remove();
             }
-            
-            // remove comments
-            /*
-            Criteria commentQuery = session.createCriteria(RefererData.class);
-            commentQuery.add(Expression.eq("weblogEntry", entry));
-            List comments = commentQuery.list();
-            */
-            List comments = RollerFactory.getRoller().getWeblogManager().getComments(entry.getId(), false);
-            for (Iterator iter = comments.iterator(); iter.hasNext();) 
-            {
-                CommentData comment = (CommentData) iter.next();
-                comment.remove();
-            }
+            removeCommentsForEntry(entry.getId());
         }
         catch (HibernateException e)
         {

Modified: incubator/roller/branches/roller_2.0/src/org/roller/pojos/HierarchicalPersistentObject.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/pojos/HierarchicalPersistentObject.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/pojos/HierarchicalPersistentObject.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/pojos/HierarchicalPersistentObject.java Fri Sep  9 04:52:39 2005
@@ -99,18 +99,7 @@
             currentAssoc = currentAssoc.getAncestor().getParentAssoc();
             count++;
         }
-        
-        // all descendents must also reset their ancestor links
-//        Query childQuery = 
-//            pstrategy.getQueryFactory().createQuery(getAssocClass());
-//        childQuery.setWhere(
-//            pstrategy.getQueryFactory().createCondition(                
-//                pstrategy.getQueryFactory().createCondition(
-//                    getAncestorPropertyName(), Query.EQ, this),
-//                Query.AND,                        
-//                pstrategy.getQueryFactory().createCondition(
-//                    "relation", Query.EQ, Assoc.PARENT)));
-//        
+
         Iterator children = getChildAssocs().iterator();
         while (children.hasNext())
         {
@@ -122,7 +111,7 @@
             // recursively...
             assoc.getObject().save();    
         }
-        
+    
         // Clear new parent now that new parent has been saved
         mNewParent = null;
     }
@@ -136,10 +125,10 @@
 
         // loop to remove all of my descendents and associations
         List toRemove = new LinkedList();
-        Iterator catIter = this.getAllDescendentAssocs().iterator();
-        while (catIter.hasNext())
+        List assocs = this.getAllDescendentAssocs();
+        for (int i=assocs.size()-1; i>=0; i--)
         {
-            Assoc assoc = (Assoc)catIter.next();
+            Assoc assoc = (Assoc)assocs.get(i);
             HierarchicalPersistentObject hpo = assoc.getObject();
             
             // remove my descendent's parent and grandparent associations
@@ -151,7 +140,7 @@
             }
             
             // remove decendent association and descendents
-            assoc.remove();
+            //assoc.remove();
             toRemove.add(hpo);
         }
         Iterator removeIterator = toRemove.iterator();
@@ -187,91 +176,5 @@
     {
         return mNewParent;
     }
-    
-//    /** Query database to get parent association. */
-//    protected Assoc getParentAssoc() 
-//        throws RollerException
-//    {
-//        Class clazz = getAssocClass();
-//        String objectColName = getObjectPropertyName();
-//
-//        QueryFactory factory =
-//          RollerFactory.getRoller().getPersistenceStrategy().getQueryFactory();
-//        Query query = factory.createQuery(clazz);
-//        
-//        Condition catCond = 
-//            factory.createCondition(objectColName, Query.EQ, this);
-//        Condition parentCond =
-//            factory.createCondition("relation",Query.EQ,Assoc.PARENT);
-//        query.setWhere(factory.createCondition(catCond, Query.AND, parentCond));
-//        List parents = query.execute();
-//        
-//        if (parents.size() > 1)
-//        {
-//            throw new RollerException("ERROR: more than one parent");
-//        }
-//        else if (parents.size() == 1)
-//        {
-//            return (Assoc) parents.get(0);
-//        }
-//        else
-//        {
-//            return null;
-//        }
-//    }
-//
-//    /** Get child associations, those whose parent is this category. */
-//    protected List getChildAssocs() 
-//        throws RollerException
-//    {
-//        Class clazz = getAssocClass();
-//        String assocColName = getAncestorPropertyName();       
-//
-//        QueryFactory factory =
-//            RollerFactory
-//                .getRoller()
-//                .getPersistenceStrategy()
-//                .getQueryFactory();
-//        Query query = factory.createQuery(clazz);
-//               
-//        Condition catCond = 
-//            factory.createCondition(assocColName, Query.EQ, this);
-//        
-//        Condition parentCond =
-//            factory.createCondition("relation", Query.EQ, Assoc.PARENT);
-//        
-//        query.setWhere(factory.createCondition(catCond, Query.AND, parentCond));
-//        return query.execute();
-//    }
-//
-//    /** 
-//     * Get all descendent associations, those that have this category as an 
-//     * ancestor, public for testing purposes only.
-//     */
-//    public List getAllDescendentAssocs() 
-//        throws RollerException
-//    {
-//        Class clazz = getAssocClass();
-//        String assocColName = getAncestorPropertyName();       
-//        QueryFactory factory =
-//           RollerFactory.getRoller().getPersistenceStrategy().getQueryFactory();
-//        Query query = factory.createQuery(clazz);
-//        query.setWhere(factory.createCondition(assocColName, Query.EQ, this));
-//        return query.execute();
-//    }
-//    
-//    /** 
-//     * Get all ancestor associations, public for testing purposes only. 
-//     */
-//    public List getAncestorAssocs() 
-//        throws RollerException
-//    {
-//        Class clazz = getAssocClass();
-//        String objectColName = getObjectPropertyName();
-//        QueryFactory factory =
-//           RollerFactory.getRoller().getPersistenceStrategy().getQueryFactory();
-//        Query query = factory.createQuery(clazz);
-//        query.setWhere(factory.createCondition(objectColName, Query.EQ, this));
-//        return query.execute();
-//    }     
+       
 }

Modified: incubator/roller/branches/roller_2.0/src/org/roller/pojos/UserData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/pojos/UserData.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/pojos/UserData.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/pojos/UserData.java Fri Sep  9 04:52:39 2005
@@ -13,6 +13,7 @@
 import org.roller.model.Roller;
 import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
+import org.roller.util.PojoUtil;
 import org.roller.util.Utilities;
 
 
@@ -283,6 +284,25 @@
 
    public boolean equals( Object pOther )
    {
+       if (pOther instanceof UserData)
+       {
+           UserData lTest = (UserData) pOther;
+           boolean lEquals = true;
+           lEquals = PojoUtil.equals(lEquals, this.getId(), lTest.getId());
+           lEquals = PojoUtil.equals(lEquals, this.getUserName(), lTest.getUserName());
+           lEquals = PojoUtil.equals(lEquals, this.getPassword(), lTest.getPassword());
+           lEquals = PojoUtil.equals(lEquals, this.getFullName(), lTest.getFullName());
+           lEquals = PojoUtil.equals(lEquals, this.getEmailAddress(), lTest.getEmailAddress());
+           return lEquals;
+       }
+       else
+       {
+           return false;
+       }
+    }
+   
+   /*public boolean equals( Object pOther )
+   {
       if( pOther instanceof UserData )
       {
          UserData lTest = (UserData) pOther;
@@ -344,7 +364,7 @@
       {
          return false;
       }
-   }
+   }*/
    
     private boolean datesEquivalent(Date d1, Date d2)
     {
@@ -391,14 +411,14 @@
      */
     public void remove() throws RollerException
     {
-        UserManager uMgr = RollerFactory.getRoller().getUserManager();
+        UserManager uMgr = RollerFactory.getRoller().getUserManager();   
         
         // remove user roles
-        Iterator roles = uMgr.getUserRoles(this).iterator();
-        while (roles.hasNext()) 
-        {
-            ((RoleData)roles.next()).remove();
-        }
+        //Iterator roles = uMgr.getUserRoles(this).iterator();
+        //while (roles.hasNext()) 
+        //{
+            //((RoleData)roles.next()).remove();
+        //}
         super.remove();
     }
     

Modified: incubator/roller/branches/roller_2.0/src/org/roller/pojos/WeblogCategoryData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/pojos/WeblogCategoryData.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/pojos/WeblogCategoryData.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/pojos/WeblogCategoryData.java Fri Sep  9 04:52:39 2005
@@ -426,11 +426,10 @@
         {
             WeblogCategoryData lTest = (WeblogCategoryData) pOther;
             boolean lEquals = true;
-            lEquals = PojoUtil.equals(lEquals, this.id, lTest.id);
-            lEquals = PojoUtil.equals(lEquals, this.mWebsite.getId(), lTest.mWebsite.getId());
-            lEquals = PojoUtil.equals(lEquals, this.name, lTest.name);
-            lEquals = PojoUtil.equals(lEquals, this.description, lTest.description);
-            lEquals = PojoUtil.equals(lEquals, this.image, lTest.image);
+            lEquals = PojoUtil.equals(lEquals, this.getId(), lTest.getId());
+            lEquals = PojoUtil.equals(lEquals, this.getName(), lTest.getName());
+            lEquals = PojoUtil.equals(lEquals, this.getDescription(), lTest.getDescription());
+            lEquals = PojoUtil.equals(lEquals, this.getImage(), lTest.getImage());
             return lEquals;
         }
         else

Modified: incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteData.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteData.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteData.java Fri Sep  9 04:52:39 2005
@@ -771,6 +771,39 @@
         {
             WebsiteData lTest = (WebsiteData) pOther;
             boolean lEquals = true;
+            lEquals = PojoUtil.equals(lEquals, this.getId(), lTest.getId());
+            lEquals = PojoUtil.equals(lEquals, this.getName(), lTest.getName());
+            lEquals = PojoUtil.equals(lEquals, this.getDescription(), lTest.getDescription());
+            lEquals = PojoUtil.equals(lEquals, this.getCreator(), lTest.getCreator());
+            lEquals = PojoUtil.equals(lEquals, this.getDefaultPageId(), lTest.getDefaultPageId());
+            lEquals = PojoUtil.equals(lEquals, this.getWeblogDayPageId(), lTest.getWeblogDayPageId());
+            lEquals = PojoUtil.equals(lEquals, this.getEnableBloggerApi(), lTest.getEnableBloggerApi());
+            lEquals = PojoUtil.equals(lEquals, this.getBloggerCategory(), lTest.getBloggerCategory());
+            lEquals = PojoUtil.equals(lEquals, this.getDefaultCategory(), lTest.getDefaultCategory());
+            lEquals = PojoUtil.equals(lEquals, this.getEditorPage(), lTest.getEditorPage());
+            lEquals = PojoUtil.equals(lEquals, this.getIgnoreWords(), lTest.getIgnoreWords());
+            lEquals = PojoUtil.equals(lEquals, this.getAllowComments(), lTest.getAllowComments());           
+            lEquals = PojoUtil.equals(lEquals, this.getEmailComments(), lTest.getEmailComments());
+            lEquals = PojoUtil.equals(lEquals, this.getEmailAddress(), lTest.getEmailAddress());            
+            lEquals = PojoUtil.equals(lEquals, this.getEmailFromAddress(), lTest.getEmailFromAddress());
+            lEquals = PojoUtil.equals(lEquals, this.getEditorTheme(), lTest.getEditorTheme());
+            lEquals = PojoUtil.equals(lEquals, this.getLocale(), lTest.getLocale());
+            lEquals = PojoUtil.equals(lEquals, this.getTimeZone(), lTest.getTimeZone());
+            lEquals = PojoUtil.equals(lEquals, this.getDefaultPlugins(), lTest.getDefaultPlugins());  
+            return lEquals;
+        }
+        else
+        {
+            return false;
+        }
+    }
+        
+    /*public boolean equals(Object pOther)
+    {
+        if (pOther instanceof WebsiteData)
+        {
+            WebsiteData lTest = (WebsiteData) pOther;
+            boolean lEquals = true;
 
             lEquals = PojoUtil.equals(lEquals, this.id, lTest.id);
 
@@ -816,7 +849,7 @@
         {
             return false;
         }
-    }
+    }*/
 
     public int hashCode()
     {

Modified: incubator/roller/branches/roller_2.0/tests/org/roller/RollerTestBase.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/tests/org/roller/RollerTestBase.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/tests/org/roller/RollerTestBase.java (original)
+++ incubator/roller/branches/roller_2.0/tests/org/roller/RollerTestBase.java Fri Sep  9 04:52:39 2005
@@ -16,6 +16,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.roller.business.BookmarkManagerTest;
+import org.roller.config.RollerConfig;
 import org.roller.model.Roller;
 import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
@@ -55,7 +56,7 @@
     protected List mUsersCreated = new ArrayList();
 
     /** Number of full website/users to create */
-    protected int mBlogCount = 2;
+    protected int mBlogCount = 3;
     /** Number of categories to create in each category of tree. */
     protected int mCatCount = 2;
     /** Depth of created category tree. */
@@ -115,6 +116,8 @@
         UserManager umgr = getRoller().getUserManager();
         mWebsite = (WebsiteData)umgr.getWebsites(mUser, null).get(0);
         getRoller().commit();
+        
+        RollerConfig.setContextPath("./build/roller");
     }
 
     //-----------------------------------------------------------------------
@@ -176,8 +179,6 @@
             mWebsitesCreated.add(website);
             mUsersCreated.add(ud);
 
-            getRoller().commit();
-
             mLogger.debug("Created user "+ud.getUserName());
 
             // ensure that the first weblog entry created is the newest
@@ -185,10 +186,10 @@
             mCalendar.setTime(new Date());
 
             // create categories
-            getRoller().begin(UserData.SYSTEM_USER);
             website  = umgr.retrieveWebsite(website.getId());
             WeblogCategoryData rootCat = wmgr.getRootWeblogCategory(website);
             createCategoryPostsAndComments(0, wmgr, ud, website, rootCat);
+
             getRoller().commit();
         }
 
@@ -339,7 +340,6 @@
         try
         {
             deleteWebsite(testUsername);
-            //getRoller().release();
         }
         catch (RollerException e)
         {
@@ -358,10 +358,14 @@
         mLogger.debug("try to delete " + deleteMe);
         getRoller().begin(UserData.SYSTEM_USER);
         UserManager umgr = getRoller().getUserManager();
+        
         UserData user = umgr.getUser(deleteMe);
+
         WebsiteData website = (WebsiteData)umgr.getWebsites(user, null).get(0);
         website.remove();
+
         user.remove();
+        
         getRoller().commit();
     }
 

Modified: incubator/roller/branches/roller_2.0/tests/org/roller/business/PermissionsTest.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/tests/org/roller/business/PermissionsTest.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/tests/org/roller/business/PermissionsTest.java (original)
+++ incubator/roller/branches/roller_2.0/tests/org/roller/business/PermissionsTest.java Fri Sep  9 04:52:39 2005
@@ -2,6 +2,7 @@
 
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -9,10 +10,8 @@
 import org.roller.RollerPermissionsException;
 import org.roller.RollerTestBase;
 import org.roller.model.UserManager;
-import org.roller.model.WeblogManager;
 import org.roller.pojos.BookmarkData;
 import org.roller.pojos.FolderData;
-import org.roller.pojos.WeblogTemplate;
 import org.roller.pojos.PermissionsData;
 import org.roller.pojos.UserData;
 import org.roller.pojos.WeblogEntryData;
@@ -55,13 +54,13 @@
         getRoller().begin(UserData.ANONYMOUS_USER);
         UserManager umgr = getRoller().getUserManager();
         
-        // evil testuser
-        UserData testuser = umgr.getUser("testuser");       
-        assertNotNull(testuser);
-        
-        // gets hold of testuser0's entry
-        UserData testuser0 = umgr.getUser("testuser0");
-        WebsiteData website0 = (WebsiteData)umgr.getWebsites(testuser0, null).get(0);
+        // evil badguy
+        UserData badguy = umgr.getUser("testuser0");       
+        assertNotNull(badguy);
+        
+        // gets hold of goodguy's entry
+        UserData goodguy = umgr.getUser("testuser2");
+        WebsiteData website0 = (WebsiteData)umgr.getWebsites(goodguy, null).get(0);
         assertNotNull(website0);
         List entries = getRoller().getWeblogManager().getWeblogEntries(
                 website0,
@@ -74,7 +73,7 @@
         assertNotNull(entry);
         
         // and tries to save it
-        getRoller().setUser(testuser);
+        getRoller().setUser(badguy);
         boolean denied = false; 
         try 
         {
@@ -95,18 +94,15 @@
         UserManager umgr = getRoller().getUserManager();
         
         // evil testuser
-        UserData testuser = umgr.getUser("testuser");       
+        UserData testuser = umgr.getUser("testuser0");       
         assertNotNull(testuser);
         
         // gets hold of testuser0's entry
-        UserData testuser0 = umgr.getUser("testuser0");
+        UserData testuser0 = umgr.getUser("testuser2");
         WebsiteData website0 = (WebsiteData)umgr.getWebsites(testuser0, null).get(0);
         assertNotNull(website0);
-        List folders = getRoller().getBookmarkManager().getAllFolders(website0);
-        FolderData root = (FolderData)folders.get(0);
-        FolderData folder = (FolderData)root.getFolders().get(0);
-        
-        BookmarkData bookmark = (BookmarkData)(folder.getBookmarks().iterator().next());
+        FolderData root = getRoller().getBookmarkManager().getRootFolder(website0);
+        BookmarkData bookmark = (BookmarkData)root.getBookmarks().iterator().next();
         assertNotNull(bookmark);
         
         // and tries to save it
@@ -123,90 +119,22 @@
         }       
         assertTrue(denied);
         
-        getRoller().setUser(testuser);
-        denied = false; 
-        try 
-        {
-            folder.save();
-        }
-        catch (RollerPermissionsException e)
-        {
-            // permission denied!
-            denied = true;
-        }       
-        assertTrue(denied);
-       
         getRoller().rollback();
     }
 
-    public void testPagePermissions() throws Exception
-    {
-        getRoller().begin(UserData.ANONYMOUS_USER);
-        UserManager umgr = getRoller().getUserManager();
-        
-        // evil testuser
-        UserData testuser = umgr.getUser("testuser");       
-        assertNotNull(testuser);
-        
-        // gets hold of testuser0's entry
-        UserData testuser0 = umgr.getUser("testuser0");
-        WebsiteData website0 = (WebsiteData)umgr.getWebsites(testuser0, null).get(0);
-        assertNotNull(website0);
-        WeblogTemplate page = (WeblogTemplate)getRoller().getUserManager().getPages(website0).get(0);
-        assertNotNull(page);
-        
-        // and tries to save it
-        getRoller().setUser(testuser);
-        boolean denied = false; 
-        try 
-        {
-            page.save();
-        }
-        catch (RollerPermissionsException e)
-        {
-            // permission denied!
-            denied = true;
-        }       
-        assertTrue(denied);
-        
-        
-        // and tries to save it
-        getRoller().setUser(testuser);
-        denied = false; 
-        try 
-        {
-            website0.save();
-        }
-        catch (RollerPermissionsException e)
-        {
-            // permission denied!
-            denied = true;
-        }       
-        assertTrue(denied);
-
-        
-        getRoller().rollback();
-    }
-
-    /*
-     Disabling this test for now because it won't work.
+    /** Verify that user without global admin role cannot save config property */
     public void testConfigPermissions() throws Exception
     {
         getRoller().begin(UserData.ANONYMOUS_USER);
         
-        // evil testuser0
         UserData testuser0 = getRoller().getUserManager().getUser("testuser0");       
         assertNotNull(testuser0);
         
-        // gets hold of testuser's (an admin) entry
-        WebsiteData website = getRoller().getUserManager().getWebsite("testuser");
-        assertNotNull(website);
-        
         Map config = getRoller().getPropertiesManager().getProperties();
         assertNotNull(config);
         
         // and tries to save it
-        getRoller().setUser(testuser0);
+        getRoller().setUser(testuser0);                
         boolean denied = false; 
         try 
         {
@@ -220,7 +148,6 @@
         assertTrue(denied);
         getRoller().rollback();
     }
-    */
     
     /**
      * Tests permissions object creation and invitations, specifically:
@@ -394,10 +321,9 @@
                  assertNull(getRoller().getPersistenceStrategy().load(
                          permsId, PermissionsData.class));                 
              }
-             getRoller().commit();   
-                         
+             getRoller().commit();                          
          }
-         catch (Exception e)
+         catch (Throwable e)
          {
              e.printStackTrace();
              fail();

Modified: incubator/roller/branches/roller_2.0/tests/org/roller/business/PlanetManagerTest.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/tests/org/roller/business/PlanetManagerTest.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/tests/org/roller/business/PlanetManagerTest.java (original)
+++ incubator/roller/branches/roller_2.0/tests/org/roller/business/PlanetManagerTest.java Fri Sep  9 04:52:39 2005
@@ -77,7 +77,7 @@
         {   // retrieve config and default group
             roller.begin();
             PlanetConfigData config = planet.getConfiguration();
-            assertEquals("test_cache_dir",config.getCacheDir());
+            assertEquals("/var/roller/planetcache",config.getCacheDir());
             assertEquals("test_title", config.getTitle());
             assertEquals("test_admin_email", config.getAdminEmail());
             

Modified: incubator/roller/branches/roller_2.0/tests/org/roller/business/TestAll.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/tests/org/roller/business/TestAll.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/tests/org/roller/business/TestAll.java (original)
+++ incubator/roller/branches/roller_2.0/tests/org/roller/business/TestAll.java Fri Sep  9 04:52:39 2005
@@ -15,6 +15,7 @@
     public static Test suite()
     {
         TestSuite suite = new TestSuite();
+        suite.addTest(WebsiteTest.suite());
         suite.addTest(ConfigManagerTest.suite());
         suite.addTest(PermissionsTest.suite());
         suite.addTest(UserManagerTest.suite());
@@ -23,7 +24,7 @@
         suite.addTest(IndexManagerTest.suite());             
         suite.addTest(BookmarkManagerTest.suite());
         suite.addTest(FileManagerTest.suite());
-        suite.addTest(PlanetManagerTest.suite());
+        suite.addTest(PlanetManagerTest.suite()); 
         return suite;
     }
     public TestAll(String testName)

Modified: incubator/roller/branches/roller_2.0/tests/org/roller/business/UserManagerTest.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/tests/org/roller/business/UserManagerTest.java?rev=279745&r1=279744&r2=279745&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/tests/org/roller/business/UserManagerTest.java (original)
+++ incubator/roller/branches/roller_2.0/tests/org/roller/business/UserManagerTest.java Fri Sep  9 04:52:39 2005
@@ -126,7 +126,7 @@
         getRoller().begin(UserData.SYSTEM_USER);
         stored = new UserData(
             null,
-            "testUserStorage",
+            "testUserStorage2",
             "password2",
             "TestUser2",
             "testuser2@example.com",
@@ -162,35 +162,36 @@
 
         user = new UserData(
             null,
-            "testWebsiteStorage",
+            "testWebsiteStorage3",
             "password3",
             "TestUser3",
             "testuser3@example.com",
             "en_US_WIN", "America/Los_Angeles",
             new java.util.Date(), Boolean.TRUE);
-        umgr.storeUser( user );
-
+        umgr.storeUser(user);
+        
         stored = new WebsiteData(
-            null,
-            "testsite",
-            "testsite",
-            "Testsite",
-            user,
-            "dpid",
-            "wpid",
-            Boolean.FALSE,
-            null,
-            null,
-            "edit-weblog.jsp",
-            "ignore",
-            Boolean.TRUE,
-            Boolean.FALSE,
-            null,
-            Boolean.TRUE, 
-            "", 
-            new Date());
+            null,          // id
+            "testsite3",    // name
+            "testsite3",    // handle 
+            "Testsite3",    // description
+            user,          // creating user
+            "dpid",        // default page ID
+            "wpid",        // default day page ID
+            Boolean.FALSE, // enable blogger API
+            null,          // blogger category
+            null,          // default category
+            "edit-weblog.jsp", // editor page
+            "ignore",      // ignore words
+            Boolean.TRUE,  // allow comments
+            Boolean.FALSE, // email comments
+            null,          // email from address
+            Boolean.TRUE,  // enabled
+            "",            // email address
+            new Date());   // date created
+        stored.setEditorTheme("theme");
         umgr.storeWebsite(stored);
-
+        
         FolderData rootFolder = getRoller().getBookmarkManager()
             .createFolder(null, "root", "root", stored);
         rootFolder.save();
@@ -201,8 +202,7 @@
 
         stored.setBloggerCategory(rootCategory);
         stored.setDefaultCategory(rootCategory);
-        stored.save();
-
+        
         getRoller().commit();
 
         getRoller().begin(UserData.SYSTEM_USER);
@@ -370,29 +370,30 @@
         assertTrue(user.hasRole("editor"));
     }
     
+    /** Each website should be able to return a page named Weblog */
     public void testGetPageByName() throws RollerException
     {
         UserManager umgr = getRoller().getUserManager();
         WebsiteData wd0 = (WebsiteData)umgr.getWebsites(
                 umgr.getUser(enabledUserName), null).get(0);
-        assertNotNull(getRoller().getUserManager().getPageByName(wd0, "Weblog"));
+        assertNotNull(wd0.getPageByName("Weblog"));
     }
 
+    /** Each website should be able to return a page with link=Weblog */
     public void testGetPageByLink() throws RollerException
     {
         UserManager umgr = getRoller().getUserManager();
         WebsiteData wd0 = (WebsiteData)umgr.getWebsites(
                 umgr.getUser(enabledUserName), null).get(0);
-        assertNotNull(getRoller().getUserManager().getPageByLink(wd0,"Weblog"));
+        assertNotNull(wd0.getPageByLink("Weblog"));
     }
 
     public void testGetPages() throws RollerException
     {
-        // testuser0 is enabled and has 3 pages
         UserManager umgr = getRoller().getUserManager();
         WebsiteData wd0 = (WebsiteData)umgr.getWebsites(
                 umgr.getUser(enabledUserName), null).get(0);
-        assertEquals(3, getRoller().getUserManager().getPages(wd0).size());
+        assertEquals(5, wd0.getPages().size());
     }
 
     public void hide_testUpdateIfNeeded() throws Exception



Mime
View raw message