Package org.ametys.cms.contenttype
Class DefaultContentType
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.contenttype.AbstractContentTypeDescriptor
org.ametys.cms.contenttype.DefaultContentType
- All Implemented Interfaces:
ContentType
,ContentTypeDescriptor
,Model
,ModelItemAccessor
,ModelItemContainer
,LogEnabled
,PluginAware
,Disposable
,Configurable
,Contextualizable
,Serviceable
,ThreadSafe
- Direct Known Subclasses:
AutomaticContentType
,HTMLContentType
,ODFContentType
,PostContentType
public class DefaultContentType
extends AbstractContentTypeDescriptor
implements ContentType, Contextualizable, ThreadSafe, Disposable
Type of content which is retrieved from a XML configuration.
TODO document xml configuration
...
Provides access based on rights and current workflow steps.
It used a configuration file with the following format:
<restrict-to>
[<right type="read|write" id="RIGHT_ID"/>]*
<!-- logical OR between several right id of the same type -->
[<workflow type="read|write" step="3"/>]*
<!-- logical OR between several workflow step of the same type -->
[<cannot type="read|write"/>]*
</restrict-to>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface
Definition with semantic annotationsprotected static interface
Deprecated. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
Suffix for global validator role.protected boolean
The abstract propertyprotected ContentAttributeDefinitionParser
The parser for content attribute's definitionsprotected Context
Cocoon ContextThe parser for content compisite's definitionsConfigured workflow names of the content type or its supertypes, can be emptyprotected Context
Avalon Context.Default workflow name.protected DublinCoreAttributeDefinitionParser
The parser for dublin core attribute's definitionsprotected List<ContentValidator>
Potential global validators.protected HierarchicalReferenceTablesHelper
The helper component for hierarchical simple contentsThe inheritable tagsprotected ServiceManager
Service manager.Model itemsList of overridden attributesList of overridden viewsprotected ContentAttributeDefinition
The parent attribute definitionThe properties references as: Impacted ContentType -> local IndexingField name -> path to impacted content.The parser for content repeater's definitionsprotected ContentRestrictedModelItemHelper
The restrictions helperprotected RichTextOutgoingReferencesExtractor
Docbook (rich text) outgoing references extractor.protected RichTextTransformer
Default rich text transformer.protected RichTextUpdater
Potentiel richtext updaterprotected String
The right needed to create a content of this type, or null if no right is needed.The tagsprotected Map<String,
ContentTypesHelper.ViewConfigurations> All configurations of content type's viewsAll content type's viewsFields inherited from class org.ametys.cms.contenttype.AbstractContentTypeDescriptor
_category, _contentTypesHelper, _contentTypesParserHelper, _cssFiles, _cTypeEP, _dcProvider, _defaultTitle, _description, _iconDecorator, _iconGlyph, _id, _label, _largeIcon, _mediumIcon, _pluginName, _smallIcon, _srcResolver, _superTypeIds
Fields inherited from interface org.ametys.cms.contenttype.ContentType
ATTRIBUTE_REF_TAG_NAME_WITH_LEGACY_SYNTAX, GROUP_TAG_NAME_WITH_LEGACY_SYNTAX, TAG_MIXIN, TAG_PRIVATE, TAG_REFERENCE_TABLE, TAG_RENDERABLE_FERENCE_TABLE, VIEW_TAG_NAME, VIEW_TAG_NAME_WITH_LEGACY_SYNTAX
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
_checkContentAttributes
(ModelItemContainer modelItemContainer, int repeaterLevel) Check for each content attribute: the content type id, the mutual references and the default valuesprotected void
_checkContentTypeId
(ContentAttributeDefinition definition) Check the content type id of the given content attribute definitionprotected void
_checkContentTypeSimplicity
(ModelItem modelItem) Checks the given model item to determine if this content type is multilingual and/or simple All items of a simple content-type have to be a simple type (string, long, date, ..) A multilingual content type should contain at least one model item of type MULTILINGUAL-STRINGprotected void
_checkModelItemsTypeAndCardinality
(ModelItem item1, ModelItem item2) Check if all model item types defined in first model item are equals to those defined in second oneprotected void
_checkModelItemsTypeAndCardinality
(Configuration modelItemConf1, Configuration modelItemConf2) Check if all model item's types defined in first configuration are equals to those defined in second configurationprotected void
_checkMutualReferences
(ContentAttributeDefinition definition, int repeaterLevel) Check the mutual reference declaration of the given content attribute definitionprotected void
_computePropertiesReferences
(ModelItemContainer modelItemContainer) Browses the model items of the givenModelItemContainer
and computes properties references.protected void
_configureDefaultWorkflowName
(Configuration mainConfig) Configure the default workflow name from the XML configuration.protected void
Configure the global validators for content typeprotected void
_configureLocalTags
(Configuration configuration) Parse the tags and add it to tags listprotected void
_configureModelItems
(Configuration mainConfig) Configure attribute definitionsprotected void
_configureParentContentType
(Configuration mainConfig) Configures the "parent" content type.protected void
_configureViewConfigurations
(Configuration mainConfig) Configure the content type view configurationsprotected void
_getApplicableModelItems
(List<ModelHelper.ConfigurationAndPluginName> configs, Map<String, ModelHelper.ConfigurationAndPluginName> modelItemConfigurations, boolean allowOverride) Fill a map of the applicable model item configurations.protected void
_getApplicableModelItems
(ModelHelper.ConfigurationAndPluginName config, Map<String, ModelHelper.ConfigurationAndPluginName> modelItemConfigurations, boolean allowOverride) Fill a map of the applicable attribute configurations.protected Map<String,
ContentTypesHelper.ViewConfigurations> _getApplicableViewConfigurations
(List<ModelHelper.ConfigurationAndPluginName> configurationAndPluginNames, String viewTagName) Compute the applicable views from their configurations.protected Map<String,
ContentTypesHelper.ViewConfigurations> _getApplicableViewConfigurations
(ModelHelper.ConfigurationAndPluginName configurationAndPluginName, String viewTagName) Compute the applicable views from their configurations.Get the ContentTypeReservedAttributeNameExtensionPoint instanceprotected void
Execute the lookup on all propertiesprotected Map<String,
ContentTypesHelper.ViewConfigurationsByType> Retrieves the merge of the view configurations between the current content type and its super typesprotected void
_parseAllModelItems
(Map<String, ModelHelper.ConfigurationAndPluginName> attributeConfigurations) Parse all attribute configurations.protected void
Parse DublinCore attributes_parseGlobalValidators
(ModelHelper.ConfigurationAndPluginName configurationAndPluginName, boolean includeSuperTypeValidators) Parse the global validatorsprotected ModelItem
_parseModelItem
(ModelHelper.ConfigurationAndPluginName itemConfigurationAndPluginName, ModelItemGroup parent) Parses a model itemprotected String
_parseProperty
(Configuration propertyConfiguration, int propertyIndex) Parses a propertyprotected void
Parses the content type viewsprotected void
Resolve the temporary view referencesprotected void
_resolveViewReferences
(ViewItemAccessor viewItemAccessor, String currentViewName) Resolve the temporary view references in the givenViewItemAccessor
void
configure
(Configuration configuration) void
contextualize
(Context context) void
dispose()
getAdditionalData
(Content content) Get the additional data relative to itsContentType
.Get the workflow names configured in the content type definition or in its supertypes.Get the default workflow name.Retrieves the Family Id (for example the extension point) Each model Id have to be unique in it's family IdRetrieves the potential global validators.Get the registered and inheritable tags for this content typeRetrieves all the model items of this accessorGet the overridden model items listGet the overridden views listprotected Optional<ModelHelper.ConfigurationAndPluginName>
Get the override configuration from _override folderprotected List<ModelHelper.ConfigurationAndPluginName>
Get the override configurations both from _override folder and extensionsprotected List<ModelHelper.ConfigurationAndPluginName>
Get the override configurations from extensionsGets the attribute holding the "parent" of the contents of this content type.Retrieves the properties references Properties can reference items on distant content type.Retrieves the RichText updatergetRight()
Get the right needed to create a content of this type.protected Configuration
getRootConfiguration
(Configuration configuration) Get the root configurationgetTags()
Get the registered tags for this content typeRetrieves the view with the given nameRetrieves all the views' configurations declared by this content typegetViewConfigurations
(String viewName) Retrieves the optional view's configuration declared by this content typegetViewNames
(boolean includeInternals) Retrieves the names of all the content type's viewboolean
Determines if the content type has the given tagvoid
Called by the extension point when the model items of all content types have been initialized.void
Called by the extension point when the views of all content types have been initialized.boolean
Get whether the content type is abstract, i.e.boolean
isMixin()
Get whether the content type is a mixin, i.e.boolean
Get whether the content type is multilingualboolean
Get whether the content type is private, i.e.boolean
Get whether the content type is a reference tableboolean
isSimple()
Get whether the content type is simple, i.e.protected Map<String,
ContentTypesHelper.ViewConfigurations> mergeViewConfigurationsWithLegacyAndClassicSyntaxes
(Map<String, ContentTypesHelper.ViewConfigurations> viewConfigurationsWithLegacySyntax, Map<String, ContentTypesHelper.ViewConfigurations> viewConfigurationsWithClassicSyntax) Merge view configurations with legacy and classic syntax.protected Map<String,
ContentTypesHelper.ViewConfigurations> mergeViewConfigurationsWithOverrides
(Map<String, ContentTypesHelper.ViewConfigurations> viewConfigurations, Map<String, ContentTypesHelper.ViewConfigurations> viewOverrideConfigurations) Merge view configurations with overrides If there is a main configuration in overrides, do not keep configurations (main or overrides) of the original view configurations.void
saxContentTypeAdditionalData
(ContentHandler contentHandler, Content content) SAX the additional content data linked to itsContentType
These additional data will be available in content viewvoid
service
(ServiceManager manager) toString()
Methods inherited from class org.ametys.cms.contenttype.AbstractContentTypeDescriptor
_configureCSSFiles, _configureIcons, _configureLabels, _configureSuperTypes, getCategory, getCSSFiles, getDefaultTitle, getDescription, getIconDecorator, getIconGlyph, getId, getLabel, getLargeIcon, getMediumIcon, getPluginName, getSmallIcon, getSupertypeIds, setPluginInfo
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, wait, wait, wait
Methods inherited from interface org.ametys.cms.contenttype.ContentType
canRead, canWrite, getViewNames
Methods inherited from interface org.ametys.cms.contenttype.ContentTypeDescriptor
getCategory, getCSSFiles, getDefaultCatalog, getDefaultTitle, getDescription, getIconDecorator, getIconGlyph, getIconPath, getId, getLabel, getLargeIcon, getMediumIcon, getPluginName, getSmallIcon, getSupertypeIds
Methods inherited from interface org.ametys.runtime.model.ModelItemAccessor
getChild, getModelItem, hasModelItem
-
Field Details
-
__GLOBAL_VALIDATOR_ROLE_PREFIX
Suffix for global validator role.- See Also:
-
_modelItems
Model items -
_propertiesReferences
The properties references as: Impacted ContentType -> local IndexingField name -> path to impacted content. -
_right
The right needed to create a content of this type, or null if no right is needed. -
_abstract
The abstract property -
_configuredWorkflowNames
Configured workflow names of the content type or its supertypes, can be empty -
_defaultWorkflowName
Default workflow name. -
_tags
The tags -
_inheritableTags
The inheritable tags -
_parentAttributeDefinition
The parent attribute definition -
_manager
Service manager. -
_context
Avalon Context. -
_cocoonContext
Cocoon Context -
_restrictedModelItemHelper
The restrictions helper -
_richTextTransformer
Default rich text transformer. -
_richTextOutgoingReferencesExtractor
Docbook (rich text) outgoing references extractor. -
_globalValidators
Potential global validators. -
_richTextUpdater
Potentiel richtext updater -
_hierarchicalSimpleContentsHelper
The helper component for hierarchical simple contents -
_overriddenModelItems
List of overridden attributes -
_overriddenViews
List of overridden views -
_views
All content type's views -
_viewConfigurations
All configurations of content type's views -
_attributeDefinitionParser
The parser for content attribute's definitions -
_compositeDefinitionParser
The parser for content compisite's definitions -
_repeaterDefinitionParser
The parser for content repeater's definitions -
_dublinCoreAttributeDefinitionParser
The parser for dublin core attribute's definitions
-
-
Constructor Details
-
DefaultContentType
public DefaultContentType()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractContentTypeDescriptor
- Throws:
ServiceException
-
_getContentTypeReservedAttributeNameExtensionPoint
protected ContentTypeReservedAttributeNameExtensionPoint _getContentTypeReservedAttributeNameExtensionPoint()Get the ContentTypeReservedAttributeNameExtensionPoint instance- Returns:
- the instance
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
dispose
- Specified by:
dispose
in interfaceDisposable
-
getRootConfiguration
Description copied from class:AbstractContentTypeDescriptor
Get the root configuration- Specified by:
getRootConfiguration
in classAbstractContentTypeDescriptor
- Parameters:
configuration
- The configuration- Returns:
- The main configuration
-
getOverrideConfigurations
protected List<ModelHelper.ConfigurationAndPluginName> getOverrideConfigurations() throws ConfigurationExceptionGet the override configurations both from _override folder and extensions- Returns:
- The list of the override configurations
- Throws:
ConfigurationException
- If an error occurs
-
getOverrideConfigurationFomFolder
protected Optional<ModelHelper.ConfigurationAndPluginName> getOverrideConfigurationFomFolder() throws ConfigurationExceptionGet the override configuration from _override folder- Returns:
- the optional override configuration from _override folder
- Throws:
ConfigurationException
- if an error occurred
-
getOverrideConfigurationsFromExtensions
protected List<ModelHelper.ConfigurationAndPluginName> getOverrideConfigurationsFromExtensions() throws ConfigurationExceptionGet the override configurations from extensions- Returns:
- The list of the override configurations from extensions
- Throws:
ConfigurationException
- If an error occurs
-
configure
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classAbstractContentTypeDescriptor
- Throws:
ConfigurationException
-
_configureModelItems
Configure attribute definitions- Parameters:
mainConfig
- The content type configuration- Throws:
ConfigurationException
- if an error occurred
-
_getApplicableModelItems
protected void _getApplicableModelItems(List<ModelHelper.ConfigurationAndPluginName> configs, Map<String, ModelHelper.ConfigurationAndPluginName> modelItemConfigurations, boolean allowOverride) throws ConfigurationExceptionFill a map of the applicable model item configurations.- Parameters:
configs
- the list of content type configurations.modelItemConfigurations
- the Map of attributesConfiguration
, indexed by name.allowOverride
- if true, encountering an attribute which has already been declared (based on its name) will replace it. Otherwise, an exception will be thrown.- Throws:
ConfigurationException
- if an error occurs.
-
_getApplicableModelItems
protected void _getApplicableModelItems(ModelHelper.ConfigurationAndPluginName config, Map<String, ModelHelper.ConfigurationAndPluginName> modelItemConfigurations, boolean allowOverride) throws ConfigurationExceptionFill a map of the applicable attribute configurations.- Parameters:
config
- the content type configuration.modelItemConfigurations
- the Map of model itemConfiguration
s, indexed by name.allowOverride
- if true, encountering a model item which has already been declared (based on its name) will replace it. Otherwise, an exception will be thrown.- Throws:
ConfigurationException
- if an error occurs.
-
getOverriddenModelItems
Description copied from interface:ContentType
Get the overridden model items list- Specified by:
getOverriddenModelItems
in interfaceContentType
- Returns:
- the overridden model items list
-
_checkModelItemsTypeAndCardinality
protected void _checkModelItemsTypeAndCardinality(Configuration modelItemConf1, Configuration modelItemConf2) throws ConfigurationException Check if all model item's types defined in first configuration are equals to those defined in second configuration- Parameters:
modelItemConf1
- The first configuration to comparemodelItemConf2
- The second configuration to compare- Throws:
ConfigurationException
- if the types are not equals
-
_parseAllModelItems
protected void _parseAllModelItems(Map<String, ModelHelper.ConfigurationAndPluginName> attributeConfigurations) throws ConfigurationExceptionParse all attribute configurations.- Parameters:
attributeConfigurations
- the attribute configurations.- Throws:
ConfigurationException
- if the configuration is invalid.
-
_parseModelItem
protected ModelItem _parseModelItem(ModelHelper.ConfigurationAndPluginName itemConfigurationAndPluginName, ModelItemGroup parent) throws ConfigurationException Parses a model item- Parameters:
itemConfigurationAndPluginName
- configuration of the model item to parseparent
- the parent of the model item to parse. Can benull
if the item has no parent.- Returns:
- the parsed model item
- Throws:
ConfigurationException
- if an error occurs while the model item is parsed
-
_parseProperty
protected String _parseProperty(Configuration propertyConfiguration, int propertyIndex) throws ConfigurationException Parses a property- Parameters:
propertyConfiguration
- configuration of the property to parsepropertyIndex
- index to use in the role to be able to use several times a property with the same class in a content-type.- Returns:
- the role of the parsed property component
- Throws:
ConfigurationException
- if an error occurs while the property is parsed
-
_checkModelItemsTypeAndCardinality
protected void _checkModelItemsTypeAndCardinality(ModelItem item1, ModelItem item2) throws ConfigurationException Check if all model item types defined in first model item are equals to those defined in second one- Parameters:
item1
- The first item to compareitem2
- The second item to compare- Throws:
ConfigurationException
- if the types are not equals
-
_checkContentTypeSimplicity
Checks the given model item to determine if this content type is multilingual and/or simple All items of a simple content-type have to be a simple type (string, long, date, ..) A multilingual content type should contain at least one model item of type MULTILINGUAL-STRING- Parameters:
modelItem
- The model item to check
-
_parseDublinCoreAttributes
Parse DublinCore attributes- Throws:
ConfigurationException
- if the configuration is invalid
-
_lookupProperties
Execute the lookup on all properties- Throws:
ConfigurationException
- if the configuration is invalid.
-
_configureDefaultWorkflowName
protected void _configureDefaultWorkflowName(Configuration mainConfig) throws ConfigurationException Configure the default workflow name from the XML configuration. - From the overriden configuration - If not, from the current configuration - If not, from the supertypes - If it cannot be determined and the content type is a reference table, then "reference-table" - Otherwise "content"- Parameters:
mainConfig
- The configuration- Throws:
ConfigurationException
- if an exception occurs
-
_configureParentContentType
Configures the "parent" content type. This must not be confounded with the super types. (SeeAbstractContentTypeDescriptor._configureSuperTypes(Configuration)
)- Parameters:
mainConfig
- The main configuration- Throws:
ConfigurationException
- if an error occurred
-
_configureViewConfigurations
Configure the content type view configurations- Parameters:
mainConfig
- The content type configuration- Throws:
ConfigurationException
- if an error occurred
-
mergeViewConfigurationsWithLegacyAndClassicSyntaxes
protected Map<String,ContentTypesHelper.ViewConfigurations> mergeViewConfigurationsWithLegacyAndClassicSyntaxes(Map<String, ContentTypesHelper.ViewConfigurations> viewConfigurationsWithLegacySyntax, Map<String, ContentTypesHelper.ViewConfigurations> viewConfigurationsWithClassicSyntax) Merge view configurations with legacy and classic syntax. Keep the main configuration from the classic syntax if there is one. Concatenate all override configurations- Parameters:
viewConfigurationsWithLegacySyntax
- the view configurations with legacy syntaxviewConfigurationsWithClassicSyntax
- the view configurations with legacy syntax- Returns:
- the merged view configurations
-
mergeViewConfigurationsWithOverrides
protected Map<String,ContentTypesHelper.ViewConfigurations> mergeViewConfigurationsWithOverrides(Map<String, ContentTypesHelper.ViewConfigurations> viewConfigurations, Map<String, ContentTypesHelper.ViewConfigurations> viewOverrideConfigurations) Merge view configurations with overrides If there is a main configuration in overrides, do not keep configurations (main or overrides) of the original view configurations. Otherwise, concatenate all override configurations- Parameters:
viewConfigurations
- the original view configurationsviewOverrideConfigurations
- the override view configurations- Returns:
-
_getApplicableViewConfigurations
protected Map<String,ContentTypesHelper.ViewConfigurations> _getApplicableViewConfigurations(List<ModelHelper.ConfigurationAndPluginName> configurationAndPluginNames, String viewTagName) throws ConfigurationException Compute the applicable views from their configurations. (from "_override" folder and from extensions)- Parameters:
configurationAndPluginNames
- The content type configurationviewTagName
- The name of the tag containing the view- Returns:
- the applicable views, indexed by their names. For each view, indicates if the view is configured
- Throws:
ConfigurationException
- if the configuration is invalid
-
_getApplicableViewConfigurations
protected Map<String,ContentTypesHelper.ViewConfigurations> _getApplicableViewConfigurations(ModelHelper.ConfigurationAndPluginName configurationAndPluginName, String viewTagName) throws ConfigurationException Compute the applicable views from their configurations.- Parameters:
configurationAndPluginName
- The content type configurationviewTagName
- The name of the tag containing the view- Returns:
- the applicable views, indexed by their names. For each view, indicates if the view is configured
- Throws:
ConfigurationException
- if the configuration is invalid
-
_configureGlobalValidators
Configure the global validators for content type- Parameters:
config
- The content type configuration- Throws:
ConfigurationException
- if an error occurs
-
_parseGlobalValidators
protected List<String> _parseGlobalValidators(ModelHelper.ConfigurationAndPluginName configurationAndPluginName, boolean includeSuperTypeValidators) throws ConfigurationException Parse the global validators- Parameters:
configurationAndPluginName
- the configurationincludeSuperTypeValidators
- true to include validators of super types- Returns:
- the role of global validators to be lookuped
- Throws:
ConfigurationException
- if configuration is incorrect
-
_configureLocalTags
Parse the tags and add it to tags list- Parameters:
configuration
- the configuration to use- Throws:
ConfigurationException
- if the configuration is not valid.
-
initializeAfterModelItemsInitialization
Description copied from interface:ContentType
Called by the extension point when the model items of all content types have been initialized. Can be used to do more initialization, checks, ... needing model items (attributes / properties) of distant contents- Specified by:
initializeAfterModelItemsInitialization
in interfaceContentType
- Throws:
Exception
- if an error occurs of if an additional check fails.
-
_checkContentAttributes
protected void _checkContentAttributes(ModelItemContainer modelItemContainer, int repeaterLevel) throws ConfigurationException Check for each content attribute: the content type id, the mutual references and the default values- Parameters:
modelItemContainer
- theModelItemContainer
to checkrepeaterLevel
- the current nested level of repeaters, 0 if the current attribute isn't in a repeater.- Throws:
ConfigurationException
- if a content attribute has an invalid configuration
-
_checkContentTypeId
protected void _checkContentTypeId(ContentAttributeDefinition definition) throws ConfigurationException Check the content type id of the given content attribute definition- Parameters:
definition
- the definition to check- Throws:
ConfigurationException
- if the given content attribute references an invalid or non-existing content type.
-
_checkMutualReferences
protected void _checkMutualReferences(ContentAttributeDefinition definition, int repeaterLevel) throws ConfigurationException Check the mutual reference declaration of the given content attribute definition- Parameters:
definition
- the definition to checkrepeaterLevel
- the current nested level of repeaters, 0 if the current attribute isn't in a repeater.- Throws:
ConfigurationException
- if there is a problem with mutual reference declaration
-
_parseViews
Parses the content type views- Throws:
ConfigurationException
- if an error occurred
-
_mergeViewConfigurationsFromCurrentTypeAndSuperTypes
protected Map<String,ContentTypesHelper.ViewConfigurationsByType> _mergeViewConfigurationsFromCurrentTypeAndSuperTypes() throws ConfigurationExceptionRetrieves the merge of the view configurations between the current content type and its super types- Returns:
- the merge of the view configurations
- Throws:
ConfigurationException
- if an error occurs
-
initializeAfterViewsInitialization
Description copied from interface:ContentType
Called by the extension point when the views of all content types have been initialized. Can be used to do more initialization, checks, ... needing views of distant contents- Specified by:
initializeAfterViewsInitialization
in interfaceContentType
- Throws:
Exception
- if an error occurs of if an additional check fails.
-
_resolveViewReferences
Resolve the temporary view references- Throws:
ConfigurationException
- if a view reference has a configuration error (the content attribute nesting the reference does not specify any content type, the view does not exist, ...)
-
_resolveViewReferences
protected void _resolveViewReferences(ViewItemAccessor viewItemAccessor, String currentViewName) throws ConfigurationException Resolve the temporary view references in the givenViewItemAccessor
- Parameters:
viewItemAccessor
- theViewItemAccessor
currentViewName
- the name of the current view (to avoid views referencing themselves)- Throws:
ConfigurationException
- if a view reference has a configuration error (the content attribute nesting the reference does not specify any content type, the view does not exist, ...)
-
_computePropertiesReferences
protected void _computePropertiesReferences(ModelItemContainer modelItemContainer) throws ConfigurationException Browses the model items of the givenModelItemContainer
and computes properties references.- Parameters:
modelItemContainer
- the model item container- Throws:
ConfigurationException
- if a property references a model item that does not exist
-
getGlobalValidators
Description copied from interface:ContentType
Retrieves the potential global validators.- Specified by:
getGlobalValidators
in interfaceContentType
- Returns:
- the global validators or an empty List if none.
-
getRichTextUpdater
Description copied from interface:ContentType
Retrieves the RichText updater- Specified by:
getRichTextUpdater
in interfaceContentType
- Returns:
- the RichText updater or
null
if none.
-
getTags
Description copied from interface:ContentType
Get the registered tags for this content type- Specified by:
getTags
in interfaceContentType
- Returns:
- the tags
-
getInheritableTags
Description copied from interface:ContentType
Get the registered and inheritable tags for this content type- Specified by:
getInheritableTags
in interfaceContentType
- Returns:
- the inheritable tags
-
hasTag
Description copied from interface:ContentType
Determines if the content type has the given tag- Specified by:
hasTag
in interfaceContentType
- Parameters:
tagName
- The tag name- Returns:
- true if the content type is tagged with the given tag name
-
isPrivate
Description copied from interface:ContentType
Get whether the content type is private, i.e. should not be created by the regular content interface.- Specified by:
isPrivate
in interfaceContentType
- Returns:
- true if the content is private, false if it is public.
-
isAbstract
Description copied from interface:ContentType
Get whether the content type is abstract, i.e. should not be created by the regular content interface.- Specified by:
isAbstract
in interfaceContentType
- Returns:
- true if the content is abstract, false otherwise.
-
isSimple
Description copied from interface:ContentType
Get whether the content type is simple, i.e. should contains only simple metadata type to be edited in a grid.- Specified by:
isSimple
in interfaceContentType
- Returns:
- true if the content is simple, false otherwise
-
isReferenceTable
Description copied from interface:ContentType
Get whether the content type is a reference table- Specified by:
isReferenceTable
in interfaceContentType
- Returns:
- true if the content type is a reference table
-
isMultilingual
Description copied from interface:ContentType
Get whether the content type is multilingual- Specified by:
isMultilingual
in interfaceContentType
- Returns:
- true if the content is multilingual, false otherwise
-
isMixin
Description copied from interface:ContentType
Get whether the content type is a mixin, i.e. should used to add metadata to a existing content.- Specified by:
isMixin
in interfaceContentType
- Returns:
- true if the content is mixin, false otherwise.
-
getConfiguredDefaultWorkflowNames
Description copied from interface:ContentType
Get the workflow names configured in the content type definition or in its supertypes.- Specified by:
getConfiguredDefaultWorkflowNames
in interfaceContentType
- Returns:
- A
Set
of workflow names
-
getDefaultWorkflowName
Description copied from interface:ContentType
Get the default workflow name.- Specified by:
getDefaultWorkflowName
in interfaceContentType
- Returns:
- The default workflow name
-
getRight
Description copied from interface:ContentType
Get the right needed to create a content of this type.- Specified by:
getRight
in interfaceContentType
- Returns:
- the right needed to create a content of this type. If null is returned, no right is needed.
-
saxContentTypeAdditionalData
public void saxContentTypeAdditionalData(ContentHandler contentHandler, Content content) throws AmetysRepositoryException, SAXException Description copied from interface:ContentType
SAX the additional content data linked to itsContentType
These additional data will be available in content view- Specified by:
saxContentTypeAdditionalData
in interfaceContentType
- Parameters:
contentHandler
- The handler to SAX intocontent
- The content- Throws:
AmetysRepositoryException
- if an error occurs while accessing the content.SAXException
- if an error occurs while SAXing
-
getAdditionalData
Description copied from interface:ContentType
Get the additional data relative to itsContentType
. These additional data are delivered to client side.- Specified by:
getAdditionalData
in interfaceContentType
- Parameters:
content
- The content- Returns:
- the additional properties in a Map
-
toString
-
getParentAttributeDefinition
Description copied from interface:ContentType
Gets the attribute holding the "parent" of the contents of this content type. Must be of typeModelItemTypeConstants.CONTENT_ELEMENT_TYPE_ID
and must reference a private and simple content type.- Specified by:
getParentAttributeDefinition
in interfaceContentType
- Returns:
- the attribute holding the "parent" of the contents of this content type
-
getModelItems
Description copied from interface:ModelItemAccessor
Retrieves all the model items of this accessor- Specified by:
getModelItems
in interfaceModelItemAccessor
- Returns:
- the model items
-
getPropertiesReferences
Description copied from interface:ContentType
Retrieves the properties references Properties can reference items on distant content type. Those references are like: Impacted ContentType -> local IndexingField name -> path to impacted content.- Specified by:
getPropertiesReferences
in interfaceContentType
- Returns:
- this content type's properties references
-
getViewNames
Description copied from interface:ContentType
Retrieves the names of all the content type's view- Specified by:
getViewNames
in interfaceContentType
- Parameters:
includeInternals
- if the result should include internal views.- Returns:
- the views' names
-
getView
Description copied from interface:ContentType
Retrieves the view with the given name- Specified by:
getView
in interfaceContentType
- Parameters:
viewName
- the name of the view to retrieve- Returns:
- the view
-
getViewConfigurations
Description copied from interface:ContentType
Retrieves all the views' configurations declared by this content type- Specified by:
getViewConfigurations
in interfaceContentType
- Returns:
- the views' configurations
-
getOverriddenViews
Get the overridden views list- Specified by:
getOverriddenViews
in interfaceContentType
- Returns:
- the overridden views list
-
getViewConfigurations
Description copied from interface:ContentType
Retrieves the optional view's configuration declared by this content type- Specified by:
getViewConfigurations
in interfaceContentType
- Parameters:
viewName
- the name of the view to retrieve- Returns:
- the view's configuration
-
getFamilyId
Description copied from interface:Model
Retrieves the Family Id (for example the extension point) Each model Id have to be unique in it's family Id- Specified by:
getFamilyId
in interfaceModel
- Returns:
- content point (for example "org.ametys.cms.contenttype.ContentTypeExtensionPoint" for a content)
-
RestrictedModelItem
instead