Class WidgetDisplayElement
java.lang.Object
io.goobi.viewer.model.cms.widgets.WidgetDisplayElement
- All Implemented Interfaces:
IPolyglott
,Comparable<WidgetDisplayElement>
public class WidgetDisplayElement
extends Object
implements IPolyglott, Comparable<WidgetDisplayElement>
Class for displaying information about available sidebar widgets in /admin/cms/widgets and the sidebar edit tab of /admin/cms/pages/edit. Widgets
are distinguished by
getGenerationType()
into default widgets with static GUI, automatic widgets provided by other custom content and
custom widgets explicitly created by users They are further distinguished by getContentType()
corresponding to the individual widget xhtml
component- Author:
- florian
-
Constructor Summary
ConstructorDescriptionWidgetDisplayElement
(de.intranda.metadata.multilanguage.IMetadataValue title, de.intranda.metadata.multilanguage.IMetadataValue description, List<CMSPage> embeddingPages, WidgetGenerationType generationType, WidgetContentType contentType) Default constructor for widgets without underlying data (i.e. default widgets)WidgetDisplayElement
(de.intranda.metadata.multilanguage.IMetadataValue title, de.intranda.metadata.multilanguage.IMetadataValue description, List<CMSPage> embeddingPages, WidgetGenerationType generationType, WidgetContentType contentType, Long id, IPolyglott translations) Default constructor for widgets with underlying data identified by the given id -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(WidgetDisplayElement other) Two elements are equal if their titles are equalDescribes the specific xhtml component used for this widgetA description of the elementA list of CMS pages using this element.Describes they way in which way data for this widget is created and storedgetId()
Identifier of the underlying data, if anygetTitle()
The displayed title of the elementboolean
boolean
isComplete
(Locale locale) Both title and description are filledboolean
If this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' classboolean
At least one of title and description is filledvoid
setSelectedLocale
(Locale locale) Not used, since this element isn't editabletoString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.goobi.viewer.model.translations.IPolyglott
getLocales, isDefaultLocaleSelected, isSelected, setSelectedLocale
-
Constructor Details
-
WidgetDisplayElement
public WidgetDisplayElement(de.intranda.metadata.multilanguage.IMetadataValue title, de.intranda.metadata.multilanguage.IMetadataValue description, List<CMSPage> embeddingPages, WidgetGenerationType generationType, WidgetContentType contentType) Default constructor for widgets without underlying data (i.e. default widgets)- Parameters:
title
-description
-embeddingPages
-generationType
-contentType
-
-
WidgetDisplayElement
public WidgetDisplayElement(de.intranda.metadata.multilanguage.IMetadataValue title, de.intranda.metadata.multilanguage.IMetadataValue description, List<CMSPage> embeddingPages, WidgetGenerationType generationType, WidgetContentType contentType, Long id, IPolyglott translations) Default constructor for widgets with underlying data identified by the given id- Parameters:
title
-description
-embeddingPages
-generationType
-contentType
-id
- the database id of the underlying content. The type of content depends on generationType and contentTypetranslations
- used to display translation status of the widget. Usually the underlying custom widget
-
-
Method Details
-
getTitle
The displayed title of the element- Returns:
- the title
-
getDescription
A description of the element- Returns:
- the description
-
getEmbeddingPages
A list of CMS pages using this element. Only used to automatic and custom widgets- Returns:
- the embeddingPages
-
getGenerationType
Describes they way in which way data for this widget is created and stored- Returns:
- the
generation type
-
getContentType
Describes the specific xhtml component used for this widget- Returns:
- the contentType
-
getId
Identifier of the underlying data, if any- Returns:
- the id
-
isComplete
Both title and description are filled- 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
At least one of title and description is 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
Not used, since this element isn't editable- Specified by:
setSelectedLocale
in interfaceIPolyglott
-
hasTranslations
public boolean hasTranslations()- Returns:
- true if an object exists providing the translation status of the widget
-
getTranslations
- Returns:
- the object providing the translation status of the widget
-
toString
-
compareTo
Two elements are equal if their titles are equal- Specified by:
compareTo
in interfaceComparable<WidgetDisplayElement>
-