roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r398712 [7/32] - in /incubator/roller/trunk/src/org/apache: ./ roller/ roller/business/ roller/business/hibernate/ roller/business/referrers/ roller/business/runnable/ roller/business/search/ roller/business/search/operations/ roller/busine...
Date Mon, 01 May 2006 22:23:34 GMT
Added: incubator/roller/trunk/src/org/apache/roller/model/BookmarkManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/BookmarkManager.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/BookmarkManager.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/BookmarkManager.java Mon May  1 15:23:02 2006
@@ -0,0 +1,190 @@
+/*
+* 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.model;
+
+import java.util.List;
+import org.apache.roller.RollerException;
+import org.apache.roller.pojos.Assoc;
+import org.apache.roller.pojos.BookmarkData;
+import org.apache.roller.pojos.FolderData;
+import org.apache.roller.pojos.WebsiteData;
+
+
+/**
+ * Interface to Bookmark Management. Provides methods for retrieving, storing,
+ * moving, removing and querying for folders and bookmarks.
+ */
+public interface BookmarkManager {
+    
+    
+    public void saveBookmark(BookmarkData bookmark) throws RollerException;
+    
+    
+    /** 
+     * Delete bookmark. 
+     */
+    public void removeBookmark(BookmarkData bookmark) throws RollerException;
+    
+    /** 
+     * Retrieve bookmark by ID, a persistent instance. 
+     */
+    public BookmarkData getBookmark(String id) throws RollerException;
+    
+    
+    /**
+     * @param data
+     * @param subfolders
+     * @return
+     */
+    public List getBookmarks(FolderData data, boolean subfolders)
+            throws RollerException;
+    
+    
+    public void saveFolder(FolderData folder) throws RollerException;
+    
+    
+    public void removeFolder(FolderData folder) throws RollerException;
+    
+    
+    /** 
+     * Retrieve folder by ID, a persistent instance. 
+     */
+    public FolderData getFolder(String id) throws RollerException;
+    
+    
+    /** 
+     * Get all folders for a website.
+     *
+     * @param website Website.
+     */
+    public List getAllFolders(WebsiteData wd) throws RollerException;
+    
+    
+    /** 
+     * Get top level folders for a website.
+     *
+     * @param website Website.
+     */
+    public FolderData getRootFolder(WebsiteData website) throws RollerException;
+    
+    
+    /** 
+     * Get folder specified by website and folderPath.
+     *
+     * @param website Website of folder.
+     * @param folderPath Path of folder, relative to folder root.
+     */
+    public FolderData getFolder(WebsiteData website, String folderPath)
+            throws RollerException;
+    
+    /**
+     * Get absolute path to folder, appropriate for use by getFolderByPath().
+     *
+     * @param folder Folder.
+     * @return Forward slash separated path string.
+     */
+    public String getPath(FolderData folder) throws RollerException;
+    
+    
+    /**
+     * Get subfolder by path relative to specified folder.
+     *
+     * @param folder  Root of path or null to start at top of folder tree.
+     * @param path    Path of folder to be located.
+     * @param website Website of folders.
+     * @return FolderData specified by path or null if not found.
+     */
+    public FolderData getFolderByPath(WebsiteData wd, FolderData folder, String string)
+            throws RollerException;
+    
+    
+    /**
+     * Determine if folder is in use.  A folder is <em>in use</em> if it contains any bookmarks
+     * or has any children.
+     *
+     * @param folder
+     * @return true if the folder contains bookmarks or has children, false otherwise.
+     * @throws RollerException
+     */
+    public boolean isFolderInUse(FolderData folder) throws RollerException;
+    
+    
+    /**
+     * Check duplicate folder name.
+     */
+    public boolean isDuplicateFolderName(FolderData data) throws RollerException;
+    
+    
+    /**
+     * Determines if folder is descendent of folder.
+     */
+    public boolean isDescendentOf(FolderData data, FolderData ancestor) throws RollerException;
+    
+    
+    /**
+     */
+    public Assoc getFolderParentAssoc(FolderData data) throws RollerException;
+    
+    /**
+     */
+    public List getFolderChildAssocs(FolderData data) throws RollerException;
+    
+    /**
+     */
+    public List getAllFolderDecscendentAssocs(FolderData data) throws RollerException;
+    
+    /**
+     */
+    public List getFolderAncestorAssocs(FolderData data) throws RollerException;
+    
+    
+    /** 
+     * Import bookmarks from OPML string into specified folder.
+     *
+     * @param site Website.
+     * @param folder Name of folder to hold bookmarks.
+     * @param opml OPML data to be imported.
+     */
+    public void importBookmarks(WebsiteData site, String folder, String opml)
+            throws RollerException;
+    
+    
+    /** 
+     * Move contents of folder to another folder.
+     *
+     * @param src Source folder.
+     * @param dest Destination folder.
+     */
+    public void moveFolderContents(FolderData src, FolderData dest)
+            throws RollerException;
+    
+    
+    /**
+     * Delete contents of specified folder.
+     */
+    public void removeFolderContents(FolderData src) throws RollerException;
+    
+    
+    /**
+     * Release all resources associated with Roller session.
+     */
+    public void release();
+    
+}
+

Added: incubator/roller/trunk/src/org/apache/roller/model/ConfigManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/ConfigManager.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/ConfigManager.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/ConfigManager.java Mon May  1 15:23:02 2006
@@ -0,0 +1,34 @@
+/*
+* 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 Feb 4, 2004
 */
package org.apache.roller.model;

import org.apache.roller.RollerException;
import org.apache.roller.pojos.RollerConfigData;
import java.io.Serializable;

/**
+ * Manages Roller configuration
+ * @deprecated Replaced by {@link RollerProperties}.
+ */
public interface ConfigManager extends Serializable 
{
    /**
+     * Release all resources associated with Roller session.
+     */
    public void release();    /**
+     * Store
+     */
+

    public void storeRollerConfig( RollerConfigData data ) throws RollerException;
        /**
+     * Get single RollerConfig object in system.
+     * @deprecated 
+     */
+
    public RollerConfigData getRollerConfig() throws RollerException;
        /**
+     * Read RollerConfig from XML file.
+     */
+
    public RollerConfigData readFromFile(String filePath) throws RollerException;
}

Added: incubator/roller/trunk/src/org/apache/roller/model/FileManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/FileManager.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/FileManager.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/FileManager.java Mon May  1 15:23:02 2006
@@ -0,0 +1,73 @@
+/*
+* 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.model;
+
+import java.io.File;
+import java.io.InputStream;
+import java.io.Serializable;
+
+import org.apache.roller.RollerException;
+import org.apache.roller.pojos.WebsiteData;
+import org.apache.roller.util.RollerMessages;
+
+/**
+ * Interface for managing files uploaded to Roller.
+ *
+ * NOTE: this should probably be renamed "ResourceManager" or similar
+ * since the real jobe here is managing resources, not just files.  We should
+ * then extend this a bit more to include the notion of not only user uploaded
+ * resources, but also other resources the system stores, such as the blacklist.
+ *
+ * @author dave
+ */
+public interface FileManager extends Serializable 
+{
+    /** Determine if file can be saved in website's file space. */
+    public boolean canSave(
+        String weblogHandle, String name, long size, RollerMessages msgs) 
+        throws RollerException;
+    
+    /** Get website's files */
+    public File[] getFiles(String weblogHandle) 
+        throws RollerException;
+    
+    /** Delete specified file from website's file space. */
+    public void deleteFile(String weblogHandle, String name) 
+        throws RollerException;
+
+    /** Save file in website's file space or throw exception if rules violated. */
+    public void saveFile(String weblogHandle, String name, long size, InputStream is) 
+        throws RollerException;
+
+    /** Return true if weblog is over the file-upload limit */
+    public boolean overQuota(String weblogHandle) throws RollerException; 
+            
+    /**
+     * Get directory in which uploaded files are stored
+     */
+    public String getUploadDir();
+    /**
+     * Get base URL where uploaded files are made available.
+     */
+    public String getUploadUrl();
+    
+    /**
+     * Release all resources associated with Roller session.
+     */
+    public void release();
+}

