Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.database
Class DbDraftManager

java.lang.Object
  extended by com.jivesoftware.forum.database.DbDraftManager
All Implemented Interfaces:
PollListener, JiveManager, DraftManager, AnnouncementListener, CategoryListener, ForumListener, MessageListener

public class DbDraftManager
extends java.lang.Object
implements DraftManager, JiveManager, CategoryListener, ForumListener, MessageListener, AnnouncementListener, PollListener

Database implementation of the DraftManager interface.


Method Summary
 void announcementCreated(AnnouncementEvent event)
          Fired when an announcement has been added to the system.
 void announcementDeleted(AnnouncementEvent event)
          Fired when an announcement is about to be deleted from the system.
 void announcementModified(AnnouncementEvent event)
          Fired when portions of an announcement have been modified.
 void anonymousVoteAdded(PollEvent event)
          Fired when an anonymous vote is added to a poll.
 void anonymousVoteModified(PollEvent event)
          Fired when an anonymous poll vote is modified.
 void anonymousVoteRemoved(PollEvent event)
          Fired when an anonymous poll vote is removed.
 void categoryAdded(CategoryEvent event)
          Fired when a category has been added to the system.
 void categoryDeleted(CategoryEvent event)
          Fired when a category is about to be deleted from the system.
 void categoryModified(CategoryEvent event)
          Fired when a category has been modified.
 void categoryMoved(CategoryEvent event)
          Fired when a category has been moved from one category to another.
 Draft createDraft(Draft draft)
          Creates a new draft.
 void deleteDraft(Draft draft)
          Delete an existing draft.
 void destroy()
          Notifies the manager to release any resources that may be holding on too.
 void forumAdded(ForumEvent event)
          Fired when a forum has been added to the system.
 void forumDeleted(ForumEvent event)
          Fired when a forum is about to be deleted from the system.
 void forumMerged(ForumEvent event)
          Fired when a forum is merged into another forum.
 void forumModified(ForumEvent event)
          Fired when a forum is modified.
 void forumMoved(ForumEvent event)
          Fired when a forum has been moved from one category to another.
 int getAutosaveInterval()
          Returns the setting for the number of seconds between autosave invocations when autosave is enabled for a text field.
 Draft getDraft(long draftID)
          Returns a draft by draft ID or null if no draft exists with the specified draftID.
 Draft getDraft(long userID, int draftType, int objectType, long objectID)
          Returns the draft for a particular user associated with a particular forum, thread and / or message.
 java.util.Iterator getDraftsByObjectID(int objectType, long objectID)
           
 java.util.Iterator getDraftsByUser(long userid)
          Returns all drafts for a particular user.
static DbDraftManager getInstance()
           
 void initialize()
          Initialize the manager.
 boolean isAutosaveEnabled()
          Determines whether or not the system has been configured to allow for autosave in text fields.
 void messageAdded(MessageEvent event)
          Fired when a message has been added to the system.
 void messageDeleted(MessageEvent event)
          Fired when a message is about to be deleted from the system.
 void messageModerationModified(MessageEvent event)
          Fired when the moderation value of a message has been changed.
 void messageModified(MessageEvent event)
          Fired when portions of a message have been modified.
 void messageMoved(MessageEvent event)
          Fired when a message is moved to another thread.
 void messageRated(MessageEvent event)
          Fired when a message has been rated.
 void pollCreated(PollEvent event)
          Fired when a poll is created.
 void pollDeleted(PollEvent event)
          Fired when a poll is deleted.
 void setAutosaveEnabled(boolean enable)
          Enables or disables autosave.
 void setAutosaveInterval(int interval)
          Sets the amount of time (in seconds) that the browser should wait between updating the draft.
 void updateDraft(Draft draft)
          Update an existing draft.
 void voteAdded(PollEvent event)
          Fired when a vote is added to a poll.
 void voteModified(PollEvent event)
          Fired when a poll vote is modified.
 void voteRemoved(PollEvent event)
          Fired when a poll vote is removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DbDraftManager getInstance()

initialize

public void initialize()
Description copied from interface: JiveManager
Initialize the manager. It is within this method that it is ok to create, access and/or otherwise use external classes (including caches). Until this method is called implementation should not access any external classes that could possibly either access one of the main Factory classes or any caches since doing so can cause deadlocks and possible clustering issues during startup.

This method is used internally by Jive during application startup and should not be called during normal usage of the class.

Specified by:
initialize in interface JiveManager

destroy

public void destroy()
Description copied from interface: JiveManager
Notifies the manager to release any resources that may be holding on too. This could also be used to clear out the managers caches, etc.

This method is used internally by Jive during application startup and should not be called during normal usage of the class.

Specified by:
destroy in interface JiveManager

createDraft

public Draft createDraft(Draft draft)
                  throws UnauthorizedException
Description copied from interface: DraftManager
Creates a new draft. If a draft already exists with the userid / drafttype / forumid / threadid / messageid combination, then the method will return the existing draft and will not create a new draft.

Specified by:
createDraft in interface DraftManager
Parameters:
draft - a Draft
Returns:
a new Draft or an existing Draft that matches the given forumid / threadid / messageid.
Throws:
UnauthorizedException

