public final class CmsFormatterConfiguration
extends java.lang.Object
A formatter configuration can be either defined in the XML schema XSD of a XML content, or in a special sitemap configuration file.
限定符和类型 | 类和说明 |
---|---|
static class |
CmsFormatterConfiguration.FormatterComparator
This class is used to sort lists of formatter beans in order of importance.
|
static class |
CmsFormatterConfiguration.IsDetail
Predicate which checks whether the given formatter is a detail formatter.
|
static class |
CmsFormatterConfiguration.IsSchemaFormatter
Predicate to check whether the formatter is from a schema.
|
限定符和类型 | 字段和说明 |
---|---|
static CmsFormatterConfiguration |
EMPTY_CONFIGURATION
The empty formatter configuration.
|
static org.apache.commons.logging.Log |
LOG
The log instance for this class.
|
限定符和类型 | 方法和说明 |
---|---|
static CmsFormatterConfiguration |
create(CmsObject cms,
java.util.List<I_CmsFormatterBean> formatters)
Returns the formatter configuration for the current project based on the given list of formatters.
|
java.util.List<I_CmsFormatterBean> |
getAllFormatters()
Gets a list of all defined formatters.
|
java.util.List<I_CmsFormatterBean> |
getAllMatchingFormatters(java.lang.String containerType,
int containerWidth)
Gets the formatters which are available for the given container type and width.
|
I_CmsFormatterBean |
getDefaultFormatter(java.lang.String containerType,
int containerWidth)
Selects the best matching formatter for the provided type and width from this configuration.
|
I_CmsFormatterBean |
getDefaultSchemaFormatter(java.lang.String containerType,
int containerWidth)
Selects the best matching schema formatter for the provided type and width from this configuration.
|
I_CmsFormatterBean |
getDetailFormatter(java.lang.String type,
int containerWidth)
Gets the detail formatter to use for the given type and container width.
|
java.util.Collection<I_CmsFormatterBean> |
getDetailFormatters()
Gets all detail formatters.
|
java.util.Map<java.lang.String,I_CmsFormatterBean> |
getFormatterSelection(java.lang.String containerType,
int containerWidth)
Returns the formatters available for selection for the given container type and width.
|
I_CmsFormatterBean |
getPreviewFormatter()
Returns the formatter from this configuration that is to be used for the preview in the ADE gallery GUI,
or
null if there is no preview formatter configured. |
boolean |
hasFormatter(java.lang.String containerType,
int containerWidth)
Returns the provided
true in case this configuration has a formatter
for the given type / width parameters. |
boolean |
hasFormatters()
Returns
true in case there is at least one usable formatter configured in this configuration. |
static void |
initialize(CmsObject cms)
Initialize the formatter configuration.
|
boolean |
isSearchContent(CmsUUID formatterStructureId)
Returns
true in case this configuration contains a formatter with the
provided structure id that has been configured for including the formatted content in the online search. |
public static final CmsFormatterConfiguration EMPTY_CONFIGURATION
public static final org.apache.commons.logging.Log LOG
public static CmsFormatterConfiguration create(CmsObject cms, java.util.List<I_CmsFormatterBean> formatters)
cms
- the current users OpenCms context, required to know which project to read the JSP fromformatters
- the list of configured formatterspublic static void initialize(CmsObject cms) throws CmsException
cms
- an initialized admin OpenCms user contextCmsException
- in case the initialization failspublic java.util.List<I_CmsFormatterBean> getAllFormatters()
public java.util.List<I_CmsFormatterBean> getAllMatchingFormatters(java.lang.String containerType, int containerWidth)
containerType
- the container typecontainerWidth
- the container widthpublic I_CmsFormatterBean getDefaultFormatter(java.lang.String containerType, int containerWidth)
This method first tries to find the formatter for the provided container type. If this fails, it returns the width based formatter that matched the container width.
containerType
- the container typecontainerWidth
- the container widthnull
if none was foundpublic I_CmsFormatterBean getDefaultSchemaFormatter(java.lang.String containerType, int containerWidth)
containerType
- the container typecontainerWidth
- the container widthnull
if none was foundpublic I_CmsFormatterBean getDetailFormatter(java.lang.String type, int containerWidth)
type
- the container typecontainerWidth
- the container widthpublic java.util.Collection<I_CmsFormatterBean> getDetailFormatters()
public java.util.Map<java.lang.String,I_CmsFormatterBean> getFormatterSelection(java.lang.String containerType, int containerWidth)
containerType
- the container typecontainerWidth
- the container widthpublic I_CmsFormatterBean getPreviewFormatter()
null
if there is no preview formatter configured.null
if there is no preview formatter configuredpublic boolean hasFormatter(java.lang.String containerType, int containerWidth)
true
in case this configuration has a formatter
for the given type / width parameters.containerType
- the container typecontainerWidth
- the container widthtrue
in case this configuration has a formatter
for the given type / width parameters.public boolean hasFormatters()
true
in case there is at least one usable formatter configured in this configuration.true
in case there is at least one usable formatter configured in this configurationpublic boolean isSearchContent(CmsUUID formatterStructureId)
true
in case this configuration contains a formatter with the
provided structure id that has been configured for including the formatted content in the online search.formatterStructureId
- true
in case this configuration contains a formatter with the
provided structure id that has been configured for including the formatted content in the online search