Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum
Interface DraftManager

All Superinterfaces:
JiveManager
All Known Implementing Classes:
DbDraftManager, DraftManagerProxy

public interface DraftManager
extends JiveManager

Manages the draft features of Jive Forums. The following Jive properties correspond to the draft manager settings:

See Also:
ForumFactory.getDraftManager()

Method Summary
 Draft createDraft(Draft draft)
          Creates a new draft.
 void deleteDraft(Draft draft)
          Delete an existing draft.
 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 getDraftsByUser(long userid)
          Returns all drafts for a particular user.
 boolean isAutosaveEnabled()
          Determines whether or not the system has been configured to allow for autosave in text fields.
 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.
 
Methods inherited from interface com.jivesoftware.base.JiveManager
destroy, initialize
 

Method Detail

createDraft

Draft createDraft(Draft draft)
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.

Parameters:
draft - a Draft
Returns:
a new Draft or an existing Draft that matches the given forumid / threadid / messageid.

getDraft

Draft getDraft(long draftID)
               throws UnauthorizedException
Returns a draft by draft ID or null if no draft exists with the specified draftID.

Parameters:
draftID - the ID of the draft to return.
Returns:
the draft or null if no draft exists with the specified draftID.
Throws:
UnauthorizedException - if the user is not either a System Admin or the user associated with the draft.

getDraft

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. 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.

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

getDraftsByUser

java.util.Iterator getDraftsByUser(long userid)
Returns all drafts for a particular user.

Parameters:
userid - the id of the user
Returns:
iterator of all available drafts

updateDraft

void updateDraft(Draft draft)
                 throws UnauthorizedException
Update an existing draft. Automatically saves an updated modification date on the draft.

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

void deleteDraft(Draft draft)
                 throws UnauthorizedException
Delete an existing draft.

Parameters:
draft - The draft to be deleted.
Throws:
UnauthorizedException - if the user associated with the draft is not either a system admin or the owner of the draft.

isAutosaveEnabled

boolean isAutosaveEnabled()
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.

Returns:
true if the system has been configured to allow autosave (default) or false if the system has been configured to disallow autosave.

setAutosaveEnabled

void setAutosaveEnabled(boolean enable)
Enables or disables autosave.

Parameters:
enable -

getAutosaveInterval

int getAutosaveInterval()
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.

Returns:
interval the number of seconds between autosave invocations

setAutosaveInterval

void setAutosaveInterval(int interval)
Sets the amount of time (in seconds) that the browser should wait between updating the draft.

Parameters:
interval -

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.