Package org.ametys.cms.contenttype
Interface ContentType
- All Superinterfaces:
ContentTypeDescriptor
,Model
,ModelItemAccessor
,ModelItemContainer
- All Known Implementing Classes:
AutomaticContentType
,DefaultContentType
,HTMLContentType
,ODFContentType
This class represents a type of content.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Tag name for a group declaration in a view using legacy syntaxstatic final String
Attribute name for an item reference in a view using the legacy syntaxstatic final String
Tag name for a model item reference declaration in a view using the legacy syntaxstatic final String
Tag for simple content typestatic final String
Tag for private content typestatic final String
Tag for reference tablestatic final String
Tag for renderable reference tablestatic final String
Tag name for a view declarationstatic final String
Tag name for a view declaration using the legacy syntax -
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
canRead
(Content content, RestrictedModelItem<Content> definition) Determine whether an attribute can be read at this time.default boolean
canWrite
(Content content, RestrictedModelItem<Content> definition) Determine whether an attribute can be written at this time.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 potential global validators.Get the registered and inheritable tags for this content typeGet the overridden model items listGet the overridden views listGets 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.getTags()
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 typeRetrieves the names of all the content type's viewgetViewNames
(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.void
saxContentTypeAdditionalData
(ContentHandler contentHandler, Content content) SAX the additional content data linked to itsContentType
These additional data will be available in content viewMethods 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.Model
getFamilyId, getId
Methods inherited from interface org.ametys.runtime.model.ModelItemAccessor
getChild, getModelItem, getModelItems, hasModelItem
-
Field Details
-
TAG_PRIVATE
Tag for private content type- See Also:
-
TAG_REFERENCE_TABLE
Tag for reference table- See Also:
-
TAG_RENDERABLE_FERENCE_TABLE
Tag for renderable reference table- See Also:
-
TAG_MIXIN
Tag for simple content type- See Also:
-
VIEW_TAG_NAME
Tag name for a view declaration- See Also:
-
VIEW_TAG_NAME_WITH_LEGACY_SYNTAX
Tag name for a view declaration using the legacy syntax- See Also:
-
GROUP_TAG_NAME_WITH_LEGACY_SYNTAX
Tag name for a group declaration in a view using legacy syntax- See Also:
-
ITEM_TAG_NAME_WITH_LEGACY_SYNTAX
Tag name for a model item reference declaration in a view using the legacy syntax- See Also:
-
ITEM_REF_ATTRIBUTE_NAME_WITH_LEGACY_SYNTAX
Attribute name for an item reference in a view using the legacy syntax- See Also:
-
-
Method Details
-
initializeAfterModelItemsInitialization
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- Throws:
Exception
- if an error occurs of if an additional check fails.
-
initializeAfterViewsInitialization
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- Throws:
Exception
- if an error occurs of if an additional check fails.
-
getGlobalValidators
Retrieves the potential global validators.- Returns:
- the global validators or an empty List if none.
-
getRichTextUpdater
Retrieves the RichText updater- Returns:
- the RichText updater or
null
if none.
-
getPropertiesReferences
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.- Returns:
- this content type's properties references
-
getViewNames
Retrieves the names of all the content type's view- Returns:
- the views' names
-
getViewNames
Retrieves the names of all the content type's view- Parameters:
includeInternals
- if the result should include internal views.- Returns:
- the views' names
-
getView
Retrieves the view with the given name- Parameters:
viewName
- the name of the view to retrieve- Returns:
- the view
-
getViewConfigurations
Retrieves all the views' configurations declared by this content type- Returns:
- the views' configurations
-
getViewConfigurations
Retrieves the optional view's configuration declared by this content type- Parameters:
viewName
- the name of the view to retrieve- Returns:
- the view's configuration
-
canRead
default boolean canRead(Content content, RestrictedModelItem<Content> definition) throws AmetysRepositoryException Determine whether an attribute can be read at this time. Method called byAttributeDefinition.canRead(Content)
to do some other checks, depending on the content type- Parameters:
definition
- the attribute definitioncontent
- The content where attribute is to be read on. Can be null, on content creation.- Returns:
true
if the current user is allowed to read the attribute of this content.- Throws:
AmetysRepositoryException
- if an error occurs while accessing the content.
-
canWrite
default boolean canWrite(Content content, RestrictedModelItem<Content> definition) throws AmetysRepositoryException Determine whether an attribute can be written at this time. Method called byAttributeDefinition.canWrite(Content)
to do some other checks, depending on the content type- Parameters:
definition
- the attribute definitioncontent
- The content where attribute is to be written on. Can be null, on content creation.- Returns:
true
if the current user is allowed to write the attribute of this content.- Throws:
AmetysRepositoryException
- if an error occurs while accessing the content.
-
getTags
Get the registered tags for this content type- Returns:
- the tags
-
getInheritableTags
Get the registered and inheritable tags for this content type- Returns:
- the inheritable tags
-
hasTag
Determines if the content type has the given tag- Parameters:
tagName
- The tag name- Returns:
- true if the content type is tagged with the given tag name
-
isPrivate
boolean isPrivate()Get whether the content type is private, i.e. should not be created by the regular content interface.- Returns:
- true if the content is private, false if it is public.
-
isSimple
boolean isSimple()Get whether the content type is simple, i.e. should contains only simple metadata type to be edited in a grid.- Returns:
- true if the content is simple, false otherwise
-
isReferenceTable
boolean isReferenceTable()Get whether the content type is a reference table- Returns:
- true if the content type is a reference table
-
isMultilingual
boolean isMultilingual()Get whether the content type is multilingual- Returns:
- true if the content is multilingual, false otherwise
-
isAbstract
boolean isAbstract()Get whether the content type is abstract, i.e. should not be created by the regular content interface.- Returns:
- true if the content is abstract, false otherwise.
-
isMixin
boolean isMixin()Get whether the content type is a mixin, i.e. should used to add metadata to a existing content.- Returns:
- true if the content is mixin, false otherwise.
-
getConfiguredDefaultWorkflowNames
Get the workflow names configured in the content type definition or in its supertypes.- Returns:
- A
Set
of workflow names
-
getDefaultWorkflowName
Get the default workflow name.- Returns:
- The default workflow name
-
getRight
Get the right needed to create a content of this type.- Returns:
- the right needed to create a content of this type. If null is returned, no right is needed.
-
saxContentTypeAdditionalData
void saxContentTypeAdditionalData(ContentHandler contentHandler, Content content) throws AmetysRepositoryException, SAXException SAX the additional content data linked to itsContentType
These additional data will be available in content view- 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
Get the additional data relative to itsContentType
. These additional data are delivered to client side.- Parameters:
content
- The content- Returns:
- the additional properties in a Map
-
getParentAttributeDefinition
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.- Returns:
- the attribute holding the "parent" of the contents of this content type
-
getOverriddenModelItems
Get the overridden model items list- Returns:
- the overridden model items list
-
getOverriddenViews
Get the overridden views list- Returns:
- the overridden views list
-