Class CmsWorkplaceMessages


Provides access to the localized messages for the OpenCms workplace.

The workplace messages are collected from the workplace resource bundles of all installed modules, plus all the OpenCms core packages.

To be recognized as a workplace module resource bundle, the workplace property file must follow the naming convention ${module_package_name}.workplace${locale}.properties, or ${module_package_name}.messages${locale}.properties for example like com.mycompany.module.workplace_en.properties or com.mycompany.module.messages_en.properties.

Workplace messages are cached for faster lookup. If a localized key is contained in more then one module, it will be used only from the module where it was first found in. The module order is undefined. It is therefore recommended to ensure the uniqueness of all module keys by placing a special prefix in front of all keys of a module.

Since:
6.0.0
  • Field Details

  • Constructor Details

    • CmsWorkplaceMessages

      public CmsWorkplaceMessages(Locale locale)
      Constructor for creating a new messages object initialized with the provided locale.

      Parameters:
      locale - the locale to initialize
  • Method Details

    • getNewResourceTitle

      public static String getNewResourceTitle(CmsWorkplace wp, String name)
      Returns the title for the "new resource" dialog.

      It will look up a key with the prefix GUI_NEW_RESOURCE_TITLE_PREFIX and the given name appended (converted to lower case).

      If this key is not found, the value of Messages.GUI_TITLE_NEWFILEOTHER_0 will be returned.

      Parameters:
      wp - an instance of a CmsWorkplace to resolve the key name with
      name - the type to generate the title for
      Returns:
      the title for the "new resource" dialog
    • getResourceTypeDescription

      Returns the description of the given resource type name.

      If this key is not found, the value of the name input will be returned.

      Parameters:
      wp - an instance of a CmsWorkplace to resolve the key name with
      name - the resource type name to generate the nice name for
      Returns:
      the description of the given resource type name
    • getResourceTypeDescription

      public static String getResourceTypeDescription(Locale locale, String name)
      Returns the description of the given resource type name.

      If this key is not found, the value of the name input will be returned.

      Parameters:
      locale - the right locale to use
      name - the resource type name to generate the nice name for
      Returns:
      the description of the given resource type name
    • getResourceTypeName

      public static String getResourceTypeName(CmsWorkplace wp, String name)
      Returns the localized name of the given resource type name.

      If this key is not found, the value of the name input will be returned.

      Parameters:
      wp - an instance of a CmsWorkplace to resolve the key name with
      name - the resource type name to generate the nice name for
      Returns:
      the localized name of the given resource type name
    • getResourceTypeName

      public static String getResourceTypeName(Locale locale, String name)
      Returns the localized name of the given resource type name.

      If this key is not found, the value of the name input will be returned.

      Parameters:
      locale - the right locale to use
      name - the resource type name to generate the nice name for
      Returns:
      the localized name of the given resource type name
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class CmsMessages
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class CmsMessages
      See Also: