Interface ContentTypes


public interface ContentTypes
A lightweight and immutable representation of the ContentType definitions. If the model is still 'current' its version property can be compared against the current version provided by the ContentTypeService.
  • Method Details

    • getEffectiveNodeTypes

      EffectiveNodeTypes getEffectiveNodeTypes()
      Returns:
      The EffectiveNodeTypes used by this ContentTypes instance.
    • version

      long version()
      Returns:
      The immutable instance version which is automatically incremented for every new (changed) ContentTypes instance created by the ContentTypeService
    • getType

      ContentType getType(String name)
      Parameters:
      name - Qualified Name for a ContentType (see JCR-2.0 3.2.5.2)
      Returns:
      The immutable ContentType definition
    • getTypesByPrefix

      SortedMap<String,Set<ContentType>> getTypesByPrefix()
      Returns:
      The immutable map of ContentTypes grouped and sorted by their namespace prefix as key and their elements ordered (but not sorted) by their name
    • getContentTypeForNode

      ContentType getContentTypeForNode(Node node) throws RepositoryException
      Returns the effective ContentType representation for a specific Node
      Parameters:
      node - The Node for which to retrieve the ContentType representation
      Returns:
      the ContentType representation for a specific Node
      Throws:
      RepositoryException - if a repository error occurs
    • getContentTypeForNodeByUuid

      ContentType getContentTypeForNodeByUuid(Session session, String uuid) throws ItemNotFoundException, RepositoryException
      Returns the effective ContentType representation for an existing Node identified by its uuid

      The existence and allowed read access to the Node is first checked through the provided Session.

      Parameters:
      session - An active repository Session
      uuid - An existing Node uuid
      Returns:
      the ContentType representation for an existing Node identified by its uuid
      Throws:
      ItemNotFoundException - if node doesn't exist or is not accessible
      RepositoryException - if another error occurs
    • getContentTypeForNodeByPath

      ContentType getContentTypeForNodeByPath(Session session, String path) throws PathNotFoundException, RepositoryException
      Returns the effective ContentType representation for an existing Node identified by its absolute path

      The existence and allowed read access to the Node is first checked through the provided Session.

      Parameters:
      session - An active repository Session
      path - The absolute path of an existing Node
      Returns:
      the ContentType representation for an existing Node identified by its absolute path
      Throws:
      PathNotFoundException - if node doesn't exist or is not accessible
      RepositoryException - if a repository error occurs