Package org.opencms.loader
Class CmsTemplateContext
java.lang.Object
org.opencms.loader.CmsTemplateContext
A template context is basically a named path to a template JSP, which
has both an internal name used as a key, and a user-readable, localizable name. It
also has a reference to the template context provider which produced it.
-
Constructor Summary
ConstructorDescriptionCmsTemplateContext
(String key, String path, CmsMessageContainer container, I_CmsTemplateContextProvider provider) Constructor.CmsTemplateContext
(String key, String path, I_CmsMessageContainer container, I_CmsTemplateContextProvider provider, Collection<CmsClientVariant> clientVariants, boolean forced) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGets the map of client variants.getKey()
Gets the internal name used as a key.getLocalizedName
(Locale locale) Gets the localized name for a given locale.Gets the message container for the user-readable name.Gets the template context provider which produced this template context.Gets the path to the template.boolean
isForced()
Return true if the template context was not automatically determined.toString()
-
Constructor Details
-
CmsTemplateContext
public CmsTemplateContext(String key, String path, CmsMessageContainer container, I_CmsTemplateContextProvider provider) Constructor.- Parameters:
key
- the internal namepath
- the template pathcontainer
- the message container for the nameprovider
- the template context provider
-
CmsTemplateContext
public CmsTemplateContext(String key, String path, I_CmsMessageContainer container, I_CmsTemplateContextProvider provider, Collection<CmsClientVariant> clientVariants, boolean forced) Constructor.- Parameters:
key
- the internal namepath
- the template pathcontainer
- the message container for the nameprovider
- the template context providerclientVariants
- the client variantsforced
- true if the template context is forced to a specific value instead of automatically determined
-
-
Method Details
-
getClientVariants
Gets the map of client variants.Client variants are specialized variants of a template context which are only used by the container page editor for preview purposes.
- Returns:
- the client variants
-
getKey
Gets the internal name used as a key.- Returns:
- the internal name
-
getLocalizedName
Gets the localized name for a given locale.- Parameters:
locale
- the locale for which we want the name- Returns:
- the localized name
-
getMessageContainer
Gets the message container for the user-readable name.- Returns:
- the message container
-
getProvider
Gets the template context provider which produced this template context.- Returns:
- the template context provider
-
getTemplatePath
Gets the path to the template.- Returns:
- the path to the template
-
isForced
Return true if the template context was not automatically determined.- Returns:
- true if the template context was not automatically determined
-
toString
-