Clearspace API (2.5.29) 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(String className)
          Installs a new class into the list of Widgets for the system.
 WidgetFrame addWidgetFrame(WidgetFrameBean widgetFrameBean)
          Creates a new WidgetFrame based on the specified WidgetFrameBean.
 void addWidgetLayout(JiveObject jiveObject, WidgetLayout layout)
          Creates a new draft WidgetLayout for the specified JiveObject.
 WidgetLayout addWidgetLayout(String className)
          Installs a new class into the list of WidgetLayouts for the system.
 void deleteUserWidgets(User user)
          Removes all wigets associated with the given user from the system.
 void disableWidgetLayout(long id)
          Disables a WidgetLayout in the system: this prevents users from selecting the layout after a layout has been disabled but lets existing users of the layout continue to use the layout.
 void discardWidgetFrames(JiveObject jiveObject)
          Discards the draft WidgetFrames for the specified parent JiveObject.
 void discardWidgetLayout(JiveObject jiveObject)
          Discards the draft WidgetLayout for the specified parent JiveObject.
 void duplicateWidgetFrames(JiveObject sourceObject, JiveObject destinationObject)
          Duplicates the WidgetFrames from the source JiveObject to the destination JiveObject.
 Map<WidgetLayoutDescriptor,WidgetLayout> getAvailableWidgetLayouts()
          Returns a list of all the WidgetLayouts in the system that have not been disabled.
 Map<WidgetDescriptor,Widget> getAvailableWidgets()
          Returns a list of all available Widgets in the system.
 List<Widget> getAvailableWidgets(com.jivesoftware.community.widget.WidgetContext widgetContext)
          Returns a list of all available Widgets that are enabled for the given widget context.
 Set<WidgetDescriptor> getInstalledWidgets()
          Returns the set of all installed widgets.
 Map<Integer,List<WidgetFrame>> getPublishedWidgetFrames(JiveObject jiveObject)
          Returns the map containing all the published WidgetFrames for the specified parent JiveObject.
 WidgetLayout getPublishedWidgetLayout(JiveObject jiveObject)
          Returns the published WidgetLayout for the specified parent JiveObject.
 Widget getWidget(WidgetDescriptor descriptor)
          Returns the instanciated widget object for the specified WidgetDescriptor
 WidgetDescriptor getWidgetByName(String className)
           
 WidgetFrame getWidgetFrame(long id)
          Returns the WidgetFrame corresponding to the specified widget frame id.
 Map<Integer,List<WidgetFrame>> getWidgetFrames(JiveObject object)
          Returns the map containing all the draft WidgetFrames for the specified parent JiveObject.
 WidgetLayout getWidgetLayout(JiveObject jiveObject)
          Returns the draft WidgetLayout for the specified parent JiveObject.
 WidgetLayout getWidgetLayout(long layoutID)
          Returns the instantiated widget layout object for the specified layoutID
 WidgetLayout getWidgetLayout(WidgetLayoutDescriptor descriptor)
          Returns the instantiated widget layout object for the specified WidgetLayoutDescriptor
 WidgetLayoutDescriptor getWidgetLayoutByName(String className)
          Returns the widget layout descriptor for the given widget layout classname or null if the widget layout doesn't exist.
 Map<WidgetLayoutDescriptor,WidgetLayout> getWidgetLayouts()
          Returns a list of all the WidgetLayouts in the system.
 void publishWidgetFrames(JiveObject jiveObject)
          Publishes the WidgetFrames for the specified parent JiveObject.
 void publishWidgetLayout(JiveObject jiveObject)
          Publishes the WidgetLayout for the specified parent JiveObject.
 void removeWidget(long id)
          Removes a Widget from the system.
 void removeWidgetFrame(WidgetFrame widgetFrame)
          Removes the specified WidgetFrame from the system.
 void updateWidgetFrameProperties(WidgetFrame widgetFrame)
          Updates the properties for the specified WidgetFrame.
 void updateWidgetFrames(JiveObject jiveObject, List<WidgetFrame> widgetFrames)
          Updates the list of WidgetFrames.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy
 

Method Detail

addWidget

Widget addWidget(String className)
                 throws UnauthorizedException,
                        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.
ClassNotFoundException - if the class could not be loaded.
WidgetAlreadyExistsException - if the widget class already exists.
See Also:
Widget

getWidget

Widget getWidget(WidgetDescriptor descriptor)
                 throws 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:
ClassNotFoundException - if the class could not be loaded.
See Also:
WidgetDescriptor, Widget

getWidgetByName

WidgetDescriptor getWidgetByName(String className)
Parameters:
className -
Returns:

getAvailableWidgets

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

getInstalledWidgets

Set<WidgetDescriptor> getInstalledWidgets()
Returns the set of all installed widgets. Installed widgets, in constrast to available widgets, may not be currently available but at one point or another were installed. This can occur when a plugin containing a widget is removed or getAvailableWidgets() is called before the plugin containing the macro was loaded.

Returns:
the set of all installed widgets.

getAvailableWidgets

List<Widget> getAvailableWidgets(com.jivesoftware.community.widget.WidgetContext widgetContext)
Returns a list of all available Widgets that are enabled for the given widget context.

Parameters:
widgetContext - the widgetContext (which itself specifies a type of widget) to get widgets for.
Returns:
a list of all available Widgets that are enabled for the given widget context.
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

deleteUserWidgets

void deleteUserWidgets(User user)
                       throws UnauthorizedException
Removes all wigets associated with the given user from the system.

Parameters:
user - the owner of the wigets being deleted.
Throws:
UnauthorizedException - if not a system administrator or user administrator
See Also:
Widget

addWidgetLayout

WidgetLayout addWidgetLayout(String className)
                             throws UnauthorizedException,
                                    ClassNotFoundException,
                                    WidgetLayoutAlreadyExistsException
Installs a new class into the list of WidgetLayouts 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 WidgetLayout.

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

getWidgetLayout

WidgetLayout getWidgetLayout(WidgetLayoutDescriptor descriptor)
                             throws ClassNotFoundException
Returns the instantiated widget layout object for the specified WidgetLayoutDescriptor

Parameters:
descriptor - the WidgetLayoutDescriptor for the requested WidgetLayout
Returns:
the instantiated widget object for the specified WidgetLayoutDescriptor
Throws:
ClassNotFoundException - if the class could not be loaded.
See Also:
WidgetLayoutDescriptor, WidgetLayout

getWidgetLayout

WidgetLayout getWidgetLayout(long layoutID)
                             throws ClassNotFoundException
Returns the instantiated widget layout object for the specified layoutID

Parameters:
layoutID - the ID for the requested WidgetLayout
Returns:
the instantiated widget object for the specified layoutID or null if the given layoutID doesn't exist.
Throws:
ClassNotFoundException - if the class could not be loaded.
See Also:
WidgetLayoutDescriptor, WidgetLayout

getWidgetLayoutByName

WidgetLayoutDescriptor getWidgetLayoutByName(String className)
Returns the widget layout descriptor for the given widget layout classname or null if the widget layout doesn't exist.

Parameters:
className - the classname of the widget layout you need to retrieve.
Returns:
the widget layout descriptor for the given widget layout classname or null if the widget layout doesn't exist.

getAvailableWidgetLayouts

Map<WidgetLayoutDescriptor,WidgetLayout> getAvailableWidgetLayouts()
Returns a list of all the WidgetLayouts in the system that have not been disabled.

Returns:
a list of all the WidgetLayouts in the system that have not been disabled.
See Also:
WidgetLayout

getWidgetLayouts

Map<WidgetLayoutDescriptor,WidgetLayout> getWidgetLayouts()
Returns a list of all the WidgetLayouts in the system.

Returns:
a list of all the WidgetLayouts in the system
See Also:
WidgetLayout

disableWidgetLayout

void disableWidgetLayout(long id)
                         throws UnauthorizedException
Disables a WidgetLayout in the system: this prevents users from selecting the layout after a layout has been disabled but lets existing users of the layout continue to use the layout.

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

getPublishedWidgetLayout

WidgetLayout getPublishedWidgetLayout(JiveObject jiveObject)
                                      throws ClassNotFoundException
Returns the published WidgetLayout for the specified parent JiveObject.

Parameters:
jiveObject - the parent JiveObject of the WidgetLayout
Returns:
the published WidgetLayout for the specified parent JiveObject.
Throws:
ClassNotFoundException - if the class could not be loaded.
See Also:
WidgetLayout, JiveObject

getWidgetLayout

WidgetLayout getWidgetLayout(JiveObject jiveObject)
                             throws ClassNotFoundException
Returns the draft WidgetLayout for the specified parent JiveObject.

Parameters:
jiveObject - the parent JiveObject of the WidgetLayout
Returns:
the draft WidgetLayout for the specified parent JiveObject.
Throws:
ClassNotFoundException - if the class could not be loaded.
See Also:
WidgetLayout, JiveObject

addWidgetLayout

void addWidgetLayout(JiveObject jiveObject,
                     WidgetLayout layout)
                     throws UnauthorizedException
Creates a new draft WidgetLayout for the specified JiveObject. The WidgetLayout will not be published until the method publishWidgetLayout(com.jivesoftware.community.JiveObject) is executed.

Parameters:
jiveObject - the object to add the WidgetLayout to
layout - the layout to add
Throws:
UnauthorizedException - if not someone who has permission to change the JiveObject
See Also:
WidgetLayout, WidgetLayoutDescriptor

publishWidgetLayout

void publishWidgetLayout(JiveObject jiveObject)
                         throws UnauthorizedException
Publishes the WidgetLayout for the specified parent JiveObject. This method will remove the existing published WidgetLayout and will publish the draft WidgetLayout. If no draft WidgetFrame exists or if the WidgetLayout class could not be loaded, this method will no-op.

Parameters:
jiveObject - the parent JiveObject of the WidgetLayout to publish.
Throws:
UnauthorizedException - if not someone who has permission to change the JiveObject
See Also:
WidgetLayout, Widget, JiveObject

discardWidgetLayout

void discardWidgetLayout(JiveObject jiveObject)
                         throws UnauthorizedException
Discards the draft WidgetLayout for the specified parent JiveObject. This method will remove the existing draft WidgetLayout and will replace it with the published WidgetLayout for the specified parent JiveObject. If the published WidgetLayout class does not exist, this method will no-op.

Parameters:
jiveObject - the parent JiveObject of the WidgetLayout to discard.
Throws:
UnauthorizedException - if not someone who has permission to change the JiveObject
See Also:
WidgetLayout, JiveObject

addWidgetFrame

WidgetFrame addWidgetFrame(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

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

Map<Integer,List<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,
                        List<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(WidgetFrame widgetFrame)
                                 throws UnauthorizedException
Updates the properties for the specified WidgetFrame. To change the index or containerID of the WidgetFrameBean, use the method updateWidgetFrames(com.jivesoftware.community.JiveObject, java.util.List).

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

removeWidgetFrame

void removeWidgetFrame(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

Map<Integer,List<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

duplicateWidgetFrames

void duplicateWidgetFrames(JiveObject sourceObject,
                           JiveObject destinationObject)
                           throws UnauthorizedException
Duplicates 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.