Interface WidgetService

All Known Implementing Classes:
WidgetServiceImpl

public interface WidgetService
Service methods for Widgets
Author:
Andre Azzolini (apazzolini)
  • Method Details

    • findAllActiveWidgets

      List<Widget> findAllActiveWidgets()
      Returns:
      a list of all currently active widgets
    • findAllCurrentlyUsedWidgets

      List<Widget> findAllCurrentlyUsedWidgets()
      Returns a list of widgets such that each widget in the list is used by at least one ContentItem.
      Returns:
      a list of all currently used widgets
    • findWidgetById

      Widget findWidgetById(Long id)
      Finds a Widget instance by its internal database id
      Parameters:
      id -
      Returns:
      the Widget
    • findContentItemsByWidgetId

      List<ContentItem> findContentItemsByWidgetId(Long id)
      Finds all Content Items which use the Widget by its internal database id
      Parameters:
      id -
      Returns:
      the list of ContentItems
    • saveWidget

      Widget saveWidget(Widget widget)
      Persists the given widget to the database.
      Parameters:
      widget -
      Returns:
      the persisted widget
    • getWidgetClasspathPath

      String getWidgetClasspathPath(String pathPrefix, Widget widget)
      Returns a computed classpath for the given widget
      Parameters:
      pathPrefix -
      widget -
      Returns:
      the classpath
    • replaceCssThemeFields

      String replaceCssThemeFields(String resourceData)
      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