Class CmsWorkplaceMessages
- java.lang.Object
-
- org.opencms.i18n.CmsMessages
-
- org.opencms.i18n.CmsMultiMessages
-
- org.opencms.workplace.CmsWorkplaceMessages
-
public class CmsWorkplaceMessages extends CmsMultiMessages
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 likecom.mycompany.module.workplace_en.properties
orcom.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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opencms.i18n.CmsMultiMessages
CmsMultiMessages.I_KeyFallbackHandler
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
GUI_NEW_RESOURCE_TITLE_PREFIX
The title key prefix used for the "new resource" dialog.static java.lang.String
PREFIX_BUNDLE_MESSAGES
Constant for the".messages"
prefix.static java.lang.String
PREFIX_BUNDLE_WORKPLACE
Constant for the".workplace"
prefix.static java.lang.String
WORKPLACE_BUNDLE_NAME
Constant for the multi bundle name.-
Fields inherited from class org.opencms.i18n.CmsMultiMessages
MULTI_BUNDLE_NAME, NULL_STRING
-
Fields inherited from class org.opencms.i18n.CmsMessages
KEY_SHORT_SUFFIX, UNKNOWN_KEY_EXTENSION
-
-
Constructor Summary
Constructors Constructor Description CmsWorkplaceMessages(java.util.Locale locale)
Constructor for creating a new messages object initialized with the provided locale.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
static java.lang.String
getNewResourceTitle(CmsWorkplace wp, java.lang.String name)
Returns the title for the "new resource" dialog.static java.lang.String
getResourceTypeDescription(java.util.Locale locale, java.lang.String name)
Returns the description of the given resource type name.static java.lang.String
getResourceTypeDescription(CmsWorkplace wp, java.lang.String name)
Returns the description of the given resource type name.static java.lang.String
getResourceTypeName(java.util.Locale locale, java.lang.String name)
Returns the localized name of the given resource type name.static java.lang.String
getResourceTypeName(CmsWorkplace wp, java.lang.String name)
Returns the localized name of the given resource type name.int
hashCode()
-
Methods inherited from class org.opencms.i18n.CmsMultiMessages
addBundle, addMessages, addMessages, getMessages, getString, isInitialized, key, setFallbackHandler
-
Methods inherited from class org.opencms.i18n.CmsMessages
formatUnknownKey, getBundleName, getDate, getDate, getDate, getDateTime, getDateTime, getDateTime, getLocale, getResourceBundle, isUncacheable, isUnknownKey, key, key, key, key, key, keyDefault, keyWithParams, setBundleName, setLocale, setResourceBundle, toString
-
-
-
-
Field Detail
-
GUI_NEW_RESOURCE_TITLE_PREFIX
public static final java.lang.String GUI_NEW_RESOURCE_TITLE_PREFIX
The title key prefix used for the "new resource" dialog.- See Also:
- Constant Field Values
-
PREFIX_BUNDLE_MESSAGES
public static final java.lang.String PREFIX_BUNDLE_MESSAGES
Constant for the".messages"
prefix.- See Also:
- Constant Field Values
-
PREFIX_BUNDLE_WORKPLACE
public static final java.lang.String PREFIX_BUNDLE_WORKPLACE
Constant for the".workplace"
prefix.- See Also:
- Constant Field Values
-
WORKPLACE_BUNDLE_NAME
public static final java.lang.String WORKPLACE_BUNDLE_NAME
Constant for the multi bundle name.
-
-
Constructor Detail
-
CmsWorkplaceMessages
public CmsWorkplaceMessages(java.util.Locale locale)
Constructor for creating a new messages object initialized with the provided locale.- Parameters:
locale
- the locale to initialize
-
-
Method Detail
-
getNewResourceTitle
public static java.lang.String getNewResourceTitle(CmsWorkplace wp, java.lang.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 aCmsWorkplace
to resolve the key name withname
- the type to generate the title for- Returns:
- the title for the "new resource" dialog
-
getResourceTypeDescription
public static java.lang.String getResourceTypeDescription(CmsWorkplace wp, java.lang.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:
wp
- an instance of aCmsWorkplace
to resolve the key name withname
- the resource type name to generate the nice name for- Returns:
- the description of the given resource type name
-
getResourceTypeDescription
public static java.lang.String getResourceTypeDescription(java.util.Locale locale, java.lang.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 usename
- the resource type name to generate the nice name for- Returns:
- the description of the given resource type name
-
getResourceTypeName
public static java.lang.String getResourceTypeName(CmsWorkplace wp, java.lang.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 aCmsWorkplace
to resolve the key name withname
- the resource type name to generate the nice name for- Returns:
- the localized name of the given resource type name
-
getResourceTypeName
public static java.lang.String getResourceTypeName(java.util.Locale locale, java.lang.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 usename
- the resource type name to generate the nice name for- Returns:
- the localized name of the given resource type name
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classCmsMessages
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classCmsMessages
- See Also:
CmsMessages.hashCode()
-
-