getDraft

public Draft getDraft(long draftID)
Description copied from interface: DraftManager
Returns a draft by draft ID or null if no draft exists with the specified draftID.

Specified by:
getDraft in interface DraftManager
Parameters:
draftID - the ID of the draft to return.
Returns:
the draft or null if no draft exists with the specified draftID.

getDraftsByObjectID

public java.util.Iterator getDraftsByObjectID(int objectType,
                                              long objectID)

getDraftsByUser

public java.util.Iterator getDraftsByUser(long userid)
Description copied from interface: DraftManager
Returns all drafts for a particular user.

Specified by:
getDraftsByUser in interface DraftManager
Parameters:
userid - the id of the user
Returns:
iterator of all available drafts

getDraft

public Draft getDraft(long userID,
                      int draftType,
                      int objectType,
                      long objectID)
Description copied from interface: DraftManager
Returns the draft for a particular user associated with a particular forum, thread and / or message. Used on thread posting page to determine whether or not the user has a draft already started for a particular forum/thread/message. If no draft is found, the method returns null.

Specified by:
getDraft in interface DraftManager
Parameters:
userID - the user to find draft for
draftType - the draft type to filter the results by
objectType - the type of container to filter by
objectID - the id of a specific container to filter by
Returns:
Draft the draft, if any, that matches the search

updateDraft

public void updateDraft(Draft draft)
                 throws UnauthorizedException
Description copied from interface: DraftManager
Update an existing draft. Automatically saves an updated modification date on the draft.

Specified by:
updateDraft in interface DraftManager
Parameters:
draft - The draft to be updated.
Throws:
UnauthorizedException - if the user associated with the draft is not either a system admin or the owner of the draft.

deleteDraft

public void deleteDraft(Draft draft)
Description copied from interface: DraftManager
Delete an existing draft.

Specified by:
deleteDraft in interface DraftManager
Parameters:
draft - The draft to be deleted.

isAutosaveEnabled

public boolean isAutosaveEnabled()
Description copied from interface: DraftManager
Determines whether or not the system has been configured to allow for autosave in text fields. By default, the system is configured to allow autosave. The value can be changed by modifying the 'draft.autosave.enabled' Jive property or via the admin console by using the Autosave Settings option or programatically using the setAutosaveEnabled() method.

Specified by:
isAutosaveEnabled in interface DraftManager
Returns:
true if the system has been configured to allow autosave (default) or false if the system has been configured to disallow autosave.

getAutosaveInterval

public int getAutosaveInterval()
Description copied from interface: DraftManager
Returns the setting for the number of seconds between autosave invocations when autosave is enabled for a text field. By default the value is 30. The value can be changed by modifying the 'draft.autosave.interval' Jive property via the admin console.

Specified by:
getAutosaveInterval in interface DraftManager
Returns:
interval the number of seconds between autosave invocations

setAutosaveEnabled

public void setAutosaveEnabled(boolean enable)
Description copied from interface: DraftManager
Enables or disables autosave.

Specified by:
setAutosaveEnabled in interface DraftManager

setAutosaveInterval

public void setAutosaveInterval(int interval)
Description copied from interface: DraftManager
Sets the amount of time (in seconds) that the browser should wait between updating the draft.

Specified by:
setAutosaveInterval in interface DraftManager

categoryAdded

public void categoryAdded(CategoryEvent event)
Description copied from interface: CategoryListener
Fired when a category has been added to the system.

Specified by:
categoryAdded in interface CategoryListener
Parameters:
event - the event object.

categoryDeleted

public void categoryDeleted(CategoryEvent event)
Description copied from interface: CategoryListener
Fired when a category is about to be deleted from the system. Because various code pieces may depend on this event for performing cleanup tasks, it's guaranteed that this method will be called before the category is deleted from the database.

Specified by:
categoryDeleted in interface CategoryListener
Parameters:
event - the event object.

categoryMoved

public void categoryMoved(CategoryEvent event)
Description copied from interface: CategoryListener
Fired when a category has been moved from one category to another.

Specified by:
categoryMoved in interface CategoryListener
Parameters:
event - the event object.

categoryModified

public void categoryModified(CategoryEvent event)
Description copied from interface: CategoryListener
Fired when a category has been modified.

Specified by:
categoryModified in interface CategoryListener
Parameters:
event - the event object.

forumAdded

public void forumAdded(ForumEvent event)
Description copied from interface: ForumListener
Fired when a forum has been added to the system.

Specified by:
forumAdded in interface ForumListener
Parameters:
event - the event object.

forumDeleted

public void forumDeleted(ForumEvent event)
Description copied from interface: ForumListener
Fired when a forum is about to be deleted from the system. This event will be fired when an individual forum is deleted or when the forum's category is deleted. Because various code pieces may depend on this event for performing cleanup tasks, it's guaranteed that this method will be called before the forum is deleted from the database.

Specified by:
forumDeleted in interface ForumListener
Parameters:
event - the event object.

forumModified

public void forumModified(ForumEvent event)
Description copied from interface: ForumListener
Fired when a forum is modified.

Specified by:
forumModified in interface ForumListener
Parameters:
event - the event object.

forumMoved

public void forumMoved(ForumEvent event)
Description copied from interface: ForumListener
Fired when a forum has been moved from one category to another.

Specified by:
forumMoved in interface ForumListener
Parameters:
event - the event object.

forumMerged

public void forumMerged(ForumEvent event)
Description copied from interface: ForumListener
Fired when a forum is merged into another forum.

Specified by:
forumMerged in interface ForumListener
Parameters:
event - the event object.

messageAdded

public void messageAdded(MessageEvent event)
Description copied from interface: MessageListener
Fired when a message has been added to the system. Care should be taken with this event type since a message being added may need to go through a moderation process before it becomes visible in a forum. Therefore, actions that should only be triggered after moderation has taken place should use the message moderation modified event type instead.

Specified by:
messageAdded in interface MessageListener
Parameters:
event - the event object.

messageDeleted

public void messageDeleted(MessageEvent event)
Description copied from interface: MessageListener
Fired when a message is about to be deleted from the system. This event will only be fired when an individual message is deleted; it is not fired when the thread or forum that contains the message is deleted. Because various code pieces may depend on this event for performing cleanup tasks, it's guaranteed that this method will be called before the message is deleted from the database.

Specified by:
messageDeleted in interface MessageListener
Parameters:
event - the event object.

messageMoved

public void messageMoved(MessageEvent event)
Description copied from interface: MessageListener
Fired when a message is moved to another thread. This happens when a thread is branched such that a message and its children become a new thread.

Specified by:
messageMoved in interface MessageListener
Parameters:
event - the event object.

messageModified

public void messageModified(MessageEvent event)
Description copied from interface: MessageListener
Fired when portions of a message have been modified.

Specified by:
messageModified in interface MessageListener
Parameters:
event - the event object.

messageModerationModified

public void messageModerationModified(MessageEvent event)
Description copied from interface: MessageListener
Fired when the moderation value of a message has been changed.

Specified by:
messageModerationModified in interface MessageListener
Parameters:
event - the event object.

messageRated

public void messageRated(MessageEvent event)
Description copied from interface: MessageListener
Fired when a message has been rated.

Specified by:
messageRated in interface MessageListener
Parameters:
event - the event object.

announcementCreated

public void announcementCreated(AnnouncementEvent event)
Description copied from interface: AnnouncementListener
Fired when an announcement has been added to the system. Care should be taken with this event type since an announcement may not become immediately visible to end users (it is not visible except after the start date and before the end date).

Specified by:
announcementCreated in interface AnnouncementListener
Parameters:
event - the event object.

announcementDeleted

public void announcementDeleted(AnnouncementEvent event)
Description copied from interface: AnnouncementListener
Fired when an announcement is about to be deleted from the system. This event will only be fired when an individual announcement is deleted; it is not fired when the container object is deleted. Because various code pieces may depend on this event for performing cleanup tasks, it's guaranteed that this method will be called before the announcement is deleted from the database.

Specified by:
announcementDeleted in interface AnnouncementListener
Parameters:
event - the event object.

announcementModified

public void announcementModified(AnnouncementEvent event)
Description copied from interface: AnnouncementListener
Fired when portions of an announcement have been modified.

Specified by:
announcementModified in interface AnnouncementListener
Parameters:
event - the event object.

pollCreated

public void pollCreated(PollEvent event)
Description copied from interface: PollListener
Fired when a poll is created.

Specified by:
pollCreated in interface PollListener
Parameters:
event - the PollEvent

pollDeleted

public void pollDeleted(PollEvent event)
Description copied from interface: PollListener
Fired when a poll is deleted.

Specified by:
pollDeleted in interface PollListener
Parameters:
event - the PollEvent

voteAdded

public void voteAdded(PollEvent event)
Description copied from interface: PollListener
Fired when a vote is added to a poll.

Specified by:
voteAdded in interface PollListener
Parameters:
event - the PollEvent.

anonymousVoteAdded

public void anonymousVoteAdded(PollEvent event)
Description copied from interface: PollListener
Fired when an anonymous vote is added to a poll.

Specified by:
anonymousVoteAdded in interface PollListener
Parameters:
event - the PollEvent.

voteModified

public void voteModified(PollEvent event)
Description copied from interface: PollListener
Fired when a poll vote is modified.

Specified by:
voteModified in interface PollListener
Parameters:
event - the PollEvent.

anonymousVoteModified

public void anonymousVoteModified(PollEvent event)
Description copied from interface: PollListener
Fired when an anonymous poll vote is modified.

Specified by:
anonymousVoteModified in interface PollListener
Parameters:
event - the PollEvent.

voteRemoved

public void voteRemoved(PollEvent event)
Description copied from interface: PollListener
Fired when a poll vote is removed.

Specified by:
voteRemoved in interface PollListener
Parameters:
event - the PollEvent.

anonymousVoteRemoved

public void anonymousVoteRemoved(PollEvent event)
Description copied from interface: PollListener
Fired when an anonymous poll vote is removed.

Specified by:
anonymousVoteRemoved in interface PollListener
Parameters:
event - the PollEvent.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.