PUT /nodes/{nodeId}
基本信息
Note: 该端点在Alfresco 5.2.2和更高版本中可用。
更新nodes nodeId。 例如,您可以重命名文件或文件夹:
{ "name":"My new name" }
您还可以设置或更新一个或多个属性:
{ "properties": { "cm:title":"Folder title" } }
Note: 不支持设置类型d:content和d:category的属性。
Note: 如果要添加或删除方面,则必须首先使用GET / nodes / {nodeId}来获取完整的aspectNames集。
您可以在继承的权限之外添加(或删除)localizeSet权限(如果有)。您还可以选择通过isInheritanceEnabled标志禁用(或重新启用)继承的权限:
{ "permissions": { "isInheritanceEnabled": false, "locallySet": [ {"authorityId": "GROUP_special", "name": "Read", "accessStatus":"DENIED"}, {"authorityId": "testuser", "name": "Contributor", "accessStatus":"ALLOWED"} ] } }
Note: 如果要添加或删除本地设置的权限,则必须首先使用GET / nodes / {nodeId}来获取完整的localSet权限集。
Note: 当前没有乐观锁定更新,因此它们以“最后一个获胜”顺序应用。
请求方式 :PUT
请求API: / nodes / {nodeId}
响应等级(状态200)
成功回应
{ "entry": { "id": "string", "name": "string", "nodeType": "string", "isFolder": true, "isFile": true, "isLocked": false, "modifiedAt": "2021-01-08T08:52:11.363Z", "modifiedByUser": { "displayName": "string", "id": "string" }, "createdAt": "2021-01-08T08:52:11.363Z", "createdByUser": { "displayName": "string", "id": "string" }, "parentId": "string", "isLink": true, "isFavorite": true, "content": { "mimeType": "string", "mimeTypeName": "string", "sizeInBytes": 0, "encoding": "string" }, "aspectNames": [ "string" ], "properties": {}, "allowableOperations": [ "string" ], "path": { "elements": [ { "id": "string", "name": "string", "nodeType": "string", "aspectNames": [ "string" ] } ], "name": "string", "isComplete": true }, "permissions": { "isInheritanceEnabled": true, "inherited": [ { "authorityId": "string", "name": "string", "accessStatus": "ALLOWED" } ], "locallySet": [ { "authorityId": "string", "name": "string", "accessStatus": "ALLOWED" } ], "settable": [ "string" ] } } }
响应内容类型 applicaiton/json
Query参数
名称 | 类型 | 是否必填 | 示例值 | 描述 |
orderBy | Array[string] | 否 | 返回有关该nodes的其他信息。 可以请求以下可选字段:association;isLink;isFavorite;isLocked;path;permissions | |
fields | Array[string] | 否 | field名称的list。 例如,如果您想节省整体带宽,则可以使用此参数来限制响应中返回的field。 例如,如果您想节省整体带宽,则可以使用此参数来限制响应中返回的field。 该列表适用于返回的单个实体或集合中的条目。 如果API方法也支持include参数,则除了在fields参数中指定的fields外,还返回include参数中指定的fields。 |
Path参数
名称 | 类型 | 是否必填 | 示例值 | 描述 |
nodeId | string | 是 | nodes的标识符。 |
Body参数(nodeBodyUpdate)
request body示例
{ "name": "string", "nodeType": "string", "aspectNames": [ "string" ], "properties": {}, "permissions": { "isInheritanceEnabled": true, "locallySet": [ { "authorityId": "string", "name": "string", "accessStatus": "ALLOWED" } ] } }
错误信息描述
状态码 | 原因 |
400 | 参数无效:更新请求无效或nodeId格式无效或nodeBodyUpdate无效 |
401 | 验证失败 |
403 | 当前用户无权更新nodeId |
404 | nodeId不存在 |
409 | 更新的名称与当前父文件夹中的现有nodes冲突 |
422 | 模型完整性异常,包括文件名包含无效字符 |
default | 意外错误 |
返回结果示例
{ "error": { "errorKey": "string", "statusCode": 0, "briefSummary": "string", "stackTrace": "string", "descriptionURL": "string", "logId": "string" } }