Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.proxy
Class DraftManagerProxy

java.lang.Object
  extended by com.jivesoftware.forum.proxy.DraftManagerProxy
All Implemented Interfaces:
JiveManager, DraftManager

public class DraftManagerProxy
extends java.lang.Object
implements DraftManager

Protection proxy for DraftManager instances.


Constructor Summary
DraftManagerProxy(DraftManager manager, AuthToken authToken, Permissions permissions)
          Creates a new ForumMessageDraftManagerProxy object.
 
Method Summary
 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.
 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.
 void initialize()
          Initialize the manager.
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DraftManagerProxy

public DraftManagerProxy(DraftManager manager,
                         AuthToken authToken,
                         Permissions permissions)
Creates a new ForumMessageDraftManagerProxy object.

Parameters:
manager - the draft manager to protect by proxy
authToken - the user's auth token
permissions - the permissions to use with this proxy.
Method Detail

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.

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

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

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)
                 throws UnauthorizedException
Description copied from interface: DraftManager
Delete an existing draft.

Specified by:
deleteDraft in interface DraftManager
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

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

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

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.