public class CmsFormatterBean extends java.lang.Object implements I_CmsFormatterBean
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CONFIGURATION_RANK
Default rank for formatters from formatter configuration files.
|
static int |
DEFAULT_SCHEMA_RANK
Default rank for formatters defined in schema.
|
protected java.util.Set<java.lang.String> |
m_containerTypes
The formatter container type.
|
protected java.util.Set<java.lang.String> |
m_cssHeadIncludes
CSS Head includes.
|
protected java.lang.String |
m_description
The description text for the formatter.
|
protected java.lang.String |
m_displayType
Provides the display type.
|
protected java.lang.String |
m_id
The id for this formatter.
|
protected java.lang.String |
m_inlineCss
Inline CSS snippets.
|
protected java.lang.String |
m_inlineJavascript
Inline Javascript snippets.
|
protected boolean |
m_isAutoEnabled
Is the formatter automatically enabled?
|
protected boolean |
m_isDetail
True if this formatter can be used for detail views.
|
protected boolean |
m_isFromFormatterConfigFile
Is the formatter from a formatter configuration file?
|
protected boolean |
m_isPreviewFormatter
Indicates if this formatter is to be used as preview in the ADE gallery GUI.
|
protected java.util.List<java.lang.String> |
m_javascriptHeadIncludes
JavaScript head includes.
|
protected java.lang.String |
m_jspRootPath
The formatter JSP.
|
protected CmsUUID |
m_jspStructureId
The UUID of the JSP resource for this formatter.
|
protected java.lang.String |
m_location
The location this formatter was configured in.
|
protected boolean |
m_matchAll
If true, will match any container/width combination.
|
protected int |
m_maxWidth
The formatter max width.
|
protected java.util.List<CmsMetaMapping> |
m_metaMappings
The meta mappings.
|
protected int |
m_minWidth
The formatter min width.
|
protected boolean |
m_nestedFormatterSettings
Indicates whether nested formatter settings should be displayed.
|
protected java.lang.String |
m_niceName
The nice name.
|
protected int |
m_rank
The rank.
|
protected java.util.Collection<java.lang.String> |
m_resourceTypeNames
The resource type name.
|
protected boolean |
m_search
Indicates if the content should be searchable in the online index when this formatter is used.
|
protected java.util.Map<java.lang.String,CmsXmlContentProperty> |
m_settings
The settings.
|
protected boolean |
m_strictContainers
Indicating if this formatter will always render all nested containers.
|
protected boolean |
m_useMetaMappingsForNormalElements
Indicates whether meta mappings should be applied for all elements.
|
static java.lang.String |
PREVIEW_TYPE
Default formatter type constant.
|
static int |
PREVIEW_WIDTH
The width of the preview window for the formatters.
|
static java.lang.String |
WILDCARD_TYPE
Wildcard formatter type for width based formatters.
|
| Constructor and Description |
|---|
CmsFormatterBean(java.util.Set<java.lang.String> containerTypes,
java.lang.String jspRootPath,
CmsUUID jspStructureId,
int minWidth,
int maxWidth,
boolean preview,
boolean searchContent,
java.lang.String location,
java.util.List<java.lang.String> cssHeadIncludes,
java.lang.String inlineCss,
java.util.List<java.lang.String> javascriptHeadIncludes,
java.lang.String inlineJavascript,
java.lang.String niceName,
java.lang.String description,
java.util.Collection<java.lang.String> resourceTypeNames,
int rank,
java.lang.String id,
java.util.Map<java.lang.String,CmsXmlContentProperty> settings,
boolean isFromConfigFile,
boolean isAutoEnabled,
boolean isDetail,
java.lang.String displayType,
boolean isAllowsSettingsInEditor,
boolean strictContainers,
boolean nestedFormatterSettings,
java.util.List<CmsMetaMapping> metaMappings,
java.util.Map<java.lang.String,java.lang.String> attributes,
boolean useMetaMappingsForNormalElements)
Constructor for creating a new formatter configuration with resource structure id.
|
CmsFormatterBean(java.lang.String containerType,
java.lang.String rootPath,
CmsUUID structureId,
int minWidth,
int maxWidth,
boolean preview,
boolean searchContent,
java.lang.String location)
Constructor for creating a new formatter configuration with resource structure id.
|
CmsFormatterBean(java.lang.String containerType,
java.lang.String jspRootPath,
java.lang.String minWidthStr,
java.lang.String maxWidthStr,
java.lang.String preview,
java.lang.String searchContent,
java.lang.String location)
Constructor for creating a new formatter configuration without resource structure id.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.String> |
getAttributes()
Gets the map of attributes.
|
java.util.Set<java.lang.String> |
getContainerTypes()
Returns the formatter container type.
|
java.util.Set<java.lang.String> |
getCssHeadIncludes()
Gets the CSS head includes.
|
java.lang.String |
getDescription(java.util.Locale locale)
Gets the formatter description.
|
java.lang.String |
getDisplayType()
The display type of this formatter or
null in case this is not a display formatter. |
java.lang.String |
getId()
Returns the id of this formatter.
|
java.lang.String |
getInlineCss()
Gets the inline CSS snippets.
|
java.lang.String |
getInlineJavascript()
Gets the inline JS snippets.
|
java.util.List<java.lang.String> |
getJavascriptHeadIncludes()
Gets the Javascript head includes.
|
java.lang.String |
getJspRootPath()
Returns the root path of the formatter JSP in the OpenCms VFS.
|
CmsUUID |
getJspStructureId()
Returns the structure id of the JSP resource for this formatter.
|
java.lang.String |
getLocation()
Returns the location this formatter was defined in.
|
int |
getMaxWidth()
Returns the maximum formatter width.
|
java.util.List<CmsMetaMapping> |
getMetaMappings()
Returns the meta mappings.
|
int |
getMinWidth()
Returns the minimum formatter width.
|
java.lang.String |
getNiceName(java.util.Locale locale)
Gets the nice name for this formatter.
|
int |
getRank()
Gets the rank.
|
java.util.Collection<java.lang.String> |
getResourceTypeNames()
Gets the resource type names.
|
java.util.Map<java.lang.String,CmsXmlContentProperty> |
getSettings()
Gets the defined settings.
|
int |
hashCode() |
boolean |
hasNestedFormatterSettings()
Returns if nested formatter settings should be displayed.
|
boolean |
isAllowsSettingsInEditor()
Returns whether this formatter allows settings to be edited in the content editor.
|
boolean |
isAutoEnabled()
Returns true if the formatter is automatically enabled.
|
boolean |
isDetailFormatter()
Returns true if the formatter can be used for detail views.
|
boolean |
isDisplayFormatter()
Returns whether this formatter should be used by the 'display' tag.
|
boolean |
isFromFormatterConfigFile()
Returns true if the formatter is from a formatter configuration file.
|
boolean |
isMatchAll()
Returns true if this formatter should match all type/width combinations.
|
boolean |
isPreviewFormatter()
Indicates if this formatter is to be used as preview in the ADE gallery GUI.
|
static boolean |
isPreviewType(java.lang.String containerType)
Checks if the given container type matches the ADE gallery preview type.
|
boolean |
isSearchContent()
Returns
true in case an XML content formatted with this formatter should be included in the
online full text search. |
boolean |
isStrictContainers()
Returns whether this formatter will always render all nested containers.
|
boolean |
isTypeFormatter()
Returns
true in case this formatter is based on type information. |
void |
setJspStructureId(CmsUUID jspStructureId)
Sets the structure id of the JSP for this formatter.
|
java.lang.String |
toString() |
boolean |
useMetaMappingsForNormalElements()
Returns true if meta mappings should be evaluated for normal container elements using this formatter, not just detail elements.
|
public static final int DEFAULT_CONFIGURATION_RANK
public static final int DEFAULT_SCHEMA_RANK
public static final java.lang.String PREVIEW_TYPE
public static final int PREVIEW_WIDTH
public static final java.lang.String WILDCARD_TYPE
protected java.util.Set<java.lang.String> m_containerTypes
protected java.util.Set<java.lang.String> m_cssHeadIncludes
protected java.lang.String m_description
protected java.lang.String m_displayType
protected java.lang.String m_id
protected java.lang.String m_inlineCss
protected java.lang.String m_inlineJavascript
protected boolean m_isAutoEnabled
protected boolean m_isDetail
protected boolean m_isFromFormatterConfigFile
protected boolean m_isPreviewFormatter
protected java.util.List<java.lang.String> m_javascriptHeadIncludes
protected java.lang.String m_jspRootPath
protected CmsUUID m_jspStructureId
protected java.lang.String m_location
protected boolean m_matchAll
protected int m_maxWidth
protected java.util.List<CmsMetaMapping> m_metaMappings
protected int m_minWidth
protected boolean m_nestedFormatterSettings
protected java.lang.String m_niceName
protected int m_rank
protected java.util.Collection<java.lang.String> m_resourceTypeNames
protected boolean m_search
protected java.util.Map<java.lang.String,CmsXmlContentProperty> m_settings
protected boolean m_strictContainers
protected boolean m_useMetaMappingsForNormalElements
public CmsFormatterBean(java.util.Set<java.lang.String> containerTypes, java.lang.String jspRootPath, CmsUUID jspStructureId, int minWidth, int maxWidth, boolean preview, boolean searchContent, java.lang.String location, java.util.List<java.lang.String> cssHeadIncludes, java.lang.String inlineCss, java.util.List<java.lang.String> javascriptHeadIncludes, java.lang.String inlineJavascript, java.lang.String niceName, java.lang.String description, java.util.Collection<java.lang.String> resourceTypeNames, int rank, java.lang.String id, java.util.Map<java.lang.String,CmsXmlContentProperty> settings, boolean isFromConfigFile, boolean isAutoEnabled, boolean isDetail, java.lang.String displayType, boolean isAllowsSettingsInEditor, boolean strictContainers, boolean nestedFormatterSettings, java.util.List<CmsMetaMapping> metaMappings, java.util.Map<java.lang.String,java.lang.String> attributes, boolean useMetaMappingsForNormalElements)
containerTypes - the formatter container typesjspRootPath - the formatter JSP VFS root pathjspStructureId - 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 pathcssHeadIncludes - the CSS head includesinlineCss - the in-line CSSjavascriptHeadIncludes - the JavaScript headincludesinlineJavascript - the in-line JavaScriptniceName - the configuration display namedescription - the description text for the formatterresourceTypeNames - the resource type namesrank - the configuration rankid - the configuration idsettings - the settings configurationisFromConfigFile - true if configuration file basedisAutoEnabled - true if auto enabledisDetail - true if detail formatterdisplayType - the display typeisAllowsSettingsInEditor - whether this formatter allows settings to be edited in the content editorstrictContainers - true if 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 elementspublic CmsFormatterBean(java.lang.String containerType, java.lang.String rootPath, CmsUUID structureId, int minWidth, int maxWidth, boolean preview, boolean searchContent, java.lang.String location)
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 pathpublic CmsFormatterBean(java.lang.String containerType, java.lang.String jspRootPath, java.lang.String minWidthStr, java.lang.String maxWidthStr, java.lang.String preview, java.lang.String searchContent, java.lang.String location)
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 pathpublic static boolean isPreviewType(java.lang.String containerType)
containerType - the container type to checktrue if the given container type matches the ADE gallery preview typepublic java.util.Map<java.lang.String,java.lang.String> getAttributes()
I_CmsFormatterBeangetAttributes in interface I_CmsFormatterBeanI_CmsFormatterBean.getAttributes()public java.util.Set<java.lang.String> getContainerTypes()
I_CmsFormatterBeanIf this is "*", then the formatter is a width based formatter.
getContainerTypes in interface I_CmsFormatterBeanI_CmsFormatterBean.getContainerTypes()public java.util.Set<java.lang.String> getCssHeadIncludes()
I_CmsFormatterBeangetCssHeadIncludes in interface I_CmsFormatterBeanI_CmsFormatterBean.getCssHeadIncludes()public java.lang.String getDescription(java.util.Locale locale)
I_CmsFormatterBeanIf 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.
getDescription in interface I_CmsFormatterBeanlocale - the locale (may be null)I_CmsFormatterBean.getDescription(Locale)public java.lang.String getDisplayType()
I_CmsFormatterBeannull in case this is not a display formatter.getDisplayType in interface I_CmsFormatterBeanI_CmsFormatterBean.getDisplayType()public java.lang.String getId()
I_CmsFormatterBeanThis method may return null because the id is not always defined for formatters, e.g. for those formatters declared in a schema.
getId in interface I_CmsFormatterBeanI_CmsFormatterBean.getId()public java.lang.String getInlineCss()
I_CmsFormatterBeangetInlineCss in interface I_CmsFormatterBeanI_CmsFormatterBean.getInlineCss()public java.lang.String getInlineJavascript()
I_CmsFormatterBeangetInlineJavascript in interface I_CmsFormatterBeanI_CmsFormatterBean.getInlineJavascript()public java.util.List<java.lang.String> getJavascriptHeadIncludes()
I_CmsFormatterBeangetJavascriptHeadIncludes in interface I_CmsFormatterBeanI_CmsFormatterBean.getJavascriptHeadIncludes()public java.lang.String getJspRootPath()
I_CmsFormatterBeangetJspRootPath in interface I_CmsFormatterBeanI_CmsFormatterBean.getJspRootPath()public CmsUUID getJspStructureId()
I_CmsFormatterBeangetJspStructureId in interface I_CmsFormatterBeanI_CmsFormatterBean.getJspStructureId()public java.lang.String getLocation()
I_CmsFormatterBeanThis 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.
getLocation in interface I_CmsFormatterBeanI_CmsFormatterBean.getLocation()public int getMaxWidth()
I_CmsFormatterBean
If this is not set, then Integer.MAX_VALUE is returned.
getMaxWidth in interface I_CmsFormatterBeanI_CmsFormatterBean.getMaxWidth()public java.util.List<CmsMetaMapping> getMetaMappings()
I_CmsFormatterBeangetMetaMappings in interface I_CmsFormatterBeanI_CmsFormatterBean.getMetaMappings()public int getMinWidth()
I_CmsFormatterBean
If this is not set, then -1 is returned.
getMinWidth in interface I_CmsFormatterBeanI_CmsFormatterBean.getMinWidth()public java.lang.String getNiceName(java.util.Locale locale)
I_CmsFormatterBeangetNiceName in interface I_CmsFormatterBeanlocale - the localeI_CmsFormatterBean.getNiceName(Locale)public int getRank()
I_CmsFormatterBeangetRank in interface I_CmsFormatterBeanI_CmsFormatterBean.getRank()public java.util.Collection<java.lang.String> getResourceTypeNames()
I_CmsFormatterBeangetResourceTypeNames in interface I_CmsFormatterBeanI_CmsFormatterBean.getResourceTypeNames()public java.util.Map<java.lang.String,CmsXmlContentProperty> getSettings()
I_CmsFormatterBeangetSettings in interface I_CmsFormatterBeanI_CmsFormatterBean.getSettings()public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public boolean hasNestedFormatterSettings()
I_CmsFormatterBeanhasNestedFormatterSettings in interface I_CmsFormatterBeantrue if nested formatter settings should be displayedI_CmsFormatterBean.hasNestedFormatterSettings()public boolean isAllowsSettingsInEditor()
I_CmsFormatterBeanisAllowsSettingsInEditor in interface I_CmsFormatterBeantrue in case editing the settings is allowed in the content editorI_CmsFormatterBean.isAllowsSettingsInEditor()public boolean isAutoEnabled()
I_CmsFormatterBeanisAutoEnabled in interface I_CmsFormatterBeanI_CmsFormatterBean.isAutoEnabled()public boolean isDetailFormatter()
I_CmsFormatterBeanisDetailFormatter in interface I_CmsFormatterBeanI_CmsFormatterBean.isDetailFormatter()public boolean isDisplayFormatter()
I_CmsFormatterBeanisDisplayFormatter in interface I_CmsFormatterBeantrue if this formatter should be used by the 'display' tagI_CmsFormatterBean.isDisplayFormatter()public boolean isFromFormatterConfigFile()
I_CmsFormatterBeanisFromFormatterConfigFile in interface I_CmsFormatterBeanI_CmsFormatterBean.isFromFormatterConfigFile()public boolean isMatchAll()
I_CmsFormatterBeanisMatchAll in interface I_CmsFormatterBeanI_CmsFormatterBean.isMatchAll()public boolean isPreviewFormatter()
I_CmsFormatterBeanisPreviewFormatter in interface I_CmsFormatterBeantrue if this formatter is to be used as preview in the ADE gallery GUII_CmsFormatterBean.isPreviewFormatter()public boolean isSearchContent()
I_CmsFormatterBeantrue in case an XML content formatted with this formatter should be included in the
online full text search.isSearchContent in interface I_CmsFormatterBeantrue in case an XML content formatted with this formatter should be included in the
online full text searchI_CmsFormatterBean.isSearchContent()public boolean isStrictContainers()
true if this formatter will always render all nested containerspublic boolean isTypeFormatter()
I_CmsFormatterBeantrue in case this formatter is based on type information.isTypeFormatter in interface I_CmsFormatterBeantrue in case this formatter is based on type informationI_CmsFormatterBean.isTypeFormatter()public void setJspStructureId(CmsUUID jspStructureId)
This is "package visible" as it should be only called from CmsFormatterConfiguration.initialize(org.opencms.file.CmsObject).
setJspStructureId in interface I_CmsFormatterBeanjspStructureId - the structure id of the JSP for this formatterpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public boolean useMetaMappingsForNormalElements()
I_CmsFormatterBeanuseMetaMappingsForNormalElements in interface I_CmsFormatterBeanI_CmsFormatterBean.useMetaMappingsForNormalElements()