@Service(value="blWidgetService") public class WidgetServiceImpl extends Object implements WidgetService
Modifier and Type | Field and Description |
---|---|
protected com.broadleafcommerce.theme.service.ThemeService |
themeService |
protected WidgetDao |
widgetDao |
Constructor and Description |
---|
WidgetServiceImpl() |
Modifier and Type | Method and Description |
---|---|
List<Widget> |
findAllActiveWidgets() |
List<Widget> |
findAllCurrentlyUsedWidgets()
Returns a list of widgets such that each widget in the list is used by at least
one
ContentItem . |
List<ContentItem> |
findContentItemsByWidgetId(Long id)
Finds all Content Items which use the Widget by its internal database id
|
Widget |
findWidgetById(Long id)
Finds a Widget instance by its internal database id
|
String |
getWidgetClasspathPath(String pathPrefix,
Widget widget)
Returns a computed classpath for the given widget
|
String |
replaceCssThemeFields(String resourceData)
This is used to ensure that widget css is theme compatible by replacing the css theme fields.
|
Widget |
saveWidget(Widget widget)
Persists the given widget to the database.
|
protected com.broadleafcommerce.theme.service.ThemeService themeService
protected WidgetDao widgetDao
public Widget findWidgetById(Long id)
WidgetService
findWidgetById
in interface WidgetService
Widget
public List<Widget> findAllActiveWidgets()
findAllActiveWidgets
in interface WidgetService
public List<Widget> findAllCurrentlyUsedWidgets()
WidgetService
ContentItem
.findAllCurrentlyUsedWidgets
in interface WidgetService
public List<ContentItem> findContentItemsByWidgetId(Long id)
WidgetService
findContentItemsByWidgetId
in interface WidgetService
Item
s@Transactional(value="blTransactionManager") public Widget saveWidget(Widget widget)
WidgetService
saveWidget
in interface WidgetService
public String getWidgetClasspathPath(String pathPrefix, Widget widget)
WidgetService
getWidgetClasspathPath
in interface WidgetService
public String replaceCssThemeFields(String resourceData)
WidgetService
replaceCssThemeFields
in interface WidgetService
resourceData
- the widget css dataCopyright © 2020. All rights reserved.