Interface WidgetService
- All Known Implementing Classes:
WidgetServiceImpl
public interface WidgetService
Service methods for
Widgets- Author:
- Andre Azzolini (apazzolini)
-
Method Summary
Modifier and TypeMethodDescriptionReturns a list of widgets such that each widget in the list is used by at least oneContentItem.Finds all Content Items which use the Widget by its internal database idfindWidgetById(Long id) Finds a Widget instance by its internal database idgetWidgetClasspathPath(String pathPrefix, Widget widget) Returns a computed classpath for the given widgetreplaceCssThemeFields(String resourceData) This is used to ensure that widget css is theme compatible by replacing the css theme fields.saveWidget(Widget widget) Persists the given widget to the database.
-
Method Details
-
findAllActiveWidgets
- Returns:
- a list of all currently active widgets
-
findAllCurrentlyUsedWidgets
Returns a list of widgets such that each widget in the list is used by at least oneContentItem.- Returns:
- a list of all currently used widgets
-
findWidgetById
Finds a Widget instance by its internal database id- Parameters:
id-- Returns:
- the
Widget
-
findContentItemsByWidgetId
Finds all Content Items which use the Widget by its internal database id- Parameters:
id-- Returns:
- the list of
ContentItems
-
saveWidget
Persists the given widget to the database.- Parameters:
widget-- Returns:
- the persisted widget
-
getWidgetClasspathPath
Returns a computed classpath for the given widget- Parameters:
pathPrefix-widget-- Returns:
- the classpath
-
replaceCssThemeFields
This is used to ensure that widget css is theme compatible by replacing the css theme fields.- Parameters:
resourceData- the widget css data- Returns:
- the widget css data with theme fields replaced
-