Clearspace API (1.7.0) Core Javadocs

com.jivesoftware.community.widget
Interface WidgetManager

All Superinterfaces:
JiveManager

public interface WidgetManager
extends JiveManager

Centralized management of widgets in the Jive system including creating, retrieving, and deleting Widget objects.

See Also:
Widget, WidgetFrame

Method Summary
 Widget addWidget(java.lang.String className)
          Installs a new class into the list of Widgets for the system.
 com.jivesoftware.community.widget.WidgetFrame addWidgetFrame(com.jivesoftware.community.widget.WidgetFrameBean widgetFrameBean)
          Creates a new WidgetFrame based on the specified WidgetFrameBean.
 void copyWidgetFrames(JiveObject sourceObject, JiveObject destinationObject)
          Copies the WidgetFrames from the source JiveObject to the destination JiveObject.
 void discardWidgetFrames(JiveObject jiveObject)
          Discards the draft WidgetFrames for the specified parent JiveObject.
 java.util.Map<com.jivesoftware.community.widget.WidgetDescriptor,Widget> getAvailableWidgets()
          Returns a list of all available Widgets in the system
 java.util.Map<java.lang.Integer,java.util.List<com.jivesoftware.community.widget.WidgetFrame>> getPublishedWidgetFrames(JiveObject jiveObject)
          Returns the map containing all the published WidgetFrames for the specified parent JiveObject.
 Widget getWidget(com.jivesoftware.community.widget.WidgetDescriptor descriptor)
          Returns the instanciated widget object for the specified WidgetDescriptor
 com.jivesoftware.community.widget.WidgetFrame getWidgetFrame(long id)
          Returns the WidgetFrame corresponding to the specified widget frame id.
 java.util.Map<java.lang.Integer,java.util.List<com.jivesoftware.community.widget.WidgetFrame>> getWidgetFrames(JiveObject object)
          Returns the map containing all the draft WidgetFrames for the specified parent JiveObject.
 void publishWidgetFrames(JiveObject jiveObject)
          Publishes the WidgetFrames for the specified parent JiveObject.
 void removeWidget(long id)
          Removes a Widget from the system.
 void removeWidgetFrame(com.jivesoftware.community.widget.WidgetFrame widgetFrame)
          Removes the specified WidgetFrame from the system.
 void updateWidgetFrameProperties(com.jivesoftware.community.widget.WidgetFrame widgetFrame)
          Updates the properties for the specified WidgetFrame.
 void updateWidgetFrames(JiveObject jiveObject, java.util.List<com.jivesoftware.community.widget.WidgetFrame> widgetFrames)
          Updates the list of WidgetFrames.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy, initialize
 

Method Detail

addWidget

Widget addWidget(java.lang.String className)
                 throws UnauthorizedException,
                        java.lang.ClassNotFoundException,
                        WidgetAlreadyExistsException
Installs a new class into the list of Widgets for the system. Exceptions are thrown if you're not a system administrator, the class can't be loaded from the classpath, or the class isn't an instance of Widget.

Parameters:
className - the fully qualified name of the class to add to the list of available Widgets in the system.
Returns:
The newly created Widget object
Throws:
UnauthorizedException - if not a system administator.
java.lang.ClassNotFoundException - if the class could not be loaded.
WidgetAlreadyExistsException - if the widget class already exists.
See Also:
Widget

getWidget

Widget getWidget(com.jivesoftware.community.widget.WidgetDescriptor descriptor)
                 throws java.lang.ClassNotFoundException
Returns the instanciated widget object for the specified WidgetDescriptor

Parameters:
descriptor - the WidgetDescriptor for the requested Widget
Returns:
the instanciated widget object for the specified WidgetDescriptor
Throws:
java.lang.ClassNotFoundException - if the class could not be loaded.
See Also:
WidgetDescriptor, Widget

getAvailableWidgets

java.util.Map<com.jivesoftware.community.widget.WidgetDescriptor,Widget> getAvailableWidgets()
Returns a list of all available Widgets in the system

Returns:
a list of all available Widgets in the system
See Also:
Widget

removeWidget

void removeWidget(long id)
                  throws UnauthorizedException
Removes a Widget from the system.

Parameters:
id - the id of the Widget to remove
Throws:
UnauthorizedException - if not a system administrator
See Also:
Widget

addWidgetFrame

com.jivesoftware.community.widget.WidgetFrame addWidgetFrame(com.jivesoftware.community.widget.WidgetFrameBean widgetFrameBean)
                                                             throws UnauthorizedException
Creates a new WidgetFrame based on the specified WidgetFrameBean. The WidgetFrame will not be published until the method publishWidgetFrames(com.jivesoftware.community.JiveObject) is executed. Other WidgetFrames with an index value higher than the specified WidgetFrame will be modified accordingly (incremented).

