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
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
API Constants - query parameters, etcstatic final String
-
Method Summary
Modifier and TypeMethodDescriptionaddChildren
(String parentNodeId, List<AssocChild> entities) void
addCustomAspects
(NodeRef nodeRef, List<String> aspectNames, List<org.alfresco.service.namespace.QName> exclusions) Add aspects to the specified NodeRef.addTargets
(String sourceNodeId, List<AssocTarget> entities) createNode
(String parentFolderNodeId, Node nodeInfo, Parameters parameters) Create node - folder or (empty) file.org.alfresco.service.namespace.QName
createQName
(String qnameStr) Helper to create a QName from either a fully qualified or short-name QName stringvoid
deleteNode
(String nodeId, Parameters parameters) Delete the given node.org.alfresco.service.namespace.QName
getAssocType
(String assocTypeQNameStr) org.alfresco.service.namespace.QName
getAssocType
(String assocTypeQNameStr, boolean mandatory) getContent
(String fileNodeId, Parameters parameters, boolean recordActivity) Download file content.getContent
(NodeRef nodeRef, Parameters parameters, boolean recordActivity) Download file content.getDocument
(NodeRef nodeRef) Get the document representation for the given node.Get the folder representation for the given node.getFolderOrDocument
(String nodeId, Parameters parameters) Get the folder or document representation (as appropriate) for the given node.getFolderOrDocument
(NodeRef nodeRef, NodeRef parentNodeRef, org.alfresco.service.namespace.QName nodeTypeQName, List<String> includeParam, Map<String, UserInfo> mapUserInfo) Get the folder or document representation (as appropriate) for the given node.getFolderOrDocumentFullInfo
(NodeRef nodeRef, NodeRef parentNodeRef, org.alfresco.service.namespace.QName nodeTypeQName, Parameters parameters, Map<String, UserInfo> mapUserInfo) Get the node representation for the given node.boolean
isSubClass
(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.listChildren
(String parentFolderNodeId, Parameters parameters) Get list of children of a parent folder.lock
(String nodeId, LockInfo lockInfo, Parameters parameters) Lock a nodelookupPathInfo
(NodeRef nodeRefIn, ChildAssociationRef archivedParentAssoc) Returns the path to the given nodeRefnodeRefIn
or the archived nodeRefarchivedParentAssoc
.mapFromNodeAspects
(Set<org.alfresco.service.namespace.QName> nodeAspects, List<String> excludedNS, 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.mapFromNodeProperties
(Map<org.alfresco.service.namespace.QName, Serializable> nodeProps, List<String> selectParam, Map<String, UserInfo> mapUserInfo, List<String> excludedNS, 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.Set<org.alfresco.service.namespace.QName>
mapToNodeAspects
(List<String> aspectNames) Map from a String representation of aspect names to a set of QName objects, as used by the repository.Map<org.alfresco.service.namespace.QName,
Serializable> mapToNodeProperties
(Map<String, 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).moveOrCopyNode
(String sourceNodeId, String parentFolderNodeId, String name, Parameters parameters, boolean isCopy) Move or Copy nodeboolean
nodeMatches
(NodeRef nodeRef, Set<org.alfresco.service.namespace.QName> expectedTypes, Set<org.alfresco.service.namespace.QName> excludedTypes) unlock
(String nodeId, Parameters parameters) Unlock a nodeupdateContent
(String fileNodeId, BasicContentInfo contentInfo, InputStream stream, Parameters parameters) Uploads file content (updates existing node with new content).void
updateCustomAspects
(NodeRef nodeRef, List<String> aspectNames, List<org.alfresco.service.namespace.QName> exclusions) Update aspects for the specified NodeRef.updateNode
(String nodeId, Node entity, Parameters parameters) Update node meta-data.upload
(String parentFolderNodeId, org.springframework.extensions.webscripts.servlet.FormData formData, Parameters parameters) Uploads file content and meta-data into the repository.void
validateAspects
(List<String> aspectNames, List<String> excludedNS, List<org.alfresco.service.namespace.QName> excludedAspects) validateNode
(String nodeId) validateNode
(NodeRef nodeRef) validateNode
(StoreRef storeRef, String nodeId) validateOrLookupNode
(String nodeId, String path) void
validateProperties
(Map<String, Object> properties, List<String> excludedNS, List<org.alfresco.service.namespace.QName> excludedProperties)
-
Field Details
-
PATH_ROOT
API Constants - query parameters, etc- See Also:
-
PATH_MY
- See Also:
-
PATH_SHARED
- See Also:
-
OP_CREATE
- See Also:
-
OP_DELETE
- See Also:
-
OP_UPDATE
- See Also:
-
OP_UPDATE_PERMISSIONS
- See Also:
-
PARAM_RELATIVE_PATH
- See Also:
-
PARAM_PERMANENT
- See Also:
-
PARAM_INCLUDE_PROPERTIES
- See Also:
-
PARAM_INCLUDE_PATH
- See Also:
-
PARAM_INCLUDE_ASPECTNAMES
- See Also:
-
PARAM_INCLUDE_ISLINK
- See Also:
-
PARAM_INCLUDE_ISLOCKED
- See Also:
-
PARAM_INCLUDE_ALLOWABLEOPERATIONS
- See Also:
-
PARAM_INCLUDE_PERMISSIONS
- See Also:
-
PARAM_INCLUDE_ISFAVORITE
- See Also:
-
PARAM_INCLUDE_ASSOCIATION
- See Also:
-
PARAM_INCLUDE_DEFINITION
- See Also:
-
PARAM_ISFOLDER
- See Also:
-
PARAM_ISFILE
- See Also:
-
PARAM_INCLUDE_SUBTYPES
- See Also:
-
PARAM_NAME
- See Also:
-
PARAM_CREATEDAT
- See Also:
-
PARAM_MODIFIEDAT
- See Also:
-
PARAM_CREATEBYUSER
- See Also:
-
PARAM_MODIFIEDBYUSER
- See Also:
-
PARAM_MIMETYPE
- See Also:
-
PARAM_SIZEINBYTES
- See Also:
-
PARAM_NODETYPE
- See Also:
-
PARAM_VERSION_MAJOR
- See Also:
-
PARAM_VERSION_COMMENT
- See Also:
-
PARAM_OVERWRITE
- See Also:
-
PARAM_AUTO_RENAME
- See Also:
-
PARAM_ISPRIMARY
- See Also:
-
PARAM_ASSOC_TYPE
- See Also:
-
-
Method Details
-
getNode
Get the node representation for the given node.- Parameters:
nodeId
- String- Returns:
- Node
-
getDocument
Get the document representation for the given node.- Parameters:
nodeRef
- NodeRef- Returns:
- Document
-
getFolder
Get the folder representation for the given node.- Parameters:
nodeRef
- NodeRef- Returns:
- Folder
-
getFolderOrDocument
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
-
getFolderOrDocument
Node getFolderOrDocument(NodeRef nodeRef, NodeRef parentNodeRef, org.alfresco.service.namespace.QName nodeTypeQName, List<String> includeParam, Map<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
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
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
Create node - folder or (empty) file.- Parameters:
parentFolderNodeId
-nodeInfo
-parameters
-- Returns:
-
moveOrCopyNode
Node moveOrCopyNode(String sourceNodeId, String parentFolderNodeId, String name, Parameters parameters, boolean isCopy) Move or Copy node- Parameters:
sourceNodeId
-parentFolderNodeId
-name
-parameters
-- Returns:
-
updateNode
Update node meta-data.- Parameters:
nodeId
-entity
-parameters
-- Returns:
-
getContent
Download file content.- Parameters:
fileNodeId
-parameters
-recordActivity
- true, if an activity post is required.- Returns:
-
getContent
Download file content.- Parameters:
nodeRef
- the content nodeRefparameters
-recordActivity
- true, if an activity post is required.- Returns:
-
updateContent
Node updateContent(String fileNodeId, BasicContentInfo contentInfo, 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(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
-
validateNode
-
validateNode
-
validateOrLookupNode
-
nodeMatches
-
isSubClass
boolean isSubClass(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
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
-
getAssocType
-
addChildren
- Parameters:
parentNodeId
-entities
-- Returns:
-
addTargets
- Parameters:
sourceNodeId
-entities
-- Returns:
-
lock
Lock a node- Parameters:
nodeId
-lockInfo
-parameters
-- Returns:
-
unlock
Unlock a node- Parameters:
nodeId
-parameters
-- Returns:
-
mapFromNodeProperties
Map<String,Object> mapFromNodeProperties(Map<org.alfresco.service.namespace.QName, Serializable> nodeProps, List<String> selectParam, Map<String, UserInfo> mapUserInfo, List<String> excludedNS, 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
Map<org.alfresco.service.namespace.QName,Serializable> mapToNodeProperties(Map<String, 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
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
Map from a String representation of aspect names to a set of QName objects, as used by the repository.- Parameters:
aspectNames
-- Returns:
-
mapFromNodeAspects
List<String> mapFromNodeAspects(Set<org.alfresco.service.namespace.QName> nodeAspects, List<String> excludedNS, 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(NodeRef nodeRef, List<String> aspectNames, 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(NodeRef nodeRef, List<String> aspectNames, 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
-
validateProperties
-