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 Detail

      • 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​(javax.jcr.Node node)
                                   throws javax.jcr.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:
        javax.jcr.RepositoryException - if a repository error occurs
      • getContentTypeForNodeByUuid

        ContentType getContentTypeForNodeByUuid​(javax.jcr.Session session,
                                                String uuid)
                                         throws javax.jcr.ItemNotFoundException,
                                                javax.jcr.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:
        javax.jcr.ItemNotFoundException - if node doesn't exist or is not accessible
        javax.jcr.RepositoryException - if another error occurs
      • getContentTypeForNodeByPath

        ContentType getContentTypeForNodeByPath​(javax.jcr.Session session,
                                                String path)
                                         throws javax.jcr.PathNotFoundException,
                                                javax.jcr.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:
        javax.jcr.PathNotFoundException - if node doesn't exist or is not accessible
        javax.jcr.RepositoryException - if a repository error occurs