Interface Nodes

All Known Implementing Classes:
NodesImpl

public interface Nodes
File Folder (Nodes) API
Author:
janv, Jamal Kaabi-Mofrad, Gethin James, steveglover
  • Field Details

  • Method Details

    • getNode

      Node getNode(String nodeId)
      Get the node representation for the given node.
      Parameters:
      nodeId - String
      Returns:
      Node
    • getDocument

      Document getDocument(NodeRef nodeRef)
      Get the document representation for the given node.
      Parameters:
      nodeRef - NodeRef
      Returns:
      Document
    • getFolder

      Folder getFolder(NodeRef nodeRef)
      Get the folder representation for the given node.
      Parameters:
      nodeRef - NodeRef
      Returns:
      Folder
    • getFolderOrDocument

      Node getFolderOrDocument(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 - the Parameters object to get the parameters passed into the request including: - incPrimaryParent
      Returns:
    • getFolderOrDocumentFullInfo

      Node getFolderOrDocumentFullInfo(NodeRef nodeRef, NodeRef parentNodeRef, org.alfresco.service.namespace.QName nodeTypeQName, Parameters parameters, Map<String,UserInfo> mapUserInfo)
    • getFoldersOrDocumentsFullInfo

      List<Node> getFoldersOrDocumentsFullInfo(List<NodeRef> nodeRefs, Parameters parameters, Map<String,UserInfo> mapUserInfo)
    • 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 Node
      parentNodeRef -
      nodeTypeQName -
      includeParam -
      mapUserInfo -
      Returns:
    • getFoldersOrDocuments

      List<Node> getFoldersOrDocuments(List<NodeRef> nodeRefs, List<String> includeParam, Map<String,UserInfo> mapUserInfo)
      Get the folder or document representation (as appropriate) for the given list of nodes.
      Parameters:
      nodeRefs - A list of real Nodes
      includeParam -
      mapUserInfo -
      Returns:
    • listChildren

      CollectionWithPagingInfo<Node> listChildren(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 - the Parameters object 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.Node objects
    • deleteNode

      void deleteNode(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 - the Parameters object to get the parameters passed into the request - permanent (default false)
    • createNode

      Node createNode(String parentFolderNodeId, Node nodeInfo, Parameters parameters)
      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

      Node updateNode(String nodeId, Node entity, Parameters parameters)
      Update node meta-data.
      Parameters:
      nodeId -
      entity -
      parameters -
      Returns:
    • getContent

      BinaryResource getContent(String fileNodeId, Parameters parameters, boolean recordActivity)
      Download file content.
      Parameters:
      fileNodeId -
      parameters -
      recordActivity - true, if an activity post is required.
      Returns:
    • getContent

      BinaryResource getContent(NodeRef nodeRef, Parameters parameters, boolean recordActivity)
      Download file content.
      Parameters:
      nodeRef - the content nodeRef
      parameters -
      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 - the FormData
      parameters - the Parameters object to get the parameters passed into the request
      Returns:
      Node if successful
    • validateNode

      NodeRef validateNode(StoreRef storeRef, String nodeId)
    • validateNodes

      List<NodeRef> validateNodes(StoreRef storeRef, List<String> nodeIds)
    • validateNode

      NodeRef validateNode(String nodeId)
    • validateNode

      NodeRef validateNode(NodeRef nodeRef)
    • validateOrLookupNode

      default NodeRef validateOrLookupNode(String nodeId)
      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

      NodeRef validateOrLookupNode(String nodeId, String path)
    • nodeMatches

      boolean nodeMatches(NodeRef nodeRef, Set<org.alfresco.service.namespace.QName> expectedTypes, Set<org.alfresco.service.namespace.QName> excludedTypes)
    • 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 nodeRef
      ofClassQName - the class to test against
      validateNodeRef - 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(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(String assocTypeQNameStr)
    • getAssocType

      org.alfresco.service.namespace.QName getAssocType(String assocTypeQNameStr, boolean mandatory)
    • addChildren

      List<AssocChild> addChildren(String parentNodeId, List<AssocChild> entities)
      Parameters:
      parentNodeId -
      entities -
      Returns:
    • addTargets

      List<AssocTarget> addTargets(String sourceNodeId, List<AssocTarget> entities)
      Parameters:
      sourceNodeId -
      entities -
      Returns:
    • lock

      Node lock(String nodeId, LockInfo lockInfo, Parameters parameters)
      Lock a node
      Parameters:
      nodeId -
      lockInfo -
      parameters -
      Returns:
    • unlock

      Node unlock(String nodeId, Parameters parameters)
      Unlock a node
      Parameters:
      nodeId -
      parameters -
      Returns:
    • checkout

      Node checkout(String nodeId, Parameters parameters)
      Checkout a node for offline editing
      Parameters:
      nodeId -
      parameters -
      Returns:
    • cancelCheckout

      Node cancelCheckout(String nodeId, Parameters parameters)
      Cancels the checkout of a node, removing the working copy and any changes made to it. The original node will be unchanged and available for editing again. If the node is locked but not checked out, it will be unlocked
      Parameters:
      nodeId -
      parameters -
      Returns:
    • requestContentDirectUrl

      default DirectAccessUrl requestContentDirectUrl(String nodeId, boolean attachment)
      Gets a presigned URL to directly access content.
      Parameters:
      nodeId - The node id for which to obtain the direct access URL
      attachment - true if an attachment URL is requested, false for an embedded URL.
      Returns:
      A direct access URL object for the content.
    • requestContentDirectUrl

      default DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment)
      Gets a presigned URL to directly access content.
      Parameters:
      nodeRef - The node reference for which to obtain the direct access URL
      attachment - true if an attachment URL is requested, false for an embedded URL.
      Returns:
      A direct access URL object for the content.
    • requestContentDirectUrl

      default DirectAccessUrl requestContentDirectUrl(String nodeId, boolean attachment, Long validFor)
      Gets a presigned URL to directly access content.
      Parameters:
      nodeId - The node id for which to obtain the direct access URL
      attachment - true if an attachment URL is requested, false for an embedded URL.
      validFor - The time at which the direct access URL will expire.
      Returns:
      A direct access URL object for the content.
    • requestContentDirectUrl

      default DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor)
      Gets a presigned URL to directly access content.
      Parameters:
      nodeRef - The node reference for which to obtain the direct access URL
      attachment - true if an attachment URL is requested, false for an embedded URL.
      validFor - The time at which the direct access URL will expire.
      Returns:
      A direct access URL object 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 access URL
      attachment - true if an attachment URL is requested, false for an embedded URL.
      validFor - The time at which the direct access URL will expire.
      fileName - Optional name for the file when downloaded
      Returns:
      A direct access URL object 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

      PathInfo lookupPathInfo(NodeRef nodeRefIn, ChildAssociationRef archivedParentAssoc)
      Returns the path to the given nodeRef nodeRefIn or the archived nodeRef archivedParentAssoc.
      Parameters:
      nodeRefIn - the NodeRef
      archivedParentAssoc - the ChildAssociationRef of the archived NodeRef
      Returns:
      the path to the given node
    • mapToNodeAspects

      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.
      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

      void validateAspects(List<String> aspectNames, List<String> excludedNS, List<org.alfresco.service.namespace.QName> excludedAspects)
    • validateProperties

      void validateProperties(Map<String,Object> properties, List<String> excludedNS, List<org.alfresco.service.namespace.QName> excludedProperties)