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 Details

  • Method Details

    • getMasterLanguage

      Language getMasterLanguage()
      Provides the persistency language used as master.
      Returns:
      The master language.
      Since:
      4.2.405
    • getMetaLanguage

      @NotNull @NotNull Language 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 in form defaults.
      Returns:
      The fallback language
      Since:
      5.2.24
      See Also:
    • getLanguages

      List<Language> getLanguages()
      Provide access to available persistency languages.
      Returns:
      An (unmodifiable) list of languages.
      Since:
      4.2.405
    • getVisibleLanguages

      List<Language> 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

      @Experimental @NotNull @NotNull List<Language> 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 and SOLE_LANGUAGE is 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 and SOLE_LANGUAGE is prepended to the list, indicating that language-independent modifications are also allowed.
      • Otherwise, the union of languages from all groups configured with SELECTED_LANGUAGES is returned. This may include SOLE_LANGUAGE if it is explicitly configured in any of those groups via Group.setModifiableLanguages(java.util.List).
      Returns:
      an unmodifiable list of languages the current user may modify, never null.
      Since:
      5.2.260700
    • isLanguageModifiable

      @Experimental boolean isLanguageModifiable(@NotNull @NotNull Language... languages)
      Checks whether the current user is allowed to modify content in all the given languages.

      SOLE_LANGUAGE may be passed to check whether language-independent modifications are permitted.

      The result is determined as follows:

      • Returns false if the current user belongs to no group.
      • Returns true if no group of the current user has language restrictions configured (all groups in mode OFF) - language-independent modifications are also allowed.
      • Returns true if at least one group is configured with ALL_LANGUAGES - language-independent modifications are also allowed.
      • Otherwise, evaluates the union of languages from all groups configured with SELECTED_LANGUAGES:
      Parameters:
      languages - one or more languages to check, may include SOLE_LANGUAGE.
      Returns:
      true if the current user may modify content in all the given languages.
      Since:
      5.2.260700
    • getEditorialLanguages

      List<Language> 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

      Map<String,Language> getProjectLanguages(boolean includeFallback)
      Provide access to available persistency languages, mapping abbreviations to the respective language definition.
      Parameters:
      includeFallback - If true, the Fallback-Language is 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