Class WidgetServiceImpl
java.lang.Object
com.broadleafcommerce.advancedcms.service.WidgetServiceImpl
- All Implemented Interfaces:
WidgetService
- Author:
- Andre Azzolini (apazzolini)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.broadleafcommerce.theme.service.ThemeServiceprotected WidgetDao -
Constructor Summary
Constructors -
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.
-
Field Details
-
themeService
protected com.broadleafcommerce.theme.service.ThemeService themeService -
widgetDao
-
-
Constructor Details
-
WidgetServiceImpl
public WidgetServiceImpl()
-
-
Method Details
-
findWidgetById
Description copied from interface:WidgetServiceFinds a Widget instance by its internal database id- Specified by:
findWidgetByIdin interfaceWidgetService- Returns:
- the
Widget
-
findAllActiveWidgets
- Specified by:
findAllActiveWidgetsin interfaceWidgetService- Returns:
- a list of all currently active widgets
-
findAllCurrentlyUsedWidgets
Description copied from interface:WidgetServiceReturns a list of widgets such that each widget in the list is used by at least oneContentItem.- Specified by:
findAllCurrentlyUsedWidgetsin interfaceWidgetService- Returns:
- a list of all currently used widgets
-
findContentItemsByWidgetId
Description copied from interface:WidgetServiceFinds all Content Items which use the Widget by its internal database id- Specified by:
findContentItemsByWidgetIdin interfaceWidgetService- Returns:
- the list of
ContentItems
-
saveWidget
Description copied from interface:WidgetServicePersists the given widget to the database.- Specified by:
saveWidgetin interfaceWidgetService- Returns:
- the persisted widget
-
getWidgetClasspathPath
Description copied from interface:WidgetServiceReturns a computed classpath for the given widget- Specified by:
getWidgetClasspathPathin interfaceWidgetService- Returns:
- the classpath
-
replaceCssThemeFields
Description copied from interface:WidgetServiceThis is used to ensure that widget css is theme compatible by replacing the css theme fields.- Specified by:
replaceCssThemeFieldsin interfaceWidgetService- Parameters:
resourceData- the widget css data- Returns:
- the widget css data with theme fields replaced
-