Title | Added | Status | Last reviewed |
---|---|---|---|
Nodes Api service |
v2.0.0 |
Active |
2019-01-16 |
Accesses and manipulates ACS document nodes using their node IDs.
- createFolder(parentNodeId:
string
, nodeBody:any
, options:any
={}
):Observable
<
MinimalNode
>
Creates a new folder node inside a parent folder.- parentNodeId:
string
- ID of the parent folder node - nodeBody:
any
- Data for the new folder - options:
any
- Optional parameters supported by JS-API - Returns
Observable
<
MinimalNode
>
- Details of the new folder
- parentNodeId:
- createNode(parentNodeId:
string
, nodeBody:any
, options:any
={}
):Observable
<
MinimalNode
>
Creates a new document node inside a folder.- parentNodeId:
string
- ID of the parent folder node - nodeBody:
any
- Data for the new node - options:
any
- Optional parameters supported by JS-API - Returns
Observable
<
MinimalNode
>
- Details of the new node
- parentNodeId:
- createNodeInsideRoot(name:
string
, nodeType:string
, properties:any
, path:string
):Observable
<
NodeEntry
>
Create a new Node inside-root-
folder- name:
string
- Node name - nodeType:
string
- Node type - properties:
any
- Node body properties - path:
string
- Path to the node - Returns
Observable
<
NodeEntry
>
- The created node
- name:
- createNodeMetadata(nodeType:
string
, nameSpace:any
, data:any
, path:string
, name?:string
):Observable
<
NodeEntry
>
Create a new Node from form metadata.- nodeType:
string
- Node type - nameSpace:
any
- Namespace for properties - data:
any
- Property data to store in the node under namespace - path:
string
- Path to the node - name:
string
- (Optional) Node name - Returns
Observable
<
NodeEntry
>
- The created node
- nodeType:
- deleteNode(nodeId:
string
, options:any
={}
):Observable
<any>
Moves a node to the trashcan.- nodeId:
string
- ID of the target node - options:
any
- Optional parameters supported by JS-API - Returns
Observable
<any>
- Empty result that notifies when the deletion is complete
- nodeId:
- getNode(nodeId:
string
, options:any
={}
):Observable
<
MinimalNode
>
Gets the stored information about a node.- nodeId:
string
- ID of the target node - options:
any
- Optional parameters supported by JS-API - Returns
Observable
<
MinimalNode
>
- Node information
- nodeId:
- getNodeChildren(nodeId:
string
, options:any
={}
):Observable
<
NodePaging
>
Gets the items contained in a folder node.- nodeId:
string
- ID of the target node - options:
any
- Optional parameters supported by JS-API - Returns
Observable
<
NodePaging
>
- List of child items from the folder
- nodeId:
- getNodeContent(nodeId:
string
):Observable
<any>
Gets content for the given node.- nodeId:
string
- ID of the target node - Returns
Observable
<any>
- Content data
- nodeId:
- getNodeMetadata(nodeId:
string
):Observable
<
NodeMetadata
>
Get the metadata and the nodeType for a nodeId cleaned by the prefix.- nodeId:
string
- ID of the target node - Returns
Observable
<
NodeMetadata
>
- Node metadata
- nodeId:
- restoreNode(nodeId:
string
):Observable
<
MinimalNode
>
Restores a node previously moved to the trashcan.- nodeId:
string
- ID of the node to restore - Returns
Observable
<
MinimalNode
>
- Details of the restored node
- nodeId:
- updateNode(nodeId:
string
, nodeBody:any
, options:any
={}
):Observable
<
MinimalNode
>
Updates the information about a node.- nodeId:
string
- ID of the target node - nodeBody:
any
- New data for the node - options:
any
- Optional parameters supported by JS-API - Returns
Observable
<
MinimalNode
>
- Updated node information
- nodeId:
- getNodeAssignedHolds(nodeId:
string
, options:{ includeSource?: boolean; } & NodesIncludeQuery & ContentPagingQuery
):Observable
<
Hold[]
>
Gets legal holds assigned to a node.- nodeId:
string
- ID of the target node - options:
{ includeSource?: boolean; } & NodesIncludeQuery & ContentPagingQuery
- Optional parameters supported by JS-API - Returns
Observable
<
Hold[]
>
- List of assigned holds
- nodeId:
Each node (ie, document or folder) in an ACS repository is identified by its own unique node ID value. The ID is a long string of hex values separated by dashes, eg:
53ef6110-ed9c-4739-a520-e7b4336229c0
The string is convenient for storage, for passing as an Angular route parameter and other purposes but doesn't enable you to do very much with the node itself. The Nodes Api Service has methods for getting information about nodes and managing them within the repository (creating, deleting, etc).
Other lower level interfaces to the ACS nodes API are also available - see the Alfresco Api service, the Alfresco JS API docs and the REST API Explorer for more information.
The getNodeChildren
method returns the contents of a folder
as a list of items. The
getNodeChildren
page in the Alfresco JS API gives more information about the structure of the
options
parameter.
You can use the createNode
and createFolder
methods to add new nodes
within a parent folder node, and the updateNode
method to update an
existing node. See the
addNode
and
updateNode
entries in the Alfresco JS API for further information about the available options and
the format of the new node data.
The Content Services repository maintains a "trashcan" where items are temporarily held after they have been deleted. This means you can restore a deleted item if you remove it from the trashcan before it gets deleted permanently.
By default, the deleteNode
method moves an item into the trash, where it can
be retrieved using restoreNode
. However, you can set an option for deleteNode
to delete the node immediately if you have the right permissions. See the
deleteNode
and
restoreNode
pages in the Alfresco JS API for further details and options. Note that you can also use the
Deleted Nodes Api service get a list of all items currently in the trashcan.