Class 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 Detail

      • CmsTemplateContext

        public CmsTemplateContext​(java.lang.String key,
                                  java.lang.String path,
                                  CmsMessageContainer container,
                                  I_CmsTemplateContextProvider provider)
        Constructor.

        Parameters:
        key - the internal name
        path - the template path
        container - the message container for the name
        provider - 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 name
        path - the template path
        container - the message container for the name
        provider - the template context provider
        clientVariants - the client variants
        forced - 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,​CmsClientVariantgetClientVariants()
        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
      • 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 class java.lang.Object
        See Also:
        Object.toString()