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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCloning constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic CustomSidebarWidgetCreates a copy of the given custom widget o.getId()de.intranda.metadata.multilanguage.IMetadataValuegetShortDescription(int maxLength) getTitle()getType()Return the type of this custom sidebar widget.booleanbooleanisComplete(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 truebooleanIf this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' classbooleanbooleanOnly meaningful for the default language for which all required fields must be filledvoidsetCollapsed(boolean collapsed) Set this widget to be displayed as a collapseablevoidvoidsetSelectedLocale(Locale locale) Set the locale to use for display and editingvoidsetStyleClass(String styleClass) Set the css style class to use for this widgetvoidsetTitle(TranslatedText title) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:IPolyglottIf 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:
isCompletein interfaceIPolyglott- Parameters:
locale-- 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:IPolyglottOnly meaningful for the default language for which all required fields must be filled- Specified by:
isValidin interfaceIPolyglott- Parameters:
locale-- Returns:
- true if all required fields contain a value in the given locale
-
isEmpty
Description copied from interface:IPolyglottIf this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' class- Specified by:
isEmptyin interfaceIPolyglott- Parameters:
locale-- Returns:
- true if no fields are filled for the given locale
-
getSelectedLocale
- Specified by:
getSelectedLocalein interfaceIPolyglott- Returns:
- the locale currently set by
IPolyglott.setSelectedLocale(Locale)
-
setSelectedLocale
Description copied from interface:IPolyglottSet the locale to use for display and editing- Specified by:
setSelectedLocalein interfaceIPolyglott- Parameters:
locale-
-
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
-
isHasShortDescription
public boolean isHasShortDescription() -
getShortDescription
public de.intranda.metadata.multilanguage.IMetadataValue getShortDescription(int maxLength) -
getAdminBackendUrl
-