Class CmsFormatterBean
- All Implemented Interfaces:
Cloneable,I_CmsFormatterBean
- Direct Known Subclasses:
CmsFlexFormatterBean,CmsFunctionFormatterBean,CmsMacroFormatterBean
- Since:
- 8.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault rank for formatters from formatter configuration files.static final intDefault rank for formatters defined in schema.Set of alias keys.The formatter container type.CSS Head includes.protected StringThe description text for the formatter.protected StringProvides the display type.protected StringThe id for this formatter.protected StringInline CSS snippets.protected StringInline Javascript snippets.protected booleanIs the formatter automatically enabled?protected booleanTrue if this formatter can be used for detail views.protected booleanIs the formatter from a formatter configuration file?protected booleanIndicates if this formatter is to be used as preview in the ADE gallery GUI.JavaScript head includes.protected StringThe formatter JSP.protected CmsUUIDThe UUID of the JSP resource for this formatter.protected StringThe formatter key.protected StringThe location this formatter was configured in.protected booleanIf true, will match any container/width combination.protected intThe formatter max width.protected List<CmsMetaMapping> The meta mappings.protected intThe formatter min width.protected booleanIndicates whether nested formatter settings should be displayed.protected StringThe nice name.protected List<CmsTemplatePlugin> The referenced plugins.protected intThe rank.protected Collection<String> The resource type name.protected booleanIndicates if the content should be searchable in the online index when this formatter is used.protected booleanIndicating if this formatter will always render all nested containers.protected booleanIndicates whether meta mappings should be applied for all elements.static final StringDefault formatter type constant.static final intThe width of the preview window for the formatters.static final StringWildcard formatter type for width based formatters. -
Constructor Summary
ConstructorsConstructorDescriptionCmsFormatterBean(String containerType, String jspRootPath, String minWidthStr, String maxWidthStr, String preview, String searchContent, String location) Constructor for creating a new formatter configuration without resource structure id.CmsFormatterBean(String containerType, String rootPath, CmsUUID structureId, int minWidth, int maxWidth, boolean preview, boolean searchContent, String location) Constructor for creating a new formatter configuration with resource structure id.CmsFormatterBean(Set<String> containerTypes, String jspRootPath, CmsUUID jspStructureId, String key, Set<String> aliasKeys, int minWidth, int maxWidth, boolean preview, boolean searchContent, String location, List<String> cssHeadIncludes, String inlineCss, List<String> javascriptHeadIncludes, String inlineJavascript, List<CmsTemplatePlugin> plugins, String niceName, String description, Collection<String> resourceTypeNames, int rank, String id, CmsSettingConfiguration settingConfig, boolean isFromConfigFile, boolean isAutoEnabled, boolean isDetail, String displayType, boolean isAllowsSettingsInEditor, boolean strictContainers, boolean nestedFormatterSettings, List<CmsMetaMapping> metaMappings, Map<String, String> attributes, boolean useMetaMappingsForNormalElements) Constructor for creating a new formatter configuration with resource structure id. -
Method Summary
Modifier and TypeMethodDescriptionGets the set of alias keys for the formatter.Gets the complete set of keys for the formatter, i.e.Gets the map of attributes.Returns the formatter container type.Gets the CSS head includes.getDescription(Locale locale) Gets the formatter description.The display type of this formatter ornullin case this is not a display formatter.getId()Returns the id of this formatter.Gets the inline CSS snippets.Gets the inline JS snippets.Gets the Javascript head includes.Returns the root path of the formatter JSP in the OpenCms VFS.Returns the structure id of the JSP resource for this formatter.getKey()Gets the formatter key, or null if no formatter key is set.Returns the location this formatter was defined in.intReturns the maximum formatter width.Returns the meta mappings.intReturns the minimum formatter width.getNiceName(Locale locale) Gets the nice name for this formatter.intgetRank()Gets the rank.Gets the resource type names.getSettings(CmsADEConfigData config) Gets the defined settings.Gets the template plugins.inthashCode()booleanReturns if nested formatter settings should be displayed.booleanReturns whether this formatter allows settings to be edited in the content editor.booleanReturns true if the formatter is automatically enabled.booleanReturns true if the formatter can be used for detail views.booleanReturns whether this formatter should be used by the 'display' tag.booleanReturns true if the formatter is from a formatter configuration file.booleanReturns true if this formatter should match all type/width combinations.booleanIndicates if this formatter is to be used as preview in the ADE gallery GUI.static booleanisPreviewType(String containerType) Checks if the given container type matches the ADE gallery preview type.booleanReturnstruein case an XML content formatted with this formatter should be included in the online full text search.booleanReturns whether this formatter will always render all nested containers.booleanReturnstruein case this formatter is based on type information.voidsetJspStructureId(CmsUUID jspStructureId) Sets the structure id of the JSP for this formatter.toString()booleanReturns true if meta mappings should be evaluated for normal container elements using this formatter, not just detail elements.withKeys(Collection<String> keys) If possible, returns a formatter bean that is basically a copy of this one, but has the keys supplied as a parameter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opencms.xml.containerpage.I_CmsFormatterBean
getKeyOrId
-
Field Details
-
DEFAULT_CONFIGURATION_RANK
Default rank for formatters from formatter configuration files.- See Also:
-
DEFAULT_SCHEMA_RANK
Default rank for formatters defined in schema.- See Also:
-
PREVIEW_TYPE
Default formatter type constant.- See Also:
-
PREVIEW_WIDTH
The width of the preview window for the formatters.- See Also:
-
WILDCARD_TYPE
Wildcard formatter type for width based formatters.- See Also:
-
m_containerTypes
The formatter container type. -
m_cssHeadIncludes
CSS Head includes. -
m_description
The description text for the formatter. -
m_aliasKeys
Set of alias keys. -
m_displayType
Provides the display type. If empty if this formatter should not be used by the display tag. -
m_id
The id for this formatter. -
m_inlineCss
Inline CSS snippets. -
m_inlineJavascript
Inline Javascript snippets. -
m_isAutoEnabled
Is the formatter automatically enabled? -
m_isDetail
True if this formatter can be used for detail views. -
m_isFromFormatterConfigFile
Is the formatter from a formatter configuration file? -
m_isPreviewFormatter
Indicates if this formatter is to be used as preview in the ADE gallery GUI. -
m_javascriptHeadIncludes
JavaScript head includes. -
m_jspRootPath
The formatter JSP. -
m_jspStructureId
The UUID of the JSP resource for this formatter. -
m_key
The formatter key. -
m_location
The location this formatter was configured in. -
m_matchAll
If true, will match any container/width combination. -
m_maxWidth
The formatter max width. -
m_metaMappings
The meta mappings. -
m_minWidth
The formatter min width. -
m_nestedFormatterSettings
Indicates whether nested formatter settings should be displayed. -
m_niceName
The nice name. -
m_plugins
The referenced plugins. -
m_rank
The rank. -
m_resourceTypeNames
The resource type name. -
m_search
Indicates if the content should be searchable in the online index when this formatter is used. -
m_strictContainers
Indicating if this formatter will always render all nested containers. -
m_useMetaMappingsForNormalElements
Indicates whether meta mappings should be applied for all elements.
-
-
Constructor Details
-
CmsFormatterBean
public CmsFormatterBean(Set<String> containerTypes, String jspRootPath, CmsUUID jspStructureId, String key, Set<String> aliasKeys, int minWidth, int maxWidth, boolean preview, boolean searchContent, String location, List<String> cssHeadIncludes, String inlineCss, List<String> javascriptHeadIncludes, String inlineJavascript, List<CmsTemplatePlugin> plugins, String niceName, String description, Collection<String> resourceTypeNames, int rank, String id, CmsSettingConfiguration settingConfig, boolean isFromConfigFile, boolean isAutoEnabled, boolean isDetail, String displayType, boolean isAllowsSettingsInEditor, boolean strictContainers, boolean nestedFormatterSettings, List<CmsMetaMapping> metaMappings, Map<String, String> attributes, boolean useMetaMappingsForNormalElements) Constructor for creating a new formatter configuration with resource structure id.- Parameters:
containerTypes- the formatter container typesjspRootPath- the formatter JSP VFS root pathjspStructureId- the structure id of the formatter JSPkey- the formatter keyaliasKeys- the alias keysminWidth- the formatter min widthmaxWidth- the formatter max widthpreview- indicates if this formatter is to be used for the preview in the ADE gallery GUIsearchContent- indicates if the content should be searchable in the online index when this formatter is usedlocation- the location where this formatter was defined, should be an OpenCms VFS resource pathcssHeadIncludes- the CSS head includesinlineCss- the in-line CSSjavascriptHeadIncludes- the JavaScript headincludesinlineJavascript- the in-line JavaScriptplugins- the template pluginsniceName- the configuration display namedescription- the description text for the formatterresourceTypeNames- the resource type namesrank- the configuration rankid- the configuration idsettingConfig- the settings configurationisFromConfigFile-trueif configuration file basedisAutoEnabled-trueif auto enabledisDetail-trueif detail formatterdisplayType- the display typeisAllowsSettingsInEditor- whether this formatter allows settings to be edited in the content editorstrictContainers-trueif this formatter will always render all nested containersnestedFormatterSettings- indicates whether nested formatter settings should be displayedmetaMappings- the meta mappingsattributes- the formatter attributesuseMetaMappingsForNormalElements- if true, meta mappings will be evaluated for normal container elements, not just detail elements
-
CmsFormatterBean
public CmsFormatterBean(String containerType, String rootPath, CmsUUID structureId, int minWidth, int maxWidth, boolean preview, boolean searchContent, String location) Constructor for creating a new formatter configuration with resource structure id.- Parameters:
containerType- the formatter container typesrootPath- the formatter JSP VFS root pathstructureId- the structure id of the formatter JSPminWidth- the formatter min widthmaxWidth- the formatter max widthpreview- indicates if this formatter is to be used for the preview in the ADE gallery GUIsearchContent- indicates if the content should be searchable in the online index when this formatter is usedlocation- the location where this formatter was defined, should be an OpenCms VFS resource path
-
CmsFormatterBean
public CmsFormatterBean(String containerType, String jspRootPath, String minWidthStr, String maxWidthStr, String preview, String searchContent, String location) Constructor for creating a new formatter configuration without resource structure id.- Parameters:
containerType- the formatter container typejspRootPath- the formatter JSP VFS root pathminWidthStr- the formatter min widthmaxWidthStr- the formatter max widthpreview- indicates if this formatter is to be used for the preview in the ADE gallery GUIsearchContent- indicates if the content should be searchable in the online index when this formatter is usedlocation- the location where this formatter was defined, should be an OpenCms VFS resource path
-
-
Method Details
-
isPreviewType
Checks if the given container type matches the ADE gallery preview type.- Parameters:
containerType- the container type to check- Returns:
trueif the given container type matches the ADE gallery preview type
-
getAliasKeys
Description copied from interface:I_CmsFormatterBeanGets the set of alias keys for the formatter.- Specified by:
getAliasKeysin interfaceI_CmsFormatterBean- Returns:
- the set of alias keys
- See Also:
-
getAllKeys
Description copied from interface:I_CmsFormatterBeanGets the complete set of keys for the formatter, i.e. its main key and all alias keys.- Specified by:
getAllKeysin interfaceI_CmsFormatterBean- Returns:
- the complete set of keys
- See Also:
-
getAttributes
Description copied from interface:I_CmsFormatterBeanGets the map of attributes.- Specified by:
getAttributesin interfaceI_CmsFormatterBean- Returns:
- the attribute map
- See Also:
-
getContainerTypes
Description copied from interface:I_CmsFormatterBeanReturns the formatter container type.If this is "*", then the formatter is a width based formatter.
- Specified by:
getContainerTypesin interfaceI_CmsFormatterBean- Returns:
- the formatter container type
- See Also:
-
getCssHeadIncludes
Description copied from interface:I_CmsFormatterBeanGets the CSS head includes.- Specified by:
getCssHeadIncludesin interfaceI_CmsFormatterBean- Returns:
- the CSS head includes
- See Also:
-
getDescription
Description copied from interface:I_CmsFormatterBeanGets the formatter description.If a locale is passed in, macros in the configured description will be resolved with a macro resolver set to that locale. If null is passed in as a locale, the raw configured description will be returned.
- Specified by:
getDescriptionin interfaceI_CmsFormatterBean- Parameters:
locale- the locale (may be null)- Returns:
- the formatter description
- See Also:
-
getDisplayType
Description copied from interface:I_CmsFormatterBeanThe display type of this formatter ornullin case this is not a display formatter.- Specified by:
getDisplayTypein interfaceI_CmsFormatterBean- Returns:
- the display type
- See Also:
-
getId
Description copied from interface:I_CmsFormatterBeanReturns the id of this formatter.This method may return null because the id is not always defined for formatters, e.g. for those formatters declared in a schema.
- Specified by:
getIdin interfaceI_CmsFormatterBean- Returns:
- the formatter id
- See Also:
-
getInlineCss
Description copied from interface:I_CmsFormatterBeanGets the inline CSS snippets.- Specified by:
getInlineCssin interfaceI_CmsFormatterBean- Returns:
- the inline CSS snippets
- See Also:
-
getInlineJavascript
Description copied from interface:I_CmsFormatterBeanGets the inline JS snippets.- Specified by:
getInlineJavascriptin interfaceI_CmsFormatterBean- Returns:
- the inline JS snippets
- See Also:
-
getJavascriptHeadIncludes
Description copied from interface:I_CmsFormatterBeanGets the Javascript head includes.- Specified by:
getJavascriptHeadIncludesin interfaceI_CmsFormatterBean- Returns:
- the head includes
- See Also:
-
getJspRootPath
Description copied from interface:I_CmsFormatterBeanReturns the root path of the formatter JSP in the OpenCms VFS.- Specified by:
getJspRootPathin interfaceI_CmsFormatterBean- Returns:
- the root path of the formatter JSP in the OpenCms VFS.
- See Also:
-
getJspStructureId
Description copied from interface:I_CmsFormatterBeanReturns the structure id of the JSP resource for this formatter.- Specified by:
getJspStructureIdin interfaceI_CmsFormatterBean- Returns:
- the structure id of the JSP resource for this formatter
- See Also:
-
getKey
Description copied from interface:I_CmsFormatterBeanGets the formatter key, or null if no formatter key is set.A formatter key is used to allow dynamic switching between formatters with the same key by enabling/disabling the formatters in the sitemap configuration. I.e. if a formatter referenced in a container page has been disabled in the sitemap configuration, but a different formatter with the same key is enabled, the second formatter will be used instead when rendering the page .
- Specified by:
getKeyin interfaceI_CmsFormatterBean- Returns:
- the formatter key, or null
- See Also:
-
getLocation
Description copied from interface:I_CmsFormatterBeanReturns the location this formatter was defined in.This will be an OpenCms VFS root path, either to the XML schema XSD, or the configuration file this formatter was defined in, or to the JSP that makes up this formatter.
- Specified by:
getLocationin interfaceI_CmsFormatterBean- Returns:
- the location this formatter was defined in
- See Also:
-
getMaxWidth
Description copied from interface:I_CmsFormatterBeanReturns the maximum formatter width.If this is not set, then
Integer.MAX_VALUEis returned.- Specified by:
getMaxWidthin interfaceI_CmsFormatterBean- Returns:
- the maximum formatter width
- See Also:
-
getMetaMappings
Description copied from interface:I_CmsFormatterBeanReturns the meta mappings.- Specified by:
getMetaMappingsin interfaceI_CmsFormatterBean- Returns:
- the meta mappings
- See Also:
-
getMinWidth
Description copied from interface:I_CmsFormatterBeanReturns the minimum formatter width.If this is not set, then
-1is returned.- Specified by:
getMinWidthin interfaceI_CmsFormatterBean- Returns:
- the minimum formatter width
- See Also:
-
getNiceName
Description copied from interface:I_CmsFormatterBeanGets the nice name for this formatter.- Specified by:
getNiceNamein interfaceI_CmsFormatterBean- Parameters:
locale- the locale- Returns:
- the nice name for this formatter
- See Also:
-
getRank
Description copied from interface:I_CmsFormatterBeanGets the rank.- Specified by:
getRankin interfaceI_CmsFormatterBean- Returns:
- the rank
- See Also:
-
getResourceTypeNames
Description copied from interface:I_CmsFormatterBeanGets the resource type names.- Specified by:
getResourceTypeNamesin interfaceI_CmsFormatterBean- Returns:
- the resource type names
- See Also:
-
getSettings
Description copied from interface:I_CmsFormatterBeanGets the defined settings.- Specified by:
getSettingsin interfaceI_CmsFormatterBean- Parameters:
config- the sitemap configuration for which the settings should be retrieved- Returns:
- the defined settings
- See Also:
-
getTemplatePlugins
Description copied from interface:I_CmsFormatterBeanGets the template plugins.- Specified by:
getTemplatePluginsin interfaceI_CmsFormatterBean- Returns:
- the template plugins
- See Also:
-
hashCode
-
hasNestedFormatterSettings
Description copied from interface:I_CmsFormatterBeanReturns if nested formatter settings should be displayed.- Specified by:
hasNestedFormatterSettingsin interfaceI_CmsFormatterBean- Returns:
trueif nested formatter settings should be displayed- See Also:
-
isAllowsSettingsInEditor
Description copied from interface:I_CmsFormatterBeanReturns whether this formatter allows settings to be edited in the content editor.- Specified by:
isAllowsSettingsInEditorin interfaceI_CmsFormatterBean- Returns:
truein case editing the settings is allowed in the content editor- See Also:
-
isAutoEnabled
Description copied from interface:I_CmsFormatterBeanReturns true if the formatter is automatically enabled.- Specified by:
isAutoEnabledin interfaceI_CmsFormatterBean- Returns:
- true if the formatter is automatically enabled
- See Also:
-
isDetailFormatter
Description copied from interface:I_CmsFormatterBeanReturns true if the formatter can be used for detail views.- Specified by:
isDetailFormatterin interfaceI_CmsFormatterBean- Returns:
- true if the formatter can be used for detail views
- See Also:
-
isDisplayFormatter
Description copied from interface:I_CmsFormatterBeanReturns whether this formatter should be used by the 'display' tag.- Specified by:
isDisplayFormatterin interfaceI_CmsFormatterBean- Returns:
trueif this formatter should be used by the 'display' tag- See Also:
-
isFromFormatterConfigFile
Description copied from interface:I_CmsFormatterBeanReturns true if the formatter is from a formatter configuration file.- Specified by:
isFromFormatterConfigFilein interfaceI_CmsFormatterBean- Returns:
- formatter f
- See Also:
-
isMatchAll
Description copied from interface:I_CmsFormatterBeanReturns true if this formatter should match all type/width combinations.- Specified by:
isMatchAllin interfaceI_CmsFormatterBean- Returns:
- true if this formatter should match all type/width combinations
- See Also:
-
isPreviewFormatter
Description copied from interface:I_CmsFormatterBeanIndicates if this formatter is to be used as preview in the ADE gallery GUI.- Specified by:
isPreviewFormatterin interfaceI_CmsFormatterBean- Returns:
trueif this formatter is to be used as preview in the ADE gallery GUI- See Also:
-
isSearchContent
Description copied from interface:I_CmsFormatterBeanReturnstruein case an XML content formatted with this formatter should be included in the online full text search.- Specified by:
isSearchContentin interfaceI_CmsFormatterBean- Returns:
truein case an XML content formatted with this formatter should be included in the online full text search- See Also:
-
isStrictContainers
Returns whether this formatter will always render all nested containers.- Returns:
trueif this formatter will always render all nested containers
-
isTypeFormatter
Description copied from interface:I_CmsFormatterBeanReturnstruein case this formatter is based on type information.- Specified by:
isTypeFormatterin interfaceI_CmsFormatterBean- Returns:
truein case this formatter is based on type information- See Also:
-
setJspStructureId
Sets the structure id of the JSP for this formatter.This is "package visible" as it should be only called from
CmsFormatterConfiguration.initialize(org.opencms.file.CmsObject).- Specified by:
setJspStructureIdin interfaceI_CmsFormatterBean- Parameters:
jspStructureId- the structure id of the JSP for this formatter
-
toString
-
useMetaMappingsForNormalElements
Description copied from interface:I_CmsFormatterBeanReturns true if meta mappings should be evaluated for normal container elements using this formatter, not just detail elements.- Specified by:
useMetaMappingsForNormalElementsin interfaceI_CmsFormatterBean- Returns:
- true if meta mappings should be evaluated for normal container elements
- See Also:
-
withKeys
Description copied from interface:I_CmsFormatterBeanIf possible, returns a formatter bean that is basically a copy of this one, but has the keys supplied as a parameter.Note that this only works for formatters which already have a key, and can not replace the main key. If the keys already match, the current instance may be returned rather than a copy.
If the formatter bean implementation does not support key replacement, or an error occurs, an empty Optional is returned
- Specified by:
withKeysin interfaceI_CmsFormatterBean- Parameters:
keys- the keys to use (should include the current key of the formatter- Returns:
- the copy with the replaced keys
- See Also:
-