Parameters:
widgetFrameBean - the bean containing all the required information to create a new WidgetFrame
Returns:
the newly created WidgetFrame
Throws:
UnauthorizedException - if not a community or system administrator
See Also:
WidgetFrameBean, WidgetFrame, Widget

getWidgetFrame

com.jivesoftware.community.widget.WidgetFrame getWidgetFrame(long id)
Returns the WidgetFrame corresponding to the specified widget frame id.

Parameters:
id - the id of the widget frame to return
Returns:
the WidgetFrame corresponding to the specified widget frame id
See Also:
WidgetFrame, Widget

getWidgetFrames

java.util.Map<java.lang.Integer,java.util.List<com.jivesoftware.community.widget.WidgetFrame>> getWidgetFrames(JiveObject object)
Returns the map containing all the draft WidgetFrames for the specified parent JiveObject. The key of the map is the containerID and the value is the list of ordered WidgetFrames in that container.

Parameters:
object - the parent JiveObject of the WidgetFrames
Returns:
the map containing all the draft WidgetFrames for the specified parent JiveObject
See Also:
WidgetFrame, Widget, JiveObject

updateWidgetFrames

void updateWidgetFrames(JiveObject jiveObject,
                        java.util.List<com.jivesoftware.community.widget.WidgetFrame> widgetFrames)
                        throws UnauthorizedException
Updates the list of WidgetFrames. WidgetFrame properties will not be modified here, only the container and index of the WidgetFrame in the parent JiveObject. If you need to save the properties for a WidgetFrame, use the method updateWidgetFrameProperties(WidgetFrame).

Parameters:
jiveObject - the parent jive object
widgetFrames - the list of WidgetFrames to update.
Throws:
UnauthorizedException - if not a community or system administrator
See Also:
WidgetFrame

updateWidgetFrameProperties

void updateWidgetFrameProperties(com.jivesoftware.community.widget.WidgetFrame widgetFrame)
                                 throws UnauthorizedException
Updates the properties for the specified WidgetFrame. To change the index or containerID of the WidgetFrameBean, use the method #updateWidgetFrames(java.util.List).

Parameters:
widgetFrame - the WidgetFrame to update
Throws:
UnauthorizedException - if not a community or system administrator
See Also:
WidgetFrame

removeWidgetFrame

void removeWidgetFrame(com.jivesoftware.community.widget.WidgetFrame widgetFrame)
                       throws UnauthorizedException
Removes the specified WidgetFrame from the system. The properties of the WidgetFrame will also be removed, and the index value of all WidgetFrames higher than the specified WidgetFrame will be modified accordingly (decremented).

Parameters:
widgetFrame - the WidgetFrame to update
Throws:
UnauthorizedException - if not a community or system administrator
See Also:
WidgetFrame

getPublishedWidgetFrames

java.util.Map<java.lang.Integer,java.util.List<com.jivesoftware.community.widget.WidgetFrame>> getPublishedWidgetFrames(JiveObject jiveObject)
Returns the map containing all the published WidgetFrames for the specified parent JiveObject. The key of the map is the containerID and the value is the list of ordered WidgetFrames in that container.

Parameters:
jiveObject - the parent JiveObject of the WidgetFrames
Returns:
the map containing all the published WidgetFrames for the specified parent JiveObject
See Also:
WidgetFrame, Widget, JiveObject

publishWidgetFrames

void publishWidgetFrames(JiveObject jiveObject)
                         throws UnauthorizedException
Publishes the WidgetFrames for the specified parent JiveObject. This method will remove all of the existing published WidgetFrames and will publish the draft WidgetFrames. If the are no draft WidgetFrames, this method will no-op.

Parameters:
jiveObject - the parent JiveObject of the WidgetFrames to publish.
Throws:
UnauthorizedException - if not a community or system administrator
See Also:
WidgetFrame, Widget, JiveObject

discardWidgetFrames

void discardWidgetFrames(JiveObject jiveObject)
                         throws UnauthorizedException
Discards the draft WidgetFrames for the specified parent JiveObject. This method will remove all of the existing draft WidgetFrames and will replace them with the published WidgetFrames for the specified parent JiveObject.

Parameters:
jiveObject - the parent JiveObject of the WidgetFrames to discard.
Throws:
UnauthorizedException - if not a community or system administrator
See Also:
WidgetFrame, Widget, JiveObject

copyWidgetFrames

void copyWidgetFrames(JiveObject sourceObject,
                      JiveObject destinationObject)
                      throws UnauthorizedException
Copies the WidgetFrames from the source JiveObject to the destination JiveObject. This method will remove the existing draft WidgetFrames from the destination JiveObject and will replace them with the published WidgetFrames from the source JiveObject.

Parameters:
sourceObject - the source JiveObject of the WidgetFrames to copy.
destinationObject - the destination JiveObject of the WidgetFrames to replace.
Throws:
UnauthorizedException - if not a community or system administrator
See Also:
WidgetFrame, Widget, JiveObject

Clearspace Project Page

Copyright © 1999-2007 Jive Software.