Class TranslationGroupItem
java.lang.Object
io.goobi.viewer.model.translations.admin.TranslationGroupItem
- Direct Known Subclasses:
CoreMessagesTranslationGroupItem
,LocalMessagesTranslationGroupItem
,SolrFieldNameTranslationGroupItem
,SolrFieldValueTranslationGroupItem
A single element as part of a translation group.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
TranslationGroupItem
(String key, boolean regex) Protected constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic TranslationGroupItem
create
(TranslationGroup.TranslationGroupType type, String key, boolean regex) Factory method.protected void
createMessageKeyStatusMap
(List<String> keys) Checks the translation status for each of the given keys and populatesmessageKeys
accordingly.getKey()
Returns the translation status over all existing entries.getTranslationStatusLanguage
(String language) Returns the translation status for the requested language over all existing entries.boolean
isRegex()
protected abstract void
Populates the message key map by first loading the appropriate keys and then callingcreateMessageKeyStatusMap
.
-
Field Details
-
key
A single message key or a regular expression for multiple message keys. -
regex
protected final boolean regexIf true,key
will contain a regular expression. -
entries
-
-
Constructor Details
-
TranslationGroupItem
Protected constructor.- Parameters:
key
-regex
-
-
-
Method Details
-
create
public static TranslationGroupItem create(TranslationGroup.TranslationGroupType type, String key, boolean regex) Factory method.- Parameters:
type
-key
-regex
-- Returns:
- Created
TranslationGroupItem
-
getTranslationStatus
public MessageEntry.TranslationStatus getTranslationStatus() throws IndexUnreachableException, PresentationExceptionReturns the translation status over all existing entries.- Returns:
TranslationStatu
; FULL if all entries are FULL; NONE if all entries are NONE; PARTIAL otherwise- Throws:
PresentationException
IndexUnreachableException
-
getTranslationStatusLanguage
public MessageEntry.TranslationStatus getTranslationStatusLanguage(String language) throws IndexUnreachableException, PresentationException Returns the translation status for the requested language over all existing entries.- Parameters:
language
- Requested language- Returns:
TranslationStatu
; FULL if all entries are FULL; NONE if all entries are NONE; PARTIAL otherwise- Throws:
PresentationException
IndexUnreachableException
Exception
-
getKey
- Returns:
- the key
-
isRegex
public boolean isRegex()- Returns:
- the regex
-
getEntries
- Returns:
- the messageKeys
- Throws:
IndexUnreachableException
PresentationException
-
loadEntries
Populates the message key map by first loading the appropriate keys and then callingcreateMessageKeyStatusMap
. Each subclass will have its specific data source, so each subclass must implement this method. -
createMessageKeyStatusMap
Checks the translation status for each of the given keys and populatesmessageKeys
accordingly.- Parameters:
keys
-
-