You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by ag...@apache.org on 2006/12/11 20:51:02 UTC

svn commit: r485845 [1/3] - in /incubator/roller/trunk: ./ metadata/database/hibernate/ sandbox/planetroller/ sandbox/planetroller/nbproject/ sandbox/planetroller/src/org/apache/roller/ sandbox/planetroller/src/org/apache/roller/planet/business/ sandbo...

Author: agilliland
Date: Mon Dec 11 11:50:59 2006
New Revision: 485845

URL: http://svn.apache.org/viewvc?view=rev&rev=485845
Log:
Mostly finishing off the process of moving the Roller Planet code into it's own project workspace so that it can be built as a standalone application separate from the Roller Weblogger code.

1. Moved Roller Planet business code to sandbox/planetroller.  This includes the PlanetManager and PlanetManagerImpl as well as all the planet pojos, plus one of the planet tasks which is not specific to the Weblogger app.

2. Copied some parts of the Weblogger codebase to the sandbox/planetroller codebase.  This is done to keep things working and in some cases this copied code can actually be moved into a shared Roller Core library so that it's not longer duplicated.  This includes the RollerException class and some various utility classes in roller.util.

3. Moved Roller Planet unit tests to sandbox/planetroller, where it makes the most sense.

4. Updated build process so that all Roller Planet operations can happen on their own: building, testing, etc.  NOTE: the link between the Planet and Weblogger build process is not fully flushed out and will need further refinement, but this commit is a start.

5. Reorganized some of the remaining Planet code left in the Weblogger src to be moved under the roller.planet package.  This was for the planet struts actions and formbeans.

6. Updated the Weblogger configuration to easily include the Roller Planet component as an addon module.  This meant tweaking the planet.properties file included with the Weblogger app as well as adding a planet-hibernate.cfg.xml to the Weblogger app for configuring the planet hibernate session factory.



Added:
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/RollerException.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/PlanetManager.java
      - copied unchanged from r483703, incubator/roller/trunk/src/org/apache/roller/planet/business/PlanetManager.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/HibernatePersistenceStrategy.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/HibernatePlanetManagerImpl.java
      - copied, changed from r483703, incubator/roller/trunk/src/org/apache/roller/planet/business/hibernate/HibernatePlanetManagerImpl.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/ThreadLocalSessionContextNoAutoClose.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/
      - copied from r483703, incubator/roller/trunk/src/org/apache/roller/planet/pojos/
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/Author.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/Category.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetConfigData.java
      - copied, changed from r485756, incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetConfigData.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetEntryData.java
      - copied, changed from r485756, incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetEntryData.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetGroupData.java
      - copied, changed from r485756, incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetGroupData.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetSubscriptionData.java
      - copied, changed from r485756, incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetSubscriptionData.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/tasks/TechnoratiRankingsTask.java
      - copied, changed from r483703, incubator/roller/trunk/src/org/apache/roller/planet/tasks/TechnoratiRankingsTask.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/MailUtil.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/PropertyExpander.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/RegexUtil.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/Technorati.java
      - copied unchanged from r483703, incubator/roller/trunk/src/org/apache/roller/util/Technorati.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/Utilities.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/rome/
      - copied from r483703, incubator/roller/trunk/src/org/apache/roller/util/rome/
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/rome/ContentModule.java
      - copied unchanged from r485756, incubator/roller/trunk/src/org/apache/roller/util/rome/ContentModule.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/rome/ContentModuleGenerator.java
      - copied unchanged from r485756, incubator/roller/trunk/src/org/apache/roller/util/rome/ContentModuleGenerator.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/rome/ContentModuleImpl.java
      - copied unchanged from r485756, incubator/roller/trunk/src/org/apache/roller/util/rome/ContentModuleImpl.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/rome/ContentModuleParser.java
      - copied unchanged from r485756, incubator/roller/trunk/src/org/apache/roller/util/rome/ContentModuleParser.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/rome/DiskFeedInfoCache.java
      - copied unchanged from r485756, incubator/roller/trunk/src/org/apache/roller/util/rome/DiskFeedInfoCache.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/rome/PlanetConverterForRSS091N.java
      - copied unchanged from r485756, incubator/roller/trunk/src/org/apache/roller/util/rome/PlanetConverterForRSS091N.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/rome/PlanetConverterForRSS091U.java
      - copied unchanged from r485756, incubator/roller/trunk/src/org/apache/roller/util/rome/PlanetConverterForRSS091U.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/rome/PlanetConverterForRSS20.java
      - copied unchanged from r485756, incubator/roller/trunk/src/org/apache/roller/util/rome/PlanetConverterForRSS20.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/rome/PlanetRSS091NParser.java
      - copied unchanged from r485756, incubator/roller/trunk/src/org/apache/roller/util/rome/PlanetRSS091NParser.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/rome/PlanetRSS091UParser.java
      - copied unchanged from r485756, incubator/roller/trunk/src/org/apache/roller/util/rome/PlanetRSS091UParser.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/util/rome/package.html
      - copied unchanged from r485756, incubator/roller/trunk/src/org/apache/roller/util/rome/package.html
    incubator/roller/trunk/sandbox/planetroller/test/org/apache/
    incubator/roller/trunk/sandbox/planetroller/test/org/apache/roller/
    incubator/roller/trunk/sandbox/planetroller/test/org/apache/roller/ant/
    incubator/roller/trunk/sandbox/planetroller/test/org/apache/roller/ant/StartDerbyTask.java
    incubator/roller/trunk/sandbox/planetroller/test/org/apache/roller/ant/StopDerbyTask.java
    incubator/roller/trunk/sandbox/planetroller/test/org/apache/roller/planet/
    incubator/roller/trunk/sandbox/planetroller/test/org/apache/roller/planet/TestUtils.java
    incubator/roller/trunk/sandbox/planetroller/test/org/apache/roller/planet/business/
    incubator/roller/trunk/sandbox/planetroller/test/org/apache/roller/planet/business/PlanetManagerTest.java
      - copied, changed from r483703, incubator/roller/trunk/tests/org/apache/roller/business/PlanetManagerTest.java
    incubator/roller/trunk/sandbox/planetroller/test/org/apache/roller/planet/business/PlanetTestSuite.java
    incubator/roller/trunk/sandbox/planetroller/testdata/planet-custom.properties
    incubator/roller/trunk/src/org/apache/roller/planet/business/hibernate/HibernateRollerPlanetImpl.java
    incubator/roller/trunk/src/org/apache/roller/planet/business/hibernate/HibernateRollerPlanetManagerImpl.java
      - copied, changed from r483703, incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateRollerPlanetManagerImpl.java
    incubator/roller/trunk/src/org/apache/roller/planet/ui/
    incubator/roller/trunk/src/org/apache/roller/planet/ui/admin/
    incubator/roller/trunk/src/org/apache/roller/planet/ui/admin/struts/
    incubator/roller/trunk/src/org/apache/roller/planet/ui/admin/struts/actions/
    incubator/roller/trunk/src/org/apache/roller/planet/ui/admin/struts/actions/PlanetConfigAction.java
      - copied, changed from r483703, incubator/roller/trunk/src/org/apache/roller/ui/admin/struts/actions/PlanetConfigAction.java
    incubator/roller/trunk/src/org/apache/roller/planet/ui/admin/struts/actions/PlanetGroupsAction.java
      - copied, changed from r483703, incubator/roller/trunk/src/org/apache/roller/ui/admin/struts/actions/PlanetGroupsAction.java
    incubator/roller/trunk/src/org/apache/roller/planet/ui/admin/struts/actions/PlanetSubscriptionsAction.java
      - copied, changed from r483703, incubator/roller/trunk/src/org/apache/roller/ui/admin/struts/actions/PlanetSubscriptionsAction.java
    incubator/roller/trunk/src/org/apache/roller/planet/ui/admin/struts/forms/
    incubator/roller/trunk/src/org/apache/roller/planet/ui/admin/struts/forms/PlanetConfigForm.java
    incubator/roller/trunk/src/org/apache/roller/planet/ui/admin/struts/forms/PlanetGroupForm.java
    incubator/roller/trunk/src/org/apache/roller/planet/ui/admin/struts/forms/PlanetSubscriptionForm.java
    incubator/roller/trunk/src/org/apache/roller/planet/ui/admin/struts/forms/PlanetSubscriptionFormEx.java
      - copied, changed from r483703, incubator/roller/trunk/src/org/apache/roller/ui/admin/struts/formbeans/PlanetSubscriptionFormEx.java
    incubator/roller/trunk/web/WEB-INF/classes/planet-hibernate.cfg.xml
