Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.theme.webwidgets
Interface Provider

All Known Implementing Classes:
DefaultProvider, PersistentProvider, PersistentProviderPerUser

public interface Provider


Method Summary
 void activate()
          Activate a provider.
 void addWidget(Widget widget, String regionName, int order)
          Add a widget to a region.
 boolean canRead()
          Check for read access.
 boolean canWrite()
          Check write access.
 Widget createWidget(String widgetTypeName)
          Create a new widget.
 void deactivate()
          Deactivate a provider.
 void deleteWidgetData(Widget widget)
          Delete all data associated with a widget
 void destroy()
          Destroy a provider.
 String getRegionOfWidget(Widget widget)
          Get the region of a widget.
 Widget getWidgetByUid(String uid)
          Get a widget by its id.
 WidgetData getWidgetData(Widget widget, String dataName)
          Get the data of a widget
 Map<String,String> getWidgetPreferences(Widget widget)
          Get the preferences of a widget.
 List<Widget> getWidgets(String regionName)
          Get the list of widgets in a region.
 WidgetState getWidgetState(Widget widget)
          Get the state of a widget.
 void moveWidget(Widget widget, String destRegionName, int order)
          Move a widget to another region.
 void removeWidget(Widget widget)
          Remove a widget.
 void reorderWidget(Widget widget, int order)
          Reorder a widget.
 void setWidgetData(Widget widget, String dataName, WidgetData data)
          Set data to a widget
 void setWidgetPreferences(Widget widget, Map<String,String> preferences)
          Set the preferences of a widget.
 void setWidgetState(Widget widget, WidgetState state)
          Set the state of a widget.
 

Method Detail

activate

void activate()
Activate a provider. The implementation is responsible for acquiring resources needed for service


deactivate

void deactivate()
Deactivate a provider. The implementation is responsible for releasing resources used by the service.


destroy

void destroy()
             throws ProviderException
Destroy a provider. The implementation is responsible for destroying all the resources used by the service.

Throws:
ProviderException

createWidget

Widget createWidget(String widgetTypeName)
                    throws ProviderException
Create a new widget. The implementation is responsible for generating a unique widget identifier.

Parameters:
widgetTypeName - the widget type name
Returns:
the created widget
Throws:
ProviderException

getWidgetByUid

Widget getWidgetByUid(String uid)
                      throws ProviderException
Get a widget by its id.

Parameters:
uid - the widget's unique identifier
Returns:
the widget or null if the identifier does not match any widget
Throws:
ProviderException

getWidgets

List<Widget> getWidgets(String regionName)
                        throws ProviderException
Get the list of widgets in a region.

Parameters:
regionName - the name of the region from which to get the list of widgets
Returns:
an ordered list of widgets located in the specified region
Throws:
ProviderException

addWidget

void addWidget(Widget widget,
               String regionName,
               int order)
               throws ProviderException
Add a widget to a region.

Parameters:
widget - the widget to add
regionName - the name of the region
order - the order at which to insert the widget (begins with 0)
Throws:
ProviderException

moveWidget

void moveWidget(Widget widget,
                String destRegionName,
                int order)
                throws ProviderException
Move a widget to another region.

Parameters:
widget - the widget to move
destRegionName - the name of the destination region
order - the order at which to insert the widget
Throws:
ProviderException

reorderWidget

void reorderWidget(Widget widget,
                   int order)
                   throws ProviderException
Reorder a widget.

Parameters:
widget - the widget to reorder
order - the new order
Throws:
ProviderException

removeWidget

void removeWidget(Widget widget)
                  throws ProviderException
Remove a widget. The implementation is responsible for removing from the widget from the region in which it is located and for destroying the widget.

Parameters:
widget - the widget to remove
Throws:
ProviderException

getRegionOfWidget

String getRegionOfWidget(Widget widget)
                         throws ProviderException
Get the region of a widget.

Parameters:
widget - the widget to get the region of
Returns:
the name of the region or null if the widget does not exist.
Throws:
ProviderException

getWidgetPreferences

Map<String,String> getWidgetPreferences(Widget widget)
                                        throws ProviderException
Get the preferences of a widget.

Parameters:
widget - the widget whose preferences are to be obtained
Returns:
a mapping of preferences as
Throws:
ProviderException

setWidgetPreferences

void setWidgetPreferences(Widget widget,
                          Map<String,String> preferences)
                          throws ProviderException
Set the preferences of a widget. Existing preferences are replaced.

Parameters:
widget - the widget whose preferences will be set
preferences - a mapping of preferences as
Throws:
ProviderException

setWidgetState

void setWidgetState(Widget widget,
                    WidgetState state)
                    throws ProviderException
Set the state of a widget.

Parameters:
widget - the widget whose state is to be set
state - the state to set (see $WidgetState)
Throws:
ProviderException

getWidgetState

WidgetState getWidgetState(Widget widget)
                           throws ProviderException
Get the state of a widget.

Parameters:
widget - the widget whose state is to be obtained
Returns:
the state (see $WidgetState)
Throws:
ProviderException

getWidgetData

WidgetData getWidgetData(Widget widget,
                         String dataName)
                         throws ProviderException
Get the data of a widget

Parameters:
widget - the widget from which to get the data
dataName - the name of the data
Returns:
Throws:
ProviderException

setWidgetData

void setWidgetData(Widget widget,
                   String dataName,
                   WidgetData data)
                   throws ProviderException
Set data to a widget

Parameters:
widget - the widget to set data to
dataName - the name of the data
data - the widget data
Throws:
ProviderException

deleteWidgetData

void deleteWidgetData(Widget widget)
                      throws ProviderException
Delete all data associated with a widget

Parameters:
widget - the widget
Throws:
ProviderException

canRead

boolean canRead()
Check for read access.

Returns:
true if the current principal can read information from this provider.

canWrite

boolean canWrite()
Check write access.

Returns:
true if the current principal can write information to this provider.

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.