Added: incubator/roller/trunk/src/org/apache/roller/model/IndexManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/IndexManager.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/IndexManager.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/IndexManager.java Mon May  1 15:23:02 2006
@@ -0,0 +1,61 @@
+/*
+* 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.model;
+
+import org.apache.roller.RollerException;
+import org.apache.roller.business.search.operations.IndexOperation;
+import org.apache.roller.pojos.UserData;
+import org.apache.roller.pojos.WeblogEntryData;
+import org.apache.roller.pojos.WebsiteData;
+
+/**
+ * Interface to Roller's Lucene-based search facility.
+ * @author Dave Johnson
+ */
+public interface IndexManager
+{
+    /** Does index need to be rebuild */
+    public abstract boolean isInconsistentAtStartup();
+    
+    /** Remove user from index, returns immediately and operates in background */
+    public void removeWebsiteIndex(WebsiteData website) throws RollerException;
+    
+    /** Remove entry from index, returns immediately and operates in background */
+    public void removeEntryIndexOperation(WeblogEntryData entry) throws RollerException;
+    
+    /** Add entry to index, returns immediately and operates in background */
+    public void addEntryIndexOperation(WeblogEntryData entry) throws RollerException;
+    
+    /** R-index entry, returns immediately and operates in background */
+    public void addEntryReIndexOperation(WeblogEntryData entry) throws RollerException;
+    
+    /** Execute operation immediately */
+    public abstract void executeIndexOperationNow(final IndexOperation op);
+    
+    /**
+     * Release all resources associated with Roller session.
+     */
+    public abstract void release();
+    
+    /** Shutdown to be called on application shutdown */
+    public abstract void shutdown();
+
+    public abstract void rebuildWebsiteIndex(WebsiteData website) throws RollerException;
+
+    public abstract void rebuildWebsiteIndex() throws RollerException;
+}
\ No newline at end of file

Added: incubator/roller/trunk/src/org/apache/roller/model/PagePlugin.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/PagePlugin.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/PagePlugin.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/PagePlugin.java Mon May  1 15:23:02 2006
@@ -0,0 +1,91 @@
+/*
+* 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 May 26, 2003
+ */
+package org.apache.roller.model;
+
+import org.apache.velocity.context.Context;
+import org.apache.roller.RollerException;
+import org.apache.roller.pojos.WeblogEntryData;
+import org.apache.roller.pojos.WebsiteData;
+
+/**
+ * Interface for Roller weblog entry page plugins, which can transform
+ * entry summary or text fields.
+ *
+ * @author David M Johnson
+ */
+public interface PagePlugin {
+    public String name = "PagePlugin";
+    
+    /**
+     * Plugins can this as an opportunity to add any required objects
+     * to the RollerRequest and the VelocityContext.
+     * @param website     Website being processed
+     * @param config      javax.servlet.ServletContext (or null if running outside webapp)
+     * @param baseURL     Base URL of Roller site 
+     * @param ctx         Plugins may place objects into the Velocity Context.
+     */
+    public void init(
+            WebsiteData website,
+            Object servletContext,
+            String baseURL,
+            Context ctx) throws RollerException;
+    
+    /**
+     * Apply plugin to summary or text string associated with entry.
+     * @param entry       Entry being rendered.
+     * @param str         String to which plugin should be applied.
+     * @param singleEntry Indicates rendering on single entry page.
+     * @return            Results of applying plugin to entry.
+     */
+    public String render(WeblogEntryData entry, String str);
+    
+    /**
+     * Apply plugin to summary or text specified in string.
+     * @param str String to which plugin should be applied.
+     * @param singleEntry Indicates rendering on single entry page.
+     * @return Results of applying plugin to string.
+     */
+    public String render(String str);
+    
+    /**
+     * Must implement toString(), returning the human-friendly
+     * name of this Plugin.  This is what users will see.
+     * @return The human-friendly name of this Plugin.
+     */
+    public String toString();
+    
+    /**
+     * Returns the human-friendly name of this Plugin.
+     * This is what users will see.
+     * @return The human-friendly name of this Plugin.
+     */
+    public String getName();
+    
+    /**
+     * Briefly describes the function of the Plugin. May
+     * contain HTML.
+     * @return A brief description of the Plugin.
+     */
+    public String getDescription();
+    
+    /** Returns true if this plugin should be skipped on single entry pages. */
+    public boolean getSkipOnSingleEntry();
+}

Added: incubator/roller/trunk/src/org/apache/roller/model/PagePluginManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/PagePluginManager.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/PagePluginManager.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/PagePluginManager.java Mon May  1 15:23:02 2006
@@ -0,0 +1,18 @@
+/*
+* 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 Nov. 26, 2005 */

package org.apache.roller.model;

import java.util.Map;
import java.io.Serializable;
import org.apache.velocity.context.Context;
import org.apache.roller.pojos.WeblogEntryData;
import org.apache.roller.pojos.WebsiteData;

/**
 * Manages Roller page plugins
 */
public interface PagePluginManager extends Serializable {
    
    /** 
     * Returns true if plugins are present 
     */
    public boolean hasPagePlugins();
    
    /**
     * Create and init plugins for processing entries in a specified website. 
     * @param website        Website being processed 
     * @param servletContext ServetContext or null if running outside webapp
     * @param contextURL     Absolute URL of webapp    
     * @param ctx            Velocity context 
     */
    public Map createAndInitPagePlugins(
            WebsiteData website,
            Object servletContext,
            String contextPath,
            Context ctx);
    
    /**
     * Accepts weblog
  entry, creates copy, applies plugins to copy and
     * returns the results.
     * @param entry       Original weblog entry
     * @param plugins     Map of plugins to apply
     * @param str         String to which to apply plugins
     * @param singleEntry Rendering for single entry page?
     * @return        Copy of weblog entry with plugins applied
     */
    public String applyPagePlugins(
       WeblogEntryData entry, Map pagePlugins, String str, boolean singleEntry);
    
    /** 
     * Release all resources associated with Roller session. 
     */
    public void release();      
}
\ No newline at end of file

Added: incubator/roller/trunk/src/org/apache/roller/model/PingQueueManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/PingQueueManager.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/PingQueueManager.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/PingQueueManager.java Mon May  1 15:23:02 2006
@@ -0,0 +1,86 @@
+/*
+ * 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.model;
+
+import java.util.List;
+import org.apache.roller.RollerException;
+import org.apache.roller.pojos.AutoPingData;
+import org.apache.roller.pojos.PingQueueEntryData;
+
+
+/**
+ * PingQueueManager.  This interface describes the manager for the weblog update ping request queue. The queue is
+ * processed by the <code>PingQueueProcesssor</code> and <code>PingQueueTask</code> components in the application
+ * layer.
+ */
+public interface PingQueueManager {
+    
+    
+    /**
+     * Add a new persistent entry to the queue.  If the queue already contains an entry for the ping target and website
+     * specified by this auto ping configuration, a new one will not be added.
+     *
+     * @param autoPing auto ping configuration for the ping request to be queued.
+     */
+    public void addQueueEntry(AutoPingData autoPing) throws RollerException;
+    
+    
+    /**
+     * Store the given queue entry.
+     *
+     * @param pingQueueEntry update the given queue entry
+     * @throws RollerException
+     */
+    public void saveQueueEntry(PingQueueEntryData pingQueueEntry) throws RollerException;
+    
+    
+    /**
+     * Remove a queue entry.
+     *
+     * @param pingQueueEntry the entry to be removed.
+     * @throws RollerException
+     */
+    public void removeQueueEntry(PingQueueEntryData pingQueueEntry) throws RollerException;
+    
+    
+    /**
+     * Retrieve an entry from the queue.
+     *
+     * @param id the unique id of the entry.
+     * @return the queue entry with the specified id.
+     * @throws RollerException
+     */
+    public PingQueueEntryData getQueueEntry(String id) throws RollerException;
+    
+    
+    /**
+     * Get all of the queue entries.
+     *
+     * @return the queue as a <code>List</code> of {@link PingQueueEntryData} objects.
+     * @throws RollerException
+     */
+    public List getAllQueueEntries() throws RollerException;
+    
+    
+    /**
+     * Release all resources associated with Roller session.
+     */
+    public void release();
+    
+}

