Package org.opencms.jsp.util
Class CmsFormatterInfoWrapper
- java.lang.Object
-
- org.opencms.jsp.util.CmsFormatterInfoWrapper
-
- All Implemented Interfaces:
I_CmsFormatterInfo
public class CmsFormatterInfoWrapper extends java.lang.Object implements I_CmsFormatterInfo
Wrapper class for accessing formatter information from JSPs.
-
-
Constructor Summary
Constructors Constructor Description CmsFormatterInfoWrapper(CmsObject cms, CmsADEConfigData config, I_CmsFormatterBean formatter)
Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
description(java.util.Locale locale)
Gets the description of the formatter in the given locale.java.util.List<java.lang.String>
getContainerTypes()
Gets the matching container types.java.lang.String
getDefinition()
Gets the path of the formatter definition XML file.java.lang.String
getDescription()
Gets the localized descriptionjava.lang.String
getDescriptionKey()
Returns the localization key for the description if one was used, and null otherwise.java.lang.String
getDescriptionRaw()
Gets the raw description, without resolving any macros.java.lang.String
getDisplay()
Gets the display type of the formatter.boolean
getIsActive()
Checks if this is active.boolean
getIsDetailFormatter()
Checks if the formatter is a detail formatter.boolean
getIsDisplayFormatter()
Checks if the formatter is a display formatter.boolean
getIsFormatter()
Checks if this wraps a (non-function) formatter.boolean
getIsFunction()
Checks if this wraps a dynamic function.boolean
getIsResourceType()
Checks if this wraps a resource type.java.lang.String
getJsp()
Gets the JSP path.java.lang.String
getKey()
Gets the formatter key.static CmsMacroResolver
getMacroResolverForFormatter(CmsObject cms, I_CmsFormatterBean formatter)
Prepares the macro resolver to use for formatter info / setting info beans.int
getMaxWidth()
Gets the maximum container width.int
getMinWidth()
Gets the minimum container width.java.lang.String
getName()
Gets the name.java.lang.String
getNiceName()
Gets the user-readable formatter name.java.lang.String
getNiceNameKey()
Gets the localization key for the nice name, if one was used, or null otherwise.java.lang.String
getNiceNameRaw()
Gets the raw nice name, without resolving any macros.int
getRank()
Returns the rank of the formatter.java.util.List<CmsSettingDefinitionWrapper>
getSettings()
Gets a list of wrapper beans for the element setting definitions.java.util.List<java.lang.String>
getTypes()
Gets the resource types.java.lang.String
niceName(java.util.Locale locale)
Gets the nice name of the formatter in the given locale.
-
-
-
Constructor Detail
-
CmsFormatterInfoWrapper
public CmsFormatterInfoWrapper(CmsObject cms, CmsADEConfigData config, I_CmsFormatterBean formatter)
Creates a new instance.- Parameters:
cms
- the CMS contextconfig
- the sitemap configurationformatter
- the formatter bean to wrap
-
-
Method Detail
-
getMacroResolverForFormatter
public static CmsMacroResolver getMacroResolverForFormatter(CmsObject cms, I_CmsFormatterBean formatter)
Prepares the macro resolver to use for formatter info / setting info beans.- Parameters:
cms
- the CMS context to useformatter
- the formatter bean- Returns:
- the macro resolver to sue
-
description
public java.lang.String description(java.util.Locale locale)
Gets the description of the formatter in the given locale.- Specified by:
description
in interfaceI_CmsFormatterInfo
- Parameters:
locale
- the locale to use- Returns:
- the description
-
getContainerTypes
public java.util.List<java.lang.String> getContainerTypes()
Gets the matching container types.- Returns:
- the container types the formatter fits into
-
getDefinition
public java.lang.String getDefinition()
Gets the path of the formatter definition XML file.- Returns:
- the path of the formatter definition XML file
-
getDescription
public java.lang.String getDescription()
Gets the localized description- Specified by:
getDescription
in interfaceI_CmsFormatterInfo
- Returns:
- the description
-
getDescriptionKey
public java.lang.String getDescriptionKey()
Description copied from interface:I_CmsFormatterInfo
Returns the localization key for the description if one was used, and null otherwise.- Specified by:
getDescriptionKey
in interfaceI_CmsFormatterInfo
- Returns:
- the localization key
- See Also:
I_CmsFormatterInfo.getDescriptionKey()
-
getDescriptionRaw
public java.lang.String getDescriptionRaw()
Gets the raw description, without resolving any macros.- Specified by:
getDescriptionRaw
in interfaceI_CmsFormatterInfo
- Returns:
- the raw description
-
getDisplay
public java.lang.String getDisplay()
Gets the display type of the formatter.- Returns:
- the display type of the formatter
-
getIsActive
public boolean getIsActive()
Description copied from interface:I_CmsFormatterInfo
Checks if this is active.- Specified by:
getIsActive
in interfaceI_CmsFormatterInfo
- Returns:
- true if this is active
- See Also:
I_CmsFormatterInfo.getIsActive()
-
getIsDetailFormatter
public boolean getIsDetailFormatter()
Checks if the formatter is a detail formatter.- Returns:
- true if the formatter is a detail formatter
-
getIsDisplayFormatter
public boolean getIsDisplayFormatter()
Checks if the formatter is a display formatter.- Returns:
- true if the formatter is a display formatter
-
getIsFormatter
public boolean getIsFormatter()
Description copied from interface:I_CmsFormatterInfo
Checks if this wraps a (non-function) formatter.- Specified by:
getIsFormatter
in interfaceI_CmsFormatterInfo
- Returns:
- true if this wraps a normal formatter
- See Also:
I_CmsFormatterInfo.getIsFormatter()
-
getIsFunction
public boolean getIsFunction()
Description copied from interface:I_CmsFormatterInfo
Checks if this wraps a dynamic function.- Specified by:
getIsFunction
in interfaceI_CmsFormatterInfo
- Returns:
- true if this wraps a dynamic function
- See Also:
I_CmsFormatterInfo.getIsFunction()
-
getIsResourceType
public boolean getIsResourceType()
Description copied from interface:I_CmsFormatterInfo
Checks if this wraps a resource type.- Specified by:
getIsResourceType
in interfaceI_CmsFormatterInfo
- Returns:
- true if this is a resource type
- See Also:
I_CmsFormatterInfo.getIsResourceType()
-
getJsp
public java.lang.String getJsp()
Gets the JSP path.- Returns:
- the JSP path
-
getKey
public java.lang.String getKey()
Gets the formatter key.- Returns:
- the formatter key
-
getMaxWidth
public int getMaxWidth()
Gets the maximum container width.- Returns:
- the maximum container width
-
getMinWidth
public int getMinWidth()
Gets the minimum container width.- Returns:
- the minimum container width
-
getName
public java.lang.String getName()
Description copied from interface:I_CmsFormatterInfo
Gets the name.- Specified by:
getName
in interfaceI_CmsFormatterInfo
- Returns:
- the name
- See Also:
I_CmsFormatterInfo.getName()
-
getNiceName
public java.lang.String getNiceName()
Gets the user-readable formatter name.- Specified by:
getNiceName
in interfaceI_CmsFormatterInfo
- Returns:
- the user-readable name
-
getNiceNameKey
public java.lang.String getNiceNameKey()
Gets the localization key for the nice name, if one was used, or null otherwise.- Specified by:
getNiceNameKey
in interfaceI_CmsFormatterInfo
- Returns:
- the localization key
-
getNiceNameRaw
public java.lang.String getNiceNameRaw()
Gets the raw nice name, without resolving any macros.- Specified by:
getNiceNameRaw
in interfaceI_CmsFormatterInfo
- Returns:
- the raw nice name
-
getRank
public int getRank()
Returns the rank of the formatter.- Returns:
- the rank
-
getSettings
public java.util.List<CmsSettingDefinitionWrapper> getSettings()
Gets a list of wrapper beans for the element setting definitions.- Returns:
- the element setting definition wrappers
-
getTypes
public java.util.List<java.lang.String> getTypes()
Gets the resource types.- Returns:
- the resource types
-
niceName
public java.lang.String niceName(java.util.Locale locale)
Gets the nice name of the formatter in the given locale.- Specified by:
niceName
in interfaceI_CmsFormatterInfo
- Parameters:
locale
- the locale to use- Returns:
- the nice name of the formatter
-
-