Package org.opencms.loader
Class CmsTemplateContext
- java.lang.Object
-
- org.opencms.loader.CmsTemplateContext
-
public class CmsTemplateContext extends java.lang.Object
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
Constructors Constructor Description CmsTemplateContext(java.lang.String key, java.lang.String path, CmsMessageContainer container, I_CmsTemplateContextProvider provider)
Constructor.CmsTemplateContext(java.lang.String key, java.lang.String path, I_CmsMessageContainer container, I_CmsTemplateContextProvider provider, java.util.Collection<CmsClientVariant> clientVariants, boolean forced)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,CmsClientVariant>
getClientVariants()
Gets the map of client variants.java.lang.String
getKey()
Gets the internal name used as a key.java.lang.String
getLocalizedName(java.util.Locale locale)
Gets the localized name for a given locale.I_CmsMessageContainer
getMessageContainer()
Gets the message container for the user-readable name.I_CmsTemplateContextProvider
getProvider()
Gets the template context provider which produced this template context.java.lang.String
getTemplatePath()
Gets the path to the template.boolean
isForced()
Return true if the template context was not automatically determined.java.lang.String
toString()
-
-
-
Constructor Detail
-
CmsTemplateContext
public CmsTemplateContext(java.lang.String key, java.lang.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(java.lang.String key, java.lang.String path, I_CmsMessageContainer container, I_CmsTemplateContextProvider provider, java.util.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 Detail
-
getClientVariants
public java.util.Map<java.lang.String,CmsClientVariant> 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
public java.lang.String getKey()
Gets the internal name used as a key.- Returns:
- the internal name
-
getLocalizedName
public java.lang.String getLocalizedName(java.util.Locale locale)
Gets the localized name for a given locale.- Parameters:
locale
- the locale for which we want the name- Returns:
- the localized name
-
getMessageContainer
public I_CmsMessageContainer getMessageContainer()
Gets the message container for the user-readable name.- Returns:
- the message container
-
getProvider
public I_CmsTemplateContextProvider getProvider()
Gets the template context provider which produced this template context.- Returns:
- the template context provider
-
getTemplatePath
public java.lang.String getTemplatePath()
Gets the path to the template.- Returns:
- the path to the template
-
isForced
public boolean isForced()
Return true if the template context was not automatically determined.- Returns:
- true if the template context was not automatically determined
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
-