Files
acs-public-rest-api/src/gen/java/com/inteligr8/alfresco/acs/api/NodesApi.java
2021-06-03 21:07:39 -04:00

441 lines
46 KiB
Java

package com.inteligr8.alfresco.acs.api;
import com.inteligr8.alfresco.acs.model.AssociationBody;
import com.inteligr8.alfresco.acs.model.AssociationEntry;
import com.inteligr8.alfresco.acs.model.ChildAssociationBody;
import com.inteligr8.alfresco.acs.model.ChildAssociationEntry;
import com.inteligr8.alfresco.acs.model.Error;
import com.inteligr8.alfresco.acs.model.NodeAssociationPaging;
import com.inteligr8.alfresco.acs.model.NodeBodyCopy;
import com.inteligr8.alfresco.acs.model.NodeBodyCreate;
import com.inteligr8.alfresco.acs.model.NodeBodyLock;
import com.inteligr8.alfresco.acs.model.NodeBodyMove;
import com.inteligr8.alfresco.acs.model.NodeBodyUpdate;
import com.inteligr8.alfresco.acs.model.NodeChildAssociationPaging;
import com.inteligr8.alfresco.acs.model.NodeEntry;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import java.io.File;
import java.util.Date;
import java.util.List;
import javax.ws.rs.*;
/**
* Alfresco Content Services REST API
*
* <p>**Core API** Provides access to the core features of Alfresco Content Services.
*
*/
@Path("/api/-default-/public/alfresco/versions/1")
@Api(value = "/api/-default-/public/alfresco/versions/1", description = "")
public interface NodesApi {
/**
* Copy a node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Copies the node **nodeId** to the parent folder node **targetParentId**. You specify the **targetParentId** in the request body. The new node has the same name as the source node unless you specify a new **name** in the request body. If the source **nodeId** is a folder, then all of its children are also copied. If the source **nodeId** is a file, it&#39;s properties, aspects and tags are copied, it&#39;s ratings, comments and locks are not.
*
*/
@POST
@Path("/nodes/{nodeId}/copy")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "Copy a node", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 201, message = "Successful response", response = NodeEntry.class),
@ApiResponse(code = 400, message = "Invalid parameter: **nodeId** is not a valid format or **nodeBodyCopy** is invalid "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission to copy **nodeId**"),
@ApiResponse(code = 404, message = "**nodeId** does not exist "),
@ApiResponse(code = 409, message = "New name clashes with an existing node in the destination parent folder"),
@ApiResponse(code = 422, message = "Model integrity exception including a file name containing invalid characters"),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public NodeEntry copyNode(@PathParam("nodeId") String nodeId, NodeBodyCopy nodeBodyCopy, @QueryParam("include")List<String> include, @QueryParam("fields")List<String> fields);
/**
* Create node association
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Create an association, with the given association type, between the source **nodeId** and a target node. **Note:** You can create more than one association by specifying a list of associations in the JSON body like this: &#x60;&#x60;&#x60;JSON [ { \&quot;targetId\&quot;: \&quot;string\&quot;, \&quot;assocType\&quot;: \&quot;string\&quot; }, { \&quot;targetId\&quot;: \&quot;string\&quot;, \&quot;assocType\&quot;: \&quot;string\&quot; } ] &#x60;&#x60;&#x60; If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: &#x60;&#x60;&#x60;JSON { \&quot;list\&quot;: { \&quot;pagination\&quot;: { \&quot;count\&quot;: 2, \&quot;hasMoreItems\&quot;: false, \&quot;totalItems\&quot;: 2, \&quot;skipCount\&quot;: 0, \&quot;maxItems\&quot;: 100 }, \&quot;entries\&quot;: [ { \&quot;entry\&quot;: { ... } }, { \&quot;entry\&quot;: { ... } } ] } } &#x60;&#x60;&#x60;
*
*/
@POST
@Path("/nodes/{nodeId}/targets")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "Create node association", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 201, message = "Successful response", response = AssociationEntry.class),
@ApiResponse(code = 400, message = "Invalid parameter: **assocType** is unknown, or the **nodeId** is not a valid format, or **associationBodyCreate** invalid "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission for **nodeId**"),
@ApiResponse(code = 404, message = "Source **nodeId** or **targetId** does not exist"),
@ApiResponse(code = 409, message = "An association of this assoc type already exists between these two nodes"),
@ApiResponse(code = 422, message = "Model integrity exception"),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public AssociationEntry createAssociation(@PathParam("nodeId") String nodeId, AssociationBody associationBodyCreate, @QueryParam("fields")List<String> fields);
/**
* Create a node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Create a node and add it as a primary child of node **nodeId**. This endpoint supports both JSON and multipart/form-data (file upload). **Using multipart/form-data** Use the **filedata** field to represent the content to upload, for example, the following curl command will create a node with the contents of test.txt in the test user&#39;s home folder. &#x60;&#x60;&#x60;curl -utest:test -X POST host:port/alfresco/api/-default-/public/alfresco/versions/1/nodes/-my-/children -F filedata&#x3D;@test.txt&#x60;&#x60;&#x60; You can use the **name** field to give an alternative name for the new file. You can use the **nodeType** field to create a specific type. The default is cm:content. You can use the **renditions** field to create renditions (e.g. doclib) asynchronously upon upload. Also, as requesting rendition is a background process, any rendition failure (e.g. No transformer is currently available) will not fail the whole upload and has the potential to silently fail. Use **overwrite** to overwrite an existing file, matched by name. If the file is versionable, the existing content is replaced. When you overwrite existing content, you can set the **majorVersion** boolean field to **true** to indicate a major version should be created. The default for **majorVersion** is **false**. Setting **majorVersion** enables versioning of the node, if it is not already versioned. When you overwrite existing content, you can use the **comment** field to add a version comment that appears in the version history. This also enables versioning of this node, if it is not already versioned. You can set the **autoRename** boolean field to automatically resolve name clashes. If there is a name clash, then the API method tries to create a unique name using an integer suffix. You can use the **relativePath** field to specify the folder structure to create relative to the node **nodeId**. Folders in the **relativePath** that do not exist are created before the node is created. Any other field provided will be treated as a property to set on the newly created node. **Note:** setting properties of type d:content and d:category are not supported. **Note:** When creating a new node using multipart/form-data by default versioning is enabled and set to MAJOR Version. Since Alfresco 6.2.3 **versioningEnabled** flag was introduced offering better control over the new node Versioning. | **versioningEnabled** | **majorVersion** | **Version Type** | |-----------------------|------------------|------------------| | unset | unset | MAJOR | | unset | true | MAJOR | | unset | false | MINOR | | true | unset | MAJOR | | true | true | MAJOR | | true | false | MINOR | | false | true | Unversioned | | false | false | Unversioned | | false | true | Unversioned | &lt;br&gt; **Using JSON** You must specify at least a **name** and **nodeType**. For example, to create a folder: &#x60;&#x60;&#x60;JSON { \&quot;name\&quot;:\&quot;My Folder\&quot;, \&quot;nodeType\&quot;:\&quot;cm:folder\&quot; } &#x60;&#x60;&#x60; You can create an empty file like this: &#x60;&#x60;&#x60;JSON { \&quot;name\&quot;:\&quot;My text file.txt\&quot;, \&quot;nodeType\&quot;:\&quot;cm:content\&quot; } &#x60;&#x60;&#x60; You can update binary content using the &#x60;&#x60;&#x60;PUT /nodes/{nodeId}&#x60;&#x60;&#x60; API method. You can create a folder, or other node, inside a folder hierarchy: &#x60;&#x60;&#x60;JSON { \&quot;name\&quot;:\&quot;My Special Folder\&quot;, \&quot;nodeType\&quot;:\&quot;cm:folder\&quot;, \&quot;relativePath\&quot;:\&quot;X/Y/Z\&quot; } &#x60;&#x60;&#x60; The **relativePath** specifies the folder structure to create relative to the node **nodeId**. Folders in the **relativePath** that do not exist are created before the node is created. You can set properties when you create a new node: &#x60;&#x60;&#x60;JSON { \&quot;name\&quot;:\&quot;My Other Folder\&quot;, \&quot;nodeType\&quot;:\&quot;cm:folder\&quot;, \&quot;properties\&quot;: { \&quot;cm:title\&quot;:\&quot;Folder title\&quot;, \&quot;cm:description\&quot;:\&quot;This is an important folder\&quot; } } &#x60;&#x60;&#x60; You can set multi-value properties when you create a new node which supports properties of type multiple. &#x60;&#x60;&#x60;JSON { \&quot;name\&quot;:\&quot;My Other Folder\&quot;, \&quot;nodeType\&quot;:\&quot;custom:destination\&quot;, \&quot;properties\&quot;: { \&quot;cm:title\&quot;:\&quot;Folder title\&quot;, \&quot;cm:description\&quot;:\&quot;This is an important folder\&quot;, \&quot;custom:locations\&quot;: [ \&quot;location X\&quot;, \&quot;location Y\&quot; ] } } &#x60;&#x60;&#x60; Any missing aspects are applied automatically. For example, **cm:titled** in the JSON shown above. You can set aspects explicitly, if needed, using an **aspectNames** field. **Note:** setting properties of type d:content and d:category are not supported. You can also optionally disable (or enable) inherited permissions via *isInheritanceEnabled* flag: &#x60;&#x60;&#x60;JSON { \&quot;permissions\&quot;: { \&quot;isInheritanceEnabled\&quot;: false, \&quot;locallySet\&quot;: [ {\&quot;authorityId\&quot;: \&quot;GROUP_special\&quot;, \&quot;name\&quot;: \&quot;Read\&quot;, \&quot;accessStatus\&quot;:\&quot;DENIED\&quot;}, {\&quot;authorityId\&quot;: \&quot;testuser\&quot;, \&quot;name\&quot;: \&quot;Contributor\&quot;, \&quot;accessStatus\&quot;:\&quot;ALLOWED\&quot;} ] } } &#x60;&#x60;&#x60; Typically, for files and folders, the primary children are created within the parent folder using the default \&quot;cm:contains\&quot; assocType. If the content model allows then it is also possible to create primary children with a different assoc type. For example: &#x60;&#x60;&#x60;JSON { \&quot;name\&quot;:\&quot;My Node\&quot;, \&quot;nodeType\&quot;:\&quot;my:specialNodeType\&quot;, \&quot;association\&quot;: { \&quot;assocType\&quot;:\&quot;my:specialAssocType\&quot; } } &#x60;&#x60;&#x60; Additional associations can be added after creating a node. You can also add associations at the time the node is created. This is required, for example, if the content model specifies that a node has mandatory associations to one or more existing nodes. You can optionally specify an array of **secondaryChildren** to create one or more secondary child associations, such that the newly created node acts as a parent node. You can optionally specify an array of **targets** to create one or more peer associations such that the newly created node acts as a source node. For example, to associate one or more secondary children at time of creation: &#x60;&#x60;&#x60;JSON { \&quot;name\&quot;:\&quot;My Folder\&quot;, \&quot;nodeType\&quot;:\&quot;cm:folder\&quot;, \&quot;secondaryChildren\&quot;: [ {\&quot;childId\&quot;:\&quot;abcde-01234-...\&quot;, \&quot;assocType\&quot;:\&quot;my:specialChildAssocType\&quot;} ] } &#x60;&#x60;&#x60; For example, to associate one or more targets at time of creation: &#x60;&#x60;&#x60;JSON { \&quot;name\&quot;:\&quot;My Folder\&quot;, \&quot;nodeType\&quot;:\&quot;cm:folder\&quot;, \&quot;targets\&quot;: [ {\&quot;targetId\&quot;:\&quot;abcde-01234-...\&quot;, \&quot;assocType\&quot;:\&quot;my:specialPeerAssocType\&quot;} ] } &#x60;&#x60;&#x60; **Note:** You can create more than one child by specifying a list of nodes in the JSON body. For example, the following JSON body creates two folders inside the specified **nodeId**, if the **nodeId** identifies a folder: &#x60;&#x60;&#x60;JSON [ { \&quot;name\&quot;:\&quot;My Folder 1\&quot;, \&quot;nodeType\&quot;:\&quot;cm:folder\&quot; }, { \&quot;name\&quot;:\&quot;My Folder 2\&quot;, \&quot;nodeType\&quot;:\&quot;cm:folder\&quot; } ] &#x60;&#x60;&#x60; If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: &#x60;&#x60;&#x60;JSON { \&quot;list\&quot;: { \&quot;pagination\&quot;: { \&quot;count\&quot;: 2, \&quot;hasMoreItems\&quot;: false, \&quot;totalItems\&quot;: 2, \&quot;skipCount\&quot;: 0, \&quot;maxItems\&quot;: 100 }, \&quot;entries\&quot;: [ { \&quot;entry\&quot;: { ... } }, { \&quot;entry\&quot;: { ... } } ] } } &#x60;&#x60;&#x60; **Note:** When creating a new node using JSON by default versioning is disabled. Since Alfresco 6.2.3 **versioningEnabled** flag was introduced offering better control over the new node Versioning. | **versioningEnabled** | **majorVersion** | **Version Type** | |-----------------------|------------------|------------------| | unset | unset | Unversioned | | unset | true | MAJOR | | unset | false | MINOR | | true | unset | MAJOR | | true | true | MAJOR | | true | false | MINOR | | false | true | Unversioned | | false | false | Unversioned | | false | true | Unversioned | &lt;br&gt;
*
*/
@POST
@Path("/nodes/{nodeId}/children")
@Consumes({ "application/json", "multipart/form-data" })
@Produces({ "application/json" })
@ApiOperation(value = "Create a node", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 201, message = "Successful response", response = NodeEntry.class),
@ApiResponse(code = 400, message = "Invalid parameter: **nodeId** is not a valid format or **nodeBodyCreate** is invalid "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission to create children of **nodeId**"),
@ApiResponse(code = 404, message = "**nodeId** or **renditionId** does not exist "),
@ApiResponse(code = 409, message = "New name clashes with an existing node in the current parent folder"),
@ApiResponse(code = 413, message = "Content exceeds individual file size limit configured for the network or system"),
@ApiResponse(code = 415, message = "Content Type is not supported"),
@ApiResponse(code = 422, message = "Model integrity exception including a file name containing invalid characters"),
@ApiResponse(code = 507, message = "Content exceeds overall storage quota limit configured for the network or system"),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public NodeEntry createNode(@PathParam("nodeId") String nodeId, NodeBodyCreate nodeBodyCreate, @QueryParam("autoRename")Boolean autoRename, @QueryParam("majorVersion")Boolean majorVersion, @QueryParam("versioningEnabled")Boolean versioningEnabled, @QueryParam("include")List<String> include, @QueryParam("fields")List<String> fields);
/**
* Create secondary child
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Create a secondary child association, with the given association type, between the parent **nodeId** and a child node. **Note:** You can create more than one secondary child association by specifying a list of associations in the JSON body like this: &#x60;&#x60;&#x60;JSON [ { \&quot;childId\&quot;: \&quot;string\&quot;, \&quot;assocType\&quot;: \&quot;string\&quot; }, { \&quot;childId\&quot;: \&quot;string\&quot;, \&quot;assocType\&quot;: \&quot;string\&quot; } ] &#x60;&#x60;&#x60; If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: &#x60;&#x60;&#x60;JSON { \&quot;list\&quot;: { \&quot;pagination\&quot;: { \&quot;count\&quot;: 2, \&quot;hasMoreItems\&quot;: false, \&quot;totalItems\&quot;: 2, \&quot;skipCount\&quot;: 0, \&quot;maxItems\&quot;: 100 }, \&quot;entries\&quot;: [ { \&quot;entry\&quot;: { ... } }, { \&quot;entry\&quot;: { ... } } ] } } &#x60;&#x60;&#x60;
*
*/
@POST
@Path("/nodes/{nodeId}/secondary-children")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "Create secondary child", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 201, message = "Successful response", response = ChildAssociationEntry.class),
@ApiResponse(code = 400, message = "Invalid parameter: **assocType** is unknown, or the **nodeId** is not a valid format, or **secondaryChildAssociationBodyCreate** invalid "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission to create secondary children of **nodeId**"),
@ApiResponse(code = 404, message = "Parent **nodeId** or **childId** does not exist"),
@ApiResponse(code = 409, message = "An association of this assoc type already exists between these two nodes"),
@ApiResponse(code = 422, message = "Model integrity exception"),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public ChildAssociationEntry createSecondaryChildAssociation(@PathParam("nodeId") String nodeId, ChildAssociationBody secondaryChildAssociationBodyCreate, @QueryParam("fields")List<String> fields);
/**
* Delete node association(s)
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Delete an association, or associations, from the source **nodeId* to a target node for the given association type. If the association type is **not** specified, then all peer associations, of any type, in the direction from source to target, are deleted. **Note:** After removal of the peer association, or associations, from source to target, the two nodes may still have peer associations in the other direction.
*
*/
@DELETE
@Path("/nodes/{nodeId}/targets/{targetId}")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "Delete node association(s)", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 204, message = "Successful response"),
@ApiResponse(code = 400, message = "Invalid parameter: **assocType** is unknown, or the **nodeId** is not a valid format, or **targetId** is invalid "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission for **nodeId**"),
@ApiResponse(code = 404, message = "Source **nodeId** or **targetId** does not exist (with given assocType, if specified)"),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public void deleteAssociation(@PathParam("nodeId") String nodeId, @PathParam("targetId") String targetId, @QueryParam("assocType")String assocType);
/**
* Delete a node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Deletes the node **nodeId**. If **nodeId** is a folder, then its children are also deleted. Deleted nodes move to the trashcan unless the **permanent** query parameter is **true** and the current user is the owner of the node or an admin. Deleting a node deletes it from its primary parent and also from any secondary parents. Peer associations are also deleted, where the deleted node is either a source or target of an association. This applies recursively to any hierarchy of primary children of the deleted node. **Note:** If the node is not permanently deleted, and is later successfully restored to its former primary parent, then the primary child association is restored. This applies recursively for any primary children. No other secondary child associations or peer associations are restored for any of the nodes in the primary parent-child hierarchy of restored nodes, regardless of whether the original associations were to nodes inside or outside the restored hierarchy.
*
*/
@DELETE
@Path("/nodes/{nodeId}")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "Delete a node", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 204, message = "Successful response"),
@ApiResponse(code = 400, message = "Invalid parameter: **nodeId** is not a valid format "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission to delete **nodeId**"),
@ApiResponse(code = 404, message = "**nodeId** does not exist "),
@ApiResponse(code = 409, message = "**nodeId** is locked and cannot be deleted "),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public void deleteNode(@PathParam("nodeId") String nodeId, @QueryParam("permanent")@DefaultValue("false") Boolean permanent);
/**
* Delete secondary child or children
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Delete secondary child associations between the parent **nodeId** and child nodes for the given association type. If the association type is **not** specified, then all secondary child associations, of any type in the direction from parent to secondary child, will be deleted. The child will still have a primary parent and may still be associated as a secondary child with other secondary parents.
*
*/
@DELETE
@Path("/nodes/{nodeId}/secondary-children/{childId}")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "Delete secondary child or children", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 204, message = "Successful response"),
@ApiResponse(code = 400, message = "Invalid parameter: **assocType** is unknown or you are trying to delete a primary **assocType**. Use delete node instead "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission for **nodeId**"),
@ApiResponse(code = 404, message = "Parent **nodeId** or **childId** does not exist (with given assocType, if specified)"),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public void deleteSecondaryChildAssociation(@PathParam("nodeId") String nodeId, @PathParam("childId") String childId, @QueryParam("assocType")String assocType);
/**
* Get a node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Get information for node **nodeId**. You can use the **include** parameter to return additional information.
*
*/
@GET
@Path("/nodes/{nodeId}")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "Get a node", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful response", response = NodeEntry.class),
@ApiResponse(code = 400, message = "Invalid parameter: **nodeId** is not a valid format "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission to retrieve **nodeId**"),
@ApiResponse(code = 404, message = "**nodeId** does not exist "),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public NodeEntry getNode(@PathParam("nodeId") String nodeId, @QueryParam("include")List<String> include, @QueryParam("relativePath")String relativePath, @QueryParam("fields")List<String> fields);
/**
* Get node content
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Gets the content of the node with identifier **nodeId**.
*
*/
@GET
@Path("/nodes/{nodeId}/content")
@Consumes({ "application/json" })
@Produces({ "application/octet-stream" })
@ApiOperation(value = "Get node content", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful response", response = File.class),
@ApiResponse(code = 206, message = "Partial Content"),
@ApiResponse(code = 304, message = "Content has not been modified since the date provided in the If-Modified-Since header"),
@ApiResponse(code = 400, message = "Invalid parameter: **nodeId** is not a valid format, or is not a file "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission to retrieve content of **nodeId**"),
@ApiResponse(code = 404, message = "**nodeId** does not exist "),
@ApiResponse(code = 416, message = "Range Not Satisfiable "),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public File getNodeContent(@PathParam("nodeId") String nodeId, @QueryParam("attachment")@DefaultValue("true") Boolean attachment, @HeaderParam("If-Modified-Since") Date ifModifiedSince, @HeaderParam("Range") String range);
/**
* List node children
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Gets a list of children of the parent node **nodeId**. Minimal information for each child is returned by default. You can use the **include** parameter to return additional information. The list of child nodes includes primary children and secondary children, if there are any. You can use the **include** parameter (include&#x3D;association) to return child association details for each child, including the **assocTyp**e and the **isPrimary** flag. The default sort order for the returned list is for folders to be sorted before files, and by ascending name. You can override the default using **orderBy** to specify one or more fields to sort by. The default order is always ascending, but you can use an optional **ASC** or **DESC** modifier to specify an ascending or descending sort order. For example, specifying &#x60;&#x60;&#x60;orderBy&#x3D;name DESC&#x60;&#x60;&#x60; returns a mixed folder/file list in descending **name** order. You can use any of the following fields to order the results: * isFolder * name * mimeType * nodeType * sizeInBytes * modifiedAt * createdAt * modifiedByUser * createdByUser
*
*/
@GET
@Path("/nodes/{nodeId}/children")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "List node children", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful response", response = NodeChildAssociationPaging.class),
@ApiResponse(code = 400, message = "Invalid parameter: **nodeId** is not a valid format, **nodeId** is not a folder or **orderBy** is invalid "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission to retrieve children of **nodeId**"),
@ApiResponse(code = 404, message = "**nodeId** does not exist "),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public NodeChildAssociationPaging listNodeChildren(@PathParam("nodeId") String nodeId, @QueryParam("skipCount")@DefaultValue("0") Integer skipCount, @QueryParam("maxItems")@DefaultValue("100") Integer maxItems, @QueryParam("orderBy")List<String> orderBy, @QueryParam("where")String where, @QueryParam("include")List<String> include, @QueryParam("relativePath")String relativePath, @QueryParam("includeSource")Boolean includeSource, @QueryParam("fields")List<String> fields);
/**
* List parents
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Gets a list of parent nodes that are associated with the current child **nodeId**. The list includes both the primary parent and any secondary parents.
*
*/
@GET
@Path("/nodes/{nodeId}/parents")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "List parents", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful response", response = NodeAssociationPaging.class),
@ApiResponse(code = 400, message = "Invalid parameter: **assocType** is unknown or the **nodeId** is not a valid format "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission for **nodeId**"),
@ApiResponse(code = 404, message = "Child **nodeId** does not exist"),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public NodeAssociationPaging listParents(@PathParam("nodeId") String nodeId, @QueryParam("where")String where, @QueryParam("include")List<String> include, @QueryParam("skipCount")@DefaultValue("0") Integer skipCount, @QueryParam("maxItems")@DefaultValue("100") Integer maxItems, @QueryParam("includeSource")Boolean includeSource, @QueryParam("fields")List<String> fields);
/**
* List secondary children
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Gets a list of secondary child nodes that are associated with the current parent **nodeId**, via a secondary child association.
*
*/
@GET
@Path("/nodes/{nodeId}/secondary-children")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "List secondary children", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful response", response = NodeChildAssociationPaging.class),
@ApiResponse(code = 400, message = "Invalid parameter: **assocType** is unknown or the **nodeId** is not a valid format "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission for **nodeId**"),
@ApiResponse(code = 404, message = "Parent **nodeId** does not exist"),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public NodeChildAssociationPaging listSecondaryChildren(@PathParam("nodeId") String nodeId, @QueryParam("where")String where, @QueryParam("include")List<String> include, @QueryParam("skipCount")@DefaultValue("0") Integer skipCount, @QueryParam("maxItems")@DefaultValue("100") Integer maxItems, @QueryParam("includeSource")Boolean includeSource, @QueryParam("fields")List<String> fields);
/**
* List source associations
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Gets a list of source nodes that are associated with the current target **nodeId**.
*
*/
@GET
@Path("/nodes/{nodeId}/sources")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "List source associations", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful response", response = NodeAssociationPaging.class),
@ApiResponse(code = 400, message = "Invalid parameter: **nodeId** is not a valid format or **assocType** is unknown "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission for **nodeId**"),
@ApiResponse(code = 404, message = "Target **nodeId** does not exist"),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public NodeAssociationPaging listSourceAssociations(@PathParam("nodeId") String nodeId, @QueryParam("where")String where, @QueryParam("include")List<String> include, @QueryParam("fields")List<String> fields);
/**
* List target associations
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Gets a list of target nodes that are associated with the current source **nodeId**.
*
*/
@GET
@Path("/nodes/{nodeId}/targets")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "List target associations", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful response", response = NodeAssociationPaging.class),
@ApiResponse(code = 400, message = "Invalid parameter: **assocType** is unknown or the **nodeId** is not a valid format "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission for **nodeId**"),
@ApiResponse(code = 404, message = "Source **nodeId** does not exist"),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public NodeAssociationPaging listTargetAssociations(@PathParam("nodeId") String nodeId, @QueryParam("where")String where, @QueryParam("include")List<String> include, @QueryParam("fields")List<String> fields);
/**
* Lock a node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Places a lock on node **nodeId**. **Note:** you can only lock files. More specifically, a node can only be locked if it is of type &#x60;cm:content&#x60; or a subtype of &#x60;cm:content&#x60;. The lock is owned by the current user, and prevents other users or processes from making updates to the node until the lock is released. If the **timeToExpire** is not set or is zero, then the lock never expires. Otherwise, the **timeToExpire** is the number of seconds before the lock expires. When a lock expires, the lock is released. If the node is already locked, and the user is the lock owner, then the lock is renewed with the new **timeToExpire**. By default, a lock is applied that allows the owner to update or delete the node. You can use **type** to change the lock type to one of the following: * **ALLOW_OWNER_CHANGES** (default) changes to the node can be made only by the lock owner. This enum is the same value as the deprecated WRITE_LOCK described in &#x60;org.alfresco.service.cmr.lock.LockType&#x60; in the Alfresco Public Java API. This is the default value. * **FULL** no changes by any user are allowed. This enum is the same value as the deprecated READ_ONLY_LOCK described in &#x60;org.alfresco.service.cmr.lock.LockType&#x60; in the Alfresco Public Java API. By default, a lock is persisted in the database. You can create a volatile in-memory lock by setting the **lifetime** property to EPHEMERAL. You might choose use EPHEMERAL locks, for example, if you are taking frequent short-term locks that you don&#39;t need to be kept over a restart of the repository. In this case you don&#39;t need the overhead of writing the locks to the database. If a lock on the node cannot be taken, then an error is returned.
*
*/
@POST
@Path("/nodes/{nodeId}/lock")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "Lock a node", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful response", response = NodeEntry.class),
@ApiResponse(code = 400, message = "Invalid parameter: **nodeId** is not a valid format, or **nodeBodyLock** is invalid, or a lock was attempted on a node that is not a file "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission to lock **nodeId** "),
@ApiResponse(code = 404, message = "**nodeId** does not exist "),
@ApiResponse(code = 422, message = "**nodeId** could not be locked "),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public NodeEntry lockNode(@PathParam("nodeId") String nodeId, NodeBodyLock nodeBodyLock, @QueryParam("include")List<String> include, @QueryParam("fields")List<String> fields);
/**
* Move a node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Move the node **nodeId** to the parent folder node **targetParentId**. The **targetParentId** is specified in the in request body. The moved node retains its name unless you specify a new **name** in the request body. If the source **nodeId** is a folder, then its children are also moved. The move will effectively change the primary parent.
*
*/
@POST
@Path("/nodes/{nodeId}/move")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "Move a node", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful response", response = NodeEntry.class),
@ApiResponse(code = 400, message = "Invalid parameter: **nodeId** is not a valid format, or **targetParentId** is not a folder, or **nodeBodyMove** is invalid "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission to move **nodeId**"),
@ApiResponse(code = 404, message = "**nodeId** does not exist "),
@ApiResponse(code = 409, message = "New name clashes with an existing node in the destination parent folder"),
@ApiResponse(code = 422, message = "Model integrity exception including a file name containing invalid characters"),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public NodeEntry moveNode(@PathParam("nodeId") String nodeId, NodeBodyMove nodeBodyMove, @QueryParam("include")List<String> include, @QueryParam("fields")List<String> fields);
/**
* Unlock a node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Deletes a lock on node **nodeId**. The current user must be the owner of the locks or have admin rights, otherwise an error is returned. If a lock on the node cannot be released, then an error is returned.
*
*/
@POST
@Path("/nodes/{nodeId}/unlock")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "Unlock a node", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful response", response = NodeEntry.class),
@ApiResponse(code = 400, message = "Invalid parameter: **nodeId** is not a valid format "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission to unlock **nodeId** "),
@ApiResponse(code = 404, message = "**nodeId** does not exist "),
@ApiResponse(code = 422, message = "**nodeId** could not be unlocked "),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public NodeEntry unlockNode(@PathParam("nodeId") String nodeId, @QueryParam("include")List<String> include, @QueryParam("fields")List<String> fields);
/**
* Update a node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Updates the node **nodeId**. For example, you can rename a file or folder: &#x60;&#x60;&#x60;JSON { \&quot;name\&quot;:\&quot;My new name\&quot; } &#x60;&#x60;&#x60; You can also set or update one or more properties: &#x60;&#x60;&#x60;JSON { \&quot;properties\&quot;: { \&quot;cm:title\&quot;:\&quot;Folder title\&quot; } } &#x60;&#x60;&#x60; You can update multi-value properties of a node which supports properties of type multiple. &#x60;&#x60;&#x60;JSON { \&quot;name\&quot;:\&quot;My Other Folder\&quot;, \&quot;nodeType\&quot;:\&quot;custom:destination\&quot;, \&quot;properties\&quot;: { \&quot;cm:title\&quot;:\&quot;Folder title\&quot;, \&quot;cm:description\&quot;:\&quot;This is an important folder\&quot;, \&quot;custom:locations\&quot;: [ \&quot;location NewX\&quot;, \&quot;location NewY\&quot; ] } } &#x60;&#x60;&#x60; **Note:** setting properties of type d:content and d:category are not supported. **Note:** if you want to add or remove aspects, then you must use **GET /nodes/{nodeId}** first to get the complete set of *aspectNames*. You can add (or remove) *locallySet* permissions, if any, in addition to any inherited permissions. You can also optionally disable (or re-enable) inherited permissions via *isInheritanceEnabled* flag: &#x60;&#x60;&#x60;JSON { \&quot;permissions\&quot;: { \&quot;isInheritanceEnabled\&quot;: false, \&quot;locallySet\&quot;: [ {\&quot;authorityId\&quot;: \&quot;GROUP_special\&quot;, \&quot;name\&quot;: \&quot;Read\&quot;, \&quot;accessStatus\&quot;:\&quot;DENIED\&quot;}, {\&quot;authorityId\&quot;: \&quot;testuser\&quot;, \&quot;name\&quot;: \&quot;Contributor\&quot;, \&quot;accessStatus\&quot;:\&quot;ALLOWED\&quot;} ] } } &#x60;&#x60;&#x60; **Note:** if you want to add or remove locally set permissions then you must use **GET /nodes/{nodeId}** first to get the complete set of *locallySet* permissions. **Note:** Currently there is no optimistic locking for updates, so they are applied in \&quot;last one wins\&quot; order.
*
*/
@PUT
@Path("/nodes/{nodeId}")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "Update a node", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful response", response = NodeEntry.class),
@ApiResponse(code = 400, message = "Invalid parameter: the update request is invalid or **nodeId** is not a valid format or **nodeBodyUpdate** is invalid "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission to update **nodeId**"),
@ApiResponse(code = 404, message = "**nodeId** does not exist "),
@ApiResponse(code = 409, message = "Updated name clashes with an existing node in the current parent folder"),
@ApiResponse(code = 422, message = "Model integrity exception including a file name containing invalid characters"),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public NodeEntry updateNode(@PathParam("nodeId") String nodeId, NodeBodyUpdate nodeBodyUpdate, @QueryParam("include")List<String> include, @QueryParam("fields")List<String> fields);
/**
* Update node content
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions. Updates the content of the node with identifier **nodeId**. The request body for this endpoint can be any text or binary stream. The **majorVersion** and **comment** parameters can be used to control versioning behaviour. If the content is versionable, a new minor version is created by default. Optionally a new **name** parameter can also be specified that must be unique within the parent folder. If specified and valid then this will rename the node. If invalid then an error is returned and the content is not updated. **Note:** This API method accepts any content type, but for testing with this tool text based content can be provided. This is because the OpenAPI Specification does not allow a wildcard to be provided or the ability for tooling to accept an arbitrary file.
*
*/
@PUT
@Path("/nodes/{nodeId}/content")
@Consumes({ "application/octet-stream" })
@Produces({ "application/json" })
@ApiOperation(value = "Update node content", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful response", response = NodeEntry.class),
@ApiResponse(code = 400, message = "Invalid parameter: **nodeId** is not a valid format, or is not a file "),
@ApiResponse(code = 401, message = "Authentication failed"),
@ApiResponse(code = 403, message = "Current user does not have permission to update **nodeId**"),
@ApiResponse(code = 404, message = "**nodeId** does not exist "),
@ApiResponse(code = 409, message = "Optional new name clashes with an existing node in the current parent folder"),
@ApiResponse(code = 413, message = "Content exceeds individual file size limit (configured for network/system)"),
@ApiResponse(code = 422, message = "Model integrity exception including a file name containing invalid characters"),
@ApiResponse(code = 507, message = "Content exceeds overall storage quota limit configured for the network/system"),
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
public NodeEntry updateNodeContent(@PathParam("nodeId") String nodeId, byte[] contentBodyUpdate, @QueryParam("majorVersion")@DefaultValue("false") Boolean majorVersion, @QueryParam("comment")String comment, @QueryParam("name")String name, @QueryParam("include")List<String> include, @QueryParam("fields")List<String> fields);
}