Class MaintenanceMode
java.lang.Object
io.goobi.viewer.model.administration.MaintenanceMode
- All Implemented Interfaces:
IPolyglott
JPA entity that stores the maintenance mode configuration, including its enabled state and
multilingual message text displayed to visitors during scheduled downtime.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetId()getText()getTextOrDefault(String language) inthashCode()booleanisComplete(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 true.booleanIf this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' class.booleanbooleanOnly meaningful for the default language for which all required fields must be filled.voidsetEnabled(boolean enabled) voidvoidsetSelectedLocale(Locale locale) Sets the locale to use for display and editing.voidsetText.voidvoidsetTranslations(List<MaintenanceModeTranslation> translations) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.goobi.viewer.model.translations.IPolyglott
getLocales, isDefaultLocaleSelected, isSelected, setSelectedLocale
-
Constructor Details
-
MaintenanceMode
public MaintenanceMode()Default constructor.
-
-
Method Details
-
getId
-
setId
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) -
getTranslations
-
setTranslations
-
getText
- Returns:
- Text value in the current language
-
getText
- Parameters:
language- locale for the text translation to retrieve- Returns:
- Text value in the given language
-
getTextOrDefault
- Parameters:
language- locale for the text translation to retrieve, with fallback to default- Returns:
- Text value in the given language
-
setText
setText.- Parameters:
text- maintenance message text for the current locale
-
setText
- Parameters:
text- maintenance message text to storelanguage- locale for which to set the text
-
hashCode
public int hashCode() -
equals
-
isComplete
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:
isCompletein interfaceIPolyglott- Parameters:
locale- the locale to check translation completeness for- 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
Only meaningful for the default language for which all required fields must be filled.- Specified by:
isValidin interfaceIPolyglott- Parameters:
locale- the locale to validate required fields for- Returns:
- true if all required fields contain a value in the given locale
-
isEmpty
If 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
Description copied from interface:IPolyglottSets the locale to use for display and editing.- Specified by:
setSelectedLocalein interfaceIPolyglott- Parameters:
locale- the locale to select
-