|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.sling.jcr.contentloader.internal.DefaultContentCreator
public class DefaultContentCreator
The ContentLoader creates the nodes and properties.
| Constructor Summary | |
|---|---|
DefaultContentCreator(JcrContentHelper jcrContentHelper)
Constructor. |
|
| Method Summary | |
|---|---|
protected void |
checkoutIfNecessary(javax.jcr.Node node)
Checkout the node if needed |
void |
clear()
Clear the content loader. |
void |
createAce(java.lang.String principalId,
java.lang.String[] grantedPrivilegeNames,
java.lang.String[] deniedPrivilegeNames,
java.lang.String order)
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 |
protected javax.jcr.Value |
createValue(javax.jcr.ValueFactory factory,
java.lang.Object value)
|
static java.lang.String |
digest(java.lang.String algorithm,
byte[] data)
Digest the plain string using the given algorithm. |
protected javax.jcr.Node |
findVersionableAncestor(javax.jcr.Node node)
Find an ancestor that is versionable |
void |
finishNode()
Indicates that a node is finished. |
javax.jcr.Node |
getCreatedRootNode()
Get the created root node. |
ImportProvider |
getImportProvider(java.lang.String name)
Return the import provider for the name |
java.lang.String |
getImportProviderExtension(java.lang.String name)
Get the extension of the file name. |
java.util.Map<java.lang.String,ImportProvider> |
getImportProviders()
Get all active import providers. |
java.util.List<javax.jcr.Node> |
getVersionables()
Get the list of versionable nodes. |
protected java.lang.String |
hashPath(java.lang.String item)
|
void |
init(ImportOptions pathEntry,
java.util.Map<java.lang.String,ImportProvider> defaultImportProviders,
java.util.List<java.lang.String> createdNodes,
ContentImportListener importListener)
Initialize this component. |
protected boolean |
isVersionable(javax.jcr.Node node)
|
void |
prepareParsing(javax.jcr.Node parentNode,
java.lang.String defaultName)
If the defaultName is null, we are in PARENT_NODE import mode. |
void |
setIgnoreOverwriteFlag(boolean flag)
Set the ignore overwrite flag. |
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). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultContentCreator(JcrContentHelper jcrContentHelper)
jcrContentHelper - Helper class to get the mime type of a file| Method Detail |
|---|
public void init(ImportOptions pathEntry,
java.util.Map<java.lang.String,ImportProvider> defaultImportProviders,
java.util.List<java.lang.String> createdNodes,
ContentImportListener importListener)
pathEntry - The configuration for this import.defaultImportProviders - List of all import providers.createdNodes - Optional list to store new nodes (for uninstall)
public void prepareParsing(javax.jcr.Node parentNode,
java.lang.String defaultName)
parentNode - defaultName - public java.util.List<javax.jcr.Node> getVersionables()
public void clear()
public void setIgnoreOverwriteFlag(boolean flag)
flag - public javax.jcr.Node getCreatedRootNode()
public java.util.Map<java.lang.String,ImportProvider> getImportProviders()
public ImportProvider getImportProvider(java.lang.String name)
name - The file name.
nullpublic java.lang.String getImportProviderExtension(java.lang.String name)
name - The file name.
null
public void createNode(java.lang.String name,
java.lang.String primaryNodeType,
java.lang.String[] mixinNodeTypes)
throws javax.jcr.RepositoryException
ContentCreatorContentCreator.finishNode() must be called.
createNode in interface ContentCreatorname - The name of the node.primaryNodeType - The primary node type or null.mixinNodeTypes - The mixin node types or null.
javax.jcr.RepositoryException - If anything goes wrong.ContentCreator.createNode(java.lang.String, java.lang.String, java.lang.String[])
public void createProperty(java.lang.String name,
int propertyType,
java.lang.String value)
throws javax.jcr.RepositoryException
ContentCreator
createProperty in interface ContentCreatorname - The property name.propertyType - The type of the property.value - The string value.
javax.jcr.RepositoryExceptionContentCreator.createProperty(java.lang.String, int, java.lang.String)
public void createProperty(java.lang.String name,
int propertyType,
java.lang.String[] values)
throws javax.jcr.RepositoryException
ContentCreator
createProperty in interface ContentCreatorname - The property name.propertyType - The type of the property.values - The string values.
javax.jcr.RepositoryExceptionContentCreator.createProperty(java.lang.String, int, java.lang.String[])
protected javax.jcr.Value createValue(javax.jcr.ValueFactory factory,
java.lang.Object value)
public void createProperty(java.lang.String name,
java.lang.Object value)
throws javax.jcr.RepositoryException
ContentCreator
createProperty in interface ContentCreatorname - The property name.value - The value.
javax.jcr.RepositoryExceptionContentCreator.createProperty(java.lang.String, java.lang.Object)
public void createProperty(java.lang.String name,
java.lang.Object[] values)
throws javax.jcr.RepositoryException
ContentCreator
createProperty in interface ContentCreatorname - The property name.values - The values.
javax.jcr.RepositoryExceptionContentCreator.createProperty(java.lang.String, java.lang.Object[])
public void finishNode()
throws javax.jcr.RepositoryException
ContentCreator
finishNode in interface ContentCreatorjavax.jcr.RepositoryExceptionContentCreator.finishNode()
public void createFileAndResourceNode(java.lang.String name,
java.io.InputStream data,
java.lang.String mimeType,
long lastModified)
throws javax.jcr.RepositoryException
ContentCreatorContentCreator.finishNode()
to be on the same level as before the file creation.
createFileAndResourceNode in interface ContentCreatorname - The name of the file nodedata - The data of the filemimeType - The mime type or nulllastModified - The last modified or -1
javax.jcr.RepositoryExceptionContentCreator.createFileAndResourceNode(java.lang.String, java.io.InputStream, java.lang.String, long)
public boolean switchCurrentNode(java.lang.String subPath,
java.lang.String newNodeType)
throws javax.jcr.RepositoryException
ContentCreatorContentCreator.finishNode()
must be callsed.
switchCurrentNode in interface ContentCreatorsubPath - The relative pathnewNodeType - Node typ for newly created nodes.
javax.jcr.RepositoryExceptionContentCreator.switchCurrentNode(java.lang.String, java.lang.String)
public void createGroup(java.lang.String name,
java.lang.String[] members,
java.util.Map<java.lang.String,java.lang.Object> extraProperties)
throws javax.jcr.RepositoryException
ContentCreator
createGroup in interface ContentCreatorname - the name of the groupmembers - the members of the group (principal names)extraProperties - extra properties to assign to the created group
javax.jcr.RepositoryException
public void createUser(java.lang.String name,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.Object> extraProperties)
throws javax.jcr.RepositoryException
ContentCreator
createUser in interface ContentCreatorname - the name of the userpassword - the password of the userextraProperties - extra properties to assign to the created user
javax.jcr.RepositoryException
protected java.lang.String hashPath(java.lang.String item)
throws javax.jcr.RepositoryException
item -
javax.jcr.RepositoryException
public void createAce(java.lang.String principalId,
java.lang.String[] grantedPrivilegeNames,
java.lang.String[] deniedPrivilegeNames,
java.lang.String order)
throws javax.jcr.RepositoryException
ContentCreator
createAce in interface ContentCreatorprincipalId - the user or group id for the ACEgrantedPrivilegeNames - the set of privileges to grant the principaldeniedPrivilegeNames - 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:
| 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 |
javax.jcr.RepositoryException
public static java.lang.String digest(java.lang.String algorithm,
byte[] data)
throws java.security.NoSuchAlgorithmException
algorithm - The alogrithm for the digest. This algorithm must be
supported by the MessageDigest class.data - the data to digest with the given algorithm
java.security.NoSuchAlgorithmException - if the desired algorithm is not supported by
the MessageDigest class.
protected javax.jcr.Node findVersionableAncestor(javax.jcr.Node node)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected boolean isVersionable(javax.jcr.Node node)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void checkoutIfNecessary(javax.jcr.Node node)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||