Added: incubator/roller/trunk/src/org/apache/roller/model/PingTargetManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/PingTargetManager.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/PingTargetManager.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/PingTargetManager.java Mon May  1 15:23:02 2006
@@ -0,0 +1,131 @@
+/*
+ * 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.model;
+
+import java.util.List;
+import org.apache.roller.RollerException;
+import org.apache.roller.pojos.PingTargetData;
+import org.apache.roller.pojos.WebsiteData;
+
+
+/**
+ * Manages ping targets.
+ *
+ * @author <a href="mailto:anil@busybuddha.org">Anil Gangolli</a>
+ */
+public interface PingTargetManager {
+    
+    
+    /**
+     * Store a ping target.
+     *
+     * @param pingTarget ping target data object.
+     * @throws RollerException
+     */
+    public void savePingTarget(PingTargetData pingTarget) throws RollerException;
+    
+    
+    /**
+     * Remove a ping target.
+     *
+     * @param id id of the ping target to be removed
+     * @throws RollerException
+     */
+    public void removePingTarget(PingTargetData pingTarget) throws RollerException;
+    
+    
+    /**
+     * Remove all custom targets (regardless of website).
+     */
+    public void removeAllCustomPingTargets() throws RollerException;
+    
+    
+    /**
+     * Retrieve a specific ping target by id.
+     *
+     * @param id id of the ping target to be retrieved.
+     * @return the ping target whose id is specified.
+     * @throws RollerException
+     */
+    public PingTargetData getPingTarget(String id) throws RollerException;
+    
+    
+    /**
+     * Get a list of the common (shared) ping targets.
+     *
+     * @return the list of common ping targets as a <code>List</code> of {@link PingTargetData} objects
+     * @throws RollerException
+     */
+    public List getCommonPingTargets() throws RollerException;
+    
+    
+    /**
+     * Get a list of the custom ping targets for the given website.
+     *
+     * @param website the website whose custom targets should be returned.
+     * @return the list of custom ping targets for the given website as a <code>List</code> of {@link PingTargetData}
+     *         objects
+     * @throws RollerException
+     */
+    public List getCustomPingTargets(WebsiteData website) throws RollerException;
+    
+    
+    /**
+     * Check if the ping target has a name that is unique in the appropriate set.  If the ping target has no website id
+     * (is common), then this checks if the name is unique amongst common targets, and if custom then unique amongst
+     * custom targets. If the target has a non-null id, then it is allowed to have the same name as tha existing stored
+     * target with the same id.
+     *
+     * @param pingTarget
+     * @return true if the name is unique in the appropriate set (custom or common) ping targets.
+     * @throws RollerException
+     */
+    public boolean isNameUnique(PingTargetData pingTarget) throws RollerException;
+    
+    
+    /**
+     * Check if the url of the ping target is well-formed.  For this test, it must parse as a <code>java.net.URL</code>,
+     * with protocol <code>http</code> and a non-empty <code>host</code> portion.
+     *
+     * @param pingTarget
+     * @return true if the <code>pingUrl</code> property of the ping target is a well-formed url.
+     * @throws RollerException
+     */
+    public boolean isUrlWellFormed(PingTargetData pingTarget) throws RollerException;
+    
+    
+    /**
+     * Check if the host portion of the url of the ping target is known, meaning it is either a well-formed IP address
+     * or a hostname that resolves from the server.  The ping target url must parse as a <code>java.net.URL</code> in
+     * order for the hostname to be extracted for this test.  This will return false if that parsing fails.
+     *
+     * @param pingTarget
+     * @return true if the <code>pingUrl</code> (is well-formed and) the <code>host</code> portion of the url of the
+     *         ping target is a valid IP address or a hostname that can be resolved on the server.
+     * @throws RollerException
+     */
+    public boolean isHostnameKnown(PingTargetData pingTarget) throws RollerException;
+    
+    
+    /**
+     * Release all resources associated with Roller session.
+     */
+    public void release();
+    
+}

Added: incubator/roller/trunk/src/org/apache/roller/model/PlanetManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/PlanetManager.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/PlanetManager.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/PlanetManager.java Mon May  1 15:23:02 2006
@@ -0,0 +1,165 @@
+/*
+* 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.model;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.roller.RollerException;
+import org.apache.roller.pojos.PlanetConfigData;
+import org.apache.roller.pojos.PlanetEntryData;
+import org.apache.roller.pojos.PlanetGroupData;
+import org.apache.roller.pojos.PlanetSubscriptionData;
+
+/**
+ * Manages groups and subscriptions, can return aggregation for any group.
+ * @author David M Johnson
+ */
+public interface PlanetManager extends Serializable
+{
+    //------------------------------------------------------------------ create
+    
+    /**
+     * Save configration 
+     */
+    public void saveConfiguration(PlanetConfigData config) 
+        throws RollerException;
+    
+    /**
+     * Save new or update existing entry
+     */
+    public void saveEntry(PlanetEntryData entry) throws RollerException; 
+
+    /**
+     * Save new or update existing a group
+     */
+    public void saveGroup(PlanetGroupData sub) throws RollerException;
+    
+    /**
+     * Save or update a subscription
+     */
+    public void saveSubscription(PlanetSubscriptionData sub) 
+        throws RollerException;
+    
+    //---------------------------------------------------------------- retrieve    
+
+    /** 
+     * Get the one planet config object, config has default group 
+     */
+    public PlanetConfigData getConfiguration() throws RollerException;
+    
+    /** 
+     * Get handles for all defined groups 
+     */
+    public List getGroupHandles() throws RollerException;
+    
+    /** 
+     * Get list of group objects 
+     */
+    public List getGroups() throws RollerException;
+    
+    /** 
+     * Get group by handle, group has subscriptions
+     */
+    public PlanetGroupData getGroup(String handle) throws RollerException;
+    
+    /** 
+     * Get group by ID rather than handle.
+     */
+    public PlanetGroupData getGroupById(String id) throws RollerException;
+    
+    /**
+     * Get subscription by feedUrl.
+     */
+    public PlanetSubscriptionData getSubscription(String feedUrl) 
+        throws RollerException;
+
+    /**
+     * Get subscription by ID rather than feedUrl.
+     */
+    public PlanetSubscriptionData getSubscriptionById(String id) 
+        throws RollerException;
+    
+    /** 
+     * Get all subscriptions.
+     */
+    public Iterator getAllSubscriptions() throws RollerException;
+    
+    /**
+     * Get total number of subscriptions.
+     */
+    public int getSubscriptionCount() throws RollerException;
+    
+    /** 
+     * Get top X subscriptions.
+     */
+    public List getTopSubscriptions(int max) throws RollerException;
+
+    /** 
+     * Get top X subscriptions, restricted by group.
+     */
+    public List getTopSubscriptions( 
+        PlanetGroupData group, int max) throws RollerException;
+
+    //------------------------------------------------------------ aggregations
+    
+    /** 
+     * Get agggration for group from cache, enries in  
+     * reverse chonological order.
+     * Respects category constraints of group.
+     * @param group 
+     * @param maxEntries Maximum number of entries to return. 
+     */
+    public List getAggregation(
+        PlanetGroupData group, int maxEntries) throws RollerException;
+    
+    /** 
+     * Get agggration from cache, enries in reverse chonological order.
+     * @param maxEntries Maximum number of entries to return. 
+     */
+    public List getAggregation(int maxEntries) throws RollerException;
+    
+    //------------------------------------------------------------------ update
+    
+    /** Refresh entry data by fetching and parsing feeds. */
+    public void refreshEntries() throws RollerException;
+    
+    //------------------------------------------------------------------ delete
+    
+    /** Delete group and any subscriptions that are orphaned. */
+    public void deleteGroup(PlanetGroupData group) throws RollerException;
+    
+    /** Delete subscription, remove it from groups, cache, etc. */
+    public void deleteSubscription(PlanetSubscriptionData group) 
+        throws RollerException;
+    
+    /** Delete entry. */
+    public void deleteEntry(PlanetEntryData entry) throws RollerException;
+
+    /** Clear any aggregations and update times that have been cached */
+    public void clearCachedAggregations();
+    
+    /** Get last update time for entries most recent 'all' aggregation */
+    public Date getLastUpdated();
+    
+    /** Get last updated time for entries in a specify group */
+    public Date getLastUpdated(PlanetGroupData group);
+}
+

