Author: agilliland
Date: Sat Apr 8 15:34:18 2006
New Revision: 392616
URL: http://svn.apache.org/viewcvs?rev=392616&view=rev
Log:
first batch of backend refactorings.
- removed transaction methods from Roller IF
- remove RoleData CRUD from UserManager
- added various store/remove CRUD to UserManager IF
- added a few store methods to WeblogManager IF
- added a store method to RefererManager IF
Modified:
incubator/roller/branches/roller-newbackend/src/org/roller/model/RefererManager.java
incubator/roller/branches/roller-newbackend/src/org/roller/model/Roller.java
incubator/roller/branches/roller-newbackend/src/org/roller/model/UserManager.java
incubator/roller/branches/roller-newbackend/src/org/roller/model/WeblogManager.java
Modified:
incubator/roller/branches/roller-newbackend/src/org/roller/model/RefererManager.java
URL:
http://svn.apache.org/viewcvs/incubator/roller/branches/roller-newbackend/src/org/roller/model/RefererManager.java?rev=392616&r1=392615&r2=392616&view=diff
==============================================================================
---
incubator/roller/branches/roller-newbackend/src/org/roller/model/RefererManager.java
(original)
+++
incubator/roller/branches/roller-newbackend/src/org/roller/model/RefererManager.java
Sat Apr 8 15:34:18 2006
@@ -125,6 +125,11 @@
public void removeReferer( String id ) throws RollerException;
/**
+ * Store the referer.
+ */
+ public void storeReferer(RefererData referer) throws RollerException;
+
+ /**
* Release all resources associated with Roller session.
*/
public void release();
Modified:
incubator/roller/branches/roller-newbackend/src/org/roller/model/Roller.java
URL:
http://svn.apache.org/viewcvs/incubator/roller/branches/roller-newbackend/src/org/roller/model/Roller.java?rev=392616&r1=392615&r2=392616&view=diff
==============================================================================
---
incubator/roller/branches/roller-newbackend/src/org/roller/model/Roller.java
(original)
+++
incubator/roller/branches/roller-newbackend/src/org/roller/model/Roller.java
Sat Apr 8 15:34:18 2006
@@ -4,9 +4,7 @@
import java.io.Serializable;
import java.sql.Connection;
import org.roller.RollerException;
-import org.roller.business.PersistenceStrategy;
import org.roller.business.referrers.ReferrerQueueManager;
-import org.roller.pojos.UserData;
/**
@@ -16,164 +14,125 @@
*/
public interface Roller extends Serializable {
+
/**
* Get UserManager associated with this Roller instance.
- *
- * @return UserManager associated with this Roller instance.
- * @throws RollerException If unable to create or return UserManager.
*/
public UserManager getUserManager() throws RollerException;
+
/**
* Get BookmarkManager associated with this Roller instance.
- *
- * @return BookmarkManager associated with this Roller instance.
- * @throws RollerException If unable to create or return BookmarkManager.
*/
public BookmarkManager getBookmarkManager() throws RollerException;
+
/**
* Get WeblogManager associated with this Roller instance.
- *
- * @return WeblogManager associated with this Roller instance.
- * @throws RollerException If unable to create or return WeblogManager.
*/
public WeblogManager getWeblogManager() throws RollerException;
+
/**
* Get RefererManager associated with this Roller instance.
- *
- * @return RefererManager associated with this Roller instance.
- * @throws RollerException If unable to create or return RefererManager.
*/
public RefererManager getRefererManager() throws RollerException;
+
/**
* Get ReferrerQueueManager.
*/
public ReferrerQueueManager getReferrerQueueManager();
+
/**
* Get RefererManager associated with this Roller instance.
- *
- * @return RefererManager associated with this Roller instance.
- * @throws RollerException If unable to create or return RefererManager.
*/
public ConfigManager getConfigManager() throws RollerException;
+
/**
* Get the AutoPingManager associated with this Roller instance.
- *
- * @return the AutoPingManager associated with this Roller instance.
- * @throws RollerException
*/
public AutoPingManager getAutopingManager() throws RollerException;
+
/**
* Get the PingTargetManager associated with this Roller instance.
- *
- * @return the PingTargetManager associated with this Roller instance.
- * @throws RollerException
*/
public PingTargetManager getPingTargetManager() throws RollerException;
+
/**
* Get the PingQueueManager associated with this Roller instance.
- *
- * @return the PingQueueManager associated with this Roller instance.
- * @throws RollerException
*/
public PingQueueManager getPingQueueManager() throws RollerException;
- /** Get PropertiesManager associated with this Roller instance.
- * @return PropertiesManager associated with this Roller instance.
- * @throws RollerException If unable to create or return PropertiesManager.
+
+ /**
+ * Get PropertiesManager associated with this Roller instance.
*/
public PropertiesManager getPropertiesManager() throws RollerException;
+
/**
* Get FileManager associated with this Roller instance.
- *
- * @return FileManager associated with this Roller instance.
- * @throws RollerException If unable to create or return FileManager.
*/
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;
+
/**
- * Begin transaction for a thread.
- */
- public void begin() throws RollerException;
-
- /**
- * Start Roller session on behalf of specified user.
+ * Commit transaction for a thread.
*/
- public void begin(UserData user) throws RollerException;
+ public void commit() throws RollerException;
- /**
- * Set user for Roller session.
- */
- public void setUser(UserData user) throws RollerException;
/**
- * Get user associated with Roller session.
+ * Upgrade database if needed.
*/
- public UserData getUser() throws RollerException;
+ public void upgradeDatabase(Connection con) throws RollerException;
- /**
- * Commit transaction for a thread.
- *
- * @throws RollerException If database error is thrown.
- */
- public void commit() throws RollerException;
-
- /**
- * Rollback uncommitted changes for a thread.
- */
- public void rollback();
/**
* Release all resources associated with Roller session.
*/
public void release();
- /**
- * Get persistence strategy used by managers and POJOs.
- */
- public PersistenceStrategy getPersistenceStrategy();
-
- /**
- * Upgrade database if needed.
- */
- public void upgradeDatabase(Connection con) throws RollerException;
/**
* Release all resources necessary for this instance of Roller.
*/
public void shutdown();
+
}
Modified:
incubator/roller/branches/roller-newbackend/src/org/roller/model/UserManager.java
URL:
http://svn.apache.org/viewcvs/incubator/roller/branches/roller-newbackend/src/org/roller/model/UserManager.java?rev=392616&r1=392615&r2=392616&view=diff
==============================================================================
---
incubator/roller/branches/roller-newbackend/src/org/roller/model/UserManager.java
(original)
+++
incubator/roller/branches/roller-newbackend/src/org/roller/model/UserManager.java
Sat Apr 8 15:34:18 2006
@@ -15,29 +15,28 @@
/**
* Manages storage, retrieval, and querying of user, website, and page data.
- *
+ *
* @author David M Johnson
*/
/**
* @author dave
*/
-public interface UserManager extends Serializable
-{
- /**
+public interface UserManager extends Serializable {
+ /**
* Get user by name
* @param name Username of user
*/
//public UserData getUserByName(String name);
-
+
/**
* 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;
+ public List getUsers(WebsiteData website, 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)
@@ -45,16 +44,23 @@
* @returns List of WebsiteData objects.
*/
public List getWebsites(UserData user, Boolean enabled, Boolean active)
- throws RollerException;
-
- /**
+ throws RollerException;
+
+
+ public void storePermissions(PermissionsData perms) throws RollerException;
+
+
+ public void removePermissions(PermissionsData perms) 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.
@@ -86,27 +92,31 @@
public List getAllPermissions(
UserData user) throws RollerException;
- public PermissionsData retrievePermissions(String inviteId)
- throws RollerException;
-
+ public PermissionsData retrievePermissions(String inviteId)
+ throws RollerException;
+
/**
* Invite user to join a website with specific permissions
- * @param website Website to be joined (persistent instance)
+ * @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 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;
-
+
+
+ public void removeUser(UserData user) throws RollerException;
+
+
/** Release any resources used */
public void release();
@@ -115,27 +125,31 @@
/** 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;
-
+ public List getUsers(Boolean enabled) throws RollerException;
+
/** Get user object by user name (only enabled users) */
public UserData getUser( String userName ) throws RollerException;
-
- /** Get user object by user name, optionally include dis-enabled users
*/
- public UserData getUser( String userName, Boolean enabled ) throws
RollerException;
-
-
+
+ /** Get user object by user name, optionally include dis-enabled users */
+ public UserData getUser( String userName, Boolean enabled ) throws
RollerException;
+
+
/**
- * Add new user object to Roller. User will be given the global editor
role,
+ * 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 user) throws RollerException;
-
+
+
+ public void createWebsite(WebsiteData newWebsite) throws RollerException;
+
+
/**
* Create a fresh new website.
* @param ud User creating website
@@ -150,75 +164,59 @@
* @throws RollerException
*/
public WebsiteData createWebsite(
- UserData ud,
- Map pages,
+ UserData ud,
+ Map pages,
String handle,
- String name,
+ String name,
String description,
String email,
- String theme,
- String locale,
+ String theme,
+ String locale,
String timeZone) throws RollerException;
-
+
public UserData retrieveUser(String id)throws RollerException;
/**
* Store user.
*/
public void storeUser( UserData data ) throws RollerException;
-
- /**
- * Get all user roles.
- */
- public List getUserRoles(UserData user) throws RollerException;
- /**
- * Get role by ID
- */
- public RoleData retrieveRole(String id) throws RollerException;
- /**
- * Store role.
- */
- public void storeRole( RoleData data ) throws RollerException;
- /**
- * Remove role by ID.
- */
- public void removeRole( String id ) throws RollerException;
-
+
+
//------------------------------------------------------------ WebsiteData
- /**
+ /**
* Get website specified by handle (or null if enabled website not found).
* @param handle Handle of website
*/
- public WebsiteData getWebsiteByHandle(String handle)
- throws RollerException;
-
- /**
+ 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;
-
+ public WebsiteData getWebsiteByHandle(String handle, Boolean enabled)
+ throws RollerException;
+
public WebsiteData retrieveWebsite(String id) throws RollerException;
/**
* Store website
*/
public void storeWebsite(WebsiteData data) throws RollerException;
-
+
//---------------------------------------------------------------
WeblogTemplate
/** 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;
-
+
/** Fix page link using page name */
public String fixPageLink(WeblogTemplate data) throws RollerException;
-
+
/** Get users pages */
public List getPages(WebsiteData w) throws RollerException;
-
+
/**
* Get page by ID
*/
@@ -231,29 +229,33 @@
* Remove page by ID
*/
public void removePage(String id) throws RollerException;
-
-
+
+
/**
- * Remove page safely. This will throw an exception on attempts to remove
+ * Remove page safely. This will throw an exception on attempts to remove
* mandatory website pages such as the
* website's default page.
* @param id id of the page to be removed
- * @throws RollerException with root cause
<code>IllegalArgumentException</code>
+ * @throws RollerException with root cause
<code>IllegalArgumentException</code>
* if the page id is that of
* a page that will not be removed by this method.
*/
public void removePageSafely(String id) throws RollerException;
-
- /**
- * Retrieve the Page in read-only mode (does hibernate support this?).
- */
- public WeblogTemplate retrievePageReadOnly(String id) throws
RollerException;
-
+
+ /**
+ * Retrieve the Page in read-only mode (does hibernate support this?).
+ */
+ public WeblogTemplate retrievePageReadOnly(String id) throws
RollerException;
+
+
+ public void removeWebsite(WebsiteData website) throws RollerException;
+
+
/**
* Remove contents of website.
*/
- public void removeWebsiteContents(WebsiteData data) throws RollerException;
-
+ //public void removeWebsiteContents(WebsiteData data) throws
RollerException;
+
/**
* Returns users whose usernames or email addresses start with a string.
* @param startsWith String to match userNames and emailAddresses against
@@ -262,7 +264,7 @@
* @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,
+ public List getUsersStartingWith(String startsWith,
int offset, int length, Boolean enabled) throws RollerException;
}
Modified:
incubator/roller/branches/roller-newbackend/src/org/roller/model/WeblogManager.java
URL:
http://svn.apache.org/viewcvs/incubator/roller/branches/roller-newbackend/src/org/roller/model/WeblogManager.java?rev=392616&r1=392615&r2=392616&view=diff
==============================================================================
---
incubator/roller/branches/roller-newbackend/src/org/roller/model/WeblogManager.java
(original)
+++
incubator/roller/branches/roller-newbackend/src/org/roller/model/WeblogManager.java
Sat Apr 8 15:34:18 2006
@@ -46,6 +46,10 @@
public WeblogCategoryData retrieveWeblogCategory(String id)
throws RollerException;
+
+ public void storeWeblogEntry(WeblogEntryData entry) throws RollerException;
+
+
/**
* Recategorize all entries with one category to another.
* @param srcId
@@ -57,6 +61,10 @@
//--------------------------------------------- WeblogCategoryData Queries
+
+ public void storeWeblogCategory(WeblogCategoryData cat) throws
RollerException;
+
+
/** Get WebLogCategory objects for a website. */
public List getWeblogCategories(WebsiteData website)
throws RollerException;
@@ -138,6 +146,8 @@
public void removeComments(String[] ids)
throws RollerException;
+ public void saveComment(CommentData comment) throws RollerException;
+
/**
* Remove all comments of entry specified by ID
*/