Interface ContentCreator
-
@ProviderType public interface ContentCreator
TheContentCreatoris used by theContentReaderto create the actual content.- Since:
- 2.0.4
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidcreateAce(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 voidcreateAce(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.voidcreateFileAndResourceNode(java.lang.String name, java.io.InputStream data, java.lang.String mimeType, long lastModified)Create a file and a resource node.voidcreateGroup(java.lang.String name, java.lang.String[] members, java.util.Map<java.lang.String,java.lang.Object> extraProperties)Create a Group in the jackrabbit UserManagervoidcreateNode(java.lang.String name, java.lang.String primaryNodeType, java.lang.String[] mixinNodeTypes)Create a new node.voidcreateProperty(java.lang.String name, int propertyType, java.lang.String value)Create a new property to the current node.voidcreateProperty(java.lang.String name, int propertyType, java.lang.String[] values)Create a new multi value property to the current node.voidcreateProperty(java.lang.String name, java.lang.Object value)Add a new property to the current node.voidcreateProperty(java.lang.String name, java.lang.Object[] values)Add a new multi value property to the current node.voidcreateUser(java.lang.String name, java.lang.String password, java.util.Map<java.lang.String,java.lang.Object> extraProperties)Create a User in the jackrabbit UserManagervoidfinish()Indicates that the import is finishedvoidfinishNode()Indicates that a node is finished.default NodegetParent()Gets the current parent NodebooleanswitchCurrentNode(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 RepositoryExceptionCreate 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 addedfinishNode()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 RepositoryExceptionIndicates that a node is finished. The parent node of the current node becomes the current node.- Throws:
RepositoryException- If anything goes wrong.
-
finish
void finish() throws RepositoryExceptionIndicates that the import is finished- Throws:
RepositoryException- If anything goes wrong.
-
createProperty
void createProperty(java.lang.String name, int propertyType, java.lang.String value) throws RepositoryExceptionCreate 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 RepositoryExceptionCreate 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 RepositoryExceptionAdd 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 RepositoryExceptionAdd 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 RepositoryExceptionCreate 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 tofinishNode()to be on the same level as before the file creation.- Parameters:
name- The name of the file nodedata- The data of the filemimeType- The mime type or nulllastModified- The last modified or -1- Throws:
RepositoryException- If anything goes wrong.
-
switchCurrentNode
boolean switchCurrentNode(java.lang.String subPath, java.lang.String newNodeType) throws RepositoryExceptionSwitch 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 pathnewNodeType- 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 RepositoryExceptionCreate a User in the jackrabbit UserManager- Parameters:
name- the name of the userpassword- the password of the userextraProperties- 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 RepositoryExceptionCreate a Group in the jackrabbit UserManager- Parameters:
name- the name of the groupmembers- 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 RepositoryExceptionCreates an Access Control Entry for the current node for the specified principal and privileges.- Parameters:
principal- the user or group id for the ACEgrantedPrivileges- the set of privileges to grant the principaldeniedPrivileges- 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 first Place the target ACE as the first amongst its siblings last Place the target ACE as the last amongst its siblings before xyz Place the target ACE immediately before the sibling whose name is xyz after xyz Place the target ACE immediately after the sibling whose name is xyz numeric Place 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 RepositoryExceptionCreates an Access Control Entry for the current node for the specified principal and privileges.- Parameters:
principal- the user or group id for the ACEgrantedPrivileges- the set of privileges to grant the principaldeniedPrivileges- 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 first Place the target ACE as the first amongst its siblings last Place the target ACE as the last amongst its siblings before xyz Place the target ACE immediately before the sibling whose name is xyz after xyz Place the target ACE immediately after the sibling whose name is xyz numeric Place 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
-
-