Package org.alfresco.rest.api
Interface Nodes
-
- All Known Implementing Classes:
NodesImpl
public interface Nodes
File Folder (Nodes) API- Author:
- janv, Jamal Kaabi-Mofrad, Gethin James, steveglover
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
OP_CREATE
static java.lang.String
OP_DELETE
static java.lang.String
OP_UPDATE
static java.lang.String
OP_UPDATE_PERMISSIONS
static java.lang.String
PARAM_ASSOC_TYPE
static java.lang.String
PARAM_AUTO_RENAME
static java.lang.String
PARAM_CREATEBYUSER
static java.lang.String
PARAM_CREATEDAT
static java.lang.String
PARAM_INCLUDE_ALLOWABLEOPERATIONS
static java.lang.String
PARAM_INCLUDE_ASPECTNAMES
static java.lang.String
PARAM_INCLUDE_ASSOCIATION
static java.lang.String
PARAM_INCLUDE_ISFAVORITE
static java.lang.String
PARAM_INCLUDE_ISLINK
static java.lang.String
PARAM_INCLUDE_ISLOCKED
static java.lang.String
PARAM_INCLUDE_PATH
static java.lang.String
PARAM_INCLUDE_PERMISSIONS
static java.lang.String
PARAM_INCLUDE_PROPERTIES
static java.lang.String
PARAM_INCLUDE_SUBTYPES
static java.lang.String
PARAM_ISFILE
static java.lang.String
PARAM_ISFOLDER
static java.lang.String
PARAM_ISPRIMARY
static java.lang.String
PARAM_MIMETYPE
static java.lang.String
PARAM_MODIFIEDAT
static java.lang.String
PARAM_MODIFIEDBYUSER
static java.lang.String
PARAM_NAME
static java.lang.String
PARAM_NODETYPE
static java.lang.String
PARAM_OVERWRITE
static java.lang.String
PARAM_PERMANENT
static java.lang.String
PARAM_RELATIVE_PATH
static java.lang.String
PARAM_SIZEINBYTES
static java.lang.String
PARAM_VERSION_COMMENT
static java.lang.String
PARAM_VERSION_MAJOR
static java.lang.String
PATH_MY
static java.lang.String
PATH_ROOT
API Constants - query parameters, etcstatic java.lang.String
PATH_SHARED
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<AssocChild>
addChildren(java.lang.String parentNodeId, java.util.List<AssocChild> entities)
void
addCustomAspects(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.List<java.lang.String> aspectNames, java.util.List<org.alfresco.service.namespace.QName> exclusions)
Add aspects to the specified NodeRef.java.util.List<AssocTarget>
addTargets(java.lang.String sourceNodeId, java.util.List<AssocTarget> entities)
Node
createNode(java.lang.String parentFolderNodeId, Node nodeInfo, Parameters parameters)
Create node - folder or (empty) file.org.alfresco.service.namespace.QName
createQName(java.lang.String qnameStr)
Helper to create a QName from either a fully qualified or short-name QName stringvoid
deleteNode(java.lang.String nodeId, Parameters parameters)
Delete the given node.org.alfresco.service.namespace.QName
getAssocType(java.lang.String assocTypeQNameStr)
org.alfresco.service.namespace.QName
getAssocType(java.lang.String assocTypeQNameStr, boolean mandatory)
BinaryResource
getContent(java.lang.String fileNodeId, Parameters parameters, boolean recordActivity)
Download file content.BinaryResource
getContent(org.alfresco.service.cmr.repository.NodeRef nodeRef, Parameters parameters, boolean recordActivity)
Download file content.Document
getDocument(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Get the document representation for the given node.Folder
getFolder(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Get the folder representation for the given node.Node
getFolderOrDocument(java.lang.String nodeId, Parameters parameters)
Get the folder or document representation (as appropriate) for the given node.Node
getFolderOrDocument(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.NodeRef parentNodeRef, org.alfresco.service.namespace.QName nodeTypeQName, java.util.List<java.lang.String> includeParam, java.util.Map<java.lang.String,UserInfo> mapUserInfo)
Get the folder or document representation (as appropriate) for the given node.Node
getFolderOrDocumentFullInfo(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.NodeRef parentNodeRef, org.alfresco.service.namespace.QName nodeTypeQName, Parameters parameters, java.util.Map<java.lang.String,UserInfo> mapUserInfo)
Node
getNode(java.lang.String nodeId)
Get the node representation for the given node.boolean
isSubClass(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName ofClassQName, boolean validateNodeRef)
Determines whether the type of the given nodeRef is a sub-class of another class or not.CollectionWithPagingInfo<Node>
listChildren(java.lang.String parentFolderNodeId, Parameters parameters)
Get list of children of a parent folder.Node
lock(java.lang.String nodeId, LockInfo lockInfo, Parameters parameters)
Lock a nodePathInfo
lookupPathInfo(org.alfresco.service.cmr.repository.NodeRef nodeRefIn, org.alfresco.service.cmr.repository.ChildAssociationRef archivedParentAssoc)
Returns the path to the given nodeRefnodeRefIn
or the archived nodeRefarchivedParentAssoc
.java.util.List<java.lang.String>
mapFromNodeAspects(java.util.Set<org.alfresco.service.namespace.QName> nodeAspects, java.util.List<java.lang.String> excludedNS, java.util.List<org.alfresco.service.namespace.QName> excludedAspects)
Map from aspects (Set of QName) retrieved from the repository to a map List of String required that can be formatted/expressed as required by the API JSON response for get nodes, get person etc.java.util.Map<java.lang.String,java.lang.Object>
mapFromNodeProperties(java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> nodeProps, java.util.List<java.lang.String> selectParam, java.util.Map<java.lang.String,UserInfo> mapUserInfo, java.util.List<java.lang.String> excludedNS, java.util.List<org.alfresco.service.namespace.QName> excludedProps)
Convert from node properties (map of QName to Serializable) retrieved from the respository to a map of String to Object that can be formatted/expressed as required by the API JSON response for get nodes, get person etc.java.util.Set<org.alfresco.service.namespace.QName>
mapToNodeAspects(java.util.List<java.lang.String> aspectNames)
Map from a String representation of aspect names to a set of QName objects, as used by the repository.java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable>
mapToNodeProperties(java.util.Map<java.lang.String,java.lang.Object> props)
Map from the JSON API format of properties (String to Object) to the typical node properties map used by the repository (QName to Serializable).Node
moveOrCopyNode(java.lang.String sourceNodeId, java.lang.String parentFolderNodeId, java.lang.String name, Parameters parameters, boolean isCopy)
Move or Copy nodeboolean
nodeMatches(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.Set<org.alfresco.service.namespace.QName> expectedTypes, java.util.Set<org.alfresco.service.namespace.QName> excludedTypes)
Node
unlock(java.lang.String nodeId, Parameters parameters)
Unlock a nodeNode
updateContent(java.lang.String fileNodeId, BasicContentInfo contentInfo, java.io.InputStream stream, Parameters parameters)
Uploads file content (updates existing node with new content).void
updateCustomAspects(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.List<java.lang.String> aspectNames, java.util.List<org.alfresco.service.namespace.QName> exclusions)
Update aspects for the specified NodeRef.Node
updateNode(java.lang.String nodeId, Node entity, Parameters parameters)
Update node meta-data.Node
upload(java.lang.String parentFolderNodeId, org.springframework.extensions.webscripts.servlet.FormData formData, Parameters parameters)
Uploads file content and meta-data into the repository.void
validateAspects(java.util.List<java.lang.String> aspectNames, java.util.List<java.lang.String> excludedNS, java.util.List<org.alfresco.service.namespace.QName> excludedAspects)
org.alfresco.service.cmr.repository.NodeRef
validateNode(java.lang.String nodeId)
org.alfresco.service.cmr.repository.NodeRef
validateNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
org.alfresco.service.cmr.repository.NodeRef
validateNode(org.alfresco.service.cmr.repository.StoreRef storeRef, java.lang.String nodeId)
org.alfresco.service.cmr.repository.NodeRef
validateOrLookupNode(java.lang.String nodeId, java.lang.String path)
void
validateProperties(java.util.Map<java.lang.String,java.lang.Object> properties, java.util.List<java.lang.String> excludedNS, java.util.List<org.alfresco.service.namespace.QName> excludedProperties)
-
-
-
Field Detail
-
PATH_ROOT
static final java.lang.String PATH_ROOT
API Constants - query parameters, etc- See Also:
- Constant Field Values
-
PATH_MY
static final java.lang.String PATH_MY
- See Also:
- Constant Field Values
-
PATH_SHARED
static final java.lang.String PATH_SHARED
- See Also:
- Constant Field Values
-
OP_CREATE
static final java.lang.String OP_CREATE
- See Also:
- Constant Field Values
-
OP_DELETE
static final java.lang.String OP_DELETE
- See Also:
- Constant Field Values
-
OP_UPDATE
static final java.lang.String OP_UPDATE
- See Also:
- Constant Field Values
-
OP_UPDATE_PERMISSIONS
static final java.lang.String OP_UPDATE_PERMISSIONS
- See Also:
- Constant Field Values
-
PARAM_RELATIVE_PATH
static final java.lang.String PARAM_RELATIVE_PATH
- See Also:
- Constant Field Values
-
PARAM_PERMANENT
static final java.lang.String PARAM_PERMANENT
- See Also:
- Constant Field Values
-
PARAM_INCLUDE_PROPERTIES
static final java.lang.String PARAM_INCLUDE_PROPERTIES
- See Also:
- Constant Field Values
-
PARAM_INCLUDE_PATH
static final java.lang.String PARAM_INCLUDE_PATH
- See Also:
- Constant Field Values
-
PARAM_INCLUDE_ASPECTNAMES
static final java.lang.String PARAM_INCLUDE_ASPECTNAMES
- See Also:
- Constant Field Values
-
PARAM_INCLUDE_ISLINK
static final java.lang.String PARAM_INCLUDE_ISLINK
- See Also:
- Constant Field Values
-
PARAM_INCLUDE_ISLOCKED
static final java.lang.String PARAM_INCLUDE_ISLOCKED
- See Also:
- Constant Field Values
-
PARAM_INCLUDE_ALLOWABLEOPERATIONS
static final java.lang.String PARAM_INCLUDE_ALLOWABLEOPERATIONS
- See Also:
- Constant Field Values
-
PARAM_INCLUDE_PERMISSIONS
static final java.lang.String PARAM_INCLUDE_PERMISSIONS
- See Also:
- Constant Field Values
-
PARAM_INCLUDE_ISFAVORITE
static final java.lang.String PARAM_INCLUDE_ISFAVORITE
- See Also:
- Constant Field Values
-
PARAM_INCLUDE_ASSOCIATION
static final java.lang.String PARAM_INCLUDE_ASSOCIATION
- See Also:
- Constant Field Values
-
PARAM_ISFOLDER
static final java.lang.String PARAM_ISFOLDER
- See Also:
- Constant Field Values
-
PARAM_ISFILE
static final java.lang.String PARAM_ISFILE
- See Also:
- Constant Field Values
-
PARAM_INCLUDE_SUBTYPES
static final java.lang.String PARAM_INCLUDE_SUBTYPES
- See Also:
- Constant Field Values
-
PARAM_NAME
static final java.lang.String PARAM_NAME
- See Also:
- Constant Field Values
-
PARAM_CREATEDAT
static final java.lang.String PARAM_CREATEDAT
- See Also:
- Constant Field Values
-
PARAM_MODIFIEDAT
static final java.lang.String PARAM_MODIFIEDAT
- See Also:
- Constant Field Values
-
PARAM_CREATEBYUSER
static final java.lang.String PARAM_CREATEBYUSER
- See Also:
- Constant Field Values
-
PARAM_MODIFIEDBYUSER
static final java.lang.String PARAM_MODIFIEDBYUSER
- See Also:
- Constant Field Values
-
PARAM_MIMETYPE
static final java.lang.String PARAM_MIMETYPE
- See Also:
- Constant Field Values
-
PARAM_SIZEINBYTES
static final java.lang.String PARAM_SIZEINBYTES
- See Also:
- Constant Field Values
-
PARAM_NODETYPE
static final java.lang.String PARAM_NODETYPE
- See Also:
- Constant Field Values
-
PARAM_VERSION_MAJOR
static final java.lang.String PARAM_VERSION_MAJOR
- See Also:
- Constant Field Values
-
PARAM_VERSION_COMMENT
static final java.lang.String PARAM_VERSION_COMMENT
- See Also:
- Constant Field Values
-
PARAM_OVERWRITE
static final java.lang.String PARAM_OVERWRITE
- See Also:
- Constant Field Values
-
PARAM_AUTO_RENAME
static final java.lang.String PARAM_AUTO_RENAME
- See Also:
- Constant Field Values
-
PARAM_ISPRIMARY
static final java.lang.String PARAM_ISPRIMARY
- See Also:
- Constant Field Values
-
PARAM_ASSOC_TYPE
static final java.lang.String PARAM_ASSOC_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getNode
Node getNode(java.lang.String nodeId)
Get the node representation for the given node.- Parameters:
nodeId
- String- Returns:
- Node
-
getDocument
Document getDocument(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Get the document representation for the given node.- Parameters:
nodeRef
- NodeRef- Returns:
- Document
-
getFolder
Folder getFolder(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Get the folder representation for the given node.- Parameters:
nodeRef
- NodeRef- Returns:
- Folder
-
getFolderOrDocument
Node getFolderOrDocument(java.lang.String nodeId, Parameters parameters)
Get the folder or document representation (as appropriate) for the given node.- Parameters:
nodeId
- String nodeId or well-known alias, eg. "-root-" or "-my-"parameters
- theParameters
object to get the parameters passed into the request including: - incPrimaryParent- Returns:
-
getFolderOrDocumentFullInfo
Node getFolderOrDocumentFullInfo(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.NodeRef parentNodeRef, org.alfresco.service.namespace.QName nodeTypeQName, Parameters parameters, java.util.Map<java.lang.String,UserInfo> mapUserInfo)
-
getFolderOrDocument
Node getFolderOrDocument(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.NodeRef parentNodeRef, org.alfresco.service.namespace.QName nodeTypeQName, java.util.List<java.lang.String> includeParam, java.util.Map<java.lang.String,UserInfo> mapUserInfo)
Get the folder or document representation (as appropriate) for the given node.- Parameters:
nodeRef
- A real NodeparentNodeRef
-nodeTypeQName
-includeParam
-mapUserInfo
-- Returns:
-
listChildren
CollectionWithPagingInfo<Node> listChildren(java.lang.String parentFolderNodeId, Parameters parameters)
Get list of children of a parent folder.- Parameters:
parentFolderNodeId
- String id of parent folder node or well-known alias, eg. "-root-" or "-my-"parameters
- theParameters
object to get the parameters passed into the request including: - filter, sort & paging params (where, orderBy, skipCount, maxItems) - incFiles, incFolders (both true by default)- Returns:
- a paged list of
org.alfresco.rest.api.model.Node
objects
-
deleteNode
void deleteNode(java.lang.String nodeId, Parameters parameters)
Delete the given node. Note: will cascade delete for a folder.- Parameters:
nodeId
- String id of node (folder or document)parameters
- theParameters
object to get the parameters passed into the request - permanent (default false)
-
createNode
Node createNode(java.lang.String parentFolderNodeId, Node nodeInfo, Parameters parameters)
Create node - folder or (empty) file.- Parameters:
parentFolderNodeId
-nodeInfo
-parameters
-- Returns:
-
moveOrCopyNode
Node moveOrCopyNode(java.lang.String sourceNodeId, java.lang.String parentFolderNodeId, java.lang.String name, Parameters parameters, boolean isCopy)
Move or Copy node- Parameters:
sourceNodeId
-parentFolderNodeId
-name
-parameters
-- Returns:
-
updateNode
Node updateNode(java.lang.String nodeId, Node entity, Parameters parameters)
Update node meta-data.- Parameters:
nodeId
-entity
-parameters
-- Returns:
-
getContent
BinaryResource getContent(java.lang.String fileNodeId, Parameters parameters, boolean recordActivity)
Download file content.- Parameters:
fileNodeId
-parameters
-recordActivity
- true, if an activity post is required.- Returns:
-
getContent
BinaryResource getContent(org.alfresco.service.cmr.repository.NodeRef nodeRef, Parameters parameters, boolean recordActivity)
Download file content.- Parameters:
nodeRef
- the content nodeRefparameters
-recordActivity
- true, if an activity post is required.- Returns:
-
updateContent
Node updateContent(java.lang.String fileNodeId, BasicContentInfo contentInfo, java.io.InputStream stream, Parameters parameters)
Uploads file content (updates existing node with new content). Note: may create a new version, depending on versioning behaviour.- Parameters:
fileNodeId
-contentInfo
-stream
-parameters
-- Returns:
-
upload
Node upload(java.lang.String parentFolderNodeId, org.springframework.extensions.webscripts.servlet.FormData formData, Parameters parameters)
Uploads file content and meta-data into the repository.- Parameters:
parentFolderNodeId
- String id of parent folder node or well-known alias, eg. "-root-" or "-my-"formData
- theFormData
parameters
- theParameters
object to get the parameters passed into the request- Returns:
Node
if successful
-
validateNode
org.alfresco.service.cmr.repository.NodeRef validateNode(org.alfresco.service.cmr.repository.StoreRef storeRef, java.lang.String nodeId)
-
validateNode
org.alfresco.service.cmr.repository.NodeRef validateNode(java.lang.String nodeId)
-
validateNode
org.alfresco.service.cmr.repository.NodeRef validateNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
-
validateOrLookupNode
org.alfresco.service.cmr.repository.NodeRef validateOrLookupNode(java.lang.String nodeId, java.lang.String path)
-
nodeMatches
boolean nodeMatches(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.Set<org.alfresco.service.namespace.QName> expectedTypes, java.util.Set<org.alfresco.service.namespace.QName> excludedTypes)
-
isSubClass
boolean isSubClass(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName ofClassQName, boolean validateNodeRef)
Determines whether the type of the given nodeRef is a sub-class of another class or not.- Parameters:
nodeRef
- source nodeRefofClassQName
- the class to test againstvalidateNodeRef
- whether to validate the given source node or not- Returns:
- true if the type of the given nodeRef is a sub-class of another class, otherwise false
-
createQName
org.alfresco.service.namespace.QName createQName(java.lang.String qnameStr)
Helper to create a QName from either a fully qualified or short-name QName string- Parameters:
qnameStr
- Fully qualified or short-name QName string- Returns:
- QName
-
getAssocType
org.alfresco.service.namespace.QName getAssocType(java.lang.String assocTypeQNameStr)
-
getAssocType
org.alfresco.service.namespace.QName getAssocType(java.lang.String assocTypeQNameStr, boolean mandatory)
-
addChildren
java.util.List<AssocChild> addChildren(java.lang.String parentNodeId, java.util.List<AssocChild> entities)
- Parameters:
parentNodeId
-entities
-- Returns:
-
addTargets
java.util.List<AssocTarget> addTargets(java.lang.String sourceNodeId, java.util.List<AssocTarget> entities)
- Parameters:
sourceNodeId
-entities
-- Returns:
-
lock
Node lock(java.lang.String nodeId, LockInfo lockInfo, Parameters parameters)
Lock a node- Parameters:
nodeId
-lockInfo
-parameters
-- Returns:
-
unlock
Node unlock(java.lang.String nodeId, Parameters parameters)
Unlock a node- Parameters:
nodeId
-parameters
-- Returns:
-
mapFromNodeProperties
java.util.Map<java.lang.String,java.lang.Object> mapFromNodeProperties(java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> nodeProps, java.util.List<java.lang.String> selectParam, java.util.Map<java.lang.String,UserInfo> mapUserInfo, java.util.List<java.lang.String> excludedNS, java.util.List<org.alfresco.service.namespace.QName> excludedProps)
Convert from node properties (map of QName to Serializable) retrieved from the respository to a map of String to Object that can be formatted/expressed as required by the API JSON response for get nodes, get person etc.Returns null if there are no properties to return, rather than an empty map.
- Parameters:
nodeProps
-selectParam
-mapUserInfo
-excludedNS
-excludedProps
-- Returns:
- The map of properties, or null if none to return.
-
mapToNodeProperties
java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> mapToNodeProperties(java.util.Map<java.lang.String,java.lang.Object> props)
Map from the JSON API format of properties (String to Object) to the typical node properties map used by the repository (QName to Serializable).- Parameters:
props
-- Returns:
-
lookupPathInfo
PathInfo lookupPathInfo(org.alfresco.service.cmr.repository.NodeRef nodeRefIn, org.alfresco.service.cmr.repository.ChildAssociationRef archivedParentAssoc)
Returns the path to the given nodeRefnodeRefIn
or the archived nodeRefarchivedParentAssoc
.- Parameters:
nodeRefIn
- the NodeRefarchivedParentAssoc
- the ChildAssociationRef of the archived NodeRef- Returns:
- the path to the given node
-
mapToNodeAspects
java.util.Set<org.alfresco.service.namespace.QName> mapToNodeAspects(java.util.List<java.lang.String> aspectNames)
Map from a String representation of aspect names to a set of QName objects, as used by the repository.- Parameters:
aspectNames
-- Returns:
-
mapFromNodeAspects
java.util.List<java.lang.String> mapFromNodeAspects(java.util.Set<org.alfresco.service.namespace.QName> nodeAspects, java.util.List<java.lang.String> excludedNS, java.util.List<org.alfresco.service.namespace.QName> excludedAspects)
Map from aspects (Set of QName) retrieved from the repository to a map List of String required that can be formatted/expressed as required by the API JSON response for get nodes, get person etc.Returns null if there are no aspect names to return, rather than an empty list.
- Parameters:
nodeAspects
-excludedNS
-excludedAspects
-- Returns:
- The list of aspect names, or null if none to return.
-
addCustomAspects
void addCustomAspects(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.List<java.lang.String> aspectNames, java.util.List<org.alfresco.service.namespace.QName> exclusions)
Add aspects to the specified NodeRef. Aspects that appear in the exclusions list will be ignored.- Parameters:
nodeRef
-aspectNames
-exclusions
-
-
updateCustomAspects
void updateCustomAspects(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.List<java.lang.String> aspectNames, java.util.List<org.alfresco.service.namespace.QName> exclusions)
Update aspects for the specified NodeRef. An empty list will result in aspects being removed.- Parameters:
nodeRef
-aspectNames
-exclusions
-
-
validateAspects
void validateAspects(java.util.List<java.lang.String> aspectNames, java.util.List<java.lang.String> excludedNS, java.util.List<org.alfresco.service.namespace.QName> excludedAspects)
-
validateProperties
void validateProperties(java.util.Map<java.lang.String,java.lang.Object> properties, java.util.List<java.lang.String> excludedNS, java.util.List<org.alfresco.service.namespace.QName> excludedProperties)
-
-