Package org.opencms.gwt.shared
Class CmsTemplateContextInfo
- java.lang.Object
-
- org.opencms.gwt.shared.CmsTemplateContextInfo
-
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable
public class CmsTemplateContextInfo extends java.lang.Object implements com.google.gwt.user.client.rpc.IsSerializable
Client-compatible bean with information about the current template context.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DUMMY_ELEMENT_MARKER
Dummy element marker class.static java.lang.String
EMPTY_VALUE
The constant used for empty setting.static java.lang.String
SETTING
The setting name used for storing the compatible template contexts.
-
Constructor Summary
Constructors Constructor Description CmsTemplateContextInfo()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,CmsDefaultSet<java.lang.String>>
getAllowedContexts()
Gets the map of forbidden contexts for resource types.java.util.Map<java.lang.String,CmsClientVariantInfo>
getClientVariants(java.lang.String context)
Gets the client variant information for a specific context.java.util.Map<java.lang.String,java.lang.String>
getContextLabels()
Gets the map of labels for the different template contexts.java.lang.String
getContextProvider()
Gets the name of the context provider class.java.lang.String
getCookieName()
Gets the name of the cookie used for overriding the template context.java.lang.String
getCurrentContext()
Gets the key of the currently active template context.java.lang.String
getSelectedContext()
Gets the key of the currently selected template context, using the cookie.CmsXmlContentProperty
getSettingDefinition()
Gets the property definition for the templateContexts setting.boolean
hasClientVariants(java.lang.String context)
Checks if client variants for the given context are present.void
setAllowedContexts(java.util.Map<java.lang.String,CmsDefaultSet<java.lang.String>> allowedContextMap)
Sets the allowed contexts.void
setClientVariant(java.lang.String context, java.lang.String variant, CmsClientVariantInfo info)
Adds a client variant.void
setContextLabels(java.util.Map<java.lang.String,java.lang.String> contextLabels)
Sets the map of labels for the contexts.void
setContextProvider(java.lang.String contextProvider)
Sets the context provider class name.void
setCookieName(java.lang.String cookieName)
Sets the name of the cookie used for overriding the template context.void
setCurrentContext(java.lang.String context)
Sets the active context.void
setSelectedContext(java.lang.String selectedContext)
Sets the selected context.void
setSettingDefinition(CmsXmlContentProperty definition)
Sets the property definition for the templateContexts setting.boolean
shouldShowElementTemplateContextSelection()
Returns true if the template context selection should be shown for container elements.boolean
shouldShowTemplateContextContextMenuEntry()
Returns true if the template context selection context menu entry should be shown.
-
-
-
Field Detail
-
DUMMY_ELEMENT_MARKER
public static final java.lang.String DUMMY_ELEMENT_MARKER
Dummy element marker class.- See Also:
- Constant Field Values
-
EMPTY_VALUE
public static final java.lang.String EMPTY_VALUE
The constant used for empty setting.- See Also:
- Constant Field Values
-
SETTING
public static final java.lang.String SETTING
The setting name used for storing the compatible template contexts.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsTemplateContextInfo
public CmsTemplateContextInfo()
Default constructor.
-
-
Method Detail
-
getAllowedContexts
public java.util.Map<java.lang.String,CmsDefaultSet<java.lang.String>> getAllowedContexts()
Gets the map of forbidden contexts for resource types.- Returns:
- the map of forbidden contexts for resource types
-
getClientVariants
public java.util.Map<java.lang.String,CmsClientVariantInfo> getClientVariants(java.lang.String context)
Gets the client variant information for a specific context.- Parameters:
context
- the context name- Returns:
- the client variant information for that context
-
getContextLabels
public java.util.Map<java.lang.String,java.lang.String> getContextLabels()
Gets the map of labels for the different template contexts.- Returns:
- the map of template context labels
-
getContextProvider
public java.lang.String getContextProvider()
Gets the name of the context provider class.- Returns:
- the name of the context provider class
-
getCookieName
public java.lang.String getCookieName()
Gets the name of the cookie used for overriding the template context.- Returns:
- the cookie name
-
getCurrentContext
public java.lang.String getCurrentContext()
Gets the key of the currently active template context.- Returns:
- the key of the currently active template context
-
getSelectedContext
public java.lang.String getSelectedContext()
Gets the key of the currently selected template context, using the cookie.- Returns:
- the name of the currently selected template context
-
getSettingDefinition
public CmsXmlContentProperty getSettingDefinition()
Gets the property definition for the templateContexts setting.- Returns:
- the property definition for the templateContexts setting
-
hasClientVariants
public boolean hasClientVariants(java.lang.String context)
Checks if client variants for the given context are present.- Parameters:
context
- a context name- Returns:
- true if there are client variants for the context
-
setAllowedContexts
public void setAllowedContexts(java.util.Map<java.lang.String,CmsDefaultSet<java.lang.String>> allowedContextMap)
Sets the allowed contexts.- Parameters:
allowedContextMap
- the map of allowed contexts
-
setClientVariant
public void setClientVariant(java.lang.String context, java.lang.String variant, CmsClientVariantInfo info)
Adds a client variant.- Parameters:
context
- a context namevariant
- the variant nameinfo
- the bean with the variant information
-
setContextLabels
public void setContextLabels(java.util.Map<java.lang.String,java.lang.String> contextLabels)
Sets the map of labels for the contexts.- Parameters:
contextLabels
- the map of context labels
-
setContextProvider
public void setContextProvider(java.lang.String contextProvider)
Sets the context provider class name.- Parameters:
contextProvider
- the context provider class name
-
setCookieName
public void setCookieName(java.lang.String cookieName)
Sets the name of the cookie used for overriding the template context.- Parameters:
cookieName
- the name of the cookie used for overriding the template context
-
setCurrentContext
public void setCurrentContext(java.lang.String context)
Sets the active context.- Parameters:
context
- the active context
-
setSelectedContext
public void setSelectedContext(java.lang.String selectedContext)
Sets the selected context.- Parameters:
selectedContext
- the selected context
-
setSettingDefinition
public void setSettingDefinition(CmsXmlContentProperty definition)
Sets the property definition for the templateContexts setting.- Parameters:
definition
- the property definition
-
shouldShowElementTemplateContextSelection
public boolean shouldShowElementTemplateContextSelection()
Returns true if the template context selection should be shown for container elements.- Returns:
- true if the template context selection for elements should be shown
-
shouldShowTemplateContextContextMenuEntry
public boolean shouldShowTemplateContextContextMenuEntry()
Returns true if the template context selection context menu entry should be shown.- Returns:
- true if the template context selection context menu entry should be shown
-
-