You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by cl...@apache.org on 2006/09/06 00:19:19 UTC
svn commit: r440509 [1/2] - in
/incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business:
datamapper/ jdo/
Author: clr
Date: Tue Sep 5 15:19:18 2006
New Revision: 440509
URL: http://svn.apache.org/viewvc?view=rev&rev=440509
Log:
Datamapper working version
Added:
incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/
incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperAutoPingManagerImpl.java
incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperBookmarkManagerImpl.java
incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPersistenceStrategy.java
incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPingQueueManagerImpl.java
incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPingTargetManagerImpl.java
incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPlanetManagerImpl.java
incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPropertiesManagerImpl.java
incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperQuery.java
incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperReferrerManagerImpl.java
incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperRollerImpl.java
incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperUserManagerImpl.java
incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperWeblogManagerImpl.java
incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOPersistenceStrategy.java
Added: incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperAutoPingManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperAutoPingManagerImpl.java?view=auto&rev=440509
==============================================================================
--- incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperAutoPingManagerImpl.java (added)
+++ incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperAutoPingManagerImpl.java Tue Sep 5 15:19:18 2006
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.roller.business.datamapper;
+
+import java.util.Collection;
+import java.util.Collections;
+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.PingConfig;
+import org.apache.roller.model.AutoPingManager;
+import org.apache.roller.pojos.AutoPingData;
+import org.apache.roller.pojos.PingTargetData;
+import org.apache.roller.pojos.WeblogEntryData;
+import org.apache.roller.pojos.WebsiteData;
+
+/*
+ * DatamapperAutoPingManagerImpl.java
+ *
+ * Created on May 29, 2006, 11:29 AM
+ *
+ */
+public class DatamapperAutoPingManagerImpl implements AutoPingManager {
+
+ private DatamapperPersistenceStrategy strategy;
+
+ /**
+ * The logger instance for this class.
+ */
+ private static Log logger = LogFactory
+ .getFactory().getInstance(DatamapperAutoPingManagerImpl.class);
+
+ /** Creates a new instance of DatamapperAutoPingManagerImpl */
+ public DatamapperAutoPingManagerImpl
+ (DatamapperPersistenceStrategy strategy) {
+ this.strategy = strategy;
+ }
+
+ public void saveAutoPing(AutoPingData autoPing)
+ throws RollerException {
+ strategy.store(autoPing);
+ }
+
+ public void removeAutoPing(AutoPingData autoPing)
+ throws RollerException {
+ strategy.remove(autoPing);
+ }
+
+ public void removeAutoPing(PingTargetData pingTarget, WebsiteData website)
+ throws RollerException {
+ strategy.newQuery(AutoPingData.class, "getByPingTarget&Website")
+ .removeAll(new Object[]{pingTarget, website});
+ }
+
+ public void removeAutoPings(Collection autopings)
+ throws RollerException {
+ strategy.removeAll(autopings);
+ }
+
+ public void removeAllAutoPings()
+ throws RollerException {
+ strategy.removeAll(AutoPingData.class);
+ }
+
+ public AutoPingData getAutoPing(String id)
+ throws RollerException {
+ return (AutoPingData)strategy.load(AutoPingData.class, id);
+ }
+
+ public List getAutoPingsByWebsite(WebsiteData website)
+ throws RollerException {
+ return (List)strategy.newQuery(AutoPingData.class, "getByWebsite")
+ .execute(website);
+ }
+
+ public List getAutoPingsByTarget(PingTargetData pingTarget)
+ throws RollerException {
+ return (List)strategy.newQuery(AutoPingData.class, "getByPingTarget")
+ .execute(pingTarget);
+ }
+
+ public List getApplicableAutoPings(WeblogEntryData changedWeblogEntry)
+ throws RollerException {
+ return (List)strategy.newQuery(AutoPingData.class, "getByWebsite")
+ .execute(changedWeblogEntry.getWebsite());
+ }
+
+ public void queueApplicableAutoPings(WeblogEntryData changedWeblogEntry)
+ throws RollerException {
+ if (PingConfig.getSuspendPingProcessing()) {
+ if (logger.isDebugEnabled())
+ logger.debug("Ping processing is suspended. " +
+ "No auto pings will be queued.");
+ return;
+ // XXX not implemented
+ }
+ }
+
+ public List getCategoryRestrictions(AutoPingData autoPing)
+ throws RollerException {
+ // XXX not implemented
+ return Collections.EMPTY_LIST;
+ }
+
+ public void setCategoryRestrictions
+ (AutoPingData autoPing, Collection newCategories) {
+ // XXX not implemented
+ }
+
+ public void release() {
+ }
+
+}
Added: incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperBookmarkManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperBookmarkManagerImpl.java?view=auto&rev=440509
==============================================================================
--- incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperBookmarkManagerImpl.java (added)
+++ incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperBookmarkManagerImpl.java Tue Sep 5 15:19:18 2006
@@ -0,0 +1,180 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.roller.business.datamapper;
+
+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.model.BookmarkManager;
+import org.apache.roller.model.RollerFactory;
+import org.apache.roller.pojos.Assoc;
+import org.apache.roller.pojos.BookmarkData;
+import org.apache.roller.pojos.FolderData;
+import org.apache.roller.pojos.WebsiteData;
+
+/*
+ * DatamapperBookmarkManagerImpl.java
+ *
+ * Created on May 31, 2006, 3:49 PM
+ *
+ */
+public class DatamapperBookmarkManagerImpl implements BookmarkManager {
+
+ private DatamapperPersistenceStrategy strategy;
+
+ /**
+ * The logger instance for this class.
+ */
+ private static Log logger = LogFactory
+ .getFactory().getInstance(DatamapperBookmarkManagerImpl.class);
+
+ /** Creates a new instance of DatamapperBookmarkManagerImpl */
+ public DatamapperBookmarkManagerImpl
+ (DatamapperPersistenceStrategy strategy) {
+ this.strategy = strategy;
+ }
+
+ public void saveBookmark(BookmarkData bookmark)
+ throws RollerException {
+ this.strategy.store(bookmark);
+
+ // update weblog last modified date (date is updated by saveWebsite())
+ RollerFactory.getRoller().getUserManager()
+ .saveWebsite(bookmark.getWebsite());
+ }
+
+ public void removeBookmark(BookmarkData bookmark)
+ throws RollerException {
+ strategy.remove(bookmark);
+ }
+
+ public BookmarkData getBookmark(String id)
+ throws RollerException {
+ return (BookmarkData) strategy.load(BookmarkData.class, id);
+ }
+
+ public List getBookmarks(FolderData data, boolean subfolders)
+ throws RollerException {
+ // todo
+ return null;
+ }
+
+ public void saveFolder(FolderData folder)
+ throws RollerException {
+ strategy.store(folder);
+ }
+
+ public void removeFolder(FolderData folder)
+ throws RollerException {
+ strategy.remove(folder);
+ }
+
+ public FolderData getFolder(String id)
+ throws RollerException {
+ return (FolderData) strategy.load(FolderData.class, id);
+ }
+
+ public List getAllFolders(WebsiteData wd)
+ throws RollerException {
+ // todo
+ return null;
+ }
+
+ public FolderData getRootFolder(WebsiteData website)
+ throws RollerException {
+ // todo
+ return null;
+ }
+
+ public FolderData getFolder(WebsiteData website, String folderPath)
+ throws RollerException {
+ // todo
+ return null;
+ }
+
+ public String getPath(FolderData folder)
+ throws RollerException {
+ // todo
+ return null;
+ }
+
+ public FolderData getFolderByPath(
+ WebsiteData wd, FolderData folder, String string)
+ throws RollerException {
+ // todo
+ return null;
+ }
+
+ public boolean isFolderInUse(FolderData folder)
+ throws RollerException {
+ // todo
+ return true;
+ }
+
+ public boolean isDuplicateFolderName(FolderData data)
+ throws RollerException {
+ // todo
+ return true;
+ }
+
+ public boolean isDescendentOf(FolderData data, FolderData ancestor)
+ throws RollerException {
+ // todo
+ return true;
+ }
+
+ public Assoc getFolderParentAssoc(FolderData data)
+ throws RollerException {
+ // todo
+ return null;
+ }
+
+ public List getFolderChildAssocs(FolderData data)
+ throws RollerException {
+ // todo
+ return null;
+ }
+
+ public List getAllFolderDecscendentAssocs(FolderData data)
+ throws RollerException {
+ // todo
+ return null;
+ }
+
+ public List getFolderAncestorAssocs(FolderData data)
+ throws RollerException {
+ // todo
+ return null;
+ }
+
+ public void importBookmarks(WebsiteData site, String folder, String opml)
+ throws RollerException {
+ }
+
+ public void moveFolderContents(FolderData src, FolderData dest)
+ throws RollerException {
+ }
+
+ public void removeFolderContents(FolderData src)
+ throws RollerException {
+ }
+
+ public void release() {
+ }
+
+}
Added: incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPersistenceStrategy.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPersistenceStrategy.java?view=auto&rev=440509
==============================================================================
--- incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPersistenceStrategy.java (added)
+++ incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPersistenceStrategy.java Tue Sep 5 15:19:18 2006
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+package org.apache.roller.business.datamapper;
+
+import java.util.Collection;
+import org.apache.roller.RollerException;
+
+import org.apache.roller.pojos.PersistentObject;
+
+/**
+ *
+ */
+public interface DatamapperPersistenceStrategy {
+
+ /**
+ * Flush changes to the datastore, commit transaction, release pm.
+ * @throws org.apache.roller.RollerException on any error
+ */
+ void flush()
+ throws RollerException;
+
+ /**
+ * Release database session, rolls back any uncommitted changes.
+ */
+ void release();
+
+ /**
+ * Store object in the database. Start a transaction if no
+ * transaction in progress.
+ * @param obj the object to persist
+ * @return the object persisted
+ * @throws org.apache.roller.RollerException on any error
+ */
+ PersistentObject store(PersistentObject obj)
+ throws RollerException;
+
+ /**
+ * Remove object from persistence storage. Start a transaction if no
+ * transaction in progress.
+ * @param clazz the class of object to remove
+ * @param id the id of the object to remove
+ * @throws RollerException on any error deleting object
+ */
+ public void remove(Class clazz, String id)
+ throws RollerException;
+
+ /**
+ * Remove object from persistence storage. Start a transaction if no
+ * transaction in progress.
+ * @param po the persistent object to remove
+ * @throws org.apache.roller.RollerException on any error
+ */
+ public void remove(PersistentObject po)
+ throws RollerException;
+
+ /**
+ * Remove objects from persistence storage. Start a transaction if no
+ * transaction in progress.
+ * @param pos the persistent objects to remove
+ * @throws org.apache.roller.RollerException on any error
+ */
+ public void removeAll(Collection pos)
+ throws RollerException;
+
+ /**
+ * Remove objects from persistence storage. Start a transaction if no
+ * transaction in progress.
+ * @param clazz the persistent from which to remove all objects
+ * @throws org.apache.roller.RollerException on any error
+ */
+ public void removeAll(Class clazz)
+ throws RollerException;
+
+ /**
+ * Retrieve object, no transaction needed.
+ * @param clazz the class of object to retrieve
+ * @param id the id of the object to retrieve
+ * @return the object retrieved
+ * @throws RollerException on any error retrieving object
+ */
+ public PersistentObject load(Class clazz, String id)
+ throws RollerException;
+
+ /**
+ * Create query.
+ * @param clazz the class of instances to find
+ * @param queryName the name of the query
+ * @throws org.apache.roller.RollerException on any error
+ */
+ public DatamapperQuery newQuery(Class clazz, String queryName)
+ throws RollerException;
+
+}
Added: incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPingQueueManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPingQueueManagerImpl.java?view=auto&rev=440509
==============================================================================
--- incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPingQueueManagerImpl.java (added)
+++ incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPingQueueManagerImpl.java Tue Sep 5 15:19:18 2006
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.roller.business.datamapper;
+
+import java.sql.Timestamp;
+import java.util.List;
+import org.apache.roller.RollerException;
+import org.apache.roller.model.PingQueueManager;
+import org.apache.roller.pojos.AutoPingData;
+import org.apache.roller.pojos.PingQueueEntryData;
+
+/*
+ * DatamapperPingQueueManagerImpl.java
+ *
+ * Created on May 28, 2006, 4:11 PM
+ *
+ */
+public class DatamapperPingQueueManagerImpl implements PingQueueManager {
+
+ /** The strategy for this manager. */
+ private DatamapperPersistenceStrategy strategy;
+
+ /** Creates a new instance of DatamapperPingQueueManagerImpl */
+ public DatamapperPingQueueManagerImpl
+ (DatamapperPersistenceStrategy strategy) {
+ this.strategy = strategy;
+ }
+
+ public void addQueueEntry(AutoPingData autoPing)
+ throws RollerException {
+ // first, determine if an entry already exists
+ int count = (Integer)strategy.newQuery(PingQueueEntryData.class,
+ "countGetByPingTarget&&website")
+ .execute(new Object[]
+ {autoPing.getPingTarget(), autoPing.getWebsite()});
+ if (count > 0)
+ return;
+
+ // create and store a new entry
+ Timestamp now = new Timestamp(System.currentTimeMillis());
+ PingQueueEntryData pingQueueEntry =
+ new PingQueueEntryData(null, now,
+ autoPing.getPingTarget(), autoPing.getWebsite(), 0);
+ this.saveQueueEntry(pingQueueEntry);
+ }
+
+ public void saveQueueEntry(PingQueueEntryData pingQueueEntry)
+ throws RollerException {
+ strategy.store(pingQueueEntry);
+ }
+
+ public void removeQueueEntry(PingQueueEntryData pingQueueEntry)
+ throws RollerException {
+ strategy.remove(pingQueueEntry);
+ }
+
+ public PingQueueEntryData getQueueEntry(String id)
+ throws RollerException {
+ return (PingQueueEntryData)strategy.load(PingQueueEntryData.class, id);
+ }
+
+ public List getAllQueueEntries()
+ throws RollerException {
+ return (List)strategy.newQuery(PingQueueEntryData.class,
+ "getAll.orderByEntryTime");
+ }
+
+ public void release() {
+ }
+
+}
Added: incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPingTargetManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPingTargetManagerImpl.java?view=auto&rev=440509
==============================================================================
--- incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPingTargetManagerImpl.java (added)
+++ incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPingTargetManagerImpl.java Tue Sep 5 15:19:18 2006
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.roller.business.datamapper;
+
+import java.net.InetAddress;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.UnknownHostException;
+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.model.PingTargetManager;
+import org.apache.roller.pojos.AutoPingData;
+import org.apache.roller.pojos.PingQueueEntryData;
+import org.apache.roller.pojos.PingTargetData;
+import org.apache.roller.pojos.WebsiteData;
+
+/*
+ * DatamapperPingTargetManagerImpl.java
+ *
+ * Created on May 29, 2006, 2:24 PM
+ *
+ */
+public class DatamapperPingTargetManagerImpl implements PingTargetManager {
+
+ private DatamapperPersistenceStrategy strategy;
+
+ /** The logger instance for this class. */
+ private static Log logger = LogFactory
+ .getFactory().getInstance(DatamapperPingTargetManagerImpl.class);
+
+ /** Creates a new instance of DatamapperPropertiesManagerImpl */
+ public DatamapperPingTargetManagerImpl
+ (DatamapperPersistenceStrategy strategy) {
+ this.strategy = strategy;
+ }
+
+ public void savePingTarget(PingTargetData pingTarget)
+ throws RollerException {
+ strategy.store(pingTarget);
+ }
+
+ public void removePingTarget(PingTargetData pingTarget)
+ throws RollerException {
+ // remove queued ping entries that refer to this ping target
+ strategy.newQuery(PingQueueEntryData.class, "getByPingTarget")
+ .removeAll(pingTarget);
+ // remove autopings that refer to this ping target
+ strategy.newQuery(AutoPingData.class, "getByPingTarget")
+ .removeAll(pingTarget);
+ }
+
+ public void removeAllCustomPingTargets()
+ throws RollerException {
+ strategy.newQuery(PingTargetData.class, "getByWebsiteNotNull")
+ .removeAll();
+ }
+
+ public PingTargetData getPingTarget(String id)
+ throws RollerException {
+ return (PingTargetData)strategy.load(PingTargetData.class, id);
+ }
+
+ public List getCommonPingTargets()
+ throws RollerException {
+ return (List)strategy.newQuery(PingTargetData.class,
+ "getByWebsiteNull.orderByName")
+ .execute();
+ }
+
+ public List getCustomPingTargets(WebsiteData website)
+ throws RollerException {
+ return (List)strategy.newQuery(PingTargetData.class,
+ "getByWebsite.orderByName")
+ .execute(website);
+ }
+
+ public boolean isNameUnique(PingTargetData pingTarget)
+ throws RollerException {
+ String name = pingTarget.getName();
+ if (name == null || name.trim().length() == 0) return false;
+ int count = ((Integer)
+ strategy.newQuery(PingTargetData.class,
+ "countByWebsite&&NameEqual&&IdNotEqual")
+ .execute(new Object[]{
+ pingTarget.getWebsite(),
+ name,
+ pingTarget.getId()}))
+ .intValue();
+ return (count != 0);
+ }
+
+ public boolean isUrlWellFormed(PingTargetData pingTarget)
+ throws RollerException {
+ String url = pingTarget.getPingUrl();
+ if (url == null || url.trim().length() == 0) return false;
+ try {
+ URL parsed = new URL(url);
+ if (!parsed.getProtocol().equals("http"))
+ return false;
+ return (parsed.getHost() != null) &&
+ (parsed.getHost().trim().length() > 0);
+ } catch (MalformedURLException e) {
+ return false;
+ }
+ }
+
+ public boolean isHostnameKnown(PingTargetData pingTarget)
+ throws RollerException {
+ String url = pingTarget.getPingUrl();
+ if (url == null || url.trim().length() == 0) return false;
+ try {
+ URL parsedUrl = new URL(url);
+ String host = parsedUrl.getHost();
+ if (host == null || host.trim().length() == 0) return false;
+ InetAddress addr = InetAddress.getByName(host);
+ return true;
+ } catch (MalformedURLException e) {
+ return false;
+ } catch (UnknownHostException e) {
+ return false;
+ }
+ }
+
+ public void release() {
+ }
+
+}
Added: incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPlanetManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPlanetManagerImpl.java?view=auto&rev=440509
==============================================================================
--- incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPlanetManagerImpl.java (added)
+++ incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPlanetManagerImpl.java Tue Sep 5 15:19:18 2006
@@ -0,0 +1,278 @@
+/*
+* 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.datamapper;
+
+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.config.RollerRuntimeConfig;
+import org.apache.roller.model.PagePluginManager;
+import org.apache.roller.model.PlanetManager;
+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 DatamapperPlanetManagerImpl implements PlanetManager {
+
+ /** The strategy for this manager. */
+ private DatamapperPersistenceStrategy strategy;
+
+ protected Map lastUpdatedByGroup = new HashMap();
+ protected static final String NO_GROUP = "zzz_nogroup_zzz";
+
+ private static Log logger = LogFactory.getFactory().getInstance(
+ DatamapperPlanetManagerImpl.class);
+
+ private DatamapperWeblogManagerImpl weblogManager;
+
+ public DatamapperPlanetManagerImpl
+ (DatamapperPersistenceStrategy strategy) {
+ this.strategy = strategy;
+ }
+
+ public void saveConfiguration(PlanetConfigData config)
+ throws RollerException {
+ strategy.store(config);
+ }
+
+ public void saveGroup(PlanetGroupData group) throws RollerException {
+ Iterator assocs = group.getGroupSubscriptionAssocs().iterator();
+ while (assocs.hasNext()) {
+ PlanetGroupSubscriptionAssoc assoc = (PlanetGroupSubscriptionAssoc) assocs
+ .next();
+ strategy.store(assoc);
+ }
+ strategy.store(group);
+ }
+
+ public void saveEntry(PlanetEntryData entry) throws RollerException {
+ strategy.store(entry);
+ }
+
+ public void saveSubscription(PlanetSubscriptionData sub)
+ throws RollerException {
+ PlanetSubscriptionData existing = getSubscription(sub.getFeedUrl());
+ if (existing == null || (existing.getId().equals(sub.getId()))) {
+ strategy.store(sub);
+ }
+ 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(
+ PlanetSubscriptionData.class, id);
+ }
+
+ public PlanetGroupData getGroup(String handle) throws RollerException {
+ return null;
+ }
+
+ public PlanetGroupData getGroupById(String id) throws RollerException {
+ return (PlanetGroupData) strategy.load(PlanetGroupData.class, id);
+ }
+
+ 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 {
+ strategy.remove(entry);
+ }
+
+ public void deleteGroup(PlanetGroupData group) throws RollerException {
+ strategy.remove(group);
+ }
+
+ public void deleteSubscription(PlanetSubscriptionData sub)
+ throws RollerException {
+ strategy.remove(sub);
+ }
+
+ 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
+ WebsiteData website = (WebsiteData)strategy.newQuery(
+ WebsiteData.class, "getByHandle&&Enabled")
+ .execute(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);
+ }
+
+ public void refreshEntries() throws RollerException {
+ }
+}
+
Added: incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPropertiesManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPropertiesManagerImpl.java?view=auto&rev=440509
==============================================================================
--- incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPropertiesManagerImpl.java (added)
+++ incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperPropertiesManagerImpl.java Tue Sep 5 15:19:18 2006
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.roller.business.datamapper;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.RollerException;
+import org.apache.roller.model.PropertiesManager;
+import org.apache.roller.pojos.RollerPropertyData;
+
+/*
+ * DatamapperPropertiesManagerImpl.java
+ *
+ * Created on May 29, 2006, 2:06 PM
+ *
+ */
+public class DatamapperPropertiesManagerImpl implements PropertiesManager {
+
+ private DatamapperPersistenceStrategy strategy;
+
+ /** The logger instance for this class. */
+ private static Log logger = LogFactory
+ .getFactory().getInstance(DatamapperPropertiesManagerImpl.class);
+
+ /** Creates a new instance of DatamapperPropertiesManagerImpl */
+ public DatamapperPropertiesManagerImpl
+ (DatamapperPersistenceStrategy strategy) {
+ this.strategy = strategy;
+ }
+
+ public void release() {
+ }
+
+ public void saveProperty(RollerPropertyData property)
+ throws RollerException {
+ strategy.store(property);
+ }
+
+ public void saveProperties(Map properties)
+ throws RollerException {
+ Iterator it = properties.values().iterator();
+ while (it.hasNext()) {
+ strategy.store((RollerPropertyData)it.next());
+ }
+ }
+
+ public RollerPropertyData getProperty(String name)
+ throws RollerException {
+ return (RollerPropertyData)strategy.load(RollerPropertyData.class,
+ name);
+ }
+
+ public Map getProperties()
+ throws RollerException {
+ HashMap result = new HashMap();
+ Collection properties = (Collection)strategy.newQuery
+ (RollerPropertyData.class, null)
+ .execute();
+ for (Iterator it = properties.iterator(); it.hasNext();) {
+ RollerPropertyData property = (RollerPropertyData)it.next();
+ result.put(property.getName(), property);
+ }
+ return result;
+ }
+
+}
Added: incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperQuery.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperQuery.java?view=auto&rev=440509
==============================================================================
--- incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperQuery.java (added)
+++ incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperQuery.java Tue Sep 5 15:19:18 2006
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.roller.business.datamapper;
+
+import java.util.List;
+
+/**
+ *
+ */
+public interface DatamapperQuery {
+
+ /** Execute the query with no parameters.
+ * @return the results of the query
+ */
+ Object execute();
+
+ /** Execute the query with one parameter.
+ * @param param the parameter
+ * @return the results of the query
+ */
+ Object execute(Object param);
+
+ /** Execute the query with parameters.
+ * @param params the parameters
+ * @return the results of the query
+ */
+ Object execute(Object[] params);
+
+ /** Remove instances selected by the query with no parameters.
+ * @return the results of the query
+ */
+ void removeAll();
+
+ /** Remove instances selected by the query with one parameter.
+ * @param param the parameter
+ * @return the results of the query
+ */
+ void removeAll(Object param);
+
+ /** Remove instances selected by the query with parameters.
+ * @param params the parameters
+ * @return the results of the query
+ */
+ void removeAll(Object[] params);
+
+ /** Set the result to be a single instance (not a List).
+ * @result the instance on which this method is called
+ */
+ DatamapperQuery setUnique();
+
+ /** Set the types of the parameters. This is only needed if the
+ * parameter types are temporal types, e.g. Date, Time, Calendar.
+ * @param the types of the parameters in corresponding positions.
+ * @result the instance on which this method is called
+ */
+ DatamapperQuery setTypes(Object[] types);
+
+ /** Set the range of results for this query.
+ * @fromIncl the beginning row number
+ * @toExcl the ending row number
+ * @return the instance on which this method is called
+ */
+ DatamapperQuery setRange(long fromIncl, long toExcl);
+
+}
Added: incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperReferrerManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperReferrerManagerImpl.java?view=auto&rev=440509
==============================================================================
--- incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperReferrerManagerImpl.java (added)
+++ incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperReferrerManagerImpl.java Tue Sep 5 15:19:18 2006
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.roller.business.datamapper;
+
+import java.util.List;
+import org.apache.roller.RollerException;
+import org.apache.roller.model.RefererManager;
+import org.apache.roller.pojos.RefererData;
+import org.apache.roller.pojos.WebsiteData;
+
+/*
+ * DatamapperReferrerManagerImpl.java
+ *
+ * Created on May 31, 2006, 4:06 PM
+ *
+ */
+public class DatamapperReferrerManagerImpl implements RefererManager {
+
+ /** The strategy for this manager. */
+ private DatamapperPersistenceStrategy strategy;
+
+ /** Creates a new instance of DatamapperReferrerManagerImpl */
+ public DatamapperReferrerManagerImpl
+ (DatamapperPersistenceStrategy strategy) {
+ this.strategy = strategy;
+ }
+
+ public void saveReferer(RefererData referer) throws RollerException {
+ strategy.store(referer);
+ }
+
+ public void removeReferer(RefererData referer) throws RollerException {
+ strategy.remove(referer);
+ }
+
+ public void clearReferrers() throws RollerException {
+ }
+
+ public void clearReferrers(WebsiteData website) throws RollerException {
+ }
+
+ public RefererData getReferer(String id) throws RollerException {
+ }
+
+ public List getReferers(WebsiteData weblog) throws RollerException {
+ }
+
+ public List getTodaysReferers(WebsiteData website) throws RollerException {
+ }
+
+ public List getReferersToDate(WebsiteData website, String date) throws RollerException {
+ }
+
+ public List getDaysPopularWebsites(int max) throws RollerException {
+ }
+
+ public List getReferersToEntry(String entryid) throws RollerException {
+ }
+
+ public int getDayHits(WebsiteData website) throws RollerException {
+ }
+
+ public int getTotalHits(WebsiteData website) throws RollerException {
+ }
+
+ public void applyRefererFilters() throws RollerException {
+ }
+
+ public void applyRefererFilters(WebsiteData website) throws RollerException {
+ }
+
+ public void processReferrer(String requestUrl, String referrerUrl, String weblogHandle, String weblogAnchor, String weblogDateString) {
+ }
+
+ public void release() {
+ }
+
+}
Added: incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperRollerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperRollerImpl.java?view=auto&rev=440509
==============================================================================
--- incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperRollerImpl.java (added)
+++ incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperRollerImpl.java Tue Sep 5 15:19:18 2006
@@ -0,0 +1,237 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.roller.business.datamapper;
+
+/*
+ * DatamapperRollerImpl.java
+ *
+ * Created on May 27, 2006, 2:50 PM
+ *
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.RollerException;
+import org.apache.roller.business.RollerImpl;
+import org.apache.roller.model.BookmarkManager;
+import org.apache.roller.model.AutoPingManager;
+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;
+
+/**
+ * A Datamapper specific implementation of the Roller business layer.
+ */
+public abstract class DatamapperRollerImpl extends RollerImpl {
+
+ static final long serialVersionUID = 5256135928578074652L;
+
+ protected static Log logger =
+ LogFactory.getLog(DatamapperRollerImpl.class);
+
+ // our singleton instance
+ private static DatamapperRollerImpl me = null;
+
+ // a persistence utility class
+ protected DatamapperPersistenceStrategy strategy = null;
+
+ // references to the managers we maintain
+ private BookmarkManager bookmarkManager = null;
+ private PropertiesManager propertiesManager = null;
+ private PlanetManager planetManager = null;
+ private RefererManager referrerManager = null;
+ private UserManager userManager = null;
+ private WeblogManager weblogManager = null;
+ private PingQueueManager pingQueueManager = null;
+ private AutoPingManager autoPingManager = null;
+ private PingTargetManager pingTargetManager = null;
+
+ protected DatamapperRollerImpl() throws RollerException {
+ }
+
+ public void flush() throws RollerException {
+ this.strategy.flush();
+ }
+
+ public void release() {
+
+ // release our own stuff first
+ if (bookmarkManager != null) bookmarkManager.release();
+ if (referrerManager != null) referrerManager.release();
+ if (userManager != null) userManager.release();
+ if (weblogManager != null) weblogManager.release();
+ if (pingTargetManager != null) pingTargetManager.release();
+ if (pingQueueManager != null) pingQueueManager.release();
+ if (autoPingManager != null) autoPingManager.release();
+
+ // tell Datamapper to close down
+ this.strategy.release();
+
+ // then let parent do its thing
+ super.release();
+ }
+
+ public void shutdown() {
+
+ // do our own shutdown first
+ this.release();
+
+ // then let parent do its thing
+ super.shutdown();
+ }
+
+ /**
+ * @see org.apache.roller.model.Roller#getAutoPingManager()
+ */
+ public AutoPingManager getAutopingManager() throws RollerException {
+ if (autoPingManager == null) {
+ autoPingManager = createAutoPingManagerImpl(strategy);
+ }
+ return autoPingManager;
+ }
+
+ /**
+ * @see org.apache.roller.model.Roller#getBookmarkManager()
+ */
+ public BookmarkManager getBookmarkManager() throws RollerException {
+ if ( bookmarkManager == null ) {
+ bookmarkManager = createBookmarkManagerImpl(strategy);
+ }
+ return bookmarkManager;
+ }
+
+ /**
+ * @see org.apache.roller.model.Roller#getPingTargetManager()
+ */
+ public PingQueueManager getPingQueueManager() throws RollerException {
+ if (pingQueueManager == null) {
+ pingQueueManager = createPingQueueManagerImpl(strategy);
+ }
+ return pingQueueManager;
+ }
+
+ /**
+ * @see org.apache.roller.model.Roller#getPingTargetManager()
+ */
+ public PingTargetManager getPingTargetManager() throws RollerException {
+ if (pingTargetManager == null) {
+ pingTargetManager = createPingTargetManagerImpl(strategy);
+ }
+ return pingTargetManager;
+ }
+
+ /**
+ * @see org.apache.roller.model.Roller#getPlanetManager()
+ */
+ public PlanetManager getPlanetManager() throws RollerException {
+ if ( planetManager == null ) {
+ planetManager = createPlanetManagerImpl(strategy);
+ }
+ return planetManager;
+ }
+
+ /**
+ * @see org.apache.roller.model.Roller#getPropertiesManager()
+ */
+ public PropertiesManager getPropertiesManager() throws RollerException {
+ if (propertiesManager == null) {
+ propertiesManager = createPropertiesManagerImpl(strategy);
+ }
+ return propertiesManager;
+ }
+
+ /**
+ * @see org.apache.roller.model.Roller#getRefererManager()
+ */
+ public RefererManager getRefererManager() throws RollerException {
+ if ( referrerManager == null ) {
+ referrerManager = createReferrerManagerImpl(strategy);
+ }
+ return referrerManager;
+ }
+
+ /**
+ * @see org.apache.roller.model.Roller#getUserManager()
+ */
+ public UserManager getUserManager() throws RollerException {
+ if ( userManager == null ) {
+ userManager = createUserManagerImpl(strategy);
+ }
+ return userManager;
+ }
+
+ /**
+ * @see org.apache.roller.model.Roller#getWeblogManager()
+ */
+ public WeblogManager getWeblogManager() throws RollerException {
+ if ( weblogManager == null ) {
+ weblogManager = createWeblogManagerImpl(strategy);
+ }
+ return weblogManager;
+ }
+
+ protected AutoPingManager createAutoPingManagerImpl
+ (DatamapperPersistenceStrategy strategy) {
+ return new DatamapperAutoPingManagerImpl(strategy);
+ }
+
+ protected BookmarkManager createBookmarkManagerImpl
+ (DatamapperPersistenceStrategy strategy) {
+ return new DatamapperBookmarkManagerImpl(strategy);
+ }
+
+ protected PingTargetManager createPingTargetManagerImpl
+ (DatamapperPersistenceStrategy strategy) {
+ return new DatamapperPingTargetManagerImpl(strategy);
+ }
+
+ protected PingQueueManager createPingQueueManagerImpl
+ (DatamapperPersistenceStrategy strategy) {
+ return new DatamapperPingQueueManagerImpl(strategy);
+ }
+
+ protected PlanetManager createPlanetManagerImpl
+ (DatamapperPersistenceStrategy strategy) {
+ return new DatamapperPlanetManagerImpl(strategy);
+ }
+
+ protected PropertiesManager createPropertiesManagerImpl
+ (DatamapperPersistenceStrategy strategy) {
+ return new DatamapperPropertiesManagerImpl(strategy);
+ }
+
+ protected RefererManager createReferrerManagerImpl
+ (DatamapperPersistenceStrategy strategy) {
+ return new DatamapperReferrerManagerImpl(strategy);
+ }
+
+ protected UserManager createUserManagerImpl
+ (DatamapperPersistenceStrategy strategy) {
+ return new DatamapperUserManagerImpl(strategy);
+ }
+
+ protected WeblogManager createWeblogManagerImpl
+ (DatamapperPersistenceStrategy strategy) {
+ return new DatamapperWeblogManagerImpl(strategy);
+ }
+
+}
Added: incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperUserManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperUserManagerImpl.java?view=auto&rev=440509
==============================================================================
--- incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperUserManagerImpl.java (added)
+++ incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperUserManagerImpl.java Tue Sep 5 15:19:18 2006
@@ -0,0 +1,438 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.roller.business.datamapper;
+
+import java.util.Collection;
+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.model.RollerFactory;
+import org.apache.roller.model.UserManager;
+import org.apache.roller.model.WeblogManager;
+import org.apache.roller.pojos.AutoPingData;
+import org.apache.roller.pojos.BookmarkData;
+import org.apache.roller.pojos.FolderData;
+import org.apache.roller.pojos.PermissionsData;
+import org.apache.roller.pojos.PingQueueEntryData;
+import org.apache.roller.pojos.PingTargetData;
+import org.apache.roller.pojos.RefererData;
+import org.apache.roller.pojos.UserData;
+import org.apache.roller.pojos.WeblogCategoryData;
+import org.apache.roller.pojos.WeblogEntryData;
+import org.apache.roller.pojos.WeblogTemplate;
+import org.apache.roller.pojos.WebsiteData;
+
+/*
+ * DatamapperUserManagerImpl.java
+ *
+ * Created on May 29, 2006, 3:15 PM
+ *
+ */
+public class DatamapperUserManagerImpl implements UserManager {
+
+ private DatamapperPersistenceStrategy strategy;
+
+ /** The logger instance for this class. */
+ private static Log logger = LogFactory
+ .getFactory().getInstance(DatamapperPingTargetManagerImpl.class);
+
+ /** Creates a new instance of DatamapperPropertiesManagerImpl */
+ public DatamapperUserManagerImpl
+ (DatamapperPersistenceStrategy strategy) {
+ this.strategy = strategy;
+ }
+
+ public void addUser(UserData newUser)
+ throws RollerException {
+ }
+
+ public void saveUser(UserData data)
+ throws RollerException {
+ strategy.store(data);
+ }
+
+ public void removeUser(UserData user)
+ throws RollerException {
+ strategy.remove(user);
+ }
+
+ public UserData getUser(String id)
+ throws RollerException {
+ return (UserData)strategy.load(UserData.class, id);
+ }
+
+ public UserData getUserByUsername(String userName)
+ throws RollerException {
+ return getUserByUsername(userName, Boolean.TRUE);
+ }
+
+ public UserData getUserByUsername(String userName, Boolean enabled)
+ throws RollerException {
+ if (userName==null )
+ throw new RollerException("userName cannot be null");
+ if (enabled == null) {
+ return (UserData)strategy.newQuery(UserData.class,
+ "getUniqueByName")
+ .execute(userName);
+ } else {
+ return (UserData)strategy.newQuery(UserData.class,
+ "getUniqueByName&&Enabled")
+ .execute(new Object[]{userName, enabled});
+ }
+ }
+
+ public List getUsers()
+ throws RollerException {
+ return getUsers(Boolean.TRUE);
+ }
+
+ public List getUsers(Boolean enabled)
+ throws RollerException {
+ if (enabled == null) {
+ return (List)strategy.newQuery(UserData.class,
+ "all")
+ .execute();
+ } else {
+ return (List)strategy.newQuery(UserData.class,
+ "getByEnabled")
+ .execute(enabled);
+ }
+ }
+
+ public List getUsers(WebsiteData website, Boolean enabled)
+ throws RollerException {
+ return (List)strategy.newQuery(UserData.class,
+ "getByWebsite&&Enabled")
+ .execute(new Object[]{website, enabled});
+ }
+
+ public List getUsersStartingWith
+ (String startsWith, int offset, int length, Boolean enabled)
+ throws RollerException {
+ return (List)strategy.newQuery(UserData.class,
+ "getByEnabled&&UserNameStartsWith||EmailStartsWith.range")
+ .setRange(offset, offset+length)
+ .execute(new Object[]{enabled, startsWith});
+ }
+
+ public void addWebsite(WebsiteData newWebsite)
+ throws RollerException {
+ strategy.store(newWebsite);
+
+ // grant weblog creator ADMIN permissions
+ PermissionsData perms = new PermissionsData();
+ perms.setUser(newWebsite.getCreator());
+ perms.setWebsite(newWebsite);
+ perms.setPending(false);
+ perms.setPermissionMask(PermissionsData.ADMIN);
+ strategy.store(perms);
+
+ // add default categories
+ WeblogCategoryData rootCat = new WeblogCategoryData(
+ null, // id
+ newWebsite, // newWeblog
+ null, // parent
+ "root", // name
+ "root", // description
+ null ); // image
+ strategy.store(rootCat);
+
+ String cats = getProperty("newuser.categories");
+ WeblogCategoryData firstCat = rootCat;
+ if (cats != null) {
+ String[] splitcats = cats.split(",");
+ for (int i = 0; i < splitcats.length; i++) {
+ WeblogCategoryData c = new WeblogCategoryData(
+ null, // id
+ newWebsite, // newWebsite
+ rootCat, // parent
+ splitcats[i], // name
+ splitcats[i], // description
+ null ); // image
+ if (i == 0) firstCat = c;
+ strategy.store(c);
+ }
+ }
+ // Use first category as default for Blogger API
+ newWebsite.setBloggerCategory(firstCat);
+
+ // But default category for weblog itself should be root
+ newWebsite.setDefaultCategory(rootCat);
+
+ strategy.store(newWebsite);
+
+ // add default bookmarks
+ FolderData root = new FolderData(null, "root", "root", newWebsite);
+ strategy.store(root);
+
+ Integer zero = new Integer(0);
+ String blogroll = getProperty("newuser.blogroll");
+ if (blogroll != null) {
+ String[] splitroll = blogroll.split(",");
+ for (int i = 0; i < splitroll.length; i++) {
+ String[] rollitems = splitroll[i].split("\\|");
+ if (rollitems != null && rollitems.length > 1) {
+ strategy.store(new BookmarkData(
+ root, // parent
+ rollitems[0], // name
+ "", // description
+ rollitems[1].trim(), // url
+ null, // feedurl
+ zero, // weight
+ zero, // priority
+ null)); // image
+ }
+ }
+ }
+
+ // add any auto enabled ping targets
+ Collection pingTargets = (Collection)strategy.newQuery(
+ PingTargetData.class,
+ "getByWebsiteNull&&AutoPingTrue")
+ .execute();
+ Iterator pingTargetIterator = pingTargets.iterator();
+ PingTargetData pingTarget = null;
+ while(pingTargetIterator.hasNext()) {
+ pingTarget = (PingTargetData)pingTargetIterator.next();
+ strategy.store(new AutoPingData(null, pingTarget, newWebsite));
+ }
+ }
+
+ public void saveWebsite(WebsiteData data)
+ throws RollerException {
+ strategy.store(data);
+ }
+
+ public void removeWebsite(WebsiteData website)
+ throws RollerException {
+
+ // Remove the website's ping queue entries
+ strategy.newQuery(PingQueueEntryData.class,
+ "getByWebsite")
+ .execute(website);
+
+ // Remove the website's auto ping configurations
+ strategy.newQuery(AutoPingData.class,
+ "getByWebsite")
+ .execute(website);
+
+ // Remove the website's custom ping targets
+ strategy.newQuery(PingTargetData.class,
+ "getByWebsite")
+ .execute(website);
+
+ // Remove the website's weblog entries
+ strategy.newQuery(WeblogEntryData.class,
+ "getByWebsite")
+ .execute(website);
+
+ // Remove the website's associated referrers
+ strategy.newQuery(RefererData.class,
+ "getByWebsite")
+ .execute(website);
+
+ // Remove the website's associated templates
+ strategy.newQuery(WeblogTemplate.class,
+ "getByWebsite")
+ .execute(website);
+
+ // Remove all the website's bookmarks in all folders
+ strategy.newQuery(BookmarkData.class,
+ "getByFolderByWebsite")
+ .execute(website);
+
+ // Remove all the website's folders
+ strategy.newQuery(FolderData.class,
+ "getByWebsite")
+ .execute(website);
+
+ // Remove the website's categories
+ strategy.newQuery(WeblogCategoryData.class,
+ "getByWebsite")
+ .execute(website);
+
+ // Finally, remove the website
+ strategy.remove(website);
+ }
+
+ public WebsiteData getWebsite(String id)
+ throws RollerException {
+ return (WebsiteData)strategy.load(WebsiteData.class, id);
+ }
+
+ public WebsiteData getWebsiteByHandle(String handle)
+ throws RollerException {
+ return getWebsiteByHandle(handle, Boolean.TRUE);
+ }
+
+ public WebsiteData getWebsiteByHandle(String handle, Boolean enabled)
+ throws RollerException {
+ // XXX cache websites by handle?
+ return (WebsiteData)strategy.newQuery(WebsiteData.class,
+ "getByHandle&&Enabled")
+ .execute(new Object[]{handle, enabled});
+ }
+
+ public List getWebsites(UserData user, Boolean enabled, Boolean active)
+ throws RollerException {
+ return (List)strategy.newQuery(WebsiteData.class,
+ "getByPermissionsContainsUser&&Enabled&&Active")
+ .execute(new Object[]{user, enabled, active});
+ }
+
+ public void savePermissions(PermissionsData perms)
+ throws RollerException {
+ strategy.store(perms);
+ }
+
+ public void removePermissions(PermissionsData perms)
+ throws RollerException {
+ strategy.remove(perms);
+ }
+
+ public PermissionsData getPermissions(String id)
+ throws RollerException {
+ return (PermissionsData)strategy.load(PermissionsData.class, id);
+ }
+
+ public List getPendingPermissions(UserData user)
+ throws RollerException {
+ return (List)strategy.newQuery(PermissionsData.class,
+ "getByUser&&Pending")
+ .execute(user);
+ }
+
+ public List getPendingPermissions(WebsiteData website)
+ throws RollerException {
+ return (List)strategy.newQuery(PermissionsData.class,
+ "getByWebsite&&Pending")
+ .execute(website);
+ }
+
+ public PermissionsData getPermissions(WebsiteData website, UserData user)
+ throws RollerException {
+ return (PermissionsData)strategy.newQuery(PermissionsData.class,
+ "getUniqueByWebsite&&User")
+ .execute(new Object[]{website, user});
+ }
+
+ public List getAllPermissions(WebsiteData website)
+ throws RollerException {
+ return (List)strategy.newQuery(PermissionsData.class,
+ "getByWebsite&&NotPending")
+ .execute(website);
+ }
+
+ public List getAllPermissions(UserData user)
+ throws RollerException {
+ return (List)strategy.newQuery(PermissionsData.class,
+ "getByUser&&NotPending")
+ .execute(user);
+ }
+
+ public PermissionsData inviteUser
+ (WebsiteData website, UserData user, short mask)
+ throws RollerException {
+ if (website == null)
+ throw new RollerException("inviteUser: Website cannot be null");
+ if (user == null)
+ throw new RollerException("inviteUser: User cannot be null");
+
+ PermissionsData perms = new PermissionsData();
+ perms.setWebsite(website);
+ perms.setUser(user);
+ perms.setPermissionMask(mask);
+ strategy.store(perms);
+
+ return perms;
+ }
+
+ public void retireUser(WebsiteData website, UserData user)
+ throws RollerException {
+ if (website == null)
+ throw new RollerException("retireUser: Website cannot be null");
+ if (user == null)
+ throw new RollerException("retireUser: User cannot be null");
+
+ strategy.newQuery(PermissionsData.class,
+ "getByWebsite&&UserId")
+ .execute(new Object[]{website, user});
+ }
+
+ public void savePage(WeblogTemplate data)
+ throws RollerException {
+ strategy.store(data);
+ saveWebsite(data.getWebsite());
+ }
+
+ public void removePage(WeblogTemplate page)
+ throws RollerException {
+ strategy.remove(page);
+ }
+
+ public WeblogTemplate getPage(String id)
+ throws RollerException {
+ // For templates stored on disk, just return
+ if (id != null && id.endsWith(".vm"))
+ return null;
+ return (WeblogTemplate)strategy.load(WeblogTemplate.class, id);
+ }
+
+ public WeblogTemplate getPageByName(WebsiteData website, String pageName)
+ throws RollerException {
+ if (website == null)
+ throw new RollerException(
+ "getPageByName: website cannot be null");
+ if (pageName == null)
+ throw new RollerException(
+ "getPageByName: Page name cannot be null");
+ return (WeblogTemplate)strategy.newQuery(WeblogTemplate.class,
+ "getUniqueByWebsite&&Name")
+ .execute(new Object[]{website, pageName});
+ }
+
+ public WeblogTemplate getPageByLink(WebsiteData website, String pageLink)
+ throws RollerException {
+ if (website == null)
+ throw new RollerException(
+ "getPageByLink: website cannot be null");
+ if (pageLink == null)
+ throw new RollerException(
+ "getPageByLink: Page link cannot be null");
+ return (WeblogTemplate)strategy.newQuery(WeblogTemplate.class,
+ "getUniqueByWebsite&&Link")
+ .execute(new Object[]{website, pageLink});
+ }
+
+ public List getPages(WebsiteData website)
+ throws RollerException {
+ return (List)strategy.newQuery(WeblogTemplate.class,
+ "getByWebsite.orderByName")
+ .execute(website);
+ }
+
+ public void release() {
+ }
+
+ private String getProperty(String property) throws RollerException {
+ return RollerFactory.getRoller().getPropertiesManager()
+ .getProperty(property).getValue();
+ }
+
+}
Added: incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperWeblogManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperWeblogManagerImpl.java?view=auto&rev=440509
==============================================================================
--- incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperWeblogManagerImpl.java (added)
+++ incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperWeblogManagerImpl.java Tue Sep 5 15:19:18 2006
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.roller.business.datamapper;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import org.apache.roller.RollerException;
+import org.apache.roller.model.WeblogManager;
+import org.apache.roller.pojos.Assoc;
+import org.apache.roller.pojos.CommentData;
+import org.apache.roller.pojos.WeblogCategoryData;
+import org.apache.roller.pojos.WeblogEntryData;
+import org.apache.roller.pojos.WebsiteData;
+
+/*
+ * DatamapperWeblogManagerImpl.java
+ *
+ * Created on May 31, 2006, 4:08 PM
+ *
+ */
+public class DatamapperWeblogManagerImpl implements WeblogManager {
+
+ /** Creates a new instance of DatamapperWeblogManagerImpl */
+ public DatamapperWeblogManagerImpl() {
+ }
+
+ public void saveWeblogEntry(WeblogEntryData entry) throws RollerException {
+ }
+
+ public void removeWeblogEntry(WeblogEntryData entry) throws RollerException {
+ }
+
+ public WeblogEntryData getWeblogEntry(String id) throws RollerException {
+ }
+
+ public WeblogEntryData getWeblogEntryByAnchor(WebsiteData website, String anchor) throws RollerException {
+ }
+
+ public List getWeblogEntries(WebsiteData website, Date startDate, Date endDate, String catName, String status, String sortBy, int offset, int range) throws RollerException {
+ }
+
+ public List getWeblogEntries(WebsiteData website, Date startDate, Date endDate, String catName, String status, String sortBy, Integer maxEntries) throws RollerException {
+ }
+
+ public Map getWeblogEntryObjectMap(WebsiteData website, Date startDate, Date endDate, String catName, String status, Integer maxEntries) throws RollerException {
+ }
+
+ public Map getWeblogEntryStringMap(WebsiteData website, Date startDate, Date endDate, String catName, String status, Integer maxEntries) throws RollerException {
+ }
+
+ public List getWeblogEntries(WeblogCategoryData cat, boolean subcats) throws RollerException {
+ }
+
+ public WeblogEntryData getNextEntry(WeblogEntryData current, String catName) throws RollerException {
+ }
+
+ public WeblogEntryData getPreviousEntry(WeblogEntryData current, String catName) throws RollerException {
+ }
+
+ public List getNextEntries(WeblogEntryData entry, String catName, int maxEntries) throws RollerException {
+ }
+
+ public List getPreviousEntries(WeblogEntryData entry, String catName, int maxEntries) throws RollerException {
+ }
+
+ public List getWeblogEntriesPinnedToMain(Integer max) throws RollerException {
+ }
+
+ public Date getWeblogLastPublishTime(WebsiteData website) throws RollerException {
+ }
+
+ public Date getWeblogLastPublishTime(WebsiteData website, String catName) throws RollerException {
+ }
+
+ public void saveWeblogCategory(WeblogCategoryData cat) throws RollerException {
+ }
+
+ public void moveWeblogCategoryContents(String srcId, String destId) throws RollerException {
+ }
+
+ public void removeWeblogCategory(WeblogCategoryData cat) throws RollerException {
+ }
+
+ public WeblogCategoryData getWeblogCategory(String id) throws RollerException {
+ }
+
+ public WeblogCategoryData getRootWeblogCategory(WebsiteData website) throws RollerException {
+ }
+
+ public WeblogCategoryData getWeblogCategoryByPath(WebsiteData website, String categoryPath) throws RollerException {
+ }
+
+ public WeblogCategoryData getWeblogCategoryByPath(WebsiteData wd, WeblogCategoryData category, String string) throws RollerException {
+ }
+
+ public List getWeblogCategories(WebsiteData website) throws RollerException {
+ }
+
+ public List getWeblogCategories(WebsiteData website, boolean includeRoot) throws RollerException {
+ }
+
+ public String getPath(WeblogCategoryData category) throws RollerException {
+ }
+
+ public Assoc getWeblogCategoryParentAssoc(WeblogCategoryData data) throws RollerException {
+ }
+
+ public List getWeblogCategoryChildAssocs(WeblogCategoryData data) throws RollerException {
+ }
+
+ public List getAllWeblogCategoryDecscendentAssocs(WeblogCategoryData data) throws RollerException {
+ }
+
+ public List getWeblogCategoryAncestorAssocs(WeblogCategoryData data) throws RollerException {
+ }
+
+ public void saveComment(CommentData comment) throws RollerException {
+ }
+
+ public void removeComment(CommentData comment) throws RollerException {
+ }
+
+ public CommentData getComment(String id) throws RollerException {
+ }
+
+ 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 {
+ }
+
+ public String createAnchor(WeblogEntryData data) throws RollerException {
+ }
+
+ public boolean isDuplicateWeblogCategoryName(WeblogCategoryData data) throws RollerException {
+ }
+
+ public boolean isWeblogCategoryInUse(WeblogCategoryData data) throws RollerException {
+ }
+
+ public boolean isDescendentOf(WeblogCategoryData child, WeblogCategoryData ancestor) throws RollerException {
+ }
+
+ public String getUrl(WebsiteData website, String contextUrl) throws RollerException {
+ }
+
+ public void applyCommentDefaultsToEntries(WebsiteData website) throws RollerException {
+ }
+
+ public void release() {
+ }
+
+}