Package org.opencms.i18n
Class CmsSingleTreeLocaleHandler
java.lang.Object
org.opencms.i18n.CmsDefaultLocaleHandler
org.opencms.i18n.CmsSingleTreeLocaleHandler
- All Implemented Interfaces:
I_CmsLocaleHandler
Advanced locale handler allowing single tree localization.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetI18nInfo(javax.servlet.http.HttpServletRequest req, CmsUser user, CmsProject project, String resourceName) Returns the i18n information to use in the request context.static LocalegetLocaleFromPath(String sitePath) Reads the locale from the first path element.voidinitHandler(CmsObject cms) Will be called during system startup.
-
Constructor Details
-
CmsSingleTreeLocaleHandler
public CmsSingleTreeLocaleHandler()
-
-
Method Details
-
getLocaleFromPath
Reads the locale from the first path element.- Parameters:
sitePath- the site path with the locale prefix- Returns:
- the locale or
nullif no matching locale was found
-
getI18nInfo
public CmsI18nInfo getI18nInfo(javax.servlet.http.HttpServletRequest req, CmsUser user, CmsProject project, String resourceName) Description copied from interface:I_CmsLocaleHandlerReturns the i18n information to use in the request context.- Specified by:
getI18nInfoin interfaceI_CmsLocaleHandler- Overrides:
getI18nInfoin classCmsDefaultLocaleHandler- Parameters:
req- the current http requestuser- the current userproject- the current projectresourceName- the URI of the requested resource (with full site root added)- Returns:
- the i18n information to use for the given request context
- See Also:
-
initHandler
Description copied from interface:I_CmsLocaleHandlerWill be called during system startup.- Specified by:
initHandlerin interfaceI_CmsLocaleHandler- Overrides:
initHandlerin classCmsDefaultLocaleHandler- Parameters:
cms- an initialized cms permission context for VFS access- See Also:
-