Package org.opencms.i18n
Class CmsSingleTreeLocaleHandler
- java.lang.Object
-
- org.opencms.i18n.CmsDefaultLocaleHandler
-
- org.opencms.i18n.CmsSingleTreeLocaleHandler
-
- All Implemented Interfaces:
I_CmsLocaleHandler
public class CmsSingleTreeLocaleHandler extends CmsDefaultLocaleHandler
Advanced locale handler allowing single tree localization.
-
-
Constructor Summary
Constructors Constructor Description CmsSingleTreeLocaleHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CmsI18nInfo
getI18nInfo(javax.servlet.http.HttpServletRequest req, CmsUser user, CmsProject project, java.lang.String resourceName)
Returns the i18n information to use in the request context.static java.util.Locale
getLocaleFromPath(java.lang.String sitePath)
Reads the locale from the first path element.void
initHandler(CmsObject cms)
Will be called during system startup.
-
-
-
Constructor Detail
-
CmsSingleTreeLocaleHandler
public CmsSingleTreeLocaleHandler()
-
-
Method Detail
-
getLocaleFromPath
public static java.util.Locale getLocaleFromPath(java.lang.String sitePath)
Reads the locale from the first path element.- Parameters:
sitePath
- the site path with the locale prefix- Returns:
- the locale or
null
if no matching locale was found
-
getI18nInfo
public CmsI18nInfo getI18nInfo(javax.servlet.http.HttpServletRequest req, CmsUser user, CmsProject project, java.lang.String resourceName)
Description copied from interface:I_CmsLocaleHandler
Returns the i18n information to use in the request context.- Specified by:
getI18nInfo
in interfaceI_CmsLocaleHandler
- Overrides:
getI18nInfo
in 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:
CmsDefaultLocaleHandler.getI18nInfo(javax.servlet.http.HttpServletRequest, org.opencms.file.CmsUser, org.opencms.file.CmsProject, java.lang.String)
-
initHandler
public void initHandler(CmsObject cms)
Description copied from interface:I_CmsLocaleHandler
Will be called during system startup.- Specified by:
initHandler
in interfaceI_CmsLocaleHandler
- Overrides:
initHandler
in classCmsDefaultLocaleHandler
- Parameters:
cms
- an initialized cms permission context for VFS access- See Also:
I_CmsLocaleHandler.initHandler(org.opencms.file.CmsObject)
-
-