Added: incubator/roller/trunk/src/org/apache/roller/model/PropertiesManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/PropertiesManager.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/PropertiesManager.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/PropertiesManager.java Mon May  1 15:23:02 2006
@@ -0,0 +1,65 @@
+/*
+* 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.
+*/
+/*
+ * PropertiesManager.java
+ *
+ * Created on April 21, 2005, 10:34 AM
+ */
+
+package org.apache.roller.model;
+
+import java.util.Map;
+import org.apache.roller.RollerException;
+import org.apache.roller.pojos.RollerPropertyData;
+
+
+/**
+ * Manages global properties for Roller.
+ */
+public interface PropertiesManager {
+    
+    /**
+     * Release all resources associated with Roller session.
+     */
+    public void release();
+    
+    
+    /** 
+     * Save a single property 
+     */
+    public void saveProperty(RollerPropertyData property) throws RollerException;
+    
+    
+    /** 
+     * Save a list of properties 
+     */
+    public void saveProperties(Map properties) throws RollerException;
+    
+    
+    /** 
+     * Retrieve a single property by name 
+     */
+    public RollerPropertyData getProperty(String name) throws RollerException;
+    
+    
+    /** 
+     * Retrieve a list of all properties 
+     */
+    public Map getProperties() throws RollerException;
+    
+}

Added: incubator/roller/trunk/src/org/apache/roller/model/RefererManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/RefererManager.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/RefererManager.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/RefererManager.java Mon May  1 15:23:02 2006
@@ -0,0 +1,148 @@
+/*
+* 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.model;
+
+import java.util.List;
+import org.apache.roller.RollerException;
+import org.apache.roller.pojos.RefererData;
+import org.apache.roller.pojos.WebsiteData;
+
+
+/**
+ * Interface to Referer management.
+ */
+public interface RefererManager {
+    
+    
+    /**
+     * Store the referer.
+     */
+    public void saveReferer(RefererData referer) throws RollerException;
+    
+    
+    /**
+     * Remove a single referer.
+     */
+    public void removeReferer(RefererData referer) throws RollerException;
+    
+    
+    /**
+     * Clear referrer dayhits and remove referrers without excerpts.
+     */
+    public void clearReferrers() throws RollerException;
+    
+    
+    /**
+     * Clear referrer dayhits and remove referrers without excerpts.
+     */
+    public void clearReferrers(WebsiteData website) throws RollerException;
+    
+    
+    /**
+     * Retrieve referer by ID.
+     */
+    public RefererData getReferer(String id) throws RollerException;
+    
+    
+    /**
+     * Get all referers for specified weblog.
+     * @param weblog
+     * @return List of type RefererData
+     * @throws RollerException
+     */
+    public List getReferers(WebsiteData weblog) throws RollerException;
+    
+    
+    /**
+     * Get all referers for specified user that were made today.
+     * @param userName Name of user.
+     * @return List of type RefererData
+     * @throws RollerException
+     */
+    public List getTodaysReferers(WebsiteData website) throws RollerException;
+    
+    
+    /**
+     * Get referers for a specified date.
+     * @param userName Name of user.
+     * @param date YYYYMMDD format of day's date.
+     * @return List of type RefererData.
+     * @throws RollerException
+     */
+    public List getReferersToDate(WebsiteData website, String date) throws RollerException;
+    
+    
+    /**
+     * Get most popular websites based on referer day hits.
+     * @return List of WebsiteDisplayData objects.
+     */
+    public List getDaysPopularWebsites(int max) throws RollerException;
+    
+    
+    /**
+     * Get referers that refer to a specific weblog entry.
+     * @param entryid Weblog entry ID
+     * @return List of RefererData objects.
+     * @throws RollerException
+     */
+    public List getReferersToEntry(String entryid) throws RollerException;
+    
+    
+    /** 
+     * Get user's day hits 
+     */
+    public int getDayHits(WebsiteData website) throws RollerException;
+    
+    
+    /** 
+     * Get user's all-time total hits 
+     */
+    public int getTotalHits(WebsiteData website) throws RollerException;
+    
+    
+    /**
+     * Apply ignoreWord/spam filters to all referers in system.
+     */
+    public void applyRefererFilters() throws RollerException;
+    
+    
+    /**
+     * Apply ignoreWord/spam filters to all referers in website.
+     */
+    public void applyRefererFilters(WebsiteData website) throws RollerException;
+    
+    
+    /**
+     * Process an incoming referer.
+     */
+    public void processReferrer(
+            String requestUrl,
+            String referrerUrl,
+            String weblogHandle,
+            String weblogAnchor,
+            String weblogDateString);
+    
+    
+    /**
+     * Release all resources associated with Roller session.
+     */
+    public void release();
+    
+}
+

Added: incubator/roller/trunk/src/org/apache/roller/model/Roller.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/Roller.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/Roller.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/Roller.java Mon May  1 15:23:02 2006
@@ -0,0 +1,153 @@
+/*
+* 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.model;
+
+import java.io.Serializable;
+import java.sql.Connection;
+import org.apache.roller.RollerException;
+import org.apache.roller.business.referrers.ReferrerQueueManager;
+
+
+/** 
+ * The main entry point interface of the Roller business tier.
+ */
+public interface Roller {
+    
+    
+    /** 
+     * Get UserManager associated with this Roller instance.
+     */
+    public UserManager getUserManager() throws RollerException;
+    
+    
+    /** 
+     * Get BookmarkManager associated with this Roller instance.
+     */
+    public BookmarkManager getBookmarkManager() throws RollerException;
+    
+    
+    /** 
+     * Get WeblogManager associated with this Roller instance.
+     */
+    public WeblogManager getWeblogManager() throws RollerException;
+    
+    
+    /** 
+     * Get RefererManager associated with this Roller instance.
+     */
+    public RefererManager getRefererManager() throws RollerException;
+    
+    
+    /**
+     * Get ReferrerQueueManager.
+     */
+    public ReferrerQueueManager getReferrerQueueManager();
+    
+    
+    /** 
+     * Get RefererManager associated with this Roller instance.
+     */
+    public ConfigManager getConfigManager() throws RollerException;
+    
+    
+    /**
+     * Get the AutoPingManager associated with this Roller instance.
+     */
+    public AutoPingManager getAutopingManager() throws RollerException;
+    
+    
+    /**
+     * Get the PingTargetManager associated with this Roller instance.
+     */
+    public PingTargetManager getPingTargetManager() throws RollerException;
+    
+    
+    /**
+     * Get the PingQueueManager associated with this Roller instance.
+     */
+    public PingQueueManager getPingQueueManager() throws RollerException;
+    
+    
+    /** 
+     * Get PropertiesManager associated with this Roller instance.
+     */
+    public PropertiesManager getPropertiesManager() throws RollerException;
+    
+    
+    /** 
+     * Get FileManager associated with this Roller instance.
+     */
+    public FileManager getFileManager() throws RollerException;
+    
+    
+    /**
+     * Get ThreadManager associated with this Roller instance.
+     */
+    public ThreadManager getThreadManager() throws RollerException;
+    
+    
+    /**
+     * Get IndexManager associated with this Roller instance.
+     */
+    public IndexManager getIndexManager() throws RollerException;
+    
+    
+    /**
+     * Get PlanetManager associated with this Roller instance.
+     */
+    public PlanetManager getPlanetManager() throws RollerException;
+    
+    
+    /**
+     * Get ThemeManager associated with this Roller instance.
+     */
+    public ThemeManager getThemeManager() throws RollerException;
+    
+    
+    /**
+     * Get PagePluginManager associated with this Roller instance.
+     */
+    public PagePluginManager getPagePluginManager() throws RollerException;
+    
+    
+    /**
+     * Upgrade database if needed.
+     */
+    public void upgradeDatabase(Connection con) throws RollerException;
+    
+    
+    /**
+     * Flush object states.
+     */
+    public void flush() throws RollerException;
+    
+    
+    /**
+     * Release all resources associated with Roller session.
+     */
+    public void release();
+    
+    
+    /**
+     * Release all resources necessary for this instance of Roller.
+     */
+    public void shutdown();
+    
+}
+

Added: incubator/roller/trunk/src/org/apache/roller/model/RollerFactory.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/RollerFactory.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/RollerFactory.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/RollerFactory.java Mon May  1 15:23:02 2006
@@ -0,0 +1,150 @@
+/*
+* 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.model;
+
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.RollerException;
+import org.apache.roller.config.RollerConfig;
+import org.apache.roller.util.StringUtils;
+
+/**
+ * This is primarily a static holder for whatever Roller implementation is 
+ * being used. RollerContext should call setRoller(ServletContext) during its 
+ * initialization so that the Roller implementation can be instantiated. 
+ * Likewise, RollerContext.getRoller() should be replaced with calls to 
+ * RollerFactory.getRoller(). This should prevent us any direct ties to 
+ * Castor and permit for experimentation* with other persistence frameworks.
+ * 
+ * @author llavandowska
+ * @author Allen Gilliland
+ */
+public abstract class RollerFactory
+{
+    private static final String DEFAULT_IMPL = 
+        "org.apache.roller.business.hibernate.HibernateRollerImpl";
+    
+    private static Roller rollerInstance = null;
+
+    private static Log mLogger = 
+        LogFactory.getFactory().getInstance(RollerFactory.class);
+            
+    /**
+     * Let's just be doubling certain this class cannot be instantiated.
+     * @see java.lang.Object#Object()
+     */
+    private RollerFactory()
+    {
+        // hello all you beautiful people
+    }
+    
+    /**
+     * Static accessor for the instance of Roller
+     * held by this class.
+     * 
+     * @return Roller
+     */
+    public static Roller getRoller()
+    {
+        // check to see if we need to instantiate
+        if(rollerInstance == null) {
+            // lookup value for the roller classname to use
+            String roller_classname = 
+                    RollerConfig.getProperty("persistence.roller.classname");
+            
+            // now call setRoller ourselves
+            RollerFactory.setRoller(roller_classname);
+        }
+		
+        return rollerInstance;
+    }
+    
+    
+    /**
+     * Construct the actual Roller implemenation for this instance.
+     * 
+     * Use reflection to call the implementation's instantiate() method.
+     * Should this fail (either no implementation is specified or
+     * instantiate() throws an Exception) then the DEFAULT_IMPL will be tried.
+     * If this should fail then we are in trouble :/
+     *
+     * @param roller_classname The name of the Roller implementation class
+     * to instantiate.
+     */
+    public static void setRoller(String roller_classname)
+    {
+        
+        if (StringUtils.isEmpty( roller_classname ))
+            roller_classname = DEFAULT_IMPL;
+        
+        try
+        {
+            Class rollerClass = Class.forName(roller_classname);
+            java.lang.reflect.Method instanceMethod =
+                    rollerClass.getMethod("instantiate", (Class[])null);
+            
+            // do the invocation
+            rollerInstance = (Roller)
+                instanceMethod.invoke(rollerClass, (Object[])null);
+            
+            mLogger.info("Using Roller Impl: " + roller_classname);
+        }
+        catch (Exception e)
+        {
+            // uh oh
+            mLogger.error("Error instantiating " + roller_classname, e);
+            try
+            {
+                // if we didn't already try DEFAULT_IMPL then try it now
+                if( ! DEFAULT_IMPL.equals(roller_classname))
+                {
+                    mLogger.info("** Trying DEFAULT_IMPL "+DEFAULT_IMPL+" **");
+                    
+                    Class rollerClass = Class.forName(DEFAULT_IMPL);
+                    java.lang.reflect.Method instanceMethod =
+                            rollerClass.getMethod("instantiate", (Class[])null);
+                    
+                    // do the invocation
+                    rollerInstance = (Roller) 
+                        instanceMethod.invoke(rollerClass, (Object[])null);
+                }
+                else
+                {
+                    // we just do this so that the logger gets the message
+                    throw new Exception("Doh! Couldn't instantiate a roller class");
+                }
+                
+            }
+            catch (Exception re)
+            {
+                mLogger.fatal("Failed to instantiate fallback roller impl", re);
+            }
+        }
+        
+    }
+    
+	
+	/**
+	 * Set Roller to be returned by factory.
+	 */
+	public static void setRoller(Roller roller)
+	{
+		if (roller != null) rollerInstance = roller;
+	}
+}

Added: incubator/roller/trunk/src/org/apache/roller/model/ScheduledTask.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/ScheduledTask.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/ScheduledTask.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/ScheduledTask.java Mon May  1 15:23:02 2006
@@ -0,0 +1,32 @@
+/*
+* 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.model;
+
+import org.apache.roller.RollerException;
+
+/**
+ * Interface for pluggable scheduled task.
+ * @author David M Johnson
+ */
+public interface ScheduledTask
+{
+    /**
+     * Initialized scheduled task with Roller instance and real-path to Roller context.
+     */
+    public void init(Roller roller, String realPath) throws RollerException;
+}

Added: incubator/roller/trunk/src/org/apache/roller/model/ThemeManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/ThemeManager.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/ThemeManager.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/ThemeManager.java Mon May  1 15:23:02 2006
@@ -0,0 +1,118 @@
+/*
+* 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.
+*/
+/*
+ * ThemeManager.java
+ *
+ * Created on June 27, 2005, 12:49 PM
+ */
+
+package org.apache.roller.model;
+
+import java.util.List;
+import org.apache.roller.RollerException;
+import org.apache.roller.ThemeNotFoundException;
+import org.apache.roller.pojos.Theme;
+import org.apache.roller.pojos.ThemeTemplate;
+import org.apache.roller.pojos.WebsiteData;
+
+
+/**
+ * Manager interface for accessing Theme related objects.
+ *
+ * @author Allen Gilliland
+ */
+public interface ThemeManager {
+    
+    /**
+     * Get the Theme object with the given name.
+     *
+     * @throws ThemeNotFoundException If the named theme cannot be found.
+     * @throws RollerException If there is some kind of fatal backend error.
+     **/
+    public Theme getTheme(String name)
+        throws ThemeNotFoundException, RollerException;
+    
+    
+    /**
+     * Get the Theme object with the given theme id.
+     *
+     * @throws ThemeNotFoundException If the named theme cannot be found.
+     * @throws RollerException If there is some kind of fatal backend error.
+     */
+    public Theme getThemeById(String theme_id)
+        throws ThemeNotFoundException, RollerException;
+    
+    
+    /**
+     * Get a list of all available themes.
+     * This list is ordered alphabetically by default.
+     *
+     * NOTE: this only returns a list of theme names, not actual Theme objects.
+     **/
+    public List getThemesList();
+    
+    
+    /**
+     * Get a list of all theme names that are currently enabled.
+     * This list is ordered alphabetically by default.
+     *
+     * NOTE: this only returns a list of theme names, not actual Theme objects.
+     */
+    public List getEnabledThemesList();
+    
+    
+    /**
+     * Get the template from a given theme.
+     *
+     * @throws ThemeNotFoundException If the named theme cannot be found.
+     * @throws RollerException If there is some kind of fatal backend error.
+     */
+    public ThemeTemplate getTemplate(String theme_name, String template_name)
+        throws ThemeNotFoundException, RollerException;
+    
+    
+    /**
+     * Get the template from a given theme using the template id.
+     *
+     * Theme templates use a special id value when they come off the filesystem.
+     * When a theme is read off the filesystem it's templates are given an id
+     * like ... <theme name>:<template name>
+     *
+     * @throws ThemeNotFoundException If the named theme cannot be found.
+     * @throws RollerException If there is some kind of fatal backend error.
+     */
+    public ThemeTemplate getTemplateById(String template_id)
+        throws ThemeNotFoundException, RollerException;
+
+    
+    /**
+     * Get the template from a given theme using the template link value.
+     *
+     * Note that for themes we enforce the rule that 
+     *      Theme.name == Theme.link
+     *
+     * So doing a lookup by link is the same as doing a lookup by name.
+     *
+     * @throws ThemeNotFoundException If the named theme cannot be found.
+     * @throws RollerException If there is some kind of fatal backend error.
+     */
+    public ThemeTemplate getTemplateByLink(String theme_name, String template_link)
+        throws ThemeNotFoundException, RollerException;
+   
+    public void saveThemePages(WebsiteData website, Theme theme) throws RollerException;
+}

Added: incubator/roller/trunk/src/org/apache/roller/model/ThreadManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/ThreadManager.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/ThreadManager.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/ThreadManager.java Mon May  1 15:23:02 2006
@@ -0,0 +1,68 @@
+/*
+* 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.model;
+
+import java.util.TimerTask;
+import java.sql.Date;
+
+/**
+ * Thread management for executing scheduled and asynchronous tasks.
+ */
+public interface ThreadManager
+{
+    public static final long MIN_RATE_INTERVAL_MINS = 1;
+
+    /**
+     * Execute runnable in background (asynchronously).
+     * @param runnable 
+     * @throws java.lang.InterruptedException 
+     */
+    public void executeInBackground(Runnable runnable)
+            throws InterruptedException;
+
+    /**
+     * Execute runnable in foreground (synchronously).
+     */
+    public void executeInForeground(Runnable runnable)
+            throws InterruptedException;
+
+    /**
+     * Schedule task to run once a day.
+     */
+    public void scheduleDailyTimerTask(TimerTask task);
+
+    /**
+     * Schedule task to run once per hour.
+     */
+    public void scheduleHourlyTimerTask(TimerTask task);
+
+    /**
+     * Schedule task to run at fixed rate.
+     */
+    public void scheduleFixedRateTimerTask(TimerTask task, long delayMins, long periodMins);
+
+    /**
+     * Shutdown
+     */
+    public void shutdown();
+
+    /**
+     * Release all resources associated with Roller session.
+     */
+    public void release();
+}
\ No newline at end of file

Added: incubator/roller/trunk/src/org/apache/roller/model/UserManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/UserManager.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/UserManager.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/UserManager.java Mon May  1 15:23:02 2006
@@ -0,0 +1,261 @@
+/*
+* 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.model;
+
+import java.util.List;
+import org.apache.roller.RollerException;
+import org.apache.roller.pojos.WeblogTemplate;
+import org.apache.roller.pojos.PermissionsData;
+import org.apache.roller.pojos.UserData;
+import org.apache.roller.pojos.WebsiteData;
+
+
+/**
+ * Manages users, weblogs, permissions, and weblog pages.
+ */
+public interface UserManager {
+        
+    /**
+     * Add new user object to Roller. User will be given the global editor role,
+     * unless it's the first user, who will get the global admin role.
+     *
+     * @param user User object to be added, initialized with name, password, etc.
+     * @throws RollerException
+     */
+    public void addUser(UserData newUser) throws RollerException;
+    
+    
+    /**
+     * Store a single user.
+     */
+    public void saveUser(UserData data) throws RollerException;
+    
+    
+    public void removeUser(UserData user) throws RollerException;
+    
+    
+    public UserData getUser(String id)throws RollerException;
+    
+    
+    /** 
+     * Get user object by user name (only enabled users) 
+     */
+    public UserData getUserByUsername(String userName) throws RollerException;
+    
+    
+    /** 
+     * Get user object by user name, optionally include dis-enabled users 
+     */
+    public UserData getUserByUsername(String userName, Boolean enabled) throws RollerException;
+    
+    
+    /** 
+     * Get all enabled users 
+     */
+    public List getUsers() throws RollerException;
+    
+    
+    /**
+     * Get all users, optionally include dis-enabled users.
+     *
+     * @param enabled True for enabled only, false for disabled only, null for all
+     */
+    public List getUsers(Boolean enabled) throws RollerException;
+    
+    
+    /**
+     * Get all users or a website.
+     *
+     * @param website Get all users of this website (or null for all)
+     * @returns List of UserData objects.
+     */
+    public List getUsers(WebsiteData website, Boolean enabled) throws RollerException;
+    
+    
+    /**
+     * Returns users whose usernames or email addresses start with a string.
+     * @param startsWith String to match userNames and emailAddresses against
+     * @param offset     Offset into results (for paging)
+     * @param length     Max to return (for paging)
+     * @param enabled    True for only enalbed, false for disabled, null for all
+     * @return List of (up to length) users that match startsWith string
+     */
+    public List getUsersStartingWith(String startsWith,
+            int offset, int length, Boolean enabled) throws RollerException;
+    
+    
+    public void addWebsite(WebsiteData newWebsite) throws RollerException;
+    
+    
+    /**
+     * Store a single weblog.
+     */
+    public void saveWebsite(WebsiteData data) throws RollerException;
+    
+    
+    public void removeWebsite(WebsiteData website) throws RollerException;
+    
+    
+    public WebsiteData getWebsite(String id) throws RollerException;
+    
+    
+    /**
+     * Get website specified by handle (or null if enabled website not found).
+     *
+     * @param handle  Handle of website
+     */
+    public WebsiteData getWebsiteByHandle(String handle) throws RollerException;
+    
+    
+    /**
+     * Get website specified by handle with option to return only enabled websites.
+     *
+     * @param handle  Handle of website
+     */
+    public WebsiteData getWebsiteByHandle(String handle, Boolean enabled) throws RollerException;
+    
+    
+    /**
+     * Get all websites of which user is a member
+     *
+     * @param user    Get all websites for this user (or null for all)
+     * @param enabled Get all with this enabled state (or null or all)
+     * @param active  Get all with this active state (or null or all)
+     * @returns List of WebsiteData objects.
+     */
+    public List getWebsites(UserData user, Boolean enabled, Boolean active) throws RollerException;
+    
+    
+    public void savePermissions(PermissionsData perms) throws RollerException;
+    
+    
+    public void removePermissions(PermissionsData perms) throws RollerException;
+    
+    
+    public PermissionsData getPermissions(String id) throws RollerException;
+    
+    
+    /**
+     * Get pending permissions for user
+     *
+     * @param user User (not null)
+     * @returns List of PermissionsData objects.
+     */
+    public List getPendingPermissions(UserData user) throws RollerException;
+    
+    
+    /**
+     * Get pending permissions for website
+     *
+     * @param website Website (not null)
+     * @returns List of PermissionsData objects.
+     */
+    public List getPendingPermissions(WebsiteData user) throws RollerException;
+    
+    
+    /**
+     * Get permissions of user in website
+     *
+     * @param website Website (not null)
+     * @param user    User (not null)
+     * @return        PermissionsData object
+     */
+    public PermissionsData getPermissions(WebsiteData website, UserData user) throws RollerException;
+    
+    
+    /**
+     * Get all permissions in website
+     *
+     * @param website Website (not null)
+     * @return        PermissionsData object
+     */
+    public List getAllPermissions(WebsiteData website) throws RollerException;
+    
+    
+    /**
+     * Get all permissions of user
+     *
+     * @param user User (not null)
+     * @return     PermissionsData object
+     */
+    public List getAllPermissions(UserData user) throws RollerException;
+    
+    
+    /**
+     * Invite user to join a website with specific permissions
+     *
+     * @param website Website to be joined (persistent instance)
+     * @param user    User to be invited (persistent instance)
+     * @param perms   Permissions mask (see statics in PermissionsData)
+     * @return        New PermissionsData object, with pending=true
+     */
+    public PermissionsData inviteUser(WebsiteData website, UserData user, short perms) throws RollerException;
+    
+    
+    /**
+     * Retire user from a website
+     *
+     * @param website Website to be retired from (persistent instance)
+     * @param user    User to be retired (persistent instance)
+     */
+    public void retireUser(WebsiteData website, UserData user) throws RollerException;
+    
+    
+    /**
+     * Store page
+     */
+    public void savePage(WeblogTemplate data) throws RollerException;
+    
+    
+    /**
+     * Remove page
+     */
+    public void removePage(WeblogTemplate page) throws RollerException;
+    
+    
+    /**
+     * Get page by ID
+     */
+    public WeblogTemplate getPage(String id) throws RollerException;
+    
+    
+    /** 
+     * Get user's page by name 
+     */
+    public WeblogTemplate getPageByName(WebsiteData w, String p) throws RollerException;
+    
+    
+    /** 
+     * Get user's page by link 
+     */
+    public WeblogTemplate getPageByLink(WebsiteData w, String p) throws RollerException;
+    
+    
+    /** 
+     * Get users pages 
+     */
+    public List getPages(WebsiteData w) throws RollerException;
+    
+    
+    public void release();
+    
+}
+
+
+

Added: incubator/roller/trunk/src/org/apache/roller/model/WeblogManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/WeblogManager.java?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/WeblogManager.java (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/WeblogManager.java Mon May  1 15:23:02 2006
@@ -0,0 +1,394 @@
+/*
+* 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.model;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import org.apache.roller.RollerException;
+import org.apache.roller.pojos.Assoc;
+import org.apache.roller.pojos.CommentData;
+import org.apache.roller.pojos.WeblogCategoryAssoc;
+import org.apache.roller.pojos.WeblogCategoryData;
+import org.apache.roller.pojos.WeblogEntryData;
+import org.apache.roller.pojos.WebsiteData;
+
+
+/**
+ * Interface to weblog entry, category and comment management.
+ */
+public interface WeblogManager {
+    
+    public static final String CATEGORY_ATT = "category.att";
+       
+    public void saveWeblogEntry(WeblogEntryData entry) throws RollerException;
+        
+    public void removeWeblogEntry(WeblogEntryData entry) throws RollerException;
+    
+    
+    /**
+     * Get weblog entry by ID
+     */
+    public WeblogEntryData getWeblogEntry(String id) throws RollerException;
+    
+    
+    /** 
+     * Get weblog entry by anchor. 
+     */
+    public WeblogEntryData getWeblogEntryByAnchor(WebsiteData website, String anchor) 
+            throws RollerException;
+    
+    
+    /**
+     * Get WeblogEntries by offset/length as list in reverse chronological order.
+     * The range offset and list arguments enable paging through query results.
+     * @param userName   User name or null to get for all users.
+     * @param startDate  Start date or null for no start date.
+     * @param endDate    End date or null for no end date.
+     * @param catName    Category path or null for all categories.
+     * @param status     Status of DRAFT, PENDING, PUBLISHED or null for all
+     * @param sortby     Sort by either 'pubTime' or 'updateTime' (null for pubTime)
+     * @param offset     Index of first entry to include.
+     * @param length     Max number of entries to include.
+     * @return List of WeblogEntryData objects in reverse chrono order.
+     * @throws RollerException
+     */
+    public List getWeblogEntries(
+            WebsiteData website,
+            Date    startDate,
+            Date    endDate,
+            String  catName,
+            String  status,
+            String  sortBy,
+            int offset,
+            int range)
+            throws RollerException;
+    
+    
+    /**
+     * Get WeblogEntries up to limit as list in reverse chronological order.
+     * The range offset and list arguments enable paging through query results.
+     * @param userName   User name or null to get for all users.
+     * @param startDate  Start date or null for no start date.
+     * @param endDate    End date or null for no end date.
+     * @param catName    Category path or null for all categories.
+     * @param status     Status of DRAFT, PENDING, PUBLISHED or null for all
+     * @param sortby     Sort by either 'pubTime' or 'updateTime' (null for pubTime)
+     * @param offset     Index of first entry to include.
+     * @param maxEntries     Max number of entries to include.
+     * @return List of WeblogEntryData objects in reverse chrono order.
+     * @throws RollerException
+     */
+    public List getWeblogEntries(
+            WebsiteData website,
+            Date    startDate,
+            Date    endDate,
+            String  catName,
+            String  status,
+            String  sortBy,
+            Integer maxEntries)
+            throws RollerException;
+    
+    
+    /**
+     * Get Weblog Entries grouped by day. This method returns a Map that
+     * contains Lists, each List contains WeblogEntryData objects, and the
+     * Lists are keyed by Date objects.
+     * @param userName   User name or null to get for all users.
+     * @param startDate  Start date or null for no start date.
+     * @param endDate    End date or null for no end date.
+     * @param catName    Category path or null for all categories.
+     * @param status     Status of DRAFT, PENDING, PUBLISHED or null for all
+     * @param maxEntries Max entries or null for no limit.
+     * @return Map of Lists, keyed by Date, and containing WeblogEntryData.
+     * @throws RollerException
+     */
+    public Map getWeblogEntryObjectMap(
+            WebsiteData website,
+            Date    startDate,
+            Date    endDate,
+            String  catName,
+            String  status,
+            Integer maxEntries)
+            throws RollerException;
+    
+    
+    /**
+     * Get Weblog Entry date strings grouped by day. This method returns a Map
+     * that contains Lists, each List contains YYYYMMDD date strings objects,
+     * and the Lists are keyed by Date objects.
+     * @param userName   User name or null to get for all users.
+     * @param startDate  Start date or null for no start date.
+     * @param endDate    End date or null for no end date.
+     * @param catName    Category path or null for all categories.
+     * @param status     Status of DRAFT, PENDING, PUBLISHED or null for all
+     * @param maxEntries Max entries or null for no limit.
+     * @return Map of Lists, keyed by Date, and containing date strings.
+     * @throws RollerException
+     */
+    public Map getWeblogEntryStringMap(
+            WebsiteData website,
+            Date    startDate,
+            Date    endDate,
+            String  catName,
+            String  status,
+            Integer maxEntries)
+            throws RollerException;
+    
+    
+    /**
+     * Get weblog entries with given category or, optionally, any sub-category
+     * of that category.
+     * @param cat     Category.
+     * @param subcats True if sub-categories are to be fetched.
+     * @return        List of weblog entries in category.
+     */
+    public List getWeblogEntries(WeblogCategoryData cat, boolean subcats) 
+            throws RollerException;
+    
+    
+    /**
+     * Get the WeblogEntry following, chronologically, the current entry.
+     * Restrict by the Category, if named.
+     *
+     * @param current The "current" WeblogEntryData.
+     * @param catName The value of the requested Category Name.
+     * @return
+     */
+    public WeblogEntryData getNextEntry(WeblogEntryData current, String catName) 
+            throws RollerException;
+    
+    
+    /**
+     * Get the WeblogEntry prior to, chronologically, the current entry.
+     * Restrict by the Category, if named.
+     *
+     * @param current The "current" WeblogEntryData.
+     * @param catName The value of the requested Category Name.
+     * @return
+     */
+    public WeblogEntryData getPreviousEntry(WeblogEntryData current, 
+            String catName) throws RollerException;
+    
+    
+    /**
+     * Get entries next after current entry.
+     * @param entry Current entry.
+     * @param catName Only return entries in this category (if not null).
+     * @param maxEntries Maximum number of entries to return.
+     */
+    public List getNextEntries(WeblogEntryData entry, 
+            String catName, int maxEntries) throws RollerException;
+    
+    
+    /**
+     * Get entries previous to current entry.
+     * @param entry Current entry.
+     * @param catName Only return entries in this category (if not null).
+     * @param maxEntries Maximum number of entries to return.
+     */
+    public List getPreviousEntries(WeblogEntryData entry, 
+            String catName, int maxEntries) throws RollerException;
+    
+    
+    /**
+     * Get specified number of most recent pinned and published Weblog Entries.
+     * @param max Maximum number to return.
+     * @return Collection of WeblogEntryData objects.
+     */
+    public List getWeblogEntriesPinnedToMain(Integer max) throws RollerException;
+    
+    
+    /** Get time of last update for a weblog specified by username */
+    public Date getWeblogLastPublishTime(WebsiteData website) throws RollerException;
+    
+    
+    /**
+     * Gets returns most recent pubTime, optionally restricted by category.
+     * @param handle   Handle of website or null for all users
+     * @param catName  Category name of posts or null for all categories
+     * @return         Date Of last publish time
+     * @throws RollerException
+     */
+    public Date getWeblogLastPublishTime(WebsiteData website, String catName )
+            throws RollerException;
+    
+    
+    public void saveWeblogCategory(WeblogCategoryData cat) throws RollerException;
+    
+    
+    /**
+     * Recategorize all entries with one category to another.
+     * @param srcId
+     * @param destId
+     * @throws org.apache.roller.RollerException
+     */
+    public void moveWeblogCategoryContents(String srcId, String destId) 
+            throws RollerException;
+    
+    
+    public void removeWeblogCategory(WeblogCategoryData cat) throws RollerException;
+    
+    
+    /**
+     * Get category by ID
+     */
+    public WeblogCategoryData getWeblogCategory(String id) throws RollerException;
+    
+    
+    /**
+     * Get top level categories for a website.
+     * @param website Website.
+     */
+    public WeblogCategoryData getRootWeblogCategory(WebsiteData website) throws RollerException;
+    
+    
+    /**
+     * Get category specified by website and categoryPath.
+     * @param website      Website of WeblogCategory.
+     * @param categoryPath Path of WeblogCategory, relative to category root.
+     */
+    public WeblogCategoryData getWeblogCategoryByPath(WebsiteData website, 
+            String categoryPath) throws RollerException;
+    
+    /**
+     * Get sub-category by path relative to specified category.
+     * @param category  Root of path or null to start at top of category tree.
+     * @param path      Path of category to be located.
+     * @param website   Website of categories.
+     * @return          Category specified by path or null if not found.
+     */
+    public WeblogCategoryData getWeblogCategoryByPath(WebsiteData wd, 
+            WeblogCategoryData category, String string) throws RollerException;
+    
+    
+    /** Get WebLogCategory objects for a website. */
+    public List getWeblogCategories(WebsiteData website) throws RollerException;
+    
+    
+    /** Get WebLogCategory objects for a website. */
+    public List getWeblogCategories(WebsiteData website, boolean includeRoot)
+            throws RollerException;
+    
+    
+    /**
+     * Get absolute path to category, appropriate for use by getWeblogCategoryByPath().
+     * @param category WeblogCategoryData.
+     * @return         Forward slash separated path string.
+     */
+    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;
+    
+    
+    /**
+     * Get comment by ID
+     */
+    public CommentData getComment(String id) throws RollerException;
+    
+    
+    /**
+     * Generic comments query method
+     * @param website    Website or null for all comments on site
+     * @param entry      Entry or null to include all comments
+     * @param startDate  Start date or null for no restriction
+     * @param endDate    End date or null for no restriction
+     * @param pending    Pending flag value or null for no restriction
+     * @param pending    Approved flag value or null for no restriction
+     * @param reverseChrono True for results in reverse chrono order
+     * @param spam       Spam flag value or null for no restriction
+     * @param offset     Offset into results for paging
+     * @param length     Max comments to return (or -1 for no limit)
+     */
+    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;
+    
+    
+    /**
+     * Create unique anchor for weblog entry.
+     */
+    public String createAnchor(WeblogEntryData data) throws RollerException;
+    
+    
+    /**
+     * Check for duplicate category name.
+     */
+    public boolean isDuplicateWeblogCategoryName(WeblogCategoryData data)
+            throws RollerException;
+    
+    
+    /**
+     * Check if weblog category is in use.
+     */
+    public boolean isWeblogCategoryInUse(WeblogCategoryData data)
+            throws RollerException;
+    
+    
+    /**
+     * Returns true if ancestor is truly an ancestor of child.
+     */
+    public boolean isDescendentOf(WeblogCategoryData child, 
+            WeblogCategoryData ancestor) throws RollerException;
+    
+    
+    /**
+     * Get the URL of a website.
+     * @param website    The website
+     * @param contextUrl The context url, this is prepended and can be absolute
+     *                   or relative depending on what is desired.
+     * @return The url of the user's weblog
+     */
+    public String getUrl(WebsiteData website, String contextUrl) throws RollerException;
+    
+    /**
+     * Apply comment default settings from website to all of website's entries.
+     */
+    public void applyCommentDefaultsToEntries(WebsiteData website) throws RollerException;
+    
+    /**
+     * Release all resources associated with Roller session.
+     */
+    public void release();
+    
+}

Added: incubator/roller/trunk/src/org/apache/roller/model/package.html
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/package.html?rev=398712&view=auto
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/model/package.html (added)
+++ incubator/roller/trunk/src/org/apache/roller/model/package.html Mon May  1 15:23:02 2006
@@ -0,0 +1,29 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <title></title>
+</head>
+<body>
+Interfaces and classes that defne the Roller business layer.
+<p />
+<img src="roller-services.png" alt="diagram of Roller and service managers" />
+
+</body>
+</html>

Added: incubator/roller/trunk/src/org/apache/roller/model/roller-services.png
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/model/roller-services.png?rev=398712&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/roller/trunk/src/org/apache/roller/model/roller-services.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Mime
View raw message