Class CustomSidebarWidget
java.lang.Object
io.goobi.viewer.model.cms.widgets.CustomSidebarWidget
- All Implemented Interfaces:
IPolyglott
,Serializable
- Direct Known Subclasses:
FacetFieldSidebarWidget
,HtmlSidebarWidget
,PageListSidebarWidget
,RssFeedSidebarWidget
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 #{CustomSidebarWidget
getType()
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 Summary
-
Constructor Summary
ConstructorDescriptionCloning constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic CustomSidebarWidget
Creates a copy of the given custom widget o.getId()
getTitle()
getType()
Return the type of this custom sidebar widget.boolean
boolean
isComplete
(Locale locale) If this returns true, an associated language tab should have the 'already-translated' class, otherwise the '-partly-translated' class unlessIPolyglott.isEmpty(Locale)
also returns trueboolean
If this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' classboolean
Only meaningfull for the default language for which all required fields must be filledvoid
setCollapsed
(boolean collapsed) Set this widget to be displayed as a collapseablevoid
void
setSelectedLocale
(Locale locale) Set the locale to use for display and editingvoid
setStyleClass
(String styleClass) Set the css style class to use for this widgetvoid
setTitle
(TranslatedText title) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.goobi.viewer.model.translations.IPolyglott
getLocales, isDefaultLocaleSelected, isSelected, setSelectedLocale
-
Field Details
-
id
Unique database ID.
-
-
Constructor Details
-
CustomSidebarWidget
public CustomSidebarWidget() -
CustomSidebarWidget
Cloning constructor.- Parameters:
source
-
-
-
Method Details
-
isComplete
Description copied from interface:IPolyglott
If this returns true, an associated language tab should have the 'already-translated' class, otherwise the '-partly-translated' class unlessIPolyglott.isEmpty(Locale)
also returns true- Specified by:
isComplete
in interfaceIPolyglott
- 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)
andIPolyglott.isValid(Locale)
are identical. For implementations with only one field, both methods are also always identical
-
isValid
Description copied from interface:IPolyglott
Only meaningfull for the default language for which all required fields must be filled- Specified by:
isValid
in interfaceIPolyglott
- Returns:
- true if all required fields contain a value in the given locale
-
isEmpty
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 interfaceIPolyglott
- Returns:
- true if no fields are filled for the given locale
-
getSelectedLocale
- Specified by:
getSelectedLocale
in interfaceIPolyglott
- Returns:
- the locale currently set by
IPolyglott.setSelectedLocale(Locale)
-
setSelectedLocale
Description copied from interface:IPolyglott
Set the locale to use for display and editing- Specified by:
setSelectedLocale
in interfaceIPolyglott
-
getId
- Returns:
- the id
-
setId
- Parameters:
id
- the id to set
-
getTitle
- Returns:
- the title
-
setTitle
-
getDescription
- Returns:
- the description
-
getType
Return the type of this custom sidebar widget. Must be implemented by subclasses ofCustomSidebarWidget
- Returns:
CustomWidgetType
-
getStyleClass
- Returns:
- the css style class to use for this widget, if any
-
setStyleClass
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
Creates a copy of the given custom widget o. Depends on cloning constructors if sublass- Parameters:
o
-- Returns:
CustomSidebarWidget
-