Package de.espirit.firstspirit.agency
Interface LanguageAgent
public interface LanguageAgent
Definition for an agent offering information about project persistency languages. These are the languages defined within a project
to be used by editors creating content. This agent is focused on a specific project.
Examples:
SpecialistsBroker.requireSpecialist(LanguageAgent.TYPE).getLanguages()
SpecialistsBroker.requireSpecialist(LanguageAgent.TYPE).getMasterLanguage()
- Since:
- 4.2.405
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SpecialistType<LanguageAgent> The agent's technical type to be used for requesting the agent from aSpecialistsBroker. -
Method Summary
Modifier and TypeMethodDescriptionProvides access to the languages marked as editorial languages, i.e, those languages used to edit the element's display names.Provide the language being used to define fallback values inform defaults.Provide access to available persistency languages.Provides the persistency language used as master.@NotNull LanguageProvide the language being used for metadata representation.Provides the languages the current user is allowed to modify content in, based on the language permissions configured for the user's groups (Group.ModifiableLanguagesMode).getProjectLanguages(boolean includeFallback) Provide access to available persistency languages, mapping abbreviations to the respective language definition.Provides access to languages defined to be visible for the current user.booleanisLanguageModifiable(@NotNull Language... languages) Checks whether the current user is allowed to modify content in all the given languages.
-
Field Details
-
TYPE
The agent's technical type to be used for requesting the agent from aSpecialistsBroker.- Since:
- 4.2.405
-
-
Method Details
-
getMasterLanguage
Language getMasterLanguage()Provides the persistency language used as master.- Returns:
- The master language.
- Since:
- 4.2.405
-
getMetaLanguage
Provide the language being used for metadata representation.- Returns:
- The metadata language.
- Since:
- 5.1.28
-
getFallbackLanguage
Language getFallbackLanguage()Provide the language being used to define fallback values inform defaults.- Returns:
- The fallback language
- Since:
- 5.2.24
- See Also:
-
getLanguages
Provide access to available persistency languages.- Returns:
- An (unmodifiable) list of languages.
- Since:
- 4.2.405
-
getVisibleLanguages
Provides access to languages defined to be visible for the current user.- Returns:
- An (unmodifiable) list of languages.
- Since:
- 5.0.601, 5.1.4
-
getModifiableLanguages
Provides the languages the current user is allowed to modify content in, based on the language permissions configured for the user's groups (Group.ModifiableLanguagesMode).The result is determined as follows:
- If the current user belongs to no group, an empty list is returned.
- If no group of the current user has language restrictions configured (all groups in mode
OFF), all project languages are returned andSOLE_LANGUAGEis prepended to the list, indicating that language-independent modifications are also allowed. - If at least one group is configured with
ALL_LANGUAGES, all project languages are returned andSOLE_LANGUAGEis prepended to the list, indicating that language-independent modifications are also allowed. - Otherwise, the union of languages from all groups configured with
SELECTED_LANGUAGESis returned. This may includeSOLE_LANGUAGEif it is explicitly configured in any of those groups viaGroup.setModifiableLanguages(java.util.List).
- Returns:
- an unmodifiable list of languages the current user may modify, never
null. - Since:
- 5.2.260700
-
isLanguageModifiable
Checks whether the current user is allowed to modify content in all the given languages.SOLE_LANGUAGEmay be passed to check whether language-independent modifications are permitted.The result is determined as follows:
- Returns
falseif the current user belongs to no group. - Returns
trueif no group of the current user has language restrictions configured (all groups in modeOFF) - language-independent modifications are also allowed. - Returns
trueif at least one group is configured withALL_LANGUAGES- language-independent modifications are also allowed. - Otherwise, evaluates the union of languages from all groups configured with
SELECTED_LANGUAGES:- Returns
trueif that union contains all the given languages.SOLE_LANGUAGEis only considered modifiable if it is explicitly configured in one of those groups viaGroup.setModifiableLanguages(java.util.List). - Returns
falseotherwise.
- Returns
- Parameters:
languages- one or more languages to check, may includeSOLE_LANGUAGE.- Returns:
trueif the current user may modify content in all the given languages.- Since:
- 5.2.260700
- Returns
-
getEditorialLanguages
Provides access to the languages marked as editorial languages, i.e, those languages used to edit the element's display names.- Returns:
- An (unmodifiable) list of languages.
- Since:
- 5.1.8
-
getProjectLanguages
Provide access to available persistency languages, mapping abbreviations to the respective language definition.- Parameters:
includeFallback- Iftrue, theFallback-Languageis included in the resulting map.- Returns:
- An (unmodifiable) map, where each value is a language and the key is the respective
abbreviation. - Since:
- 4.2.405
-