Package org.ametys.cms.contenttype
Class ContentTypesParserHelper
java.lang.Object
org.ametys.cms.contenttype.ContentTypesParserHelper
- All Implemented Interfaces:
Component
Helper for content types parsing
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionparseI18nizableText
(ContentTypeDescriptor contentType, Configuration config, String name) Parse an i18n text.parseI18nizableText
(ContentTypeDescriptor contentType, Configuration config, String name, String defaultValue) Parse an i18n text.parseIcon
(ContentTypeDescriptor contentType, Configuration configuration, String name) Parse an icon pathparseIcon
(ContentTypeDescriptor contentType, Configuration configuration, String name, String defaultValue) Parse an icon pathparseIconGlyph
(Configuration configuration, String viewName, String defaultGlyph) Parse the icon glyph.
-
Field Details
-
ROLE
The Avalon role
-
-
Constructor Details
-
ContentTypesParserHelper
public ContentTypesParserHelper()
-
-
Method Details
-
parseI18nizableText
public I18nizableText parseI18nizableText(ContentTypeDescriptor contentType, Configuration config, String name) throws ConfigurationException Parse an i18n text.- Parameters:
contentType
- the content typeconfig
- the configuration to use.name
- the child name.- Returns:
- the i18n text.
- Throws:
ConfigurationException
- if the configuration is not valid.
-
parseI18nizableText
public I18nizableText parseI18nizableText(ContentTypeDescriptor contentType, Configuration config, String name, String defaultValue) throws ConfigurationException Parse an i18n text.- Parameters:
contentType
- the content typeconfig
- the configuration to use.name
- the child name.defaultValue
- the default value if no present- Returns:
- the i18n text.
- Throws:
ConfigurationException
- if the configuration is not valid.
-
parseIcon
public String parseIcon(ContentTypeDescriptor contentType, Configuration configuration, String name) throws ConfigurationException Parse an icon path- Parameters:
contentType
- the content typeconfiguration
- the configuration to usename
- the child name.- Returns:
- The icon path
- Throws:
ConfigurationException
- if the configuration is not valid.
-
parseIcon
public String parseIcon(ContentTypeDescriptor contentType, Configuration configuration, String name, String defaultValue) throws ConfigurationException Parse an icon path- Parameters:
contentType
- the content typeconfiguration
- the configuration to usename
- the child name.defaultValue
- the default value.- Returns:
- The icon path
- Throws:
ConfigurationException
- if the configuration is not valid.
-
parseIconGlyph
Parse the icon glyph. If not present, a default will be assigned if a icon is not yet defined- Parameters:
configuration
- the configurationviewName
- The view namedefaultGlyph
- The default glyph to assign if no glyph is defined. Can be null.- Returns:
- the glyph icon
-