You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2006/05/02 00:30:31 UTC
svn commit: r398716 - in /incubator/roller/trunk: ./
sandbox/jdobackend/src/org/apache/ sandbox/jdobackend/src/org/apache/roller/
sandbox/jdobackend/src/org/apache/roller/business/
sandbox/jdobackend/src/org/apache/roller/business/jdo/ sandbox/standalo...
Author: snoopdave
Date: Mon May 1 15:30:26 2006
New Revision: 398716
URL: http://svn.apache.org/viewcvs?rev=398716&view=rev
Log:
Moving to org.apache.roller packaging
Added:
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOAutoPingManagerImpl.java
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOBookmarkManagerImpl.java
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOConfigManagerImpl.java
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPersistenceSession.java
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPingQueueManagerImpl.java
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPingTargetManagerImpl.java
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPlanetManagerImpl.java
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPropertiesManagerImpl.java
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDORefererManagerImpl.java
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDORollerImpl.java
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOStrategy.java
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOUserManagerImpl.java
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOWeblogManagerImpl.java
incubator/roller/trunk/sandbox/standalone/src/org/apache/
incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/
incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/jspwiki/
incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/jspwiki/AttachmentProvider.java
incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/jspwiki/PageProvider.java
incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/tomcat/
incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/tomcat/TomcatHSQLDBPlugin.java
incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/util/
incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/util/HSQLDBUtility.java
Modified:
incubator/roller/trunk/build.xml
incubator/roller/trunk/testdata/WEB-INF/classes/hibernate.cfg.xml
Modified: incubator/roller/trunk/build.xml
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/build.xml?rev=398716&r1=398715&r2=398716&view=diff
==============================================================================
--- incubator/roller/trunk/build.xml (original)
+++ incubator/roller/trunk/build.xml Mon May 1 15:30:26 2006
@@ -110,9 +110,9 @@
<!-- Use EJBDoclet to generate Struts forms -->
<ejbdoclet destdir="${build.generated}/src" excludedtags="@version,@author">
- <fileset dir="./src" includes="org/roller/pojos/WeblogTemplate.java" />
- <fileset dir="./src" includes="org/roller/pojos/*Data.java" />
- <fileset dir="./src" includes="org/roller/business/*Data.java" />
+ <fileset dir="./src" includes="org/apache/roller/pojos/WeblogTemplate.java" />
+ <fileset dir="./src" includes="org/apache/roller/pojos/*Data.java" />
+ <fileset dir="./src" includes="org/apache/roller/business/*Data.java" />
&custom-gen-web;
<!-- Generate Struts forms -->
@@ -120,7 +120,7 @@
prefixWithPackageStructure="no"
templateFile="./metadata/xdoclet/struts_form.xdt">
- <!-- into the org.roller.presentation.forms package -->
+ <!-- into the org.apache.roller.presentation.forms package -->
<packageSubstitution packages="pojos"
substituteWith="presentation.forms"/>
<packageSubstitution packages="presentation"
@@ -139,10 +139,10 @@
</copy>
<!-- Change Struts form names from *DataForm.java to *Form.java -->
- <replace dir="${build.generated}/src.presentation/org/roller/presentation/forms"
+ <replace dir="${build.generated}/src.presentation/org/apache/roller/presentation/forms"
token="DataForm" value="Form"/>
- <move todir="${build.generated}/src.presentation/org/roller/presentation/forms">
- <fileset dir="${build.generated}/src.presentation/org/roller/presentation/forms" >
+ <move todir="${build.generated}/src.presentation/org/apache/roller/presentation/forms">
+ <fileset dir="${build.generated}/src.presentation/org/apache/roller/presentation/forms" >
<include name="*DataForm.java"/>
<include name="*ConfigForm.java" />
</fileset>
@@ -166,10 +166,10 @@
excludedtags="@version,@author"
addedtags="@xdoclet-generated at ${TODAY}"
force="true">
- <fileset dir="./src" includes="org/roller/pojos/WeblogTemplate.java" />
- <fileset dir="./src" includes="org/roller/pojos/*Data.java" />
- <fileset dir="./src" includes="org/roller/pojos/*Assoc.java" />
- <fileset dir="./src" includes="org/roller/business/*Data.java" />
+ <fileset dir="./src" includes="org/apache/roller/pojos/WeblogTemplate.java" />
+ <fileset dir="./src" includes="org/apache/roller/pojos/*Data.java" />
+ <fileset dir="./src" includes="org/apache/roller/pojos/*Assoc.java" />
+ <fileset dir="./src" includes="org/apache/roller/business/*Data.java" />
&custom-gen-beans;
<hibernate validatexml="true" version="3.0"/>
</hibernatedoclet>
@@ -200,9 +200,9 @@
<include name="**/*FormEx.java" />
<include name="**/*Servlet.java" />
<include name="**/*Tag.java" />
- <include name="org/roller/presentation/**/actions/*.java" />
- <include name="org/roller/presentation/RollerContext.java" />
- <include name="org/roller/presentation/RollerSession.java" />
+ <include name="org/apache/roller/presentation/**/actions/*.java" />
+ <include name="org/apache/roller/presentation/RollerContext.java" />
+ <include name="org/apache/roller/presentation/RollerSession.java" />
<exclude name="**/IPBanFilter**" />
<exclude name="**/LinkTag**" />
<exclude name="**/LinkParamTag**" />
@@ -250,16 +250,16 @@
maybe we can extend the process to only wrap classes that have
methods tagged with @roller.wrapPojoMethod ??
-->
- <include name="org/roller/pojos/BookmarkData.java"/>
- <include name="org/roller/pojos/CommentData.java"/>
- <include name="org/roller/pojos/EntryAttributeData.java"/>
- <include name="org/roller/pojos/FolderData.java"/>
- <include name="org/roller/pojos/RefererData.java"/>
- <include name="org/roller/pojos/Template.java"/>
- <include name="org/roller/pojos/UserData.java"/>
- <include name="org/roller/pojos/WeblogEntryData.java"/>
- <include name="org/roller/pojos/WeblogCategoryData.java"/>
- <include name="org/roller/pojos/WebsiteData.java"/>
+ <include name="org/apache/roller/pojos/BookmarkData.java"/>
+ <include name="org/apache/roller/pojos/CommentData.java"/>
+ <include name="org/apache/roller/pojos/EntryAttributeData.java"/>
+ <include name="org/apache/roller/pojos/FolderData.java"/>
+ <include name="org/apache/roller/pojos/RefererData.java"/>
+ <include name="org/apache/roller/pojos/Template.java"/>
+ <include name="org/apache/roller/pojos/UserData.java"/>
+ <include name="org/apache/roller/pojos/WeblogEntryData.java"/>
+ <include name="org/apache/roller/pojos/WeblogCategoryData.java"/>
+ <include name="org/apache/roller/pojos/WebsiteData.java"/>
</fileset>
<template
@@ -289,7 +289,7 @@
</echo>
<javac debug="${build.debug}" destdir="${build.compile_beans}"
- excludes="org/roller/presentation/**" >
+ excludes="org/apache/roller/presentation/**" >
<src path="${basedir}/src" />
<src path="${build.generated}/src.business"/>
&custom-src-beans;
@@ -300,7 +300,7 @@
</javac>
<!-- Copy class resources -->
- <copy todir="${build.compile_beans}/org/roller/model">
+ <copy todir="${build.compile_beans}/org/apache/roller/model">
<fileset dir="${build.generated}/src.business" includes="*.hbm.xml"/>
</copy>
<!-- Jar up the beans -->
@@ -347,7 +347,7 @@
<mkdir dir="${build.compile_web}"/>
<antcall target="prepare.resin" />
<javac debug="${build.debug}" destdir="${build.compile_web}"
- includes="org/roller/presentation/**, org/roller/util/rome/**" >
+ includes="org/apache/roller/presentation/**, org/apache/roller/util/rome/**" >
<src path="./src" />
<src path="${build.generated}/src.presentation"/>
&custom-src-web;
@@ -585,8 +585,8 @@
<pathelement path="${ro.build}/generated/src.presentation"/>
</sourcepath>
<packageset dir="src" defaultexcludes="yes">
- <include name="org/roller/**" />
- <exclude name="org/roller/business/prevayler/**" />
+ <include name="org/apache/roller/**" />
+ <exclude name="org/apache/roller/business/prevayler/**" />
</packageset>
<link href="http://java.sun.com/j2se/1.4/docs/api/"/>
<link href="http://java.sun.com/products/servlet/2.3/javadoc/"/>
@@ -882,9 +882,9 @@
</javac>
<!-- register Ant tasks that were just built -->
- <taskdef name="startdb" classname="org.roller.ant.StartHsqldbTask"
+ <taskdef name="startdb" classname="org.apache.roller.ant.StartHsqldbTask"
classpath="${basedir}/tools/buildtime/hsqldb.jar;${build.tests}/WEB-INF/classes" />
- <taskdef name="stopdb" classname="org.roller.ant.StopHsqldbTask"
+ <taskdef name="stopdb" classname="org.apache.roller.ant.StopHsqldbTask"
classpath="${basedir}/tools/buildtime/hsqldb.jar;${build.tests}/WEB-INF/classes" />
<!-- Copy custom testing files -->
@@ -956,20 +956,20 @@
<formatter type="xml"/>
<batchtest toDir="${build.reports}/business/xml">
<fileset dir="${build.tests}/WEB-INF/classes">
- <include name="org/roller/business/UserTest.class"/>
- <include name="org/roller/business/WeblogTest.class"/>
- <include name="org/roller/business/PermissionTest.class"/>
- <include name="org/roller/business/WeblogPageTest.class"/>
- <include name="org/roller/business/PingsTest.class"/>
- <include name="org/roller/business/PropertiesTest.class"/>
- <include name="org/roller/business/WeblogEntryTest.class"/>
- <include name="org/roller/business/WeblogCategoryTest.class"/>
- <include name="org/roller/business/CommentTest.class"/>
- <include name="org/roller/business/FileManagerTest.class"/>
- <include name="org/roller/business/IndexManagerTest.class"/>
- <include name="org/roller/business/PlanetManagerTest.class"/>
- <include name="org/roller/business/BookmarkTest.class"/>
- <include name="org/roller/business/RefererTest.class"/>
+ <include name="org/apache/roller/business/UserTest.class"/>
+ <include name="org/apache/roller/business/WeblogTest.class"/>
+ <include name="org/apache/roller/business/PermissionTest.class"/>
+ <include name="org/apache/roller/business/WeblogPageTest.class"/>
+ <include name="org/apache/roller/business/PingsTest.class"/>
+ <include name="org/apache/roller/business/PropertiesTest.class"/>
+ <include name="org/apache/roller/business/WeblogEntryTest.class"/>
+ <include name="org/apache/roller/business/WeblogCategoryTest.class"/>
+ <include name="org/apache/roller/business/CommentTest.class"/>
+ <include name="org/apache/roller/business/FileManagerTest.class"/>
+ <include name="org/apache/roller/business/IndexManagerTest.class"/>
+ <include name="org/apache/roller/business/PlanetManagerTest.class"/>
+ <include name="org/apache/roller/business/BookmarkTest.class"/>
+ <include name="org/apache/roller/business/RefererTest.class"/>
</fileset>
</batchtest>
</junit>
@@ -1011,7 +1011,7 @@
<junit fork="true" dir="${build.tests}">
<batchtest toDir="${build.reports}/presentation/xml">
<fileset dir="${build.tests}/WEB-INF/classes">
- <include name="org/roller/presentation/**/*Test.class"/>
+ <include name="org/apache/roller/presentation/**/*Test.class"/>
<exclude name="**/ApplicationResourcesTest.class"/>
<exclude name="**/ArchiveParserTest.class"/>
<exclude name="**/AtomCollectionTest.class"/>
@@ -1020,7 +1020,7 @@
<exclude name="**/LanguageUtilTest.class"/>
</fileset>
</batchtest>
- <!--arg value="org.roller.presentation.velocity.ExportRssTest"/-->
+ <!--arg value="org.apache.roller.presentation.velocity.ExportRssTest"/-->
<jvmarg value="-Dro.build=${ro.build}"/>
<jvmarg value="-Dcatalina.base=${build.tests}"/> <!-- needed to satisfy ref in log4j.properties -->
<jvmarg value="-Droller.custom.config=${build.tests}/roller-custom.properties"/>
@@ -1056,7 +1056,7 @@
<junit fork="true" dir="${build.tests}">
<batchtest toDir="${build.reports}/utils/xml">
<fileset dir="${build.tests}/WEB-INF/classes">
- <include name="org/roller/util/*Test.class"/>
+ <include name="org/apache/roller/util/*Test.class"/>
</fileset>
</batchtest>
<!-- needed to satisfy ref in log4j.properties -->
@@ -1092,7 +1092,7 @@
<formatter type="xml"/>
<batchtest toDir="${build.reports}/presentation/xml">
<fileset dir="${build.tests}/WEB-INF/classes">
- <include name="org/roller/presentation/atomadminapi/sdk/*EntryTest.class"/>
+ <include name="org/apache/roller/presentation/atomadminapi/sdk/*EntryTest.class"/>
</fileset>
</batchtest>
</junit>
@@ -1118,7 +1118,7 @@
<formatter type="xml"/>
<batchtest toDir="${build.reports}/presentation/xml">
<fileset dir="${build.tests}/WEB-INF/classes">
- <include name="org/roller/presentation/atomadminapi/*HandlerTest.class"/>
+ <include name="org/apache/roller/presentation/atomadminapi/*HandlerTest.class"/>
</fileset>
</batchtest>
</junit>
@@ -1131,7 +1131,7 @@
</target>
<!-- You can specify testClass using -DtestClass=foo -->
-<property name="testClass" value="org.roller.presentation.velocity.plugins.smileys.SmileysTest"/>
+<property name="testClass" value="org.apache.roller.presentation.velocity.plugins.smileys.SmileysTest"/>
<target name="test-one" depends="build-tests">
<java classname="junit.textui.TestRunner" fork="yes" failonerror="false">
<arg value="${testClass}"/>
@@ -1177,7 +1177,7 @@
<condition property="command" value="-purge">
<isset property="delete" />
</condition>
- <java classname="org.roller.business.utils.ConsistencyCheck" fork="yes">
+ <java classname="org.apache.roller.business.utils.ConsistencyCheck" fork="yes">
<arg value="${command}"/>
<jvmarg value="-Dusername=roller"/>
<jvmarg value="-Dpassword=tiger"/>
Added: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOAutoPingManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOAutoPingManagerImpl.java?rev=398716&view=auto
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOAutoPingManagerImpl.java (added)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOAutoPingManagerImpl.java Mon May 1 15:30:26 2006
@@ -0,0 +1,82 @@
+/*
+* 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.jdo;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.roller.RollerException;
+import org.apache.roller.business.AutoPingManagerImpl;
+import org.apache.roller.business.PersistenceStrategy;
+import org.apache.roller.pojos.AutoPingData;
+import org.apache.roller.pojos.PingTargetData;
+import org.apache.roller.pojos.WeblogEntryData;
+import org.apache.roller.pojos.WebsiteData;
+
+/**
+ * @author Dave Johnson
+ */
+public class JDOAutoPingManagerImpl extends AutoPingManagerImpl {
+
+ public JDOAutoPingManagerImpl(PersistenceStrategy persistenceStrategy) {
+ super(persistenceStrategy);
+ // TODO Auto-generated constructor stub
+ }
+
+ public void removeAutoPing(PingTargetData pingTarget, WebsiteData website)
+ throws RollerException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void removeAllAutoPings() throws RollerException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public List getAutoPingsByWebsite(WebsiteData website)
+ throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List getAutoPingsByTarget(PingTargetData pingTarget)
+ throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List getCategoryRestrictions(AutoPingData autoPing)
+ throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setCategoryRestrictions(AutoPingData autoPing,
+ Collection newCategories) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public List getApplicableAutoPings(WeblogEntryData changedWeblogEntry)
+ throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
\ No newline at end of file
Added: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOBookmarkManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOBookmarkManagerImpl.java?rev=398716&view=auto
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOBookmarkManagerImpl.java (added)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOBookmarkManagerImpl.java Mon May 1 15:30:26 2006
@@ -0,0 +1,93 @@
+/*
+* 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.jdo;
+
+import java.util.List;
+
+import org.apache.roller.RollerException;
+import org.apache.roller.business.BookmarkManagerImpl;
+import org.apache.roller.business.PersistenceStrategy;
+import org.apache.roller.pojos.Assoc;
+import org.apache.roller.pojos.FolderData;
+import org.apache.roller.pojos.WebsiteData;
+
+/**
+ * @author Dave Johnson
+ */
+public class JDOBookmarkManagerImpl extends BookmarkManagerImpl {
+
+ public JDOBookmarkManagerImpl(PersistenceStrategy pstrategy) {
+ super(pstrategy);
+ // TODO Auto-generated constructor stub
+ }
+
+ public boolean isFolderInUse(FolderData folder) throws RollerException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public List getAllFolders(WebsiteData wd) throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public FolderData getRootFolder(WebsiteData website) throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List retrieveBookmarks(FolderData data, boolean subfolders)
+ throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isDuplicateFolderName(FolderData data)
+ throws RollerException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public Assoc getFolderParentAssoc(FolderData data) throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List getFolderChildAssocs(FolderData data) throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List getAllFolderDecscendentAssocs(FolderData data)
+ throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List getFolderAncestorAssocs(FolderData data) throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isDescendentOf(FolderData data, FolderData ancestor)
+ throws RollerException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+}
\ No newline at end of file
Added: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOConfigManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOConfigManagerImpl.java?rev=398716&view=auto
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOConfigManagerImpl.java (added)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOConfigManagerImpl.java Mon May 1 15:30:26 2006
@@ -0,0 +1,40 @@
+/*
+* 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.
+*/
+/*
+ * Created on Dec 13, 2005
+ */
+package org.apache.roller.business.jdo;
+
+import org.apache.roller.RollerException;
+import org.apache.roller.business.ConfigManagerImpl;
+import org.apache.roller.business.PersistenceStrategy;
+import org.apache.roller.pojos.RollerConfigData;
+
+/**
+ * @author Dave Johnson
+ */
+public class JDOConfigManagerImpl extends ConfigManagerImpl {
+ public JDOConfigManagerImpl(PersistenceStrategy strategy) {
+ super(strategy);
+ }
+
+ public RollerConfigData getRollerConfig() throws RollerException {
+ return null;
+ }
+
+}
\ No newline at end of file
Added: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPersistenceSession.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPersistenceSession.java?rev=398716&view=auto
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPersistenceSession.java (added)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPersistenceSession.java Mon May 1 15:30:26 2006
@@ -0,0 +1,51 @@
+/*
+* 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.jdo;
+
+import org.apache.roller.model.PersistenceSession;
+import org.apache.roller.pojos.UserData;
+
+/**
+ * @author David M Johnson
+ */
+public class JDOPersistenceSession implements PersistenceSession {
+ private Object session = null;
+ private UserData user = null;
+
+ public JDOPersistenceSession(UserData user, Object session) {
+ this.user = user;
+ this.session = session;
+ }
+
+ public Object getSessionObject() {
+ return session;
+ }
+
+ public void setSessionObject(Object newSession) {
+ this.session = session;
+ }
+
+ public UserData getUser() {
+ return user;
+ }
+
+ public void setUser(UserData user) {
+ this.user = user;
+ }
+}
+
Added: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPingQueueManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPingQueueManagerImpl.java?rev=398716&view=auto
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPingQueueManagerImpl.java (added)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPingQueueManagerImpl.java Mon May 1 15:30:26 2006
@@ -0,0 +1,55 @@
+/*
+* 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.jdo;
+
+import java.util.List;
+
+import org.apache.roller.RollerException;
+import org.apache.roller.business.PersistenceStrategy;
+import org.apache.roller.business.PingQueueManagerImpl;
+import org.apache.roller.pojos.AutoPingData;
+import org.apache.roller.pojos.PingTargetData;
+import org.apache.roller.pojos.WebsiteData;
+
+/**
+ * @author Dave Johnson
+ */
+public class JDOPingQueueManagerImpl extends PingQueueManagerImpl {
+ public JDOPingQueueManagerImpl(PersistenceStrategy persistenceStrategy) {
+ super(persistenceStrategy);
+ }
+
+ public void addQueueEntry(AutoPingData autoPing) throws RollerException {
+ }
+
+ public void dropQueue() throws RollerException {
+ }
+
+ public List getAllQueueEntries() throws RollerException {
+ return null;
+ }
+
+ public void removeQueueEntriesByPingTarget(PingTargetData pingTarget)
+ throws RollerException {
+ }
+
+ public void removeQueueEntriesByWebsite(WebsiteData website)
+ throws RollerException {
+ }
+
+}
\ No newline at end of file
Added: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPingTargetManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPingTargetManagerImpl.java?rev=398716&view=auto
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPingTargetManagerImpl.java (added)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPingTargetManagerImpl.java Mon May 1 15:30:26 2006
@@ -0,0 +1,47 @@
+/*
+* 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.jdo;
+
+import java.util.List;
+
+import org.apache.roller.RollerException;
+import org.apache.roller.business.PersistenceStrategy;
+import org.apache.roller.business.PingTargetManagerImpl;
+import org.apache.roller.pojos.WebsiteData;
+
+public class JDOPingTargetManagerImpl extends PingTargetManagerImpl {
+ public JDOPingTargetManagerImpl(PersistenceStrategy persistenceStrategy) {
+ super(persistenceStrategy);
+ }
+
+ public List getCommonPingTargets() throws RollerException {
+ return null;
+ }
+
+ public List getCustomPingTargets(WebsiteData website)
+ throws RollerException {
+ return null;
+ }
+
+ public void removeCustomPingTargets(WebsiteData website)
+ throws RollerException {
+ }
+
+ public void removeAllCustomPingTargets() throws RollerException {
+ }
+}
\ No newline at end of file
Added: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPlanetManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPlanetManagerImpl.java?rev=398716&view=auto
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPlanetManagerImpl.java (added)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPlanetManagerImpl.java Mon May 1 15:30:26 2006
@@ -0,0 +1,271 @@
+/*
+* 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.jdo;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.velocity.VelocityContext;
+import org.apache.roller.RollerException;
+import org.apache.roller.business.PersistenceStrategy;
+import org.apache.roller.business.PlanetManagerImpl;
+import org.apache.roller.config.RollerRuntimeConfig;
+import org.apache.roller.model.PagePluginManager;
+import org.apache.roller.model.Roller;
+import org.apache.roller.model.UserManager;
+import org.apache.roller.model.WeblogManager;
+import org.apache.roller.pojos.PlanetConfigData;
+import org.apache.roller.pojos.PlanetEntryData;
+import org.apache.roller.pojos.PlanetGroupData;
+import org.apache.roller.pojos.PlanetGroupSubscriptionAssoc;
+import org.apache.roller.pojos.PlanetSubscriptionData;
+import org.apache.roller.pojos.WeblogEntryData;
+import org.apache.roller.pojos.WebsiteData;
+
+import com.sun.syndication.fetcher.FeedFetcher;
+import com.sun.syndication.fetcher.impl.FeedFetcherCache;
+
+/**
+ * Manages Planet Roller objects and entry aggregations in a database.
+ *
+ * @author Dave Johnson
+ */
+public class JDOPlanetManagerImpl extends PlanetManagerImpl {
+ protected Map lastUpdatedByGroup = new HashMap();
+ protected static final String NO_GROUP = "zzz_nogroup_zzz";
+
+ private static Log logger = LogFactory
+ .getFactory()
+ .getInstance(
+ JDOPlanetManagerImpl.class);
+
+ public JDOPlanetManagerImpl(PersistenceStrategy strategy, Roller roller) {
+ super(strategy, roller);
+ }
+
+ public void saveConfiguration(PlanetConfigData config)
+ throws RollerException {
+ config.save();
+ }
+
+ public void saveGroup(PlanetGroupData group) throws RollerException {
+ Iterator assocs = group.getGroupSubscriptionAssocs().iterator();
+ while (assocs.hasNext()) {
+ PlanetGroupSubscriptionAssoc assoc = (PlanetGroupSubscriptionAssoc) assocs
+ .next();
+ assoc.save();
+ }
+ group.save();
+ }
+
+ public void saveEntry(PlanetEntryData entry) throws RollerException {
+ entry.save();
+ }
+
+ public void saveSubscription(PlanetSubscriptionData sub)
+ throws RollerException {
+ PlanetSubscriptionData existing = getSubscription(sub.getFeedUrl());
+ if (existing == null || (existing.getId().equals(sub.getId()))) {
+ sub.save();
+ }
+ else {
+ throw new RollerException("ERROR: duplicate feed URLs not allowed");
+ }
+ }
+
+ public PlanetConfigData getConfiguration() throws RollerException {
+ return null;
+ }
+
+ public List getGroups() throws RollerException {
+ return null;
+ }
+
+ public List getGroupHandles() throws RollerException {
+ List handles = new ArrayList();
+ Iterator list = getGroups().iterator();
+ while (list.hasNext()) {
+ PlanetGroupData group = (PlanetGroupData) list.next();
+ handles.add(group.getHandle());
+ }
+ return handles;
+ }
+
+ public PlanetSubscriptionData getSubscription(String feedUrl)
+ throws RollerException {
+ return null;
+ }
+
+ public PlanetSubscriptionData getSubscriptionById(String id)
+ throws RollerException {
+ return (PlanetSubscriptionData) strategy.load(id,
+ PlanetSubscriptionData.class);
+ }
+
+ public PlanetGroupData getGroup(String handle) throws RollerException {
+ return null;
+ }
+
+ public PlanetGroupData getGroupById(String id) throws RollerException {
+ return (PlanetGroupData) strategy.load(id, PlanetGroupData.class);
+ }
+
+ public synchronized List getAggregation(int maxEntries)
+ throws RollerException {
+ return getAggregation(null, maxEntries);
+ }
+
+ public synchronized List getAggregation(PlanetGroupData group,
+ int maxEntries) throws RollerException {
+ return null;
+ }
+
+ public void deleteEntry(PlanetEntryData entry) throws RollerException {
+ entry.remove();
+ }
+
+ public void deleteGroup(PlanetGroupData group) throws RollerException {
+ group.remove();
+ }
+
+ public void deleteSubscription(PlanetSubscriptionData sub)
+ throws RollerException {
+ sub.remove();
+ }
+
+ public Iterator getAllSubscriptions() {
+ return null;
+ }
+
+ public int getSubscriptionCount() throws RollerException {
+ return -1;
+ }
+
+ public synchronized List getTopSubscriptions(int max)
+ throws RollerException {
+ return null;
+ }
+
+ public synchronized List getTopSubscriptions(PlanetGroupData group, int max)
+ throws RollerException {
+ return null;
+ }
+
+ public synchronized void clearCachedAggregations() {
+ lastUpdatedByGroup.clear();
+ }
+
+ public Date getLastUpdated() {
+ return (Date) lastUpdatedByGroup.get(NO_GROUP);
+ }
+
+ public Date getLastUpdated(PlanetGroupData group) {
+ return (Date) lastUpdatedByGroup.get(group);
+ }
+
+ protected Set getNewEntriesLocal(PlanetSubscriptionData sub,
+ FeedFetcher feedFetcher, FeedFetcherCache feedInfoCache)
+ throws RollerException {
+
+ Set newEntries = new TreeSet();
+ try {
+ // for local feeds, sub.author = website.handle
+ if (sub.getAuthor() != null
+ && sub.getFeedUrl().endsWith(sub.getAuthor())) {
+
+ logger.debug("Getting LOCAL feed " + sub.getFeedUrl());
+
+ // get corresponding website object
+ UserManager usermgr = roller.getUserManager();
+ WebsiteData website = usermgr.getWebsiteByHandle(sub
+ .getAuthor());
+ if (website == null)
+ return newEntries;
+
+ // figure website last update time
+ WeblogManager blogmgr = roller.getWeblogManager();
+
+ Date siteUpdated = blogmgr.getWeblogLastPublishTime(website);
+ if (siteUpdated == null) { // Site never updated, skip it
+ logger.warn("Last-publish time null, skipping local feed ["
+ + website.getHandle() + "]");
+ return newEntries;
+ }
+
+ // if website last update time > subsciption last update time
+ List entries = new ArrayList();
+ if (sub.getLastUpdated() == null
+ || siteUpdated.after(sub.getLastUpdated())) {
+ int entryCount = RollerRuntimeConfig
+ .getIntProperty("site.newsfeeds.defaultEntries");
+ entries = blogmgr.getWeblogEntries(website, null, // startDate
+ new Date(), // endDate
+ null, // catName
+ WeblogEntryData.PUBLISHED, // status
+ new Integer(entryCount)); // maxEntries
+
+ sub.setLastUpdated(siteUpdated);
+ saveSubscription(sub);
+
+ }
+ else {
+ if (logger.isDebugEnabled()) {
+ String msg = MessageFormat.format(
+ " Skipping ({0} / {1})", new Object[] {
+ siteUpdated, sub.getLastUpdated() });
+ logger.debug(msg);
+ }
+ }
+ // Populate subscription object with new entries
+ PagePluginManager ppmgr = roller.getPagePluginManager();
+ Map pagePlugins = ppmgr.createAndInitPagePlugins(website, null,
+ RollerRuntimeConfig.getProperty("site.absoluteurl"),
+ new VelocityContext());
+ Iterator entryIter = entries.iterator();
+ while (entryIter.hasNext()) {
+ try {
+ WeblogEntryData rollerEntry = (WeblogEntryData) entryIter
+ .next();
+ PlanetEntryData entry = new PlanetEntryData(
+ rollerEntry, sub, pagePlugins);
+ saveEntry(entry);
+ newEntries.add(entry);
+ }
+ catch (Exception e) {
+ logger.error("ERROR processing subscription entry", e);
+ }
+ }
+ return newEntries;
+ }
+ }
+ catch (Exception e) {
+ logger.warn("Problem reading local feed", e);
+ }
+ return getNewEntriesRemote(sub, feedFetcher, feedInfoCache);
+ }
+}
+
Added: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPropertiesManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPropertiesManagerImpl.java?rev=398716&view=auto
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPropertiesManagerImpl.java (added)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPropertiesManagerImpl.java Mon May 1 15:30:26 2006
@@ -0,0 +1,44 @@
+/*
+* 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.jdo;
+
+import java.util.Map;
+
+import org.apache.roller.RollerException;
+import org.apache.roller.business.PersistenceStrategy;
+import org.apache.roller.business.PropertiesManagerImpl;
+import org.apache.roller.pojos.RollerPropertyData;
+
+/**
+ * @author Dave Johnson
+ */
+public class JDOPropertiesManagerImpl extends PropertiesManagerImpl {
+
+ public JDOPropertiesManagerImpl(PersistenceStrategy strategy) {
+ super(strategy);
+ }
+
+ public RollerPropertyData getProperty(String name) throws RollerException {
+ return null;
+ }
+
+ public Map getProperties() throws RollerException {
+ return null;
+ }
+
+}
\ No newline at end of file
Added: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDORefererManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDORefererManagerImpl.java?rev=398716&view=auto
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDORefererManagerImpl.java (added)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDORefererManagerImpl.java Mon May 1 15:30:26 2006
@@ -0,0 +1,113 @@
+/*
+* 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.jdo;
+
+import java.util.List;
+
+import org.apache.roller.RollerException;
+import org.apache.roller.business.RefererManagerImpl;
+import org.apache.roller.pojos.WebsiteData;
+
+/**
+ * @author Dave Johnson
+ */
+public class JDORefererManagerImpl extends RefererManagerImpl {
+
+ protected List getReferersWithSameTitle(WebsiteData website,
+ String requestUrl, String title, String excerpt)
+ throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ protected List getExistingReferers(WebsiteData website, String dateString,
+ String permalink) throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ protected List getReferersToWebsite(WebsiteData website, String refererUrl)
+ throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ protected List getMatchingReferers(WebsiteData website, String requestUrl,
+ String refererUrl) throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ protected int getHits(WebsiteData website, String type)
+ throws RollerException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public List getReferers(WebsiteData website) throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List getTodaysReferers(WebsiteData website) throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List getReferersToDate(WebsiteData website, String date)
+ throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List getDaysPopularWebsites(int max) throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List getReferersToEntry(String entryid) throws RollerException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void removeReferersForEntry(String entryid) throws RollerException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void applyRefererFilters() throws RollerException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void applyRefererFilters(WebsiteData website) throws RollerException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void clearReferrers() throws RollerException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void clearReferrers(WebsiteData website) throws RollerException {
+ // TODO Auto-generated method stub
+
+ }
+
+}
\ No newline at end of file
Added: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDORollerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDORollerImpl.java?rev=398716&view=auto
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDORollerImpl.java (added)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDORollerImpl.java Mon May 1 15:30:26 2006
@@ -0,0 +1,140 @@
+/*
+* 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.
+*/
+/*
+ * Created on Dec 13, 2005
+ */
+package org.apache.roller.business.jdo;
+
+import java.sql.Connection;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.PersistenceManagerFactory;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.RollerException;
+import org.apache.roller.business.PersistenceStrategy;
+import org.apache.roller.business.utils.UpgradeDatabase;
+import org.apache.roller.model.AutoPingManager;
+import org.apache.roller.model.BookmarkManager;
+import org.apache.roller.model.PingQueueManager;
+import org.apache.roller.model.PingTargetManager;
+import org.apache.roller.model.PlanetManager;
+import org.apache.roller.model.PropertiesManager;
+import org.apache.roller.model.RefererManager;
+import org.apache.roller.model.Roller;
+import org.apache.roller.model.UserManager;
+import org.apache.roller.model.WeblogManager;
+import org.apache.roller.pojos.UserData;
+
+/**
+ * Implements Roller, the entry point interface for the Roller business tier
+ * APIs. JDO specific implementation.
+ *
+ * @author Dave Johnson
+ */
+public class JDORollerImpl extends org.apache.roller.business.RollerImpl {
+ private static Log mLogger = LogFactory.getFactory()
+ .getInstance(JDORollerImpl.class);
+
+ protected static JDORollerImpl me;
+ protected PersistenceStrategy mStrategy = null;
+
+ protected JDORollerImpl() throws RollerException {
+ PersistenceManagerFactory pmf =
+ JDOHelper.getPersistenceManagerFactory("JDOPMF.properties");
+ mStrategy = new JDOStrategy(pmf);
+ }
+
+ public static Roller instantiate() throws RollerException {
+ if (me == null) {
+ me = new JDORollerImpl();
+ }
+
+ return me;
+ }
+
+
+ /** */
+ protected UserManager createUserManager() {
+ return new JDOUserManagerImpl(mStrategy);
+ }
+
+ /** */
+ protected BookmarkManager createBookmarkManager() {
+ return new JDOBookmarkManagerImpl(mStrategy);
+ }
+
+ /** */
+ protected WeblogManager createWeblogManager() {
+ return new JDOWeblogManagerImpl(mStrategy);
+ }
+
+ /** */
+ protected RefererManager createRefererManager() {
+ return new JDORefererManagerImpl();
+ }
+
+ /** */
+ protected PropertiesManager createPropertiesManager() {
+ return new JDOPropertiesManagerImpl(mStrategy);
+ }
+
+ /** */
+ protected PingQueueManager createPingQueueManager() {
+ return new JDOPingQueueManagerImpl(mStrategy);
+ }
+
+ /** */
+ protected PlanetManager createPlanetManager() {
+ return new JDOPlanetManagerImpl(mStrategy, this);
+ }
+
+ /** */
+ protected AutoPingManager createAutoPingManager() {
+ return new JDOAutoPingManagerImpl(mStrategy);
+ }
+
+ /** */
+ protected PingTargetManager createPingTargetManager() {
+ return new JDOPingTargetManagerImpl(mStrategy);
+ }
+
+ /**
+ * @see org.apache.roller.model.Roller#getPersistenceStrategy()
+ */
+ public PersistenceStrategy getPersistenceStrategy() {
+ return mStrategy;
+ }
+
+ public void release() {
+ super.release();
+ // nothing else to do for now
+ }
+
+ public void shutdown() {
+ super.shutdown();
+
+ try {
+ release();
+ }
+ catch (Exception e) {
+ mLogger.error("Unable to close PersistenceManagerFactory", e);
+ }
+ }
+}
\ No newline at end of file
Added: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOStrategy.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOStrategy.java?rev=398716&view=auto
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOStrategy.java (added)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOStrategy.java Mon May 1 15:30:26 2006
@@ -0,0 +1,224 @@
+/*
+* 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.
+*/
+/*
+ * Created on Dec 13, 2005
+ */
+package org.apache.roller.business.jdo;
+
+import java.util.List;
+
+import javax.jdo.PersistenceManager;
+import javax.jdo.PersistenceManagerFactory;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.RollerException;
+import org.apache.roller.business.PersistenceStrategy;
+import org.apache.roller.model.PersistenceSession;
+import org.apache.roller.pojos.PersistentObject;
+import org.apache.roller.pojos.UserData;
+
+///////////////////////////////////////////////////////////////////////////////
+/**
+ * @author Dave Johnson
+ */
+public class JDOStrategy implements PersistenceStrategy {
+ private static final ThreadLocal mSessionTLS = new ThreadLocal();
+ private PersistenceManagerFactory mPMF = null;
+ private static Log mLogger = LogFactory
+ .getFactory().getInstance(JDOStrategy.class);
+
+ //-------------------------------------------------------------------------
+ /**
+ * Construct using JDO PersistenceManagerFactory.
+ */
+ public JDOStrategy(PersistenceManagerFactory pmf) throws RollerException {
+ this.mPMF = pmf;
+ }
+
+ //-------------------------------------------------------------------------
+ /**
+ * Start new Roller persistence session on current thread.
+ */
+ public void begin(UserData user) throws RollerException {
+ getPersistenceSession(user, true); // force create of new session
+ }
+
+ //-------------------------------------------------------------------------
+ /**
+ * Start new Roller persistence session on current thread.
+ */
+ public void setUser(UserData user) throws RollerException {
+ PersistenceSession pses = getPersistenceSession(user, false);
+ pses.setUser(user);
+ }
+
+ //-------------------------------------------------------------------------
+ /**
+ * Start new Roller persistence session on current thread.
+ */
+ public UserData getUser() throws RollerException {
+ PersistenceSession pses = getPersistenceSession(null, false);
+ return pses.getUser();
+ }
+
+ //-------------------------------------------------------------------------
+ /**
+ * Get existing persistence session on current thread.
+ */
+ public Object getSession() throws RollerException {
+ return (getPersistenceSession(UserData.ANONYMOUS_USER, false)
+ .getSessionObject());
+ }
+
+ //-------------------------------------------------------------------------
+ /**
+ * Get existing or open new persistence session for current thread
+ *
+ * @param createNew
+ * True if existing session on thread is an warn condition.
+ */
+ public PersistenceSession getPersistenceSession(UserData user,
+ boolean createNew) throws RollerException {
+ PersistenceSession ses = (PersistenceSession)mSessionTLS.get();
+ if (createNew && ses != null)
+ {
+ mLogger.warn("TLS not empty at beginnng of request");
+ release();
+ ses = null;
+ }
+ if (ses == null && user != null)
+ {
+ try
+ {
+ PersistenceManager pm = mPMF.getPersistenceManager();
+ ses = new JDOPersistenceSession(user, pm);
+ }
+ catch (Throwable e)
+ {
+ mLogger.error(
+ "JDOStrategy.exceptionGetPersistenceManager");
+ throw new RuntimeException();
+ }
+ mSessionTLS.set(ses);
+ }
+ else if (ses == null)
+ {
+ throw new RollerException(
+ "MUST specify user for new persistence session");
+ }
+ return ses;
+ }
+
+ //-------------------------------------------------------------------------
+ /**
+ * This is called on error to start a new Hibernate session. Gavin: "make
+ * sure you never catch + handle an exception and then keep using the
+ * session (ObjectNotFoundException included!)
+ */
+ private void newSession() throws RollerException {
+ PersistenceSession pses = getPersistenceSession(null, false);
+ UserData user = pses.getUser();
+ release();
+ getPersistenceSession(user, true);
+ }
+
+ //-------------------------------------------------------------------------
+ /**
+ * Release database session, rolls back any uncommitted changes.
+ */
+ public void release() throws RollerException {
+ }
+
+ //-------------------------------------------------------------------------
+ /**
+ * Remove object from persistence storage.
+ *
+ * @param clazz
+ * Class of object to remove.
+ * @param id
+ * Id of object to remove.
+ * @throws RollerException
+ * Error deleting object.
+ */
+ public void remove(String id, Class clazz) throws RollerException {
+ }
+
+ //-------------------------------------------------------------------------
+ /**
+ * Remove object from persistence storage.
+ */
+ public void remove(PersistentObject po) throws RollerException {
+ }
+
+ //-------------------------------------------------------------------------
+ /**
+ * Retrieve object, begins and ends its own transaction.
+ *
+ * @param clazz
+ * Class of object to retrieve.
+ * @param id
+ * Id of object to retrieve.
+ * @return Object Object retrieved.
+ * @throws RollerException
+ * Error retrieving object.
+ */
+ public PersistentObject load(String id, Class clazz) throws RollerException {
+ return null;
+ }
+
+ //-------------------------------------------------------------------------
+ /**
+ * Store object using an existing transaction.
+ */
+ public PersistentObject store(PersistentObject obj) throws RollerException {
+ return null;
+ }
+
+ //-------------------------------------------------------------------------
+ /**
+ * Execute query
+ */
+ public List query(String query, Object[] args, Object[] types)
+ throws RollerException {
+ return query(query, args, types);
+ }
+
+ //-------------------------------------------------------------------------
+ /**
+ * Execute Hibernate HSQL query
+ */
+ public List query(String query) throws RollerException {
+ return null;
+ }
+
+ //-------------------------------------------------------------------------
+ /**
+ * Commits current transaction, if there is one, does not release session.
+ */
+ public void commit() throws RollerException {
+ }
+
+ //-------------------------------------------------------------------------
+ /**
+ * Rollback uncommitted changes, does not release session.
+ */
+ public void rollback() throws RollerException {
+ }
+}
+
Added: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOUserManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOUserManagerImpl.java?rev=398716&view=auto
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOUserManagerImpl.java (added)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOUserManagerImpl.java Mon May 1 15:30:26 2006
@@ -0,0 +1,173 @@
+/*
+* 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.
+*/
+/*
+ * Created on Dec 13, 2005
+ */
+package org.apache.roller.business.jdo;
+
+import java.io.IOException;
+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.apache.roller.RollerException;
+import org.apache.roller.business.PersistenceStrategy;
+import org.apache.roller.business.UserManagerImpl;
+import org.apache.roller.model.AutoPingManager;
+import org.apache.roller.model.BookmarkManager;
+import org.apache.roller.model.PingQueueManager;
+import org.apache.roller.model.PingTargetManager;
+import org.apache.roller.model.RollerFactory;
+import org.apache.roller.model.WeblogManager;
+import org.apache.roller.pojos.FolderData;
+import org.apache.roller.pojos.WeblogTemplate;
+import org.apache.roller.pojos.PermissionsData;
+import org.apache.roller.pojos.RefererData;
+import org.apache.roller.pojos.RoleData;
+import org.apache.roller.pojos.UserData;
+import org.apache.roller.pojos.WeblogCategoryData;
+import org.apache.roller.pojos.WeblogEntryData;
+import org.apache.roller.pojos.WebsiteData;
+
+/**
+ * @author Dave Johnson
+ */
+public class JDOUserManagerImpl extends UserManagerImpl {
+ public JDOUserManagerImpl(PersistenceStrategy strategy) {
+ super(strategy);
+ }
+
+ /**
+ * Get websites of a user
+ */
+ public List getWebsites(UserData user, Boolean enabled)
+ throws RollerException {
+ return null;
+ }
+
+ /**
+ * Get users of a website
+ */
+ public List getUsers(WebsiteData website, Boolean enabled)
+ throws RollerException {
+ return null;
+ }
+
+ /**
+ * Use Hibernate directly because Roller's Query API does too much
+ * allocation.
+ */
+ public WeblogTemplate getPageByLink(WebsiteData website, String pagelink)
+ throws RollerException {
+ return null;
+ }
+
+ /**
+ * Return website specified by handle.
+ */
+ public WebsiteData getWebsiteByHandle(String handle, Boolean enabled)
+ throws RollerException {
+ return null;
+ }
+
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ public UserData getUser(String userName, Boolean enabled)
+ throws RollerException {
+ return null;
+ }
+
+ //------------------------------------------------------------------------
+ /**
+ * @see org.apache.roller.model.UserManager#getPages(WebsiteData)
+ */
+ public List getPages(WebsiteData website) throws RollerException {
+ return null;
+ }
+
+ /**
+ * @see org.apache.roller.model.UserManager#getPageByName(WebsiteData,
+ * java.lang.String)
+ */
+ public WeblogTemplate getPageByName(WebsiteData website, String pagename)
+ throws RollerException {
+ return null;
+ }
+
+ /*
+ * @see org.apache.roller.business.UserManagerBase#getRoles(org.apache.roller.pojos.UserData)
+ */
+ public List getUserRoles(UserData user) throws RollerException {
+ return null;
+ }
+
+ public List getUsers(Boolean enabled) throws RollerException {
+ return null;
+ }
+
+ /**
+ * @see org.apache.roller.model.UserManager#removeWebsiteContents(org.apache.roller.pojos.WebsiteData)
+ */
+ public void removeWebsiteContents(WebsiteData website)
+ throws RollerException {
+ }
+
+ /**
+ * Return permissions for specified user in website
+ */
+ public PermissionsData getPermissions(WebsiteData website, UserData user)
+ throws RollerException {
+ return null;
+ }
+
+ /**
+ * Get pending permissions for user
+ */
+ public List getPendingPermissions(UserData user) throws RollerException {
+ return null;
+ }
+
+ /**
+ * Get pending permissions for website
+ */
+ public List getPendingPermissions(WebsiteData website)
+ throws RollerException {
+ return null;
+ }
+
+ /**
+ * Get all permissions of a website (pendings not including)
+ */
+ public List getAllPermissions(WebsiteData website) throws RollerException {
+ return null;
+ }
+
+ /**
+ * Get all permissions of a user.
+ */
+ public List getAllPermissions(UserData user) throws RollerException {
+ return null;
+ }
+
+ public List getUsersStartingWith(String startsWith, int offset, int length,
+ Boolean enabled) throws RollerException {
+ return null;
+ }
+}
+
Added: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOWeblogManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOWeblogManagerImpl.java?rev=398716&view=auto
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOWeblogManagerImpl.java (added)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOWeblogManagerImpl.java Mon May 1 15:30:26 2006
@@ -0,0 +1,154 @@
+/*
+* 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.jdo;
+
+import java.util.Date;
+import java.util.List;
+
+import org.apache.roller.RollerException;
+import org.apache.roller.business.PersistenceStrategy;
+import org.apache.roller.business.WeblogManagerImpl;
+import org.apache.roller.pojos.Assoc;
+import org.apache.roller.pojos.WeblogCategoryData;
+import org.apache.roller.pojos.WeblogEntryData;
+import org.apache.roller.pojos.WebsiteData;
+
+/**
+ * @author Dave Johnson
+ */
+public class JDOWeblogManagerImpl extends WeblogManagerImpl {
+
+ public JDOWeblogManagerImpl(PersistenceStrategy strategy) {
+ super(strategy);
+ // TODO Auto-generated constructor stub
+ }
+
+ public List getWeblogEntries(WebsiteData website, Date startDate,
+ Date endDate, String catName, String status, Integer maxEntries,
+ Boolean pinned) throws RollerException {
+
+ return null;
+ }
+
+ public List getNextPrevEntries(WeblogEntryData current, String catName,
+ int maxEntries, boolean next) throws RollerException {
+
+ return null;
+ }
+
+ public void moveWeblogCategoryContents(String srcId, String destId)
+ throws RollerException {
+
+ }
+
+ public List getWeblogCategories(WebsiteData website) throws RollerException {
+
+ return null;
+ }
+
+ public List getWeblogCategories(WebsiteData website, boolean includeRoot)
+ throws RollerException {
+
+ return null;
+ }
+
+ public WeblogCategoryData getRootWeblogCategory(WebsiteData website)
+ throws RollerException {
+
+ return null;
+ }
+
+ public List getComments(WebsiteData website, WeblogEntryData entry,
+ String searchString, Date startDate, Date endDate, Boolean pending,
+ Boolean approved, Boolean spam, boolean reverseChrono, int offset,
+ int length) throws RollerException {
+
+ return null;
+ }
+
+ public List retrieveWeblogEntries(WeblogCategoryData cat, boolean subcats)
+ throws RollerException {
+
+ return null;
+ }
+
+ public WeblogEntryData getWeblogEntryByAnchor(WebsiteData website,
+ String anchor) throws RollerException {
+
+ return null;
+ }
+
+ public Date getWeblogLastPublishTime(WebsiteData website, String catName)
+ throws RollerException {
+
+ return null;
+ }
+
+ public void removeWeblogEntryContents(WeblogEntryData data)
+ throws RollerException {
+
+ }
+
+ public String createAnchor(WeblogEntryData data) throws RollerException {
+
+ return null;
+ }
+
+ public boolean isDuplicateWeblogCategoryName(WeblogCategoryData data)
+ throws RollerException {
+
+ return false;
+ }
+
+ public boolean isWeblogCategoryInUse(WeblogCategoryData data)
+ throws RollerException {
+
+ return false;
+ }
+
+ public boolean isDescendentOf(WeblogCategoryData child,
+ WeblogCategoryData ancestor) throws RollerException {
+
+ return false;
+ }
+
+ public Assoc getWeblogCategoryParentAssoc(WeblogCategoryData data)
+ throws RollerException {
+
+ return null;
+ }
+
+ public List getWeblogCategoryChildAssocs(WeblogCategoryData data)
+ throws RollerException {
+
+ return null;
+ }
+
+ public List getAllWeblogCategoryDecscendentAssocs(WeblogCategoryData data)
+ throws RollerException {
+
+ return null;
+ }
+
+ public List getWeblogCategoryAncestorAssocs(WeblogCategoryData data)
+ throws RollerException {
+
+ return null;
+ }
+
+}
\ No newline at end of file
Added: incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/jspwiki/AttachmentProvider.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/jspwiki/AttachmentProvider.java?rev=398716&view=auto
==============================================================================
--- incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/jspwiki/AttachmentProvider.java (added)
+++ incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/jspwiki/AttachmentProvider.java Mon May 1 15:30:26 2006
@@ -0,0 +1,42 @@
+/*
+* 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.jspwiki;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import com.ecyrd.jspwiki.NoRequiredPropertyException;
+import com.ecyrd.jspwiki.WikiEngine;
+import com.ecyrd.jspwiki.providers.BasicAttachmentProvider;
+
+public class AttachmentProvider extends BasicAttachmentProvider {
+
+ public void initialize(WikiEngine engine, Properties properties)
+ throws NoRequiredPropertyException, IOException {
+
+ String rollerStorageDir = System.getProperty("rollerStorageDir");
+ if (rollerStorageDir != null) {
+ System.out.println(getClass().getName()
+ + " Using storageDir=" + rollerStorageDir);
+ properties.put(PROP_STORAGEDIR, rollerStorageDir);
+ }
+
+ super.initialize(engine, properties);
+ }
+}
Added: incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/jspwiki/PageProvider.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/jspwiki/PageProvider.java?rev=398716&view=auto
==============================================================================
--- incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/jspwiki/PageProvider.java (added)
+++ incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/jspwiki/PageProvider.java Mon May 1 15:30:26 2006
@@ -0,0 +1,42 @@
+/*
+* 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.jspwiki;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import com.ecyrd.jspwiki.NoRequiredPropertyException;
+import com.ecyrd.jspwiki.WikiEngine;
+import com.ecyrd.jspwiki.providers.VersioningFileProvider;
+
+public class PageProvider extends VersioningFileProvider {
+
+ public void initialize(WikiEngine engine, Properties properties)
+ throws NoRequiredPropertyException, IOException {
+
+ String rollerPageDir = System.getProperty("rollerPageDir");
+ if (rollerPageDir != null) {
+ System.out.println(getClass().getName()
+ + " Using pageDir=" + rollerPageDir);
+ properties.put(PROP_PAGEDIR, rollerPageDir);
+ }
+
+ super.initialize(engine, properties);
+ }
+}
Added: incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/tomcat/TomcatHSQLDBPlugin.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/tomcat/TomcatHSQLDBPlugin.java?rev=398716&view=auto
==============================================================================
--- incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/tomcat/TomcatHSQLDBPlugin.java (added)
+++ incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/tomcat/TomcatHSQLDBPlugin.java Mon May 1 15:30:26 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.tomcat;
+
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.LifecycleEvent;
+import org.apache.catalina.LifecycleListener;
+import org.apache.roller.util.HSQLDBUtility;
+
+public class TomcatHSQLDBPlugin implements LifecycleListener {
+
+ public void lifecycleEvent(LifecycleEvent event) {
+
+ if (event.getType().equals(Lifecycle.START_EVENT)) {
+ HSQLDBUtility.start();
+ }
+ else if (event.getType().equals(Lifecycle.STOP_EVENT)) {
+ HSQLDBUtility.stop();
+
+ // This is drastic, but
+ // 1) we really want Tomcat to stop and
+ // 2) this is a DEMO bundle
+ System.exit(0);
+ }
+ else {
+ System.out.println(getClass().getName()
+ + ": Not handling LifecycleEvent: " + event.getType());
+ }
+ }
+}
Added: incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/util/HSQLDBUtility.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/util/HSQLDBUtility.java?rev=398716&view=auto
==============================================================================
--- incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/util/HSQLDBUtility.java (added)
+++ incubator/roller/trunk/sandbox/standalone/src/org/apache/roller/util/HSQLDBUtility.java Mon May 1 15:30:26 2006
@@ -0,0 +1,58 @@
+/*
+* 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.util;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import org.hsqldb.Server;
+
+/**
+ * Created for standalone Roller/Tomcat/HSQLDB demo
+ */
+public class HSQLDBUtility {
+
+ public static void start() {
+ final String database = System.getProperties().getProperty("hsqldb_database");
+ final String port = System.getProperties().getProperty("hsqldb_port");
+ if (database != null) {
+ Thread server = new Thread() {
+ public void run() {
+ System.out.println("Starting HSQLDB");
+ String[] args = {
+ "-database", database,
+ "-port", port,
+ "-no_system_exit", "true" };
+ Server.main(args);
+ }
+ };
+ server.start();
+ }
+ }
+
+ public static void stop() {
+ try {
+ System.out.println("Stopping HSQLDB");
+ final String port = System.getProperties().getProperty("hsqldb_port");
+ final Connection con = DriverManager.getConnection("jdbc:hsqldb://localhost:"+port);
+ con.createStatement().execute("SHUTDOWN");
+ } catch (SQLException e) {
+ System.out.println("ERROR shutting down HSQLDB");
+ }
+ }
+}
Modified: incubator/roller/trunk/testdata/WEB-INF/classes/hibernate.cfg.xml
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/testdata/WEB-INF/classes/hibernate.cfg.xml?rev=398716&r1=398715&r2=398716&view=diff
==============================================================================
--- incubator/roller/trunk/testdata/WEB-INF/classes/hibernate.cfg.xml (original)
+++ incubator/roller/trunk/testdata/WEB-INF/classes/hibernate.cfg.xml Mon May 1 15:30:26 2006
@@ -46,31 +46,31 @@
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
-->
- <mapping resource="org/roller/pojos/BookmarkData.hbm.xml" />
- <mapping resource="org/roller/pojos/CommentData.hbm.xml" />
- <mapping resource="org/roller/pojos/EntryAttributeData.hbm.xml" />
- <mapping resource="org/roller/pojos/FolderAssoc.hbm.xml" />
- <mapping resource="org/roller/pojos/FolderData.hbm.xml" />
- <mapping resource="org/roller/pojos/WeblogTemplate.hbm.xml" />
- <mapping resource="org/roller/pojos/PingCategoryRestrictionData.hbm.xml" />
- <mapping resource="org/roller/pojos/AutoPingData.hbm.xml" />
- <mapping resource="org/roller/pojos/PingQueueEntryData.hbm.xml" />
- <mapping resource="org/roller/pojos/PingTargetData.hbm.xml" />
- <mapping resource="org/roller/pojos/RefererData.hbm.xml" />
- <mapping resource="org/roller/pojos/RoleData.hbm.xml" />
- <mapping resource="org/roller/pojos/RollerConfigData.hbm.xml" />
- <mapping resource="org/roller/pojos/UserData.hbm.xml" />
- <mapping resource="org/roller/pojos/WeblogCategoryData.hbm.xml" />
- <mapping resource="org/roller/pojos/WeblogCategoryAssoc.hbm.xml" />
- <mapping resource="org/roller/pojos/WeblogEntryData.hbm.xml" />
- <mapping resource="org/roller/pojos/WebsiteData.hbm.xml" />
- <mapping resource="org/roller/pojos/RollerPropertyData.hbm.xml" />
- <mapping resource="org/roller/pojos/PermissionsData.hbm.xml" />
- <mapping resource="org/roller/pojos/PlanetConfigData.hbm.xml" />
- <mapping resource="org/roller/pojos/PlanetGroupData.hbm.xml" />
- <mapping resource="org/roller/pojos/PlanetEntryData.hbm.xml" />
- <mapping resource="org/roller/pojos/PlanetSubscriptionData.hbm.xml" />
- <mapping resource="org/roller/pojos/PlanetGroupSubscriptionAssoc.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/BookmarkData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/CommentData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/EntryAttributeData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/FolderAssoc.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/FolderData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/WeblogTemplate.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/PingCategoryRestrictionData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/AutoPingData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/PingQueueEntryData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/PingTargetData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/RefererData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/RoleData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/RollerConfigData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/UserData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/WeblogCategoryData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/WeblogCategoryAssoc.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/WeblogEntryData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/WebsiteData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/RollerPropertyData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/PermissionsData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/PlanetConfigData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/PlanetGroupData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/PlanetEntryData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/PlanetSubscriptionData.hbm.xml" />
+ <mapping resource="org/apache/roller/pojos/PlanetGroupSubscriptionAssoc.hbm.xml" />
</session-factory>
</hibernate-configuration>