Class CustomSidebarWidget

java.lang.Object
io.goobi.viewer.model.cms.widgets.CustomSidebarWidget
All Implemented Interfaces:
IPolyglott, Serializable
Direct Known Subclasses:
FacetFieldSidebarWidget, HtmlSidebarWidget, PageListSidebarWidget, RssFeedSidebarWidget

@Entity public class CustomSidebarWidget extends Object implements IPolyglott, Serializable
Class to persist user generated CMS-Sidebar widgets in the database. Different types of widgets containing different data are encoded in subclasses. This main class should be considered effectively abstract, even though it cannot be marked as abstract due to dao persistence restrictions. The exact type of custom widget can be gathered from #{CustomSidebarWidgetgetType() Each inheriting class must implement a cloning constructor, i.e. a constructor taking an argument of the same class and copying all its data
Author:
florian
See Also:
  • Field Details

    • id

      protected Long id
      Unique database ID.
  • Constructor Details

    • CustomSidebarWidget

      public CustomSidebarWidget()
    • CustomSidebarWidget

      public CustomSidebarWidget(CustomSidebarWidget source)
      Cloning constructor.
      Parameters:
      source -
  • Method Details

    • isComplete

      public boolean isComplete(Locale locale)
      Description copied from interface: IPolyglott
      If this returns true, an associated language tab should have the 'already-translated' class, otherwise the '-partly-translated' class unless IPolyglott.isEmpty(Locale) also returns true
      Specified by:
      isComplete in interface IPolyglott
      Returns:
      true if IPolyglott.isValid(Locale) returns true for the given locale and all fields contain a value which have a value in the default locale. For the default locale, IPolyglott.isComplete(Locale) and IPolyglott.isValid(Locale) are identical. For implementations with only one field, both methods are also always identical
    • isValid

      public boolean isValid(Locale locale)
      Description copied from interface: IPolyglott
      Only meaningfull for the default language for which all required fields must be filled
      Specified by:
      isValid in interface IPolyglott
      Returns:
      true if all required fields contain a value in the given locale
    • isEmpty

      public boolean isEmpty(Locale locale)
      Description copied from interface: IPolyglott
      If this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' class
      Specified by:
      isEmpty in interface IPolyglott
      Returns:
      true if no fields are filled for the given locale
    • getSelectedLocale

      public Locale getSelectedLocale()
      Specified by:
      getSelectedLocale in interface IPolyglott
      Returns:
      the locale currently set by IPolyglott.setSelectedLocale(Locale)
    • setSelectedLocale

      public void setSelectedLocale(Locale locale)
      Description copied from interface: IPolyglott
      Set the locale to use for display and editing
      Specified by:
      setSelectedLocale in interface IPolyglott
    • getId

      public Long getId()
      Returns:
      the id
    • setId

      public void setId(Long id)
      Parameters:
      id - the id to set
    • getTitle

      public TranslatedText getTitle()
      Returns:
      the title
    • setTitle

      public void setTitle(TranslatedText title)
    • getDescription

      public TranslatedText getDescription()
      Returns:
      the description
    • getType

      public CustomWidgetType getType()
      Return the type of this custom sidebar widget. Must be implemented by subclasses of CustomSidebarWidget
      Returns:
      CustomWidgetType
    • getStyleClass

      public String getStyleClass()
      Returns:
      the css style class to use for this widget, if any
    • setStyleClass

      public void setStyleClass(String styleClass)
      Set the css style class to use for this widget
      Parameters:
      styleClass -
    • isCollapsed

      public boolean isCollapsed()
      Returns:
      true if the widget should initially be displayed in a collapsed state with a button to expand it
    • setCollapsed

      public void setCollapsed(boolean collapsed)
      Set this widget to be displayed as a collapseable
      Parameters:
      collapsed - the collapsed to set
    • clone

      public static CustomSidebarWidget clone(CustomSidebarWidget o)
      Creates a copy of the given custom widget o. Depends on cloning constructors if sublass
      Parameters:
      o -
      Returns:
      CustomSidebarWidget