Package org.opencms.i18n
Class CmsVfsBundleManager
- java.lang.Object
-
- org.opencms.i18n.CmsVfsBundleManager
-
- All Implemented Interfaces:
I_CmsEventListener
public class CmsVfsBundleManager extends java.lang.Object implements I_CmsEventListener
Manages message bundles loaded from the VFS.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsVfsBundleManager.NameAndLocale
Data holder for a base name and locale of a message bundle.
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.commons.logging.Log
LOG
The logger instance for this class.static java.lang.String
TYPE_PROPERTIES_BUNDLE
Resource type name for plain-text properties files containing messages.static java.lang.String
TYPE_XML_BUNDLE
Resource type name for XML contents containing messages.-
Fields inherited from interface org.opencms.main.I_CmsEventListener
EVENT_BEFORE_PUBLISH_PROJECT, EVENT_CLEAR_CACHES, EVENT_CLEAR_OFFLINE_CACHES, EVENT_CLEAR_ONLINE_CACHES, EVENT_CLEAR_PRINCIPAL_CACHES, EVENT_FLEX_CACHE_CLEAR, EVENT_FLEX_PURGE_JSP_REPOSITORY, EVENT_FULLSTATIC_EXPORT, EVENT_GROUP_MODIFIED, EVENT_LOGIN_USER, EVENT_OU_MODIFIED, EVENT_PROJECT_MODIFIED, EVENT_PROPERTY_DEFINITION_CREATED, EVENT_PROPERTY_DEFINITION_MODIFIED, EVENT_PROPERTY_MODIFIED, EVENT_PUBLISH_PROJECT, EVENT_REBUILD_SEARCHINDEXES, EVENT_REINDEX_OFFLINE, EVENT_REINDEX_ONLINE, EVENT_RESOURCE_AND_PROPERTIES_MODIFIED, EVENT_RESOURCE_COPIED, EVENT_RESOURCE_CREATED, EVENT_RESOURCE_DELETED, EVENT_RESOURCE_MODIFIED, EVENT_RESOURCE_MOVED, EVENT_RESOURCES_AND_PROPERTIES_MODIFIED, EVENT_RESOURCES_MODIFIED, EVENT_SITEMAP_CHANGED, EVENT_UPDATE_EXPORTS, EVENT_USER_MODIFIED, KEY_CHANGE, KEY_DBCONTEXT, KEY_GROUP_ID, KEY_GROUP_NAME, KEY_INDEX_NAMES, KEY_IS_ONLINE, KEY_OU_ID, KEY_OU_NAME, KEY_PROJECTID, KEY_PUBLISHID, KEY_PUBLISHLIST, KEY_REINDEX_RELATED, KEY_REPORT, KEY_RESOURCE, KEY_RESOURCES, KEY_SKIPINDEX, KEY_USER_ACTION, KEY_USER_CHANGES, KEY_USER_ID, KEY_USER_NAME, LISTENERS_FOR_ALL_EVENTS, VALUE_CREATE_SIBLING, VALUE_GROUP_MODIFIED_ACTION_CREATE, VALUE_GROUP_MODIFIED_ACTION_DELETE, VALUE_GROUP_MODIFIED_ACTION_WRITE, VALUE_OU_MODIFIED_ACTION_CREATE, VALUE_OU_MODIFIED_ACTION_DELETE, VALUE_USER_MODIFIED_ACTION_ADD_USER_TO_GROUP, VALUE_USER_MODIFIED_ACTION_CREATE_USER, VALUE_USER_MODIFIED_ACTION_DELETE_USER, VALUE_USER_MODIFIED_ACTION_REMOVE_USER_FROM_GROUP, VALUE_USER_MODIFIED_ACTION_RESET_PASSWORD, VALUE_USER_MODIFIED_ACTION_SET_OU, VALUE_USER_MODIFIED_ACTION_WRITE_USER
-
-
Constructor Summary
Constructors Constructor Description CmsVfsBundleManager(CmsObject cms)
Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cmsEvent(CmsEvent event)
Acknowledge the occurrence of the specified event, implement this method to check for CmsEvents in your class.static CmsVfsBundleManager.NameAndLocale
getNameAndLocale(CmsResource bundleRes)
Extracts the locale and base name from a resource's file name.boolean
isReloadScheduled()
Indicates if a reload thread is currently scheduled.protected void
logError(java.lang.Exception e, boolean logToErrorChannel)
Logs an exception that occurred.void
reload(boolean isStartup)
Re-initializes the resource bundles.void
setReloadScheduled(boolean reloadIsScheduled)
Sets the information if a reload thread is currently scheduled.void
shutDown()
Shuts down the VFS bundle manager.
-
-
-
Field Detail
-
TYPE_PROPERTIES_BUNDLE
public static final java.lang.String TYPE_PROPERTIES_BUNDLE
Resource type name for plain-text properties files containing messages.- See Also:
- Constant Field Values
-
TYPE_XML_BUNDLE
public static final java.lang.String TYPE_XML_BUNDLE
Resource type name for XML contents containing messages.- See Also:
- Constant Field Values
-
LOG
protected static final org.apache.commons.logging.Log LOG
The logger instance for this class.
-
-
Constructor Detail
-
CmsVfsBundleManager
public CmsVfsBundleManager(CmsObject cms)
Creates a new instance.- Parameters:
cms
- the CMS context to use
-
-
Method Detail
-
getNameAndLocale
public static CmsVfsBundleManager.NameAndLocale getNameAndLocale(CmsResource bundleRes)
Extracts the locale and base name from a resource's file name.- Parameters:
bundleRes
- the resource for which to get the base name and locale- Returns:
- a bean containing the base name and locale
-
cmsEvent
public void cmsEvent(CmsEvent event)
Description copied from interface:I_CmsEventListener
Acknowledge the occurrence of the specified event, implement this method to check for CmsEvents in your class.- Specified by:
cmsEvent
in interfaceI_CmsEventListener
- Parameters:
event
- CmsEvent that has occurred- See Also:
I_CmsEventListener.cmsEvent(org.opencms.main.CmsEvent)
-
isReloadScheduled
public boolean isReloadScheduled()
Indicates if a reload thread is currently scheduled.- Returns:
true
if a reload is currently scheduled
-
reload
public void reload(boolean isStartup)
Re-initializes the resource bundles.- Parameters:
isStartup
- true when this is called during startup
-
setReloadScheduled
public void setReloadScheduled(boolean reloadIsScheduled)
Sets the information if a reload thread is currently scheduled.- Parameters:
reloadIsScheduled
- iftrue
there is a reload currently scheduled
-
shutDown
public void shutDown()
Shuts down the VFS bundle manager.This will cause the internal reloading Thread not reload in case it is still running.
-
logError
protected void logError(java.lang.Exception e, boolean logToErrorChannel)
Logs an exception that occurred.- Parameters:
e
- the exception to loglogToErrorChannel
- if true erros should be written to the error channel instead of the info channel
-
-