Package org.ametys.cms.contenttype
Class ContentTypesParserHelper
- java.lang.Object
-
- org.ametys.cms.contenttype.ContentTypesParserHelper
-
- All Implemented Interfaces:
Component
public class ContentTypesParserHelper extends Object implements Component
Helper for content types parsing
-
-
Constructor Summary
Constructors Constructor Description ContentTypesParserHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description I18nizableText
parseI18nizableText(ContentTypeDescriptor contentType, Configuration config, String name)
Parse an i18n text.I18nizableText
parseI18nizableText(ContentTypeDescriptor contentType, Configuration config, String name, String defaultValue)
Parse an i18n text.String
parseIcon(ContentTypeDescriptor contentType, Configuration configuration, String name)
Parse an icon pathString
parseIcon(ContentTypeDescriptor contentType, Configuration configuration, String name, String defaultValue)
Parse an icon pathString
parseIconGlyph(Configuration configuration, String viewName, String defaultGlyph)
Parse the icon glyph.
-
-
-
Constructor Detail
-
ContentTypesParserHelper
public ContentTypesParserHelper()
-
-
Method Detail
-
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
public String parseIconGlyph(Configuration configuration, String viewName, String defaultGlyph)
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
-
-