Class ContentTypeExtensionPoint

All Implemented Interfaces:
LogEnabled, ExtensionPoint<ContentType>, Disposable, Initializable, Component, Contextualizable, Serviceable, ThreadSafe

This class is in charge of handling content type extension point.
This point handles the pool of available content types.
  • Field Details

  • Constructor Details

  • Method Details

    • initializeExtensions

      public void initializeExtensions() throws Exception
      Description copied from interface: ExtensionPoint
      Finalize the initialization of the extensions.
      This method is called after all addExtension() calls.
      This is the last step before the actual startup of the application.
      Specified by:
      initializeExtensions in interface ExtensionPoint<ContentType>
      Overrides:
      initializeExtensions in class AbstractThreadSafeComponentExtensionPoint<ContentType>
      Throws:
      Exception - if something wrong occurs
    • createHierarchicalCTExpression

      Create a hierarchical ContentTypeExpression which returns all contents of the specified type and all its descendant types.
      Parameters:
      contentTypeIds - the content type id.
      Returns:
      the hierarchical content type expression.
    • createHierarchicalMixinExpression

      Create a hierarchical ContentTypeExpression which returns all contents of the specified mixin and all its descendant types.
      Parameters:
      mixinIds - the mixin ids
      Returns:
      the hierarchical content type expression.
    • createHierarchicalContentTypeOrMixinExpression

      Create a hierarchical ContentTypeExpression which returns all contents of the specified type or mixin and all its descendant types.
      Parameters:
      contentIds - the mixin ids
      Returns:
      the hierarchical content type expression.
    • getSubTypes

      public Set<String> getSubTypes(String contentTypeId)
      Get all the descendant types of a given ContentType.
      Parameters:
      contentTypeId - the content type id.
      Returns:
      a collection of the ids of all the ContentType's descendants.
    • isDescendant

      public boolean isDescendant(String contentTypeId, String parentTypeId)
      Get all the descendant types of a given ContentType.
      Parameters:
      contentTypeId - the content type id to test
      parentTypeId - the content type that should be the parent content type
      Returns:
      a collection of the ids of all the ContentType's descendants.
    • isSameOrDescendant

      public boolean isSameOrDescendant(String contentTypeId, String parentTypeId)
      Get all the descendant types of a given ContentType.
      Parameters:
      contentTypeId - the content type id to test
      parentTypeId - the content type that should be the parent content type
      Returns:
      a collection of the ids of all the ContentType's descendants.
    • getDirectSubTypes

      public Set<String> getDirectSubTypes(String contentTypeId)
      Get the immediate children types of a given ContentType.
      Parameters:
      contentTypeId - the content type id.
      Returns:
      a collection of the ids of the immediate ContentType's children.
    • getIndexingReferences

      public Map<String,Map<String,List<String>>> getIndexingReferences(String referencedContentType)
      Get the content types referencing this content type as an indexing field.
      Parameters:
      referencedContentType - the referenced content type.
      Returns:
      the ContentTypes referencing the given ContentType as an indexing field, as a Map of referencing ContentType -> local IndexingField name -> path to impacted content.
      null is returned if the ContentType isn't referenced in any indexing field.
    • hasIndexingReferences

      public boolean hasIndexingReferences(String contentTypeId)
      Test if the given content type has indexing references, i.e. if other content types reference this one in an indexing field chain.
      Parameters:
      contentTypeId - the referenced content type ID.
      Returns:
      true if the given content type has indexing references, false otherwise.
    • initializeContentTypeHierarchy

      Initialize the content type hierarchy.
    • postInitialize

      protected void postInitialize() throws Exception
      The content type hierarchy has been computed: call postInitialize on each ContentType.
      Throws:
      Exception - if an error occurs.
    • initializeContentTypeIndexingReferences

      Initialize the indexing references on all content types.