public class PersistentProvider extends Object implements Provider
Constructor and Description |
---|
PersistentProvider() |
Modifier and Type | Method and Description |
---|---|
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.
|
Principal |
getCurrentPrincipal() |
PersistenceProvider |
getPersistenceProvider() |
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 |
reorderWidgets(List<Widget> widgets) |
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.
|
public void activate()
Provider
public void deactivate()
Provider
deactivate
in interface Provider
public void destroy() throws ProviderException
Provider
destroy
in interface Provider
ProviderException
public PersistenceProvider getPersistenceProvider()
public Principal getCurrentPrincipal()
public void addWidget(Widget widget, String regionName, int order) throws ProviderException
Provider
addWidget
in interface Provider
widget
- the widget to addregionName
- the name of the regionorder
- the order at which to insert the widget (begins with 0)ProviderException
public Widget createWidget(String widgetTypeName) throws ProviderException
Provider
createWidget
in interface Provider
widgetTypeName
- the widget type nameProviderException
public String getRegionOfWidget(Widget widget) throws ProviderException
Provider
getRegionOfWidget
in interface Provider
widget
- the widget to get the region ofProviderException
public WidgetState getWidgetState(Widget widget) throws ProviderException
Provider
getWidgetState
in interface Provider
widget
- the widget whose state is to be obtainedWidgetState
)ProviderException
public Widget getWidgetByUid(String uid) throws ProviderException
Provider
getWidgetByUid
in interface Provider
uid
- the widget's unique identifierProviderException
public List<Widget> getWidgets(String regionName) throws ProviderException
Provider
getWidgets
in interface Provider
regionName
- the name of the region from which to get the list of
widgetsProviderException
public void moveWidget(Widget widget, String destRegionName, int order) throws ProviderException
Provider
moveWidget
in interface Provider
widget
- the widget to movedestRegionName
- the name of the destination regionorder
- the order at which to insert the widgetProviderException
public void removeWidget(Widget widget) throws ProviderException
Provider
removeWidget
in interface Provider
widget
- the widget to removeProviderException
public void reorderWidget(Widget widget, int order) throws ProviderException
Provider
reorderWidget
in interface Provider
widget
- the widget to reorderorder
- the new orderProviderException
public Map<String,String> getWidgetPreferences(Widget widget) throws ProviderException
Provider
getWidgetPreferences
in interface Provider
widget
- the widget whose preferences are to be obtainedProviderException
public void setWidgetPreferences(Widget widget, Map<String,String> preferences) throws ProviderException
Provider
setWidgetPreferences
in interface Provider
widget
- the widget whose preferences will be setpreferences
- a mapping of preferences as ProviderException
public void setWidgetState(Widget widget, WidgetState state) throws ProviderException
Provider
setWidgetState
in interface Provider
widget
- the widget whose state is to be setstate
- the state to set (see $WidgetState
)ProviderException
public void reorderWidgets(List<Widget> widgets) throws ProviderException
ProviderException
public WidgetData getWidgetData(Widget widget, String dataName) throws ProviderException
Provider
getWidgetData
in interface Provider
widget
- the widget from which to get the datadataName
- the name of the dataProviderException
public void setWidgetData(Widget widget, String dataName, WidgetData data) throws ProviderException
Provider
setWidgetData
in interface Provider
widget
- the widget to set data todataName
- the name of the datadata
- the widget dataProviderException
public void deleteWidgetData(Widget widget) throws ProviderException
Provider
deleteWidgetData
in interface Provider
widget
- the widgetProviderException
public boolean canRead()
Provider
Copyright © 2013 Nuxeo SA. All Rights Reserved.