Removed:
    incubator/roller/trunk/sandbox/planetroller/test/org/roller/model/PlanetManagerTest.java
    incubator/roller/trunk/sandbox/planetroller/test/org/roller/tools/planet/PlanetToolTest.java
    incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateRollerPlanetManagerImpl.java
    incubator/roller/trunk/src/org/apache/roller/planet/business/PlanetManager.java
    incubator/roller/trunk/src/org/apache/roller/planet/business/hibernate/HibernatePlanetManagerImpl.java
    incubator/roller/trunk/src/org/apache/roller/planet/pojos/
    incubator/roller/trunk/src/org/apache/roller/planet/tasks/TechnoratiRankingsTask.java
    incubator/roller/trunk/src/org/apache/roller/ui/admin/struts/actions/PlanetConfigAction.java
    incubator/roller/trunk/src/org/apache/roller/ui/admin/struts/actions/PlanetGroupsAction.java
    incubator/roller/trunk/src/org/apache/roller/ui/admin/struts/actions/PlanetSubscriptionsAction.java
    incubator/roller/trunk/src/org/apache/roller/ui/admin/struts/formbeans/PlanetSubscriptionFormEx.java
    incubator/roller/trunk/src/org/apache/roller/util/Technorati.java
    incubator/roller/trunk/src/org/apache/roller/util/rome/
    incubator/roller/trunk/tests/org/apache/roller/business/PlanetManagerTest.java
Modified:
    incubator/roller/trunk/build.xml
    incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml
    incubator/roller/trunk/properties.xmlf
    incubator/roller/trunk/sandbox/planetroller/build.xml
    incubator/roller/trunk/sandbox/planetroller/nbproject/project.xml
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/Planet.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/HibernatePlanetImpl.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/tasks/GeneratePlanetTask.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/tasks/RefreshPlanetTask.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/ui/forms/ConfigForm.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/ui/forms/GroupForm.java
    incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/ui/forms/SubscriptionForm.java
    incubator/roller/trunk/sandbox/planetroller/web/WEB-INF/classes/hibernate.cfg.xml
    incubator/roller/trunk/src/org/apache/roller/business/Roller.java
    incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateRollerImpl.java
    incubator/roller/trunk/src/org/apache/roller/planet/tasks/RefreshEntriesTask.java
    incubator/roller/trunk/src/org/apache/roller/planet/tasks/SyncWebsitesTask.java
    incubator/roller/trunk/src/org/apache/roller/ui/core/filters/PersistenceSessionFilter.java
    incubator/roller/trunk/src/org/apache/roller/ui/rendering/model/PlanetModel.java
    incubator/roller/trunk/src/org/apache/roller/ui/rendering/pagers/PlanetEntriesPager.java
    incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets/PlanetFeedServlet.java
    incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/cache/PlanetCache.java
    incubator/roller/trunk/web/WEB-INF/classes/planet.properties

Modified: incubator/roller/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/build.xml?view=diff&rev=485845&r1=485844&r2=485845
==============================================================================
--- incubator/roller/trunk/build.xml (original)
+++ incubator/roller/trunk/build.xml Mon Dec 11 11:50:59 2006
@@ -114,13 +114,10 @@
         addedtags="@xdoclet-generated at ${TODAY}"
         force="true">
         
-	    <fileset dir="${ro.src}" includes="org/apache/roller/pojos/WeblogTemplate.java" />
+	<fileset dir="${ro.src}" includes="org/apache/roller/pojos/WeblogTemplate.java" />
         <fileset dir="${ro.src}" includes="org/apache/roller/pojos/*Data.java" />
         <fileset dir="${ro.src}" includes="org/apache/roller/pojos/*Assoc.java" />
         
-        <fileset dir="${ro.src}" includes="org/apache/roller/planet/pojos/*Assoc.java" />
-        <fileset dir="${ro.src}" includes="org/apache/roller/planet/pojos/*Data.java" />
-        
         <hibernate validatexml="true" version="3.0"/>
         
     </hibernatedoclet>
@@ -166,8 +163,6 @@
             <include name="org/apache/roller/pojos/WeblogCategoryData.java"/>
             <include name="org/apache/roller/pojos/SiteTagAggregateData.java"/>          	
             <include name="org/apache/roller/pojos/WebsiteData.java"/>
-            <include name="org/apache/roller/planet/pojos/PlanetEntryData.java"/>
-            <include name="org/apache/roller/planet/pojos/PlanetSubscriptionData.java"/>
         </fileset>
 
         <template 
@@ -193,7 +188,6 @@
     <ejbdoclet destdir="${build.generated}/unused" excludedtags="@version,@author">
         <fileset dir="${ro.src}" includes="org/apache/roller/pojos/WeblogTemplate.java" />
         <fileset dir="${ro.src}" includes="org/apache/roller/pojos/*Data.java" />
-        <fileset dir="${ro.src}" includes="org/apache/roller/planet/pojos/*Data.java" />
 
         &custom-gen-web;
      
@@ -224,17 +218,7 @@
         </fileset>
         <mapper type="glob" from="*DataForm.java" to="*Form.java"/>
     </move>
-
-    <replace dir="${build.generated.web}/org/apache/roller/planet/ui/authoring/struts/forms"
-        token="DataForm" value="Form"/>
-    <move      todir="${build.generated.web}/org/apache/roller/planet/ui/authoring/struts/forms">
-        <fileset dir="${build.generated.web}/org/apache/roller/planet/ui/authoring/struts/forms" >
-            <include name="*DataForm.java"/>
-            <include name="*ConfigForm.java" />
-        </fileset>
-        <mapper type="glob" from="*DataForm.java" to="*Form.java"/>
-    </move>
-
+    
 </target>
 
 
@@ -320,7 +304,7 @@
     
     <!-- compile roller business classes -->
     <javac destdir="${build.compile.business}"
-        excludes="org/apache/roller/ui/**, org/apache/roller/webservices/**"
+        excludes="org/apache/roller/ui/**, org/apache/roller/webservices/**, org/apache/roller/planet/**"
         debug="${build.debug}" 
         source="${build.sourcelevel}"
         deprecation="${build.deprecation}">
@@ -337,7 +321,7 @@
     <!-- Copy resources -->
     <copy todir="${build.compile.business}">
         <fileset dir="${ro.src}" 
-            excludes="**/*.java, **/*.html, **/*.png, org/apache/roller/ui/**, org/apache/roller/webservices/**" />
+            excludes="**/*.java, **/*.html, **/*.png, org/apache/roller/ui/**, org/apache/roller/webservices/**, org/apache/roller/planet/**" />
         <fileset dir="${build.generated.business}" excludes="**/*.java" />
     </copy>
     
@@ -362,7 +346,7 @@
     <javac debug="${build.debug}" 
         source="${build.sourcelevel}"
         destdir="${build.compile.web}"
-        includes="org/apache/roller/ui/**, org/apache/roller/webservices/**, org/apache/roller/util/rome/**" >
+        includes="org/apache/roller/ui/**, org/apache/roller/webservices/**, org/apache/roller/planet/**" >
         
         <src path="${ro.src}"  />
         <src path="${build.generated.web}"/>
@@ -397,7 +381,7 @@
 <!-- Stage web application -->
 <!-- ********************************************************************* -->
 	
-<target name="stage-webapp" depends="gen-business, build-business, gen-web, build-web, copy-webapp" description="Stage webapp, including jars">
+<target name="stage-webapp" depends="gen-business, build-business, build-web, copy-webapp, gen-web" description="Stage webapp, including jars">
 </target>
     
 <target name="copy-webapp" depends="build-web" description="Stage webapp without code generation">
@@ -427,6 +411,7 @@
         <fileset refid="struts.jars" />
         <fileset refid="spring.jars" /> 
         <fileset refid="jstl.jars" />
+        <fileset refid="planet.jars" />
         
         <!-- include custom jars -->
         &custom-jars;

Modified: incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml?view=diff&rev=485845&r1=485844&r2=485845
==============================================================================
--- incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml (original)
+++ incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml Mon Dec 11 11:50:59 2006
@@ -67,10 +67,5 @@
         <mapping resource="org/apache/roller/pojos/EntryAttributeData.hbm.xml" />
         <mapping resource="org/apache/roller/pojos/WeblogCategoryData.hbm.xml" />
         
-        <mapping resource="org/apache/roller/planet/pojos/PlanetConfigData.hbm.xml" />
-        <mapping resource="org/apache/roller/planet/pojos/PlanetGroupData.hbm.xml" />
-        <mapping resource="org/apache/roller/planet/pojos/PlanetEntryData.hbm.xml" />
-        <mapping resource="org/apache/roller/planet/pojos/PlanetSubscriptionData.hbm.xml" />
-                
     </session-factory>
 </hibernate-configuration>

Modified: incubator/roller/trunk/properties.xmlf
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/properties.xmlf?view=diff&rev=485845&r1=485844&r2=485845
==============================================================================
--- incubator/roller/trunk/properties.xmlf (original)
+++ incubator/roller/trunk/properties.xmlf Mon Dec 11 11:50:59 2006
@@ -142,6 +142,10 @@
     <include name="*.jar"/>
 </fileset>
 
+<fileset id="planet.jars" dir="sandbox/planetroller/build/webapp/WEB-INF/lib" >
+    <include name="roller-planet.jar"/>
+</fileset>
+
 <!-- **************************************************************** -->
 <!-- Define path based on above filesets -->
 <!-- **************************************************************** -->
@@ -151,6 +155,7 @@
     <fileset refid="base.jars"/>
     <fileset refid="mail.jars"/>
     <fileset refid="commons.jars"/>
+    <fileset refid="planet.jars"/>
 </path>
 
 <path id="business.path">

Modified: incubator/roller/trunk/sandbox/planetroller/build.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/planetroller/build.xml?view=diff&rev=485845&r1=485844&r2=485845
==============================================================================
--- incubator/roller/trunk/sandbox/planetroller/build.xml (original)
+++ incubator/roller/trunk/sandbox/planetroller/build.xml Mon Dec 11 11:50:59 2006
@@ -20,57 +20,77 @@
     <!ENTITY custom-web SYSTEM "custom/custom-web.xmlf">
 ]>
 <project name="planetroller" default="stage-webapp" basedir=".">
+    
     <description>Builds, tests, and runs the project planetroller.</description>   
 
     <property file="./ant.properties" />
     
-    <fileset id="roller-jars" dir="${rollersrc.dir}/build/webapp/WEB-INF/lib">
-        
-        <!-- needed for business layer model and pojos -->
-        <include name="roller-business.jar"/>   
-        
-        <!-- needed for OldUtilities and UtilitiesModel -->
-        <include name="roller-web.jar"/>           
-        
+    <!-- core properties -->
+    <property name="ro.build"            value="${basedir}/build" />
+    <property name="ro.dist"             value="${basedir}/dist" />
+    <property name="ro.src"              value="${basedir}/src" />
+    <property name="ro.tools"            value="${basedir}/../../tools" />
+    <property name="ro.test"             value="${basedir}/test" />
+    <property name="ro.web"              value="${basedir}/web" />
+    
+    <!-- build properties -->
+    <property name="build.generated"                value="${ro.build}/generated"/>
+    <property name="build.generated.business"       value="${build.generated}/business"/>
+    <property name="build.generated.web"            value="${build.generated}/web"/>
+    <property name="build.compile"                  value="${ro.build}/compile"/>
+    <property name="build.compile.business"         value="${build.compile}/business"/>
+    <property name="build.compile.web"              value="${build.compile}/web"/>
+    <property name="build.compile.test"             value="${build.compile}/test"/>
+    <property name="build.lib"           value="${ro.build}/lib"/>
+    <property name="build.webapp"        value="${ro.build}/webapp"/>
+    <property name="build.test"          value="${ro.build}/test"/>
+    <property name="build.test.reports"  value="${build.test}/reports"/>
+    
+    
+    <fileset id="roller-jars" dir="${ro.tools}">
         <!-- needed for Hibernate -->
-        <include name="hibernate3.jar"/>
-        <include name="antlr.jar"/>
-        <include name="asm.jar"/>
-        <include name="asm-attrs.jar"/>
-        <include name="cglib-2.1.3.jar"/>
-        <include name="ehcache-1.1.jar"/>
-        <include name="dom4j-1.6.1.jar"/>       
-        <include name="jta.jar"/>
-        <include name="jdbc2_0-stdext.jar"/>
+        <include name="hibernate-3.1/hibernate3.jar"/>
+        <include name="hibernate-3.1/lib/antlr.jar"/>
+        <include name="hibernate-3.1/lib/asm.jar"/>
+        <include name="hibernate-3.1/lib/asm-attrs.jar"/>
+        <include name="hibernate-3.1/lib/cglib-2.1.3.jar"/>
+        <include name="hibernate-3.1/lib/ehcache-1.1.jar"/>
+        <include name="hibernate-3.1/lib/dom4j-1.6.1.jar"/>
+        <include name="hibernate-3.1/lib/jta.jar"/>
+        <include name="hibernate-3.1/lib/jdbc2_0-stdext.jar"/>
                 
         <!-- needed for ROME -->
-        <include name="rome-0.9.jar"/>
-        <include name="rome-fetcher-0.9.jar"/>        
-        <include name="jdom.jar"/> 
+        <include name="lib/rome-0.9.jar"/>
+        <include name="lib/rome-fetcher-0.9.jar"/>
+        <include name="lib/jdom.jar"/>
         
         <!-- Needed for Velocity -->
-        <include name="velocity-1.4.jar"/>
-        <include name="velocity-dep-1.4.jar"/>   
+        <include name="lib/velocity-1.4.jar"/>
+        <include name="lib/velocity-dep-1.4.jar"/>
         
         <!-- General dependencies -->
-        <include name="commons-lang-2.0.jar"/>   
-        <include name="commons-logging.jar"/>   
-        <include name="commons-fileupload.jar"/>   
-        <include name="commons-validator.jar"/>   
-        <include name="log4j-1.2.11.jar"/>
-        <include name="jaxen-full.jar"/>
-        <include name="saxpath.jar"/>   
-        <include name="activation.jar"/>   
-        <include name="mail.jar"/>   
-        
+        <include name="lib/commons-codec-1.3.jar"/>
+        <include name="struts-1.2.4/lib/antlr.jar"/>
+        <include name="struts-1.2.4/lib/commons-lang-2.0.jar"/>
+        <include name="struts-1.2.4/lib/commons-logging.jar"/>
+        <include name="struts-1.2.4/lib/commons-fileupload.jar"/>
+        <include name="struts-1.2.4/lib/commons-validator.jar"/>
+        <include name="struts-1.2.4/lib/commons-collections.jar"/>
+        <include name="lib/log4j-1.2.11.jar"/>
+        <include name="lib/jaxen-full.jar"/>
+        <include name="lib/saxpath.jar"/>
+        <include name="lib/activation.jar"/>
+        <include name="lib/mail.jar"/>
     </fileset>
     
     <path id="planet.path">
         <fileset refid="roller-jars" />
-        <fileset dir="../../tools/buildtime/tomcat-5.0.28">
+        
+        <fileset dir="${ro.tools}/buildtime/tomcat-5.0.28">
             <include name="servlet-api.jar"/>
-        </fileset>                      
-        <fileset dir="./web/WEB-INF/lib">
+        </fileset>
+        
+        <fileset dir="${ro.web}/WEB-INF/lib">
             <include name="commons-logging-1.0.4.jar"/>
             <include name="commons-lang-2.1.jar"/>  
             <include name="myfaces-api-1.1.4.jar"/>  
@@ -78,28 +98,89 @@
         </fileset>                      
     </path>
     
-    <target name="stage-webapp" description="Build Planet webapp">
+    <path id="xdoclet.path">
+        <path refid="planet.path"/>
+        <fileset dir="${ro.tools}/buildtime" includes="ejb-1.1.jar"/>
+        <fileset dir="${ro.tools}/buildtime/xdoclet-1.2.3/lib" includes="*.jar"/>
+    </path>
+    
+    <path id="test.path">
+        <!-- testing jars -->
+        <fileset dir="${ro.tools}/buildtime/mockrunner-0.35/lib">
+            <include name="*.jar"/>
+        </fileset>
+        
+        <pathelement location="${ro.tools}/buildtime/ant-1.6.2/ant.jar"/>
+        <pathelement location="${ro.tools}/buildtime/strutstest-2.0.0.jar"/>
+        <pathelement location="${ro.tools}/buildtime/junit-3.8.1.jar"/>
+        <pathelement location="${ro.tools}/buildtime/derby.jar"/>
+        <pathelement location="${ro.tools}/buildtime/derbyclient.jar"/>
+        <pathelement location="${ro.tools}/buildtime/derbynet.jar"/>
+        
+        <pathelement location="${ro.tools}/lib/commons-httpclient-2.0.2.jar"/>
+        
+        <!-- plus normal jars -->
+        <path refid="planet.path"/>
+
+        <!-- plus already built roller planet jars -->
+        <fileset dir="${build.lib}">
+            <include name="*.jar" />
+        </fileset>
+    </path>
+    
+    
+    <!-- ============================================== -->
+    <!-- generate code/files for the business layer -->
+    <target name="gen-business" description="Generate business layer resources">
+
+        <taskdef name="hibernatedoclet"
+            classname="xdoclet.modules.hibernate.HibernateDocletTask"
+            classpathref="xdoclet.path" />
+
+        <!-- generate hibernate mapping files -->
+        <hibernatedoclet
+            destdir="${build.compile.business}"
+            mergedir="./metadata/xdoclet"
+            excludedtags="@version,@author"
+            addedtags="@xdoclet-generated at ${TODAY}"
+            force="true">
+        
+            <fileset dir="${ro.src}" includes="org/apache/roller/planet/pojos/*Data.java" />
+        
+            <hibernate validatexml="true" version="3.0"/>
+        
+        </hibernatedoclet>
+    
+    </target>
+    
+    
+    <!-- ============================================== -->
+    <!-- build the code and stage the planet webapp -->
+    <target name="stage-webapp" depends="gen-business" description="Build Planet webapp">
         
-        <mkdir dir="./build/classes" />
-        <javac debug="on" destdir="./build/classes">
-            <src path="./src" />
+        <mkdir dir="${build.compile.business}" />
+        <javac debug="on" destdir="${build.compile.business}" source="1.4">
+            <src path="${ro.src}" />
             <classpath>
                 <path refid="planet.path"/>
             </classpath>
         </javac>
-
-        <mkdir dir="./build/webapp/WEB-INF/lib" />
-        <jar basedir="./build/classes" destfile="./build/webapp/WEB-INF/lib/roller-planet.jar" />
-        <copy todir="./build/webapp/WEB-INF/lib">
+        
+        <mkdir dir="${build.lib}" />
+        <jar basedir="${build.compile.business}" destfile="${build.lib}/roller-planet.jar" />
+        
+        <mkdir dir="${build.webapp}/WEB-INF/lib" />
+        <copy todir="${build.webapp}/WEB-INF/lib" flatten="true">
+            <fileset dir="${build.lib}" />
             <fileset refid="roller-jars" />
         </copy>         
 
-        <copy todir="./build/webapp">
-            <fileset dir="./web" includes="**/**" />
+        <copy todir="${build.webapp}">
+            <fileset dir="${ro.web}" includes="**/**" />
         </copy> 
 
-        <mkdir dir="./build/webapp/WEB-INF/templates" />
-        <copy todir="./build/webapp/WEB-INF/templates">
+        <mkdir dir="${build.webapp}/WEB-INF/templates" />
+        <copy todir="${build.webapp}/WEB-INF/templates">
             <fileset dir="./templates" includes="**/**" />
         </copy> 
         
@@ -118,8 +199,157 @@
 
     
     <target name="clean" description="Clean (i.e. remove) build and dist dirs">
-        <delete dir="./build" />
-        <delete dir="./dist" />
+        <delete dir="${ro.build}" />
+        <delete dir="${ro.dist}" />
     </target>
     
+    
+    <target name="build-tests" depends="stage-webapp" description="Build unit tests">
+    
+        <mkdir dir="${build.compile.test}" />
+    
+        <!-- compile all test classes -->
+        <javac destdir="${build.compile.test}"
+            includeantruntime="false"
+            debug="true" 
+            source="1.4"
+            deprecation="true">
+            
+            <src path="${ro.test}" />
+            
+            <classpath>
+                <path refid="test.path"/>
+            </classpath>
+        </javac>
+                
+        <!-- Copy test resources -->
+        <copy todir="${build.compile.test}">
+            <fileset dir="${ro.test}" 
+            excludes="**/*.java, **/*.html, **/*.png" />
+        </copy>
+    
+        <!-- register Ant tasks that were just built -->
+        <taskdef name="startdb" classname="org.apache.roller.ant.StartDerbyTask" 
+        classpath="${ro.tools}/buildtime/derby.jar;${ro.tools}/buildtime/derbynet.jar;${build.compile.test}" />
+        <taskdef name="stopdb" classname="org.apache.roller.ant.StopDerbyTask" 
+        classpath="${ro.tools}/buildtime/derby.jar;${ro.tools}/buildtime/derbynet.jar;${build.compile.test}" />
+    
+        <!-- 
+        Copy web config files to ${build.tests} to make them available for testing.
+        This includes the WEB-INF directory, minus jsps
+        -->
+        <mkdir dir="${build.test}/WEB-INF" />
+        <copy todir="${build.test}/WEB-INF">
+            <fileset dir="${basedir}/web/WEB-INF">
+                <exclude name="jsps/**" />
+            </fileset>
+        </copy>
+
+        <!-- 
+        Copy custom testing files which will overwrite some config files 
+        -->
+        <copy todir="${build.test}">
+            <fileset dir="${basedir}/testdata" />
+        </copy>
+    
+    </target>
+
+    <!-- ===================================== -->
+    <!-- test business -->
+	
+    <target name="test-business" depends="build-tests" description="Back-end tests">
+        
+        <mkdir dir="${build.test.reports}/business/xml"/>
+        <mkdir dir="${build.test.reports}/business/html"/>
+        
+        <antcall target="start-db" /> 
+        <antcall target="init-db" />
+        
+        <junit fork="true" dir="${build.test}" printsummary="on" showOutput="true">
+            <classpath>
+                <!-- testing jars -->
+                <path refid="test.path"/>
+                
+                <!-- plus our compiled test classes -->
+                <pathelement location="${build.compile.test}"/>
+        
+                <!-- plus our config location, like the webapp would have -->
+                <pathelement location="${build.test}/WEB-INF/classes" />
+            </classpath>
+            
+            <!-- needed to satisfy ref in log4j.properties -->
+            <jvmarg value="-Dcatalina.base=${build.test}"/> 
+            <jvmarg value="-Dro.build=${ro.build}"/>
+            <jvmarg value="-Dplanet.custom.config=${build.test}/planet-custom.properties"/>
+            <jvmarg value="-Dhttp.proxySet=true"/>
+            <jvmarg value="-Dhttp.proxyHost=webcache.sfbay.sun.com"/>
+            <jvmarg value="-Dhttp.proxyPort=8080"/>
+            <formatter type="xml"/>
+            <batchtest toDir="${build.test.reports}/business/xml" haltonerror="${junit.haltonerror}">
+                <fileset dir="${build.compile.test}">
+                    <include name="org/apache/roller/planet/business/PlanetTestSuite.class"/>
+                </fileset>
+            </batchtest>
+        </junit>
+        
+        <junitreport todir="${build.test.reports}/business/xml">
+            <fileset dir="${build.test.reports}/business/xml">
+                <include name="TEST-*.xml"/>
+            </fileset>
+            <report format="noframes" toDir="${build.test.reports}/business/html"/>
+        </junitreport>
+        
+        <antcall target="stop-db" />
+    </target>
+    
+    
+    <!-- ********************************************************************* -->
+    <!-- HSQLDB start, init and stop targets -->
+    <!-- ********************************************************************* -->
+    
+    <target name="init-db" description=
+            "Initializes built-in database by running drop table and create table">
+        <sql driver="org.apache.derby.jdbc.ClientDriver"
+             url="jdbc:derby://localhost:3219/roller;create=true"
+             userid="app" password="app"
+             src="../../build/webapp/WEB-INF/dbscripts/droptables.sql" onerror="continue"
+             classpath="${ro.tools}/buildtime/derbyclient.jar" />    
+        <sql driver="org.apache.derby.jdbc.ClientDriver" onerror="continue"
+             url="jdbc:derby://localhost:3219/roller"
+             userid="app" password="app"
+             src="../../build/webapp/WEB-INF/dbscripts/derby/createdb.sql"
+             classpath="${ro.tools}/buildtime/derbyclient.jar" /> 
+    </target>
+    
+    <target name="start-db" description="Starts built-in database">  
+        <startdb database="${build.test}/derby-system/roller" port="3219" />
+        <!-- 
+    <delete dir="${build.tests}/derby-system/roller" />
+    Not sure we need that custom 'startdb' task if this plain old Ant works:
+    <java classname="org.hsqldb.Server"  
+        fork="yes" spawn="true" classpath="./tools/buildtime/hsqldb.jar">
+        <arg value="-database"/>
+        <arg value="${build.tests}/testdb"/>
+        <arg value="-port"/>
+        <arg value="3219"/>
+    </java>
+        -->    
+    </target>
+    
+    <target name="stop-db" description="Drop tables and stops the built-in database">   
+        <stopdb port="3219"/>
+        <!--
+    <delete dir="${build.tests}/derby-system/roller" />
+    This below code does the same thing as 'stopdb' but the 'sql' task throws 
+    an exception when HSQLDB disconnects and that causes a build failure, so 
+    for now I'm keeping the custom 'startdb' and 'stopdb' Ant tasks.
+    <sql driver="org.hsqldb.jdbcDriver" onerror="continue" 
+         url="jdbc:hsqldb:hsql://localhost:3219"
+         userid="sa" password=""
+         classpath="${ro.tools}/buildtime/hsqldb.jar" >
+         SHUTDOWN
+    </sql>  
+        -->
+    </target>
+
 </project>

Modified: incubator/roller/trunk/sandbox/planetroller/nbproject/project.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/planetroller/nbproject/project.xml?view=diff&rev=485845&r1=485844&r2=485845
==============================================================================
--- incubator/roller/trunk/sandbox/planetroller/nbproject/project.xml (original)
+++ incubator/roller/trunk/sandbox/planetroller/nbproject/project.xml Mon Dec 11 11:50:59 2006
@@ -17,6 +17,11 @@
                     <type>java</type>
                     <location>src</location>
                 </source-folder>
+                <source-folder>
+                    <label>test</label>
+                    <type>java</type>
+                    <location>test</location>
+                </source-folder>
             </folders>
             <ide-actions>
                 <action name="build">
@@ -40,6 +45,10 @@
                         <label>src</label>
                         <location>src</location>
                     </source-folder>
+                    <source-folder style="packages">
+                        <label>test</label>
+                        <location>test</location>
+                    </source-folder>
                     <source-file>
                         <location>build.xml</location>
                     </source-file>
@@ -52,11 +61,16 @@
             </view>
             <subprojects/>
         </general-data>
-        <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
+        <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2">
             <compilation-unit>
                 <package-root>src</package-root>
                 <classpath mode="compile">web/WEB-INF/lib/commons-beanutils-1.7.0.jar:web/WEB-INF/lib/commons-codec-1.3.jar:web/WEB-INF/lib/commons-collections-3.1.jar:web/WEB-INF/lib/commons-digester-1.6.jar:web/WEB-INF/lib/commons-el-1.0.jar:web/WEB-INF/lib/commons-lang-2.1.jar:web/WEB-INF/lib/commons-logging-1.0.4.jar:web/WEB-INF/lib/jstl.jar:web/WEB-INF/lib/myfaces-api-1.1.4.jar:web/WEB-INF/lib/myfaces-impl-1.1.4.jar:web/WEB-INF/lib/standard.jar:web/WEB-INF/lib/tomahawk-1.1.3.jar:../../tools/buildtime/tomcat-5.0.28/servlet-api.jar:lib/antlr.jar:lib/asm-attrs.jar:lib/asm.jar:lib/cglib-2.1.3.jar:lib/commons-fileupload.jar:lib/commons-lang-2.0.jar:lib/commons-logging.jar:lib/commons-validator.jar:lib/dom4j-1.6.1.jar:lib/ehcache-1.1.jar:lib/hibernate3.jar:lib/jaxen-full.jar:lib/jdbc2_0-stdext.jar:lib/jdom.jar:lib/jta.jar:lib/log4j-1.2.11.jar:lib/roller-business.jar:lib/roller-web.jar:lib/rome-0.8.jar:lib/rome-fetcher-0.8.jar:lib/saxpath.jar:lib/servlet-api.jar:lib/velocity-1
 .4.jar:lib/velocity-dep-1.4.jar:lib/activation.jar:lib/mail.jar</classpath>
-                <source-level>1.5</source-level>
+                <source-level>1.4</source-level>
+            </compilation-unit>
+            <compilation-unit>
+                <package-root>test</package-root>
+                <unit-tests/>
+                <source-level>1.4</source-level>
             </compilation-unit>
         </java-data>
         <web-data xmlns="http://www.netbeans.org/ns/freeform-project-web/1">

Added: incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/RollerException.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/RollerException.java?view=auto&rev=485845
==============================================================================
--- incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/RollerException.java (added)
+++ incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/RollerException.java Mon Dec 11 11:50:59 2006
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.roller;
+
+import java.io.PrintStream;
+import java.io.PrintWriter;
+
+
+/**
+ * Base Roller exception class.
+ */
+public class RollerException extends Exception {
+    
+    private Throwable mRootCause = null;
+    
+    
+    /**
+     * Construct emtpy exception object.
+     */
+    public RollerException() {
+        super();
+    }
+    
+    
+    /**
+     * Construct RollerException with message string.
+     * @param s Error message string.
+     */
+    public RollerException(String s) {
+        super(s);
+    }
+    
+    
+    /**
+     * Construct RollerException, wrapping existing throwable.
+     * @param s Error message
+     * @param t Existing connection to wrap.
+     */
+    public RollerException(String s, Throwable t) {
+        super(s);
+        mRootCause = t;
+    }
+    
+    
+    /**
+     * Construct RollerException, wrapping existing throwable.
+     * @param t Existing exception to be wrapped.
+     */
+    public RollerException(Throwable t) {
+        mRootCause = t;
+    }
+    
+    
+    /**
+     * Get root cause object, or null if none.
+     * @return Root cause or null if none.
+     */
+    public Throwable getRootCause() {
+        return mRootCause;
+    }
+    
+    
+    /**
+     * Get root cause message.
+     * @return Root cause message.
+     */
+    public String getRootCauseMessage() {
+        String rcmessage = null;
+        if (getRootCause()!=null) {
+            if (getRootCause().getCause()!=null) {
+                rcmessage = getRootCause().getCause().getMessage();
+            }
+            rcmessage = (rcmessage == null) ? getRootCause().getMessage() : rcmessage;
+            rcmessage = (rcmessage == null) ? super.getMessage() : rcmessage;
+            rcmessage = (rcmessage == null) ? "NONE" : rcmessage;
+        }
+        return rcmessage;
+    }
+    
+    
+    /**
+     * Print stack trace for exception and for root cause exception if htere is one.
+     * @see java.lang.Throwable#printStackTrace()
+     */
+    public void printStackTrace() {
+        super.printStackTrace();
+        if (mRootCause != null) {
+            System.out.println("--- ROOT CAUSE ---");
+            mRootCause.printStackTrace();
+        }
+    }
+    
+    
+    /**
+     * Print stack trace for exception and for root cause exception if htere is one.
+     * @param s Stream to print to.
+     */
+    public void printStackTrace(PrintStream s) {
+        super.printStackTrace(s);
+        if (mRootCause != null) {
+            s.println("--- ROOT CAUSE ---");
+            mRootCause.printStackTrace(s);
+        }
+    }
+    
+    
+    /**
+     * Print stack trace for exception and for root cause exception if htere is one.
+     * @param s Writer to write to.
+     */
+    public void printStackTrace(PrintWriter s) {
+        super.printStackTrace(s);
+        if (null != mRootCause) {
+            s.println("--- ROOT CAUSE ---");
+            mRootCause.printStackTrace(s);
+        }
+    }
+    
+}

Modified: incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/Planet.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/Planet.java?view=diff&rev=485845&r1=485844&r2=485845
==============================================================================
--- incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/Planet.java (original)
+++ incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/Planet.java Mon Dec 11 11:50:59 2006
@@ -30,7 +30,7 @@
     /**
      * Get PlanetManager associated with this Roller instance.
      */
-    public PlanetManager getPlanetManager() throws RollerException;
+    public PlanetManager getPlanetManager();
         
     /**
      * Flush object states.

Added: incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/HibernatePersistenceStrategy.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/HibernatePersistenceStrategy.java?view=auto&rev=485845
==============================================================================
--- incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/HibernatePersistenceStrategy.java (added)
+++ incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/HibernatePersistenceStrategy.java Mon Dec 11 11:50:59 2006
@@ -0,0 +1,319 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.roller.planet.business.hibernate;
+
+import java.io.StringBufferInputStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.cfg.Configuration;
+import org.apache.roller.RollerException;
+import org.jdom.Attribute;
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.input.SAXBuilder;
+import org.jdom.output.DOMOutputter;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+
+
+/**
+ * Base class for Hibernate persistence implementation.
+ *
+ * This class serves as a helper/util class for all of the Hibernate
+ * manager implementations by providing a set of basic persistence methods
+ * that can be easily reused.
+ *
+ */
+public class HibernatePersistenceStrategy {
+    
+    static final long serialVersionUID = 2561090040518169098L;
+    
+    protected static SessionFactory sessionFactory = null;
+    
+    private static Log log = LogFactory.getLog(HibernatePersistenceStrategy.class);
+    
+    /** No-op so XML parser doesn't hit the network looking for Hibernate DTDs */
+    private EntityResolver noOpEntityResolver = new EntityResolver() {
+        public InputSource resolveEntity(String publicId, String systemId) {
+            return new InputSource(new StringBufferInputStream(""));
+        }
+    };
+    
+    
+    public HibernatePersistenceStrategy() {
+    }   
+
+    /** 
+     * Construct self using Hibernate config resource and optional dialect.
+     * @param configResouce Classpath-based path to Hibernate config file (e.g. "/hibernate.cgf.xml")
+     * @parma dialect Classname of Hibernate dialect to be used (overriding any specified in the configResource)
+     */
+    public HibernatePersistenceStrategy(
+            String configResource,
+            String dialect) throws Exception {
+
+        log.info("configResource: " + configResource);
+        log.info("dialect:        " + dialect);
+        
+        // read configResource into DOM form
+        SAXBuilder builder = new SAXBuilder();
+        builder.setEntityResolver(noOpEntityResolver); 
+        Document configDoc = builder.build(
+            getClass().getResourceAsStream(configResource));
+        Element root = configDoc.getRootElement();
+        Element sessionFactoryElem = root.getChild("session-factory");
+        
+        // remove any existing connection.datasource and dialect properties
+        List propertyElems = sessionFactoryElem.getChildren("property");
+        List removeList = new ArrayList();
+        for (Iterator it = propertyElems.iterator(); it.hasNext();) {
+            Element elem = (Element) it.next();
+            if (elem.getAttribute("name") != null 
+                && elem.getAttribute("name").getValue().equals("dialect")) {
+                removeList.add(elem);           
+            }
+        }
+        for (Iterator it = removeList.iterator(); it.hasNext();) {
+            Element elem = (Element) it.next();
+            sessionFactoryElem.removeContent(elem); 
+        }
+        
+        // add Roller dialect property      
+        Element prop = new Element("property").setAttribute(
+            new Attribute("name","dialect"));
+        prop.addContent(dialect);
+        sessionFactoryElem.addContent(prop);
+        
+        Configuration config = new Configuration();
+        DOMOutputter outputter = new DOMOutputter();
+        config.configure(outputter.output(configDoc));
+        this.sessionFactory = config.buildSessionFactory(); 
+    }
+    
+    /** 
+     * Construct self using Hibernate config resource and optional dialect.
+     * @param configResouce Classpath-based path to Hibernate config file (e.g. "/hibernate.cgf.xml")
+     * @parma dialect Classname of Hibernate dialect to be used (or null to use one specified in configResource)
+     */
+    public HibernatePersistenceStrategy(
+            String configResource,
+            String dialect,
+            String driverClass,
+            String connectionURL,
+            String username,
+            String password) throws Exception {
+        
+        log.info("configResource: " + configResource);
+        log.info("dialect:        " + dialect);
+        log.info("driverClass:    " + driverClass);
+        log.info("connectionURL:  " + connectionURL);
+        log.info("username:       " + username);
+
+        // read configResource into DOM form
+        SAXBuilder builder = new SAXBuilder();
+        builder.setEntityResolver(noOpEntityResolver); 
+        Document configDoc = builder.build(
+            getClass().getResourceAsStream(configResource));
+        Element root = configDoc.getRootElement();
+        Element sessionFactoryElem = root.getChild("session-factory");
+        
+        // remove any existing connection.datasource and dialect properties
+        List propertyElems = sessionFactoryElem.getChildren("property");
+        List removeList = new ArrayList();
+        for (Iterator it = propertyElems.iterator(); it.hasNext();) {
+            Element elem = (Element) it.next();
+            if (elem.getAttribute("name") != null 
+                && elem.getAttribute("name").getValue().equals("connection.datasource")) {
+                removeList.add(elem);
+            }
+            if (elem.getAttribute("name") != null 
+                && elem.getAttribute("name").getValue().equals("dialect")) {
+                removeList.add(elem);
+            }
+        }
+        for (Iterator it = removeList.iterator(); it.hasNext();) {
+            Element elem = (Element) it.next();
+            sessionFactoryElem.removeContent(elem); 
+        }
+                                       
+        // add JDBC connection params instead
+        Element prop = new Element("property").setAttribute(
+            new Attribute("name","hibernate.connection.driver_class"));
+        prop.addContent(driverClass);
+        sessionFactoryElem.addContent(prop);
+
+        prop = new Element("property").setAttribute(
+            new Attribute("name","hibernate.connection.url"));
+        prop.addContent(connectionURL);
+        sessionFactoryElem.addContent(prop);
+        
+        prop = new Element("property").setAttribute(
+            new Attribute("name","hibernate.connection.username"));
+        prop.addContent(username);
+        sessionFactoryElem.addContent(prop);
+        
+        prop = new Element("property").setAttribute(
+            new Attribute("name","hibernate.connection.password"));
+        prop.addContent(password);
+        sessionFactoryElem.addContent(prop);
+        
+        prop = new Element("property").setAttribute(
+            new Attribute("name","dialect"));
+        prop.addContent(dialect);
+        sessionFactoryElem.addContent(prop);
+        
+        Configuration config = new Configuration();
+        DOMOutputter outputter = new DOMOutputter();
+        config.configure(outputter.output(configDoc));
+        this.sessionFactory = config.buildSessionFactory();
+    }
+    
+    
+    /**
+     * Get persistence session on current thread.
+     *
+     * This will open a new Session if one is not already open, otherwise
+     * it will return the already open Session.
+     */
+    public Session getSession() {
+        
+        log.debug("Obtaining Hibernate Session");
+        
+        // get Hibernate Session and make sure we are in a transaction
+        // this will join existing Session/Transaction if they exist
+        Session session = sessionFactory.getCurrentSession();
+        session.beginTransaction();
+        
+        return session;
+    }
+    
+    
+    public void flush() throws RollerException {
+        
+        Session session = getSession();
+        try {
+            // first lets flush the current state to the db
+            log.debug("Flushing Hibernate Session");
+            session.flush();
+            
+            // then commit the current transaction to finish it
+            log.debug("Committing Hibernate Transaction");
+            session.getTransaction().commit();
+            
+        } catch(Throwable t) {
+            // uh oh ... failed persisting, gotta release
+            release();
+            
+            // wrap and rethrow so caller knows something bad happened
+            throw new RollerException(t);
+        }
+    }
+    
+    
+    /**
+     * Release database session, rollback any uncommitted changes.
+     *
+     * IMPORTANT: we don't want to open a transaction and force the use of a
+     * jdbc connection just to close the session and do a rollback, so this
+     * method must be sensitive about how the release is triggered.
+     *
+     * In particular we don't want to use our custom getSession() method which
+     * automatically begins a transaction.  Instead we get a Session and check
+     * if there is already an active transaction that needs to be rolled back.
+     * If not then we can close the Session without ever getting a jdbc
+     * connection, which is important for scalability.
+     */
+    public void release() {
+        
+        try {
+            Session session = sessionFactory.getCurrentSession();
+            
+            if(session != null && session.isOpen()) {
+                
+                log.debug("Closing Hibernate Session");
+                
+                try {
+                    Transaction tx = session.getTransaction();
+                    
+                    if(tx != null && tx.isActive()) {
+                        log.debug("Forcing rollback on active transaction");
+                        tx.rollback();
+                    }
+                } catch(Throwable t) {
+                    log.error("ERROR doing Hibernate rollback", t);
+                } finally {
+                    if(session.isOpen()) {
+                        session.close();
+                    }
+                }
+            }
+        } catch(Throwable t) {
+            log.error("ERROR closing Hibernate Session", t);
+        }
+    }
+    
+    
+    /**
+     * Retrieve object.  We return null if the object is not found.
+     */
+    public Object load(String id, Class clazz) throws RollerException {
+        
+        if(id == null || clazz == null) {
+            throw new RollerException("Cannot load objects when value is null");
+        }
+        
+        return (Object) getSession().get(clazz, id);
+    }
+    
+    
+    /**
+     * Store object.
+     */
+    public void store(Object obj) throws HibernateException {
+        
+        if(obj == null) {
+            throw new HibernateException("Cannot save null object");
+        }
+        
+        Session session = getSession();
+        
+        session.saveOrUpdate(obj);
+    }
+    
+    
+    /**
+     * Remove object.
+     */
+    public void remove(Object obj) throws HibernateException {
+        
+        if(obj == null) {
+            throw new HibernateException("Cannot remove null object");
+        }
+        
+        getSession().delete(obj);
+    }
+    
+}

Modified: incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/HibernatePlanetImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/HibernatePlanetImpl.java?view=diff&rev=485845&r1=485844&r2=485845
==============================================================================
--- incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/HibernatePlanetImpl.java (original)
+++ incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/HibernatePlanetImpl.java Mon Dec 11 11:50:59 2006
@@ -15,16 +15,18 @@
 * copyright in this work, please see the NOTICE file in the top level
 * directory of this distribution.
 */
+
 package org.apache.roller.planet.business.hibernate;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.RollerException;
-import org.apache.roller.business.hibernate.HibernatePersistenceStrategy;
 import org.apache.roller.planet.config.PlanetConfig;
 import org.apache.roller.planet.business.Planet;
 import org.apache.roller.planet.business.PlanetManager;
+import org.apache.roller.planet.business.hibernate.HibernatePersistenceStrategy;
+
 
 /**
  * A Hibernate specific implementation of the Roller business layer.
@@ -37,10 +39,10 @@
     private static HibernatePlanetImpl me = null;
     
     // a persistence utility class
-    private HibernatePersistenceStrategy strategy = null;
+    protected HibernatePersistenceStrategy strategy = null;
     
     // references to the managers we maintain
-    private PlanetManager planetManager = null;
+    protected PlanetManager planetManager = null;
     
         
     /**
@@ -85,7 +87,7 @@
     }
     
     
-    public PlanetManager getPlanetManager() throws RollerException {
+    public PlanetManager getPlanetManager() {
         if ( planetManager == null ) {
             planetManager = new HibernatePlanetManagerImpl(strategy);  
         }

Copied: incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/HibernatePlanetManagerImpl.java (from r483703, incubator/roller/trunk/src/org/apache/roller/planet/business/hibernate/HibernatePlanetManagerImpl.java)
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/HibernatePlanetManagerImpl.java?view=diff&rev=485845&p1=incubator/roller/trunk/src/org/apache/roller/planet/business/hibernate/HibernatePlanetManagerImpl.java&r1=483703&p2=incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/HibernatePlanetManagerImpl.java&r2=485845
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/planet/business/hibernate/HibernatePlanetManagerImpl.java (original)
+++ incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/HibernatePlanetManagerImpl.java Mon Dec 11 11:50:59 2006
@@ -35,7 +35,6 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
-import org.apache.roller.business.hibernate.*;
 import org.hibernate.Criteria;
 import org.hibernate.HibernateException;
 import org.hibernate.Query;

Added: incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/ThreadLocalSessionContextNoAutoClose.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/ThreadLocalSessionContextNoAutoClose.java?view=auto&rev=485845
==============================================================================
--- incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/ThreadLocalSessionContextNoAutoClose.java (added)
+++ incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/business/hibernate/ThreadLocalSessionContextNoAutoClose.java Mon Dec 11 11:50:59 2006
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.roller.business.hibernate;
+
+import org.hibernate.FlushMode;
+import org.hibernate.SessionFactory;
+import org.hibernate.classic.Session;
+import org.hibernate.context.ThreadLocalSessionContext;
+import org.hibernate.engine.SessionFactoryImplementor;
+
+
+/**
+ * This is a special Hibernate SessionContext which was taken from the Hibernate forums so that we can use it
+ * to provide a way to commit our transactions while keeping the Session open for further use.  Details here ...
+ *
+ * http://forum.hibernate.org/viewtopic.php?t=958752
+ *
+ * ... which was found from a reference here ...
+ *
+ * http://forum.hibernate.org/viewtopic.php?t=957056
+ *
+ * Extends {@link ThreadLocalSessionContext} to allow for long conversations. It achieves this by setting every
+ * <code>Session</code> it produces to <code>FlushMode.NEVER</code> so that it won't flush unless explicitly asked
+ * to, and by preventing the session from auto-closing or unbinding from the thread after a <code>Transaction</code>
+ * commit. Note that this means the application code must do these functions manually as needed!
+ */
+public class ThreadLocalSessionContextNoAutoClose extends ThreadLocalSessionContext {
+    
+    /**
+     * Create a new instance.
+     *
+     * @param factory The <code>SessionFactoryImplementor</code> required by the super constructor.
+     */
+    public ThreadLocalSessionContextNoAutoClose(SessionFactoryImplementor factory) {
+        super(factory);
+    }
+    
+    
+    /**
+     * Returns <code>false</code> to prevent auto closing.
+     *
+     * @return <code>false</code> to prevent auto closing.
+     */
+    protected boolean isAutoCloseEnabled() {
+        return false;
+    }
+    
+    
+    /**
+     * Returns <code>false</code> to prevent auto flushing.
+     *
+     * @return <code>false</code> to prevent auto flushing.
+     */
+    protected boolean isAutoFlushEnabled() {
+        return false;
+    }
+    
+    
+    /**
+     * Uses <code>super.buildOrObtainSession()</code>, then sets the resulting <code>Session</code>'s flush mode
+     * to <code>FlushMode.NEVER</code> to prevent auto-flushing.
+     *
+     * @return A session configured with <code>FlushMode.NEVER</code>.
+     */
+    protected Session buildOrObtainSession() {
+        Session s = super.buildOrObtainSession();
+        s.setFlushMode(FlushMode.NEVER);
+        return s;
+    }
+    
+    
+    /**
+     * Returns an instance of <code>CleanupSynch</code> which prevents auto closing and unbinding.
+     *
+     * @return A <code>CleanupSynch</code> which prevents auto closing and unbinding.
+     */
+    protected CleanupSynch buildCleanupSynch() {
+        return new NoCleanupSynch(factory);
+    }
+    
+    
+    /**
+     * A simple extension of <code>CleanupSynch</code> that prevents any cleanup from happening. No session closing or
+     * unbinding.
+     */
+    private static class NoCleanupSynch extends ThreadLocalSessionContext.CleanupSynch {
+        
+        /**
+         * Creates a new instance based on the given factory.
+         *
+         * @param factory The required <code>SessionFactory</code> that is passed to the super constructor.
+         */
+        public NoCleanupSynch(SessionFactory factory) {
+            super(factory);
+        }
+        
+        /**
+         * Does nothing, thus helping to prevent session closing and/or unbinding.
+         */
+        public void beforeCompletion() {
+            // do nothing
+        }
+        
+        /**
+         * Does nothing, thus helping to prevent session closing and/or unbinding.
+         *
+         * @param i
+         */
+        public void afterCompletion(int i) {
+            // do nothing
+        }
+    }
+    
+}

Added: incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/Author.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/Author.java?view=auto&rev=485845
==============================================================================
--- incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/Author.java (added)
+++ incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/Author.java Mon Dec 11 11:50:59 2006
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.roller.planet.pojos;
+
+/**
+ * Represents the author of an entry.
+ */
+public class Author {
+    
+    private String fullName = null;
+    private String userName = null;
+    
+
+    public String getFullName() {
+        return fullName;
+    }
+
+    public void setFullName(String fullName) {
+        this.fullName = fullName;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+    
+}

Added: incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/Category.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/Category.java?view=auto&rev=485845
==============================================================================
--- incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/Category.java (added)
+++ incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/Category.java Mon Dec 11 11:50:59 2006
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.roller.planet.pojos;
+
+/**
+ * Represents a category of an entry.
+ */
+public class Category {
+    
+    private String name = null;
+    private String path = null;
+    
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPath() {
+        return path;
+    }
+
+    public void setPath(String path) {
+        this.path = path;
+    }
+    
+}

Copied: incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetConfigData.java (from r485756, incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetConfigData.java)
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetConfigData.java?view=diff&rev=485845&p1=incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetConfigData.java&r1=485756&p2=incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetConfigData.java&r2=485845
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetConfigData.java (original)
+++ incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetConfigData.java Mon Dec 11 11:50:59 2006
@@ -13,19 +13,18 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.roller.planet.pojos;
 
 import java.io.Serializable;
-import org.apache.roller.pojos.*;
 
-import org.apache.roller.pojos.PersistentObject;
 
 /**
  * @struts.form include-all="true"
  * @hibernate.class lazy="true" table="rag_config"
  * @author Dave Johnson
  */
-public class PlanetConfigData extends PersistentObject implements Serializable
+public class PlanetConfigData implements Serializable
 {
     /** Database ID */
     protected String id;
@@ -238,10 +237,5 @@
     {
         cacheDir = dir;
     }
-
-    //-------------------------------------------------------------- implementation
-    public void setData(PersistentObject vo)
-    {
-        // TODO Auto-generated method stub
-    }
-}
\ No newline at end of file
+    
+}

Copied: incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetEntryData.java (from r485756, incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetEntryData.java)
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetEntryData.java?view=diff&rev=485845&p1=incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetEntryData.java&r1=485756&p2=incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetEntryData.java&r2=485845
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetEntryData.java (original)
+++ incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetEntryData.java Mon Dec 11 11:50:59 2006
@@ -15,6 +15,7 @@
  * copyright in this work, please see the NOTICE file in the top level
  * directory of this distribution.
  */
+
 package org.apache.roller.planet.pojos;
 
 import java.io.Serializable;
@@ -23,24 +24,14 @@
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.roller.config.RollerRuntimeConfig;
-import org.apache.roller.pojos.*;
-import org.apache.roller.util.rome.ContentModule;
-
 import org.apache.roller.util.Utilities;
-import org.apache.commons.lang.StringUtils;
 import com.sun.syndication.feed.module.DCModule;
 import com.sun.syndication.feed.synd.SyndCategory;
 import com.sun.syndication.feed.synd.SyndContent;
 import com.sun.syndication.feed.synd.SyndEntry;
 import com.sun.syndication.feed.synd.SyndFeed;
-
-import java.util.Map;
 import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.roller.RollerException;
-import org.apache.roller.business.PluginManager;
-import org.apache.roller.business.Roller;
-import org.apache.roller.business.RollerFactory;
+
 
 /**
  * Represents a planet entry, i.e. an entry that was parsed out of an RSS or 
@@ -52,8 +43,8 @@
  * 
  * @hibernate.class lazy="true" table="rag_entry"
  */
-public class PlanetEntryData extends PersistentObject
-        implements Serializable, Comparable {
+public class PlanetEntryData implements Serializable, Comparable {
+    
     protected String    id;
     protected String    handle;
     protected String    title;
@@ -85,6 +76,7 @@
     /**
      * Create entry from Rome entry.
      */
+    /*
     public PlanetEntryData(
             WeblogEntryData rollerEntry,
             PlanetSubscriptionData sub,
@@ -92,6 +84,7 @@
         setSubscription(sub);
         initFromRollerEntry(rollerEntry, pagePlugins);
     }
+    */
     
     /**
      * Init entry from Rome entry
@@ -150,9 +143,11 @@
         }
     }
     
+    
     /**
      * Init entry from Roller entry
      */
+    /*
     private void initFromRollerEntry(WeblogEntryData rollerEntry, Map pagePlugins)
     throws RollerException {
         Roller roller = RollerFactory.getRoller();
@@ -179,6 +174,7 @@
         cats.add(rollerEntry.getCategory().getPath());
         setCategoriesString(cats);
     }
+    */
     
     //----------------------------------------------------------- persistent fields
     
@@ -319,7 +315,7 @@
         if (categoriesString != null) {
             String[] catArray = Utilities.stringToStringArray(categoriesString,",");
             for (int i=0; i<catArray.length; i++) {
-                WeblogCategoryData cat = new WeblogCategoryData();
+                Category cat = new Category();
                 cat.setName(catArray[i]);
                 cat.setPath(catArray[i]);
                 list.add(cat);
@@ -332,11 +328,11 @@
      * Return first entry in category collection.
      * @roller.wrapPojoMethod type="pojo"
      */
-    public WeblogCategoryData getCategory() {
-        WeblogCategoryData cat = null;
+    public Category getCategory() {
+        Category cat = null;
         List cats = getCategories();
         if (cats.size() > 0) {
-            cat = (WeblogCategoryData)cats.get(0);
+            cat = (Category)cats.get(0);
         }
         return cat;
     }
@@ -357,10 +353,10 @@
      * @roller.wrapPojoMethod type="pojo"
      * TODO: make planet model entry author name, email, and uri
      */
-    public UserData getCreator() {
-        UserData user = null;
+    public Author getCreator() {
+        Author user = null;
         if (author != null) {
-            user = new UserData();
+            user = new Author();
             user.setFullName(author);
             user.setUserName(author);
         }
@@ -399,8 +395,6 @@
     public int hashCode() {
         return this.permalink.hashCode();
     }
-    
-    public void setData(PersistentObject vo) {}
 
     /**
      * Read-only synomym for getSubscription()

Copied: incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetGroupData.java (from r485756, incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetGroupData.java)
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetGroupData.java?view=diff&rev=485845&p1=incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetGroupData.java&r1=485756&p2=incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetGroupData.java&r2=485845
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetGroupData.java (original)
+++ incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetGroupData.java Mon Dec 11 11:50:59 2006
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.roller.planet.pojos;
 
 import java.io.Serializable;
@@ -22,7 +23,6 @@
 import java.util.Set;
 import java.util.StringTokenizer;
 import java.util.TreeSet;
-import org.apache.roller.pojos.*;
 
 
 /**
@@ -30,7 +30,7 @@
  * @ejb:bean name="PlanetGroupData"
  * @hibernate.class lazy="true" table="rag_group"
  */
-public class PlanetGroupData extends PersistentObject implements Serializable
+public class PlanetGroupData implements Serializable
 {
     transient private String[] catArray = null;
 
@@ -192,10 +192,4 @@
     {
     }
     
-    //---------------------------------------------------------- implementation
-
-    public void setData(PersistentObject vo)
-    {
-        // TODO Auto-generated method stub    
-    }
 }

Copied: incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetSubscriptionData.java (from r485756, incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetSubscriptionData.java)
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetSubscriptionData.java?view=diff&rev=485845&p1=incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetSubscriptionData.java&r1=485756&p2=incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetSubscriptionData.java&r2=485845
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/planet/pojos/PlanetSubscriptionData.java (original)
+++ incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/pojos/PlanetSubscriptionData.java Mon Dec 11 11:50:59 2006
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.roller.planet.pojos;
 
 import java.io.Serializable;
@@ -23,15 +24,14 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
-import org.apache.roller.pojos.*;
+
 
 /**
  * @struts.form include-all="true"
  * @ejb:bean name="PlanetSubscriptionData"
  * @hibernate.class lazy="true" table="rag_subscription"
  */
-public class PlanetSubscriptionData extends PersistentObject 
-    implements Serializable, Comparable
+public class PlanetSubscriptionData implements Serializable, Comparable
 {
     /** Database ID */
     protected String id;
@@ -195,13 +195,7 @@
     }
     
     //-------------------------------------------------------------- implementation
-   
-    /**
-     */
-    public void setData(PersistentObject vo)
-    {
-        // TODO Auto-generated method stub        
-    }
+    
     /**
      */
     public int compareTo(Object o)

Modified: incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/tasks/GeneratePlanetTask.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/tasks/GeneratePlanetTask.java?view=diff&rev=485845&r1=485844&r2=485845
==============================================================================
--- incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/tasks/GeneratePlanetTask.java (original)
+++ incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/tasks/GeneratePlanetTask.java Mon Dec 11 11:50:59 2006
@@ -25,13 +25,10 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.RollerException;
-import org.apache.roller.config.RollerConfig;
 import org.apache.roller.planet.config.PlanetConfig;
 import org.apache.roller.planet.business.Planet;
 import org.apache.roller.planet.business.PlanetFactory;
 import org.apache.roller.planet.business.PlanetManager;
-import org.apache.roller.ui.rendering.model.UtilitiesModel;
-import org.apache.roller.ui.rendering.velocity.deprecated.OldUtilities;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.VelocityEngine;
 import org.apache.velocity.texen.Generator;
@@ -82,8 +79,9 @@
             // Build context with current date 
             VelocityContext context = new VelocityContext();
             context.put("date", new Date());
-            context.put("utils", new UtilitiesModel());
-            context.put("utilities", new OldUtilities());
+            // TODO fix
+            //context.put("utils", new UtilitiesModel());
+            //context.put("utilities", new OldUtilities());
             context.put("planet", new StaticPlanetModel());
             
             // Ensure that output directories exists, one for each group

Modified: incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/tasks/RefreshPlanetTask.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/tasks/RefreshPlanetTask.java?view=diff&rev=485845&r1=485844&r2=485845
==============================================================================
--- incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/tasks/RefreshPlanetTask.java (original)
+++ incubator/roller/trunk/sandbox/planetroller/src/org/apache/roller/planet/tasks/RefreshPlanetTask.java Mon Dec 11 11:50:59 2006
@@ -18,23 +18,12 @@
 
 package org.apache.roller.planet.tasks;
 
-import java.io.File;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.RollerException;
-import org.apache.roller.config.RollerConfig;
 import org.apache.roller.planet.config.PlanetConfig;
 import org.apache.roller.planet.business.Planet;
 import org.apache.roller.planet.business.PlanetFactory;
-import org.apache.roller.planet.business.PlanetManager;
-import org.apache.roller.ui.rendering.model.UtilitiesModel;
-import org.apache.roller.ui.rendering.velocity.deprecated.OldUtilities;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.VelocityEngine;
-import org.apache.velocity.texen.Generator;
 
 
 /**
@@ -45,7 +34,7 @@
  * </pre>
  */
 public class RefreshPlanetTask implements Runnable {
-    private static Log log = LogFactory.getLog(GeneratePlanetTask.class);
+    private static Log log = LogFactory.getLog(RefreshPlanetTask.class);
     
     public void run() {
         try {