Package org.ametys.cms.contenttype
Class AbstractContentTypeDescriptor
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.contenttype.AbstractContentTypeDescriptor
- All Implemented Interfaces:
ContentTypeDescriptor
,LogEnabled
,PluginAware
,Configurable
,Serviceable
- Direct Known Subclasses:
DefaultContentType
,DynamicContentTypeDescriptor
public abstract class AbstractContentTypeDescriptor
extends AbstractLogEnabled
implements ContentTypeDescriptor, Configurable, PluginAware, Serviceable
This abstract class represents a content type descriptor
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<String,
MetadataSet> Deprecated.protected I18nizableText
Category.protected ContentTypesHelper
The content types helperprotected ContentTypesParserHelper
The content types parser helperprotected List<ClientSideElement.ScriptFile>
The CSS filesprotected ContentTypeExtensionPoint
The content type extension point.protected DublinCoreMetadataProvider
The DublinCore metadata providerprotected I18nizableText
Default title.protected I18nizableText
Description.protected String
Icon decoratorprotected String
Glyph iconprotected String
Content type id.protected I18nizableText
Label.protected String
Large icon URI 48x48.protected String
Medium icon URI 32x32.protected Map<String,
MetadataSet> Deprecated.UseDefaultContentType._views
insteadprotected String
Plugin name.protected String
Small icon URI 16x16.protected SourceResolver
The source resolverprotected String[]
This content-type's supertype ids (can be empty). -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_configureCSSFiles
(Configuration configuration) Configure the CSS to importprotected void
_configureIcons
(Configuration mainConfig) Configures the iconsprotected void
_configureLabels
(Configuration mainConfig) Configures the labelsprotected void
_configureMetadataSets
(Configuration mainConfig) Deprecated.protected void
_configureSuperTypes
(Configuration mainConfig) Configures the super typesprotected void
_fillMetadataSetDublinCore
(AbstractMetadataSetElement metadataSetElement) Deprecated.UseContentTypeViewParser
insteadprotected void
_fillMetadataSetElement
(MetadataSet rootMetadataSet, Configuration metadataSetConfig, AbstractMetadataSetElement metadataSetElement, boolean isEdition, MetadataSet superMetadataSet) Deprecated.UseContentTypeViewParser
insteadprotected void
_getApplicableMetadataSets
(Configuration config, Map<String, Configuration> metadataSetViewConfs, Map<String, Configuration> metadataSetEditConfs, boolean allowOverride) Deprecated.protected MetadataSet
_parseMetadataSet
(Configuration metadataSetConfig, String metadataSetName, boolean isEdition, boolean isInternal, String[] superTypeIds) Deprecated.UseContentTypeViewParser.parseView(Configuration)
insteadprotected void
_parseMetadataSets
(Map<String, Configuration> metadataSetConfs, Map<String, MetadataSet> metadataSets, Map<String, MetadataSet> allMetadataSets, String[] superTypeIds) Deprecated.UseContentTypeViewParser
insteadvoid
configure
(Configuration configuration) Retrieves the category of the content type.Returns the list of CSS files needed to correctly display the content's in BO, such as the content's iconRetrieves the default title of the content type.Retrieves the description of the content type.getEditionMetadataSetNames
(boolean includeInternal) Returns all names of "edition" metadataSets.Retrieves the CSS class to use for decorator above the main iconRetrieves the CSS class to use for glyph icongetId()
Retrieves the id of the content type.getLabel()
Retrieves the label of the content type.Retrieves the URL of the icon without the context path.Retrieves the URL of the icon without the context path.getMetadataSetForEdition
(String metadataSetName) Retrieves the metadata set name for edition.getMetadataSetForView
(String metadataSetName) Retrieves the metadata set name for view.protected abstract Configuration
Get the overridden configurationRetrieves the name of the plugin declaring this content type.protected abstract Configuration
getRootConfiguration
(Configuration configuration) Get the root configurationRetrieves the URL of the icon without the context path.String[]
Retrieves the super type's ids.getViewMetadataSetNames
(boolean includeInternal) Returns all names of "view" metadataSets.void
service
(ServiceManager smanager) void
setPluginInfo
(String pluginName, String featureName, String id) Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.cms.contenttype.ContentTypeDescriptor
getDefaultCatalog, getIconPath
-
Field Details
-
_pluginName
Plugin name. -
_id
Content type id. -
_label
Label. -
_description
Description. -
_defaultTitle
Default title. -
_category
Category. -
_iconGlyph
Glyph icon -
_iconDecorator
Icon decorator -
_smallIcon
Small icon URI 16x16. -
_mediumIcon
Medium icon URI 32x32. -
_largeIcon
Large icon URI 48x48. -
_cssFiles
The CSS files -
_superTypeIds
This content-type's supertype ids (can be empty). -
_allMetadataSets
Deprecated.UseDefaultContentType._views
insteadAll metadata sets. -
_metadataSets
Deprecated.UseDefaultContentType._views
insteadNon-internal metadata sets. -
_cTypeEP
The content type extension point. -
_contentTypesHelper
The content types helper -
_contentTypesParserHelper
The content types parser helper -
_srcResolver
The source resolver -
_dcProvider
The DublinCore metadata provider
-
-
Constructor Details
-
AbstractContentTypeDescriptor
public AbstractContentTypeDescriptor()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
setPluginInfo
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
getRootConfiguration
Get the root configuration- Parameters:
configuration
- The configuration- Returns:
- The main configuration
-
getOverridenConfiguration
Get the overridden configuration- Returns:
- the overridden configuration or null
- Throws:
ConfigurationException
- if an error occurred TODO NEWATTRIBUTEAPI_CONTENT: Remove this abstract method when_configureMetadataSets(Configuration)
is removed. This method will now only be used inDefaultContentType
to configure attributes and views
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
_configureSuperTypes
Configures the super types- Parameters:
mainConfig
- The main configuration
-
_configureLabels
Configures the labels- Parameters:
mainConfig
- The main configuration- Throws:
ConfigurationException
- if an error occurred
-
_configureIcons
Configures the icons- Parameters:
mainConfig
- The main configuration- Throws:
ConfigurationException
- if an error occurred
-
_configureMetadataSets
@Deprecated protected void _configureMetadataSets(Configuration mainConfig) throws ConfigurationException Deprecated.Configure metadata sets- Parameters:
mainConfig
- The content type configuration- Throws:
ConfigurationException
- if an error occurred
-
_getApplicableMetadataSets
@Deprecated protected void _getApplicableMetadataSets(Configuration config, Map<String, Configuration> metadataSetViewConfs, Map<String, throws ConfigurationExceptionConfiguration> metadataSetEditConfs, boolean allowOverride) Deprecated.Compute the applicable metadata-sets from their configurations.- Parameters:
config
- The content type configurationmetadataSetViewConfs
- the view metadata-set configurations, indexed by name.metadataSetEditConfs
- the edition metadata-set configurations, indexed by name.allowOverride
- if true, encountering a metadata-set which has already been declared (based on its name) will replace it. Otherwise, an exception will be thrown.- Throws:
ConfigurationException
- if the configuration is invalid
-
_parseMetadataSets
@Deprecated protected void _parseMetadataSets(Map<String, Configuration> metadataSetConfs, Map<String, throws ConfigurationExceptionMetadataSet> metadataSets, Map<String, MetadataSet> allMetadataSets, String[] superTypeIds) Deprecated.UseContentTypeViewParser
insteadParse the metadata-set configurations- Parameters:
metadataSetConfs
- the metadata-set configurations, indexed by name.metadataSets
- the Map of "public"MetadataSet
objects to fill, indexed by nameallMetadataSets
- the Map ofMetadataSet
objects to fill (including internal ones), indexed by name.superTypeIds
- the super content-types- Throws:
ConfigurationException
- if the configuration is invalid
-
_parseMetadataSet
@Deprecated protected MetadataSet _parseMetadataSet(Configuration metadataSetConfig, String metadataSetName, boolean isEdition, boolean isInternal, String[] superTypeIds) throws ConfigurationException Deprecated.UseContentTypeViewParser.parseView(Configuration)
insteadParse a metadata-set configuration to create aMetadataSet
object.- Parameters:
metadataSetConfig
- the metadata set configuration to use.metadataSetName
- the metadata set name.isEdition
- the metadata set edition status.isInternal
- the metadata internal status.superTypeIds
- the super types.- Returns:
- the metadata set
- Throws:
ConfigurationException
- if the configuration is not valid.
-
_fillMetadataSetElement
@Deprecated protected void _fillMetadataSetElement(MetadataSet rootMetadataSet, Configuration metadataSetConfig, AbstractMetadataSetElement metadataSetElement, boolean isEdition, MetadataSet superMetadataSet) throws ConfigurationException Deprecated.UseContentTypeViewParser
insteadFill child elements for a metadata set element.- Parameters:
rootMetadataSet
- The root metadata setmetadataSetConfig
- the metadata set configuration to use.metadataSetElement
- the metadata set element to fill.isEdition
- true if it is the edition modesuperMetadataSet
- the overridden metadata-set if applicable, null otherwise.- Throws:
ConfigurationException
- if the configuration is not valid.
-
_fillMetadataSetDublinCore
@Deprecated protected void _fillMetadataSetDublinCore(AbstractMetadataSetElement metadataSetElement) throws ConfigurationException Deprecated.UseContentTypeViewParser
insteadParse the DublinCore metadata set.- Parameters:
metadataSetElement
- the metadata set element to fill.- Throws:
ConfigurationException
- if the configuration is not valid.
-
_configureCSSFiles
Configure the CSS to import- Parameters:
configuration
- The imports configuration- Throws:
ConfigurationException
- If an error occurs
-
getPluginName
Description copied from interface:ContentTypeDescriptor
Retrieves the name of the plugin declaring this content type.- Specified by:
getPluginName
in interfaceContentTypeDescriptor
- Returns:
- the name of the plugin.
-
getId
Description copied from interface:ContentTypeDescriptor
Retrieves the id of the content type.- Specified by:
getId
in interfaceContentTypeDescriptor
- Returns:
- the id.
-
getLabel
Description copied from interface:ContentTypeDescriptor
Retrieves the label of the content type.- Specified by:
getLabel
in interfaceContentTypeDescriptor
- Returns:
- the label.
-
getDescription
Description copied from interface:ContentTypeDescriptor
Retrieves the description of the content type.- Specified by:
getDescription
in interfaceContentTypeDescriptor
- Returns:
- the description.
-
getCategory
Description copied from interface:ContentTypeDescriptor
Retrieves the category of the content type.- Specified by:
getCategory
in interfaceContentTypeDescriptor
- Returns:
- the category.
-
getDefaultTitle
Description copied from interface:ContentTypeDescriptor
Retrieves the default title of the content type.- Specified by:
getDefaultTitle
in interfaceContentTypeDescriptor
- Returns:
- the default title.
-
getIconGlyph
Description copied from interface:ContentTypeDescriptor
Retrieves the CSS class to use for glyph icon- Specified by:
getIconGlyph
in interfaceContentTypeDescriptor
- Returns:
- the glyph name.
-
getIconDecorator
Description copied from interface:ContentTypeDescriptor
Retrieves the CSS class to use for decorator above the main icon- Specified by:
getIconDecorator
in interfaceContentTypeDescriptor
- Returns:
- the glyph name.
-
getSmallIcon
Description copied from interface:ContentTypeDescriptor
Retrieves the URL of the icon without the context path.- Specified by:
getSmallIcon
in interfaceContentTypeDescriptor
- Returns:
- the icon URL for the small image 16x16.
-
getMediumIcon
Description copied from interface:ContentTypeDescriptor
Retrieves the URL of the icon without the context path.- Specified by:
getMediumIcon
in interfaceContentTypeDescriptor
- Returns:
- the icon URL for the medium sized image 32x32.
-
getLargeIcon
Description copied from interface:ContentTypeDescriptor
Retrieves the URL of the icon without the context path.- Specified by:
getLargeIcon
in interfaceContentTypeDescriptor
- Returns:
- the icon URL for the large image 48x48.
-
getSupertypeIds
Description copied from interface:ContentTypeDescriptor
Retrieves the super type's ids.- Specified by:
getSupertypeIds
in interfaceContentTypeDescriptor
- Returns:
- the super type's ids, or empty if this content type doesn't extend a specific content type.
-
getCSSFiles
Description copied from interface:ContentTypeDescriptor
Returns the list of CSS files needed to correctly display the content's in BO, such as the content's icon- Specified by:
getCSSFiles
in interfaceContentTypeDescriptor
- Returns:
- The list of CSS files needed. Must not be null.
-
getEditionMetadataSetNames
Description copied from interface:ContentTypeDescriptor
Returns all names of "edition" metadataSets.- Specified by:
getEditionMetadataSetNames
in interfaceContentTypeDescriptor
- Parameters:
includeInternal
- if the result should include internal metadataSets.- Returns:
- all names of "edition" metadataSets.
-
getViewMetadataSetNames
Description copied from interface:ContentTypeDescriptor
Returns all names of "view" metadataSets.- Specified by:
getViewMetadataSetNames
in interfaceContentTypeDescriptor
- Parameters:
includeInternal
- if the result should include internal metadataSets.- Returns:
- all names of "view" metadataSets.
-
getMetadataSetForView
Description copied from interface:ContentTypeDescriptor
Retrieves the metadata set name for view.- Specified by:
getMetadataSetForView
in interfaceContentTypeDescriptor
- Parameters:
metadataSetName
- the metadata set name.- Returns:
- the metadata definition.
-
getMetadataSetForEdition
Description copied from interface:ContentTypeDescriptor
Retrieves the metadata set name for edition.- Specified by:
getMetadataSetForEdition
in interfaceContentTypeDescriptor
- Parameters:
metadataSetName
- the metadata set name.- Returns:
- the metadata set.
-
DefaultContentType._views
instead