Interface ContentType

All Superinterfaces:
ContentTypeDescriptor, MetadataDefinitionHolder, Model, ModelItemAccessor, ModelItemContainer
All Known Implementing Classes:
AutomaticContentType, DefaultContentType, HTMLContentType, ODFContentType, PostContentType, WebContentType

This class represents a type of content.
  • Field Details

  • Method Details

    • postInitialize

      void postInitialize() throws Exception
      Called by the extension point when the content type hierarchy has been computed. Can be used to do more initialization, checks, ...
      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.
    • getIndexingModel

      Get the indexing model
      Returns:
      the indexing model
    • getViewNames

      default Set<String> getViewNames()
      Retrieves the names of all the content type's view
      Returns:
      the views' names
    • getViewNames

      Set<String> getViewNames(boolean includeInternals)
      Retrieves the names of all the content type's view
      Parameters:
      includeInternals - if the result should include internal views.
      Returns:
      the views' names
    • getView

      View getView(String viewName)
      Retrieves the view with the given name
      Parameters:
      viewName - the name of the view to retrieve
      Returns:
      the view
    • getMetadataDefinitionByPath

      Deprecated.
      Retrieves the definition of a given metadata by its path.
      Parameters:
      metadataPath - the metadata path, separated by '/'
      Returns:
      the metadata definition or null if not found
    • hasMetadataDefinition

      @Deprecated boolean hasMetadataDefinition(String metadataName)
      Deprecated.
      Use ModelItem API instead
      Determines if the definition of a given metadata exists.
      Parameters:
      metadataName - the metadata name.
      Returns:
      true if the metadata definition exists
    • canRead

      Deprecated.
      Determine whether a metadata can be read at this time.
      Parameters:
      metadataDef - the metadata definition
      content - The content where metadata is to be read on. Can be null, on content creation.
      Returns:
      true if the current user is allowed to read the metadata of this content.
      Throws:
      AmetysRepositoryException - if an error occurs while accessing the content.
    • canWrite

      Deprecated.
      Determine whether a metadata can be written at this time.
      Parameters:
      metadataDef - the metadata definition
      content - The content where metadata is to be written on. Can be null, on content creation.
      Returns:
      true if the current user is allowed to write the metadata of this content.
      Throws:
      AmetysRepositoryException - if an error occurs while accessing the content.
    • canRead

      default boolean canRead(Content content, AttributeDefinition definition) throws AmetysRepositoryException
      Determine whether an attribute can be read at this time. Method called by AttributeDefinition.canRead(Content) to do some other checks, depending on the content type
      Parameters:
      definition - the attribute definition
      content - 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, AttributeDefinition definition) throws AmetysRepositoryException
      Determine whether an attribute can be written at this time. Method called by AttributeDefinition.canWrite(Content) to do some other checks, depending on the content type
      Parameters:
      definition - the attribute definition
      content - 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 types
      Returns:
      the tags
    • hasTag

      boolean hasTag(String tagName)
      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.
    • 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

      SAX the additional content data linked to its ContentType These additional data will be available in content view
      Parameters:
      contentHandler - The handler to SAX into
      content - 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 its ContentType. 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 type ModelItemTypeConstants.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
    • getOverriddenAttributes

      Get the overridden attributes list
      Returns:
      the overridden attributes list
    • getOverriddenViews

      Get the overridden views list
      Returns:
      the overridden views list