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 Alpers
-
Constructor Summary
ConstructorsConstructorDescriptionWidgetDisplayElement(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.WidgetDisplayElement(CustomSidebarWidget widget, List<CMSPage> embeddedPages) -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(WidgetDisplayElement other) Two elements are equal if their titles are equal.Describes the specific xhtml component used for this widget.A description of the element.A list of CMS pages using this element.Describes they way in which way data for this widget is created and stored.getId()Identifier of the underlying data, if any.getTitle()The displayed title of the element.booleanbooleanisComplete(Locale locale) Both title and description are filled.booleanIf this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' class.booleanAt least one of title and description is filled.voidsetSelectedLocale(Locale locale) Not used, since this element isn't editable.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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- displayed title of the widgetdescription- short description of the widgetembeddingPages- CMS pages that embed this widgetgenerationType- the way the widget's data is generated and storedcontentType- the specific xhtml component used for this widget
-
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- displayed title of the widgetdescription- short description of the widgetembeddingPages- CMS pages that embed this widgetgenerationType- the way the widget's data is generated and storedcontentType- the specific xhtml component used for this widgetid- 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
-
WidgetDisplayElement
-
WidgetDisplayElement
-
-
Method Details
-
getTitle
The displayed title of the element.- Returns:
- the title of this widget display element as a
TranslatedText
-
getDescription
A description of the element.- Returns:
- the description of this widget display element as a
TranslatedText
-
getDescriptionOrTypeDescription
-
getEmbeddingPages
A list of CMS pages using this element. Only used to automatic and custom widgets- Returns:
- the list of
CMSPageinstances that embed this widget
-
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
WidgetContentTypeidentifying the xhtml component for this widget
-
getId
Identifier of the underlying data, if any.- Returns:
- the database identifier of the underlying widget data, or null if no persistent data exists
-
isComplete
Both title and description are filled.- Specified by:
isCompletein interfaceIPolyglott- Parameters:
locale- the locale to check translation completeness for- Returns:
- true if both title and description are non-empty for the given locale, false otherwise
-
isValid
At least one of title and description is filled.- Specified by:
isValidin interfaceIPolyglott- Parameters:
locale- the locale to check validity for- Returns:
- true if the title is non-empty for any locale, false otherwise
-
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- the locale to check for empty fields- 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
Not used, since this element isn't editable.- Specified by:
setSelectedLocalein interfaceIPolyglott- Parameters:
locale- the locale to set (ignored)
-
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:
compareToin interfaceComparable<WidgetDisplayElement>- Parameters:
other- the widget display element to compare to- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object
-
getAdminBackendUrl
-