Interface ContentCreator


  • @ProviderType
    public interface ContentCreator
    The ContentCreator is used by the ContentReader to create the actual content.
    Since:
    2.0.4
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void createAce​(java.lang.String principal, java.lang.String[] grantedPrivileges, java.lang.String[] deniedPrivileges, java.lang.String order)
      Creates an Access Control Entry for the current node for the specified principal and privileges.
      default void createAce​(java.lang.String principal, java.lang.String[] grantedPrivileges, java.lang.String[] deniedPrivileges, java.lang.String order, java.util.Map<java.lang.String,​Value> restrictions, java.util.Map<java.lang.String,​Value[]> mvRestrictions, java.util.Set<java.lang.String> removedRestrictionNames)
      Creates an Access Control Entry for the current node for the specified principal and privileges.
      void createFileAndResourceNode​(java.lang.String name, java.io.InputStream data, java.lang.String mimeType, long lastModified)
      Create a file and a resource node.
      void createGroup​(java.lang.String name, java.lang.String[] members, java.util.Map<java.lang.String,​java.lang.Object> extraProperties)
      Create a Group in the jackrabbit UserManager
      void createNode​(java.lang.String name, java.lang.String primaryNodeType, java.lang.String[] mixinNodeTypes)
      Create a new node.
      void createProperty​(java.lang.String name, int propertyType, java.lang.String value)
      Create a new property to the current node.
      void createProperty​(java.lang.String name, int propertyType, java.lang.String[] values)
      Create a new multi value property to the current node.
      void createProperty​(java.lang.String name, java.lang.Object value)
      Add a new property to the current node.
      void createProperty​(java.lang.String name, java.lang.Object[] values)
      Add a new multi value property to the current node.
      void createUser​(java.lang.String name, java.lang.String password, java.util.Map<java.lang.String,​java.lang.Object> extraProperties)
      Create a User in the jackrabbit UserManager
      void finish()
      Indicates that the import is finished
      void finishNode()
      Indicates that a node is finished.
      default Node getParent()
      Gets the current parent Node
      boolean switchCurrentNode​(java.lang.String subPath, java.lang.String newNodeType)
      Switch the current node to the path (which must be relative to the current node).
    • Method Detail

      • createNode

        void createNode​(java.lang.String name,
                        java.lang.String primaryNodeType,
                        java.lang.String[] mixinNodeTypes)
                 throws RepositoryException
        Create a new node. To add properties to this node, one of the createProperty() methods should be called. To add child nodes, this method should be called to create a new child node. If all properties and child nodes have been added finishNode() must be called.
        Parameters:
        name - The name of the node.
        primaryNodeType - The primary node type or null.
        mixinNodeTypes - The mixin node types or null.
        Throws:
        RepositoryException - If anything goes wrong.
      • finishNode

        void finishNode()
                 throws RepositoryException
        Indicates that a node is finished. The parent node of the current node becomes the current node.
        Throws:
        RepositoryException - If anything goes wrong.
      • createProperty

        void createProperty​(java.lang.String name,
                            int propertyType,
                            java.lang.String value)
                     throws RepositoryException
        Create a new property to the current node.
        Parameters:
        name - The property name.
        propertyType - The type of the property.
        value - The string value.
        Throws:
        RepositoryException - If anything goes wrong.
      • createProperty

        void createProperty​(java.lang.String name,
                            int propertyType,
                            java.lang.String[] values)
                     throws RepositoryException
        Create a new multi value property to the current node.
        Parameters:
        name - The property name.
        propertyType - The type of the property.
        values - The string values.
        Throws:
        RepositoryException - If anything goes wrong.
      • createProperty

        void createProperty​(java.lang.String name,
                            java.lang.Object value)
                     throws RepositoryException
        Add a new property to the current node.
        Parameters:
        name - The property name.
        value - The value.
        Throws:
        RepositoryException - If anything goes wrong.
      • createProperty

        void createProperty​(java.lang.String name,
                            java.lang.Object[] values)
                     throws RepositoryException
        Add a new multi value property to the current node.
        Parameters:
        name - The property name.
        values - The values.
        Throws:
        RepositoryException - If anything goes wrong.
      • createFileAndResourceNode

        void createFileAndResourceNode​(java.lang.String name,
                                       java.io.InputStream data,
                                       java.lang.String mimeType,
                                       long lastModified)
                                throws RepositoryException
        Create a file and a resource node. After the nodes have been created, the current node is the resource node. So this method call should be followed by two calls to finishNode() to be on the same level as before the file creation.
        Parameters:
        name - The name of the file node
        data - The data of the file
        mimeType - The mime type or null
        lastModified - The last modified or -1
        Throws:
        RepositoryException - If anything goes wrong.
      • switchCurrentNode

        boolean switchCurrentNode​(java.lang.String subPath,
                                  java.lang.String newNodeType)
                           throws RepositoryException
        Switch the current node to the path (which must be relative to the current node). If the path does not exist and a node type is supplied, the nodes are created with the given node type. If the path does not exist and node type is null, false is returned. When the changes to the node are finished, finishNode() must be called.
        Parameters:
        subPath - The relative path
        newNodeType - Node type for newly created nodes.
        Throws:
        RepositoryException - If anything goes wrong.
      • createUser

        void createUser​(java.lang.String name,
                        java.lang.String password,
                        java.util.Map<java.lang.String,​java.lang.Object> extraProperties)
                 throws RepositoryException
        Create a User in the jackrabbit UserManager
        Parameters:
        name - the name of the user
        password - the password of the user
        extraProperties - extra properties to assign to the created user
        Throws:
        RepositoryException - If anything goes wrong.
      • createGroup

        void createGroup​(java.lang.String name,
                         java.lang.String[] members,
                         java.util.Map<java.lang.String,​java.lang.Object> extraProperties)
                  throws RepositoryException
        Create a Group in the jackrabbit UserManager
        Parameters:
        name - the name of the group
        members - the members of the group (principal names)
        extraProperties - extra properties to assign to the created group
        Throws:
        RepositoryException
      • createAce

        void createAce​(java.lang.String principal,
                       java.lang.String[] grantedPrivileges,
                       java.lang.String[] deniedPrivileges,
                       java.lang.String order)
                throws RepositoryException
        Creates an Access Control Entry for the current node for the specified principal and privileges.
        Parameters:
        principal - the user or group id for the ACE
        grantedPrivileges - the set of privileges to grant the principal
        deniedPrivileges - the set of privileges to deny the principal (for users only)
        order - specifies the position of the ACE in the containing ACL. (may be null) Value should be one of these:
        Values
        firstPlace the target ACE as the first amongst its siblings
        lastPlace the target ACE as the last amongst its siblings
        before xyzPlace the target ACE immediately before the sibling whose name is xyz
        after xyzPlace the target ACE immediately after the sibling whose name is xyz
        numericPlace the target ACE at the specified index
        Throws:
        RepositoryException - If anything goes wrong.
      • createAce

        default void createAce​(java.lang.String principal,
                               java.lang.String[] grantedPrivileges,
                               java.lang.String[] deniedPrivileges,
                               java.lang.String order,
                               java.util.Map<java.lang.String,​Value> restrictions,
                               java.util.Map<java.lang.String,​Value[]> mvRestrictions,
                               java.util.Set<java.lang.String> removedRestrictionNames)
                        throws RepositoryException
        Creates an Access Control Entry for the current node for the specified principal and privileges.
        Parameters:
        principal - the user or group id for the ACE
        grantedPrivileges - the set of privileges to grant the principal
        deniedPrivileges - the set of privileges to deny the principal (for users only)
        order - specifies the position of the ACE in the containing ACL. (may be null) Value should be one of these:
        Values
        firstPlace the target ACE as the first amongst its siblings
        lastPlace the target ACE as the last amongst its siblings
        before xyzPlace the target ACE immediately before the sibling whose name is xyz
        after xyzPlace the target ACE immediately after the sibling whose name is xyz
        numericPlace the target ACE at the specified index
        restrictions - specifies additional Map of single-value restrictions to apply. (optional)
        mvRestrictions - specifies additional Map of multi-value restrictions to apply. (optional)
        removedRestrictionNames - optional set of restriction names that should be removed (if they already exist).
        Throws:
        RepositoryException - If anything goes wrong.
      • getParent

        default Node getParent()
        Gets the current parent Node
        Returns:
        the current parent node or null