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 Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringAPI Constants - query parameters, etcstatic final String -
Method Summary
Modifier and TypeMethodDescriptionaddChildren(String parentNodeId, List<AssocChild> entities) voidaddCustomAspects(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.QNamecreateQName(String qnameStr) Helper to create a QName from either a fully qualified or short-name QName stringvoiddeleteNode(String nodeId, Parameters parameters) Delete the given node.org.alfresco.service.namespace.QNamegetAssocType(String assocTypeQNameStr) org.alfresco.service.namespace.QNamegetAssocType(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.booleanisSubClass(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 nodeRefnodeRefInor 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 nodebooleannodeMatches(NodeRef nodeRef, Set<org.alfresco.service.namespace.QName> expectedTypes, Set<org.alfresco.service.namespace.QName> excludedTypes) default DirectAccessUrlrequestContentDirectUrl(String nodeId, boolean attachment) Gets a presigned URL to directly access content.default DirectAccessUrlrequestContentDirectUrl(String nodeId, boolean attachment, Long validFor) Gets a presigned URL to directly access content.default DirectAccessUrlrequestContentDirectUrl(NodeRef nodeRef, boolean attachment) Gets a presigned URL to directly access content.default DirectAccessUrlrequestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor) Gets a presigned URL to directly access content.requestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor, String fileName) Gets a presigned URL to directly access content.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).voidupdateCustomAspects(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.voidvalidateAspects(List<String> aspectNames, List<String> excludedNS, List<org.alfresco.service.namespace.QName> excludedAspects) validateNode(String nodeId) validateNode(NodeRef nodeRef) validateNode(StoreRef storeRef, String nodeId) default NodeRefvalidateOrLookupNode(String nodeId) Check that the specified id refers to a valid node.validateOrLookupNode(String nodeId, String path) voidvalidateProperties(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- theParametersobject 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- theParametersobject to get the parameters passed into the request including: - filter, sort invalid input: '&' paging params (where, orderBy, skipCount, maxItems) - incFiles, incFolders (both true by default)- Returns:
- a paged list of
org.alfresco.rest.api.model.Nodeobjects
-
deleteNode
Delete the given node. Note: will cascade delete for a folder.- Parameters:
nodeId- String id of node (folder or document)parameters- theParametersobject 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- theFormDataparameters- theParametersobject to get the parameters passed into the request- Returns:
Nodeif successful
-
validateNode
-
validateNode
-
validateNode
-
validateOrLookupNode
Check that the specified id refers to a valid node.- Parameters:
nodeId- The node id to look up using SpacesStore or an alias like -root-.- Returns:
- The node ref.
- Throws:
InvalidArgumentException- if the specified node id is not a valid format.EntityNotFoundException- if the specified node was not found in the database.
-
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:
-
requestContentDirectUrl
Gets a presigned URL to directly access content.- Parameters:
nodeId- The node id for which to obtain the direct accessURLattachment-trueif an attachmentURLis requested,falsefor an embeddedURL.- Returns:
- A direct access
URLobject for the content.
-
requestContentDirectUrl
Gets a presigned URL to directly access content.- Parameters:
nodeRef- The node reference for which to obtain the direct accessURLattachment-trueif an attachmentURLis requested,falsefor an embeddedURL.- Returns:
- A direct access
URLobject for the content.
-
requestContentDirectUrl
Gets a presigned URL to directly access content.- Parameters:
nodeId- The node id for which to obtain the direct accessURLattachment-trueif an attachmentURLis requested,falsefor an embeddedURL.validFor- The time at which the direct accessURLwill expire.- Returns:
- A direct access
URLobject for the content.
-
requestContentDirectUrl
Gets a presigned URL to directly access content.- Parameters:
nodeRef- The node reference for which to obtain the direct accessURLattachment-trueif an attachmentURLis requested,falsefor an embeddedURL.validFor- The time at which the direct accessURLwill expire.- Returns:
- A direct access
URLobject for the content.
-
requestContentDirectUrl
DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor, String fileName) Gets a presigned URL to directly access content.- Parameters:
nodeRef- The node reference for which to obtain the direct accessURLattachment-trueif an attachmentURLis requested,falsefor an embeddedURL.validFor- The time at which the direct accessURLwill expire.fileName- Optional name for the file when downloaded- Returns:
- A direct access
URLobject for the content.
-
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 nodeRefnodeRefInor 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
-