Class: AlfrescoAPI::NodesApi
- Inherits:
-
Object
- Object
- AlfrescoAPI::NodesApi
- Defined in:
- lib/alfresco_api/api/nodes_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#copy_node(node_id, node_body_copy, opts = {}) ⇒ NodeEntry
Copy a node Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#copy_node_with_http_info(node_id, node_body_copy, opts = {}) ⇒ Array<(NodeEntry, Fixnum, Hash)>
Copy a node Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#create_assocation(node_id, association_body_create, opts = {}) ⇒ AssociationEntry
Create node association Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#create_assocation_with_http_info(node_id, association_body_create, opts = {}) ⇒ Array<(AssociationEntry, Fixnum, Hash)>
Create node association Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#create_node(node_id, node_body_create, opts = {}) ⇒ NodeEntry
Create a node Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#create_node_with_http_info(node_id, node_body_create, opts = {}) ⇒ Array<(NodeEntry, Fixnum, Hash)>
Create a node Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#create_secondary_child_assocation(node_id, secondary_child_association_body_create, opts = {}) ⇒ ChildAssociationEntry
Create secondary child Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#create_secondary_child_assocation_with_http_info(node_id, secondary_child_association_body_create, opts = {}) ⇒ Array<(ChildAssociationEntry, Fixnum, Hash)>
Create secondary child Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#delete_assocation(node_id, target_id, opts = {}) ⇒ nil
Delete node association(s) Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#delete_assocation_with_http_info(node_id, target_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete node association(s) Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#delete_node(node_id, opts = {}) ⇒ nil
Delete a node Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#delete_node_with_http_info(node_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete a node Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#delete_secondary_child_assocation(node_id, child_id, opts = {}) ⇒ nil
Delete secondary child or children Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#delete_secondary_child_assocation_with_http_info(node_id, child_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete secondary child or children Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#get_node(node_id, opts = {}) ⇒ NodeEntry
Get a node Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#get_node_content(node_id, opts = {}) ⇒ nil
Get node content Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#get_node_content_with_http_info(node_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Get node content Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#get_node_with_http_info(node_id, opts = {}) ⇒ Array<(NodeEntry, Fixnum, Hash)>
Get a node Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#initialize(api_client = ApiClient.default) ⇒ NodesApi
constructor
A new instance of NodesApi.
-
#list_node_children(node_id, opts = {}) ⇒ NodeChildAssociationPaging
List node children Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#list_node_children_with_http_info(node_id, opts = {}) ⇒ Array<(NodeChildAssociationPaging, Fixnum, Hash)>
List node children Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#list_parents(node_id, opts = {}) ⇒ NodeAssociationPaging
List parents Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#list_parents_with_http_info(node_id, opts = {}) ⇒ Array<(NodeAssociationPaging, Fixnum, Hash)>
List parents Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#list_secondary_children(node_id, opts = {}) ⇒ NodeChildAssociationPaging
List secondary children Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#list_secondary_children_with_http_info(node_id, opts = {}) ⇒ Array<(NodeChildAssociationPaging, Fixnum, Hash)>
List secondary children Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#list_source_associations(node_id, opts = {}) ⇒ NodeAssociationPaging
List source associations Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#list_source_associations_with_http_info(node_id, opts = {}) ⇒ Array<(NodeAssociationPaging, Fixnum, Hash)>
List source associations Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#list_target_associations(node_id, opts = {}) ⇒ NodeAssociationPaging
List target associations Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#list_target_associations_with_http_info(node_id, opts = {}) ⇒ Array<(NodeAssociationPaging, Fixnum, Hash)>
List target associations Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#lock_node(node_id, node_body_lock, opts = {}) ⇒ NodeEntry
Lock a node Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#lock_node_with_http_info(node_id, node_body_lock, opts = {}) ⇒ Array<(NodeEntry, Fixnum, Hash)>
Lock a node Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#move_node(node_id, node_body_move, opts = {}) ⇒ NodeEntry
Move a node Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#move_node_with_http_info(node_id, node_body_move, opts = {}) ⇒ Array<(NodeEntry, Fixnum, Hash)>
Move a node Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#unlock_node(node_id, opts = {}) ⇒ NodeEntry
Unlock a node Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#unlock_node_with_http_info(node_id, opts = {}) ⇒ Array<(NodeEntry, Fixnum, Hash)>
Unlock a node Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#update_node(node_id, node_body_update, opts = {}) ⇒ NodeEntry
Update a node Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#update_node_content(node_id, content_body_update, opts = {}) ⇒ NodeEntry
Update node content Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#update_node_content_with_http_info(node_id, content_body_update, opts = {}) ⇒ Array<(NodeEntry, Fixnum, Hash)>
Update node content Note: this endpoint is available in Alfresco 5.2 and newer versions.
-
#update_node_with_http_info(node_id, node_body_update, opts = {}) ⇒ Array<(NodeEntry, Fixnum, Hash)>
Update a node Note: this endpoint is available in Alfresco 5.2 and newer versions.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#copy_node(node_id, node_body_copy, opts = {}) ⇒ NodeEntry
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’s properties, aspects and tags are copied, it’s ratings, comments and locks are not.
31 32 33 34 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 31 def copy_node(node_id, node_body_copy, opts = {}) data, _status_code, _headers = copy_node_with_http_info(node_id, node_body_copy, opts) return data end |
#copy_node_with_http_info(node_id, node_body_copy, opts = {}) ⇒ Array<(NodeEntry, Fixnum, Hash)>
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's properties, aspects and tags are copied, it's ratings, comments and locks are not.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 44 def copy_node_with_http_info(node_id, node_body_copy, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.copy_node ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.copy_node" end # verify the required parameter 'node_body_copy' is set if @api_client.config.client_side_validation && node_body_copy.nil? fail ArgumentError, "Missing the required parameter 'node_body_copy' when calling NodesApi.copy_node" end # resource path local_var_path = "/nodes/{nodeId}/copy".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(node_body_copy) auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NodeEntry') if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#copy_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_assocation(node_id, association_body_create, opts = {}) ⇒ AssociationEntry
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: “‘JSON [ { "targetId": "string", "assocType": "string" }, { "targetId": "string", "assocType": "string" } ] “` If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: “`JSON { "list": { "pagination": { "count": 2, "hasMoreItems": false, "totalItems": 2, "skipCount": 0, "maxItems": 100 }, "entries": [ { "entry": { … } }, { "entry": { … } } ] } } “`
97 98 99 100 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 97 def create_assocation(node_id, association_body_create, opts = {}) data, _status_code, _headers = create_assocation_with_http_info(node_id, association_body_create, opts) return data end |
#create_assocation_with_http_info(node_id, association_body_create, opts = {}) ⇒ Array<(AssociationEntry, Fixnum, Hash)>
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: ```JSON [ { "targetId": "string", "assocType": "string" }, { "targetId": "string", "assocType": "string" } ] ``` If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: ```JSON { "list": { "pagination": { "count": 2, "hasMoreItems": false, "totalItems": 2, "skipCount": 0, "maxItems": 100 }, "entries": [ { "entry": { … } }, { "entry": { … } } ] } } ```
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 109 def create_assocation_with_http_info(node_id, association_body_create, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.create_assocation ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.create_assocation" end # verify the required parameter 'association_body_create' is set if @api_client.config.client_side_validation && association_body_create.nil? fail ArgumentError, "Missing the required parameter 'association_body_create' when calling NodesApi.create_assocation" end # resource path local_var_path = "/nodes/{nodeId}/targets".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(association_body_create) auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'AssociationEntry') if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#create_assocation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_node(node_id, node_body_create, opts = {}) ⇒ NodeEntry
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’s home folder. “‘curl -utest:test -X POST host:port/alfresco/api/-default-/public/alfresco/versions/1/nodes/-my-/children -F [email protected]“` 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. Note that currently only one rendition can be requested. 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. **Using JSON** You must specify at least a name and nodeType. For example, to create a folder: “`JSON { "name":"My Folder", "nodeType":"cm:folder" } “` You can create an empty file like this: “`JSON { "name":"My text file.txt", "nodeType":"cm:content" } “` You can update binary content using the “`PUT /nodes/nodeId“` API method. You can create a folder, or other node, inside a folder hierarchy: “`JSON { "name":"My Special Folder", "nodeType":"cm:folder", "relativePath":"X/Y/Z" } “` 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: “`JSON { "name":"My Other Folder", "nodeType":"cm:folder", "properties": { "cm:title":"Folder title", "cm:description":"This is an important folder" } } “` 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. Typically, for files and folders, the primary children are created within the parent folder using the default "cm:contains" assocType. If the content model allows then it is also possible to create primary children with a different assoc type. For example: “`JSON { "name":"My Node", "nodeType":"my:specialNodeType", "association": { "assocType":"my:specialAssocType" } } “` 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: “`JSON { "name":"My Folder", "nodeType":"cm:folder", "secondaryChildren": [ "assocType":"my:specialChildAssocType" ] } “` For example, to associate one or more targets at time of creation: “`JSON { "name":"My Folder", "nodeType":"cm:folder", "targets": [ "assocType":"my:specialPeerAssocType" ] } “` 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: “`JSON [ { "name":"My Folder 1", "nodeType":"cm:folder" }, { "name":"My Folder 2", "nodeType":"cm:folder" } ] “` If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: “`JSON { "list": { "pagination": { "count": 2, "hasMoreItems": false, "totalItems": 2, "skipCount": 0, "maxItems": 100 }, "entries": [ { "entry": { … } }, { "entry": { … } } ] } } “`
163 164 165 166 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 163 def create_node(node_id, node_body_create, opts = {}) data, _status_code, _headers = create_node_with_http_info(node_id, node_body_create, opts) return data end |
#create_node_with_http_info(node_id, node_body_create, opts = {}) ⇒ Array<(NodeEntry, Fixnum, Hash)>
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's home folder. ```curl -utest:test -X POST host:port/alfresco/api/-default-/public/alfresco/versions/1/nodes/-my-/children -F filedata=@test.txt``` 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. Note that currently only one rendition can be requested. 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. **Using JSON** You must specify at least a name and nodeType. For example, to create a folder: ```JSON { "name":"My Folder", "nodeType":"cm:folder" } ``` You can create an empty file like this: ```JSON { "name":"My text file.txt", "nodeType":"cm:content" } ``` You can update binary content using the ```PUT /nodes/nodeId``` API method. You can create a folder, or other node, inside a folder hierarchy: ```JSON { "name":"My Special Folder", "nodeType":"cm:folder", "relativePath":"X/Y/Z" } ``` 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: ```JSON { "name":"My Other Folder", "nodeType":"cm:folder", "properties": { "cm:title":"Folder title", "cm:description":"This is an important folder" } } ``` 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. Typically, for files and folders, the primary children are created within the parent folder using the default "cm:contains" assocType. If the content model allows then it is also possible to create primary children with a different assoc type. For example: ```JSON { "name":"My Node", "nodeType":"my:specialNodeType", "association": { "assocType":"my:specialAssocType" } } ``` 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: ```JSON { "name":"My Folder", "nodeType":"cm:folder", "secondaryChildren": [ "assocType":"my:specialChildAssocType" ] } ``` For example, to associate one or more targets at time of creation: ```JSON { "name":"My Folder", "nodeType":"cm:folder", "targets": [ "assocType":"my:specialPeerAssocType" ] } ``` 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: ```JSON [ { "name":"My Folder 1", "nodeType":"cm:folder" }, { "name":"My Folder 2", "nodeType":"cm:folder" } ] ``` If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: ```JSON { "list": { "pagination": { "count": 2, "hasMoreItems": false, "totalItems": 2, "skipCount": 0, "maxItems": 100 }, "entries": [ { "entry": { … } }, { "entry": { … } } ] } } ```
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 177 def create_node_with_http_info(node_id, node_body_create, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.create_node ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.create_node" end # verify the required parameter 'node_body_create' is set if @api_client.config.client_side_validation && node_body_create.nil? fail ArgumentError, "Missing the required parameter 'node_body_create' when calling NodesApi.create_node" end # resource path local_var_path = "/nodes/{nodeId}/children".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'autoRename'] = opts[:'auto_rename'] if !opts[:'auto_rename'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(node_body_create) auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NodeEntry') if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#create_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_secondary_child_assocation(node_id, secondary_child_association_body_create, opts = {}) ⇒ ChildAssociationEntry
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: “‘JSON [ { "childId": "string", "assocType": "string" }, { "childId": "string", "assocType": "string" } ] “` If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: “`JSON { "list": { "pagination": { "count": 2, "hasMoreItems": false, "totalItems": 2, "skipCount": 0, "maxItems": 100 }, "entries": [ { "entry": { … } }, { "entry": { … } } ] } } “`
231 232 233 234 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 231 def create_secondary_child_assocation(node_id, secondary_child_association_body_create, opts = {}) data, _status_code, _headers = create_secondary_child_assocation_with_http_info(node_id, secondary_child_association_body_create, opts) return data end |
#create_secondary_child_assocation_with_http_info(node_id, secondary_child_association_body_create, opts = {}) ⇒ Array<(ChildAssociationEntry, Fixnum, Hash)>
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: ```JSON [ { "childId": "string", "assocType": "string" }, { "childId": "string", "assocType": "string" } ] ``` If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: ```JSON { "list": { "pagination": { "count": 2, "hasMoreItems": false, "totalItems": 2, "skipCount": 0, "maxItems": 100 }, "entries": [ { "entry": { … } }, { "entry": { … } } ] } } ```
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 243 def create_secondary_child_assocation_with_http_info(node_id, secondary_child_association_body_create, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.create_secondary_child_assocation ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.create_secondary_child_assocation" end # verify the required parameter 'secondary_child_association_body_create' is set if @api_client.config.client_side_validation && secondary_child_association_body_create.nil? fail ArgumentError, "Missing the required parameter 'secondary_child_association_body_create' when calling NodesApi.create_secondary_child_assocation" end # resource path local_var_path = "/nodes/{nodeId}/secondary-children".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(secondary_child_association_body_create) auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ChildAssociationEntry') if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#create_secondary_child_assocation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_assocation(node_id, target_id, opts = {}) ⇒ nil
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.
295 296 297 298 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 295 def delete_assocation(node_id, target_id, opts = {}) delete_assocation_with_http_info(node_id, target_id, opts) return nil end |
#delete_assocation_with_http_info(node_id, target_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
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.
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 307 def delete_assocation_with_http_info(node_id, target_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.delete_assocation ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.delete_assocation" end # verify the required parameter 'target_id' is set if @api_client.config.client_side_validation && target_id.nil? fail ArgumentError, "Missing the required parameter 'target_id' when calling NodesApi.delete_assocation" end # resource path local_var_path = "/nodes/{nodeId}/targets/{targetId}".sub('{' + 'nodeId' + '}', node_id.to_s).sub('{' + 'targetId' + '}', target_id.to_s) # query parameters query_params = {} query_params[:'assocType'] = opts[:'assoc_type'] if !opts[:'assoc_type'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#delete_assocation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_node(node_id, opts = {}) ⇒ nil
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.
357 358 359 360 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 357 def delete_node(node_id, opts = {}) delete_node_with_http_info(node_id, opts) return nil end |
#delete_node_with_http_info(node_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
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.
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 368 def delete_node_with_http_info(node_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.delete_node ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.delete_node" end # resource path local_var_path = "/nodes/{nodeId}".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'permanent'] = opts[:'permanent'] if !opts[:'permanent'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#delete_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_secondary_child_assocation(node_id, child_id, opts = {}) ⇒ nil
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.
415 416 417 418 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 415 def delete_secondary_child_assocation(node_id, child_id, opts = {}) delete_secondary_child_assocation_with_http_info(node_id, child_id, opts) return nil end |
#delete_secondary_child_assocation_with_http_info(node_id, child_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
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.
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 427 def delete_secondary_child_assocation_with_http_info(node_id, child_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.delete_secondary_child_assocation ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.delete_secondary_child_assocation" end # verify the required parameter 'child_id' is set if @api_client.config.client_side_validation && child_id.nil? fail ArgumentError, "Missing the required parameter 'child_id' when calling NodesApi.delete_secondary_child_assocation" end # resource path local_var_path = "/nodes/{nodeId}/secondary-children/{childId}".sub('{' + 'nodeId' + '}', node_id.to_s).sub('{' + 'childId' + '}', child_id.to_s) # query parameters query_params = {} query_params[:'assocType'] = opts[:'assoc_type'] if !opts[:'assoc_type'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#delete_secondary_child_assocation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_node(node_id, opts = {}) ⇒ NodeEntry
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.
479 480 481 482 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 479 def get_node(node_id, opts = {}) data, _status_code, _headers = get_node_with_http_info(node_id, opts) return data end |
#get_node_content(node_id, opts = {}) ⇒ nil
Get node content Note: this endpoint is available in Alfresco 5.2 and newer versions. Gets the content of the node with identifier nodeId.
542 543 544 545 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 542 def get_node_content(node_id, opts = {}) get_node_content_with_http_info(node_id, opts) return nil end |
#get_node_content_with_http_info(node_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Get node content Note: this endpoint is available in Alfresco 5.2 and newer versions. Gets the content of the node with identifier nodeId.
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 554 def get_node_content_with_http_info(node_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.get_node_content ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.get_node_content" end # resource path local_var_path = "/nodes/{nodeId}/content".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'attachment'] = opts[:'attachment'] if !opts[:'attachment'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#get_node_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_node_with_http_info(node_id, opts = {}) ⇒ Array<(NodeEntry, Fixnum, Hash)>
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.
492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 492 def get_node_with_http_info(node_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.get_node ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.get_node" end # resource path local_var_path = "/nodes/{nodeId}".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'relativePath'] = opts[:'relative_path'] if !opts[:'relative_path'].nil? query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NodeEntry') if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#get_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_node_children(node_id, opts = {}) ⇒ NodeChildAssociationPaging
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=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 “‘orderBy=name DESC“` 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
608 609 610 611 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 608 def list_node_children(node_id, opts = {}) data, _status_code, _headers = list_node_children_with_http_info(node_id, opts) return data end |
#list_node_children_with_http_info(node_id, opts = {}) ⇒ Array<(NodeChildAssociationPaging, Fixnum, Hash)>
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=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 ```orderBy=name DESC``` 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
626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 626 def list_node_children_with_http_info(node_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.list_node_children ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.list_node_children" end if @api_client.config.client_side_validation && !opts[:'skip_count'].nil? && opts[:'skip_count'] < 0 fail ArgumentError, 'invalid value for "opts[:"skip_count"]" when calling NodesApi.list_node_children, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'max_items'].nil? && opts[:'max_items'] < 1 fail ArgumentError, 'invalid value for "opts[:"max_items"]" when calling NodesApi.list_node_children, must be greater than or equal to 1.' end # resource path local_var_path = "/nodes/{nodeId}/children".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'skipCount'] = opts[:'skip_count'] if !opts[:'skip_count'].nil? query_params[:'maxItems'] = opts[:'max_items'] if !opts[:'max_items'].nil? query_params[:'orderBy'] = @api_client.build_collection_param(opts[:'order_by'], :csv) if !opts[:'order_by'].nil? query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'relativePath'] = opts[:'relative_path'] if !opts[:'relative_path'].nil? query_params[:'includeSource'] = opts[:'include_source'] if !opts[:'include_source'].nil? query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NodeChildAssociationPaging') if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#list_node_children\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_parents(node_id, opts = {}) ⇒ NodeAssociationPaging
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.
693 694 695 696 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 693 def list_parents(node_id, opts = {}) data, _status_code, _headers = list_parents_with_http_info(node_id, opts) return data end |
#list_parents_with_http_info(node_id, opts = {}) ⇒ Array<(NodeAssociationPaging, Fixnum, Hash)>
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.
709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 709 def list_parents_with_http_info(node_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.list_parents ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.list_parents" end if @api_client.config.client_side_validation && !opts[:'skip_count'].nil? && opts[:'skip_count'] < 0 fail ArgumentError, 'invalid value for "opts[:"skip_count"]" when calling NodesApi.list_parents, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'max_items'].nil? && opts[:'max_items'] < 1 fail ArgumentError, 'invalid value for "opts[:"max_items"]" when calling NodesApi.list_parents, must be greater than or equal to 1.' end # resource path local_var_path = "/nodes/{nodeId}/parents".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'skipCount'] = opts[:'skip_count'] if !opts[:'skip_count'].nil? query_params[:'maxItems'] = opts[:'max_items'] if !opts[:'max_items'].nil? query_params[:'includeSource'] = opts[:'include_source'] if !opts[:'include_source'].nil? query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NodeAssociationPaging') if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#list_parents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_secondary_children(node_id, opts = {}) ⇒ NodeChildAssociationPaging
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.
774 775 776 777 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 774 def list_secondary_children(node_id, opts = {}) data, _status_code, _headers = list_secondary_children_with_http_info(node_id, opts) return data end |
#list_secondary_children_with_http_info(node_id, opts = {}) ⇒ Array<(NodeChildAssociationPaging, Fixnum, Hash)>
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.
790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 790 def list_secondary_children_with_http_info(node_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.list_secondary_children ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.list_secondary_children" end if @api_client.config.client_side_validation && !opts[:'skip_count'].nil? && opts[:'skip_count'] < 0 fail ArgumentError, 'invalid value for "opts[:"skip_count"]" when calling NodesApi.list_secondary_children, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'max_items'].nil? && opts[:'max_items'] < 1 fail ArgumentError, 'invalid value for "opts[:"max_items"]" when calling NodesApi.list_secondary_children, must be greater than or equal to 1.' end # resource path local_var_path = "/nodes/{nodeId}/secondary-children".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'skipCount'] = opts[:'skip_count'] if !opts[:'skip_count'].nil? query_params[:'maxItems'] = opts[:'max_items'] if !opts[:'max_items'].nil? query_params[:'includeSource'] = opts[:'include_source'] if !opts[:'include_source'].nil? query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NodeChildAssociationPaging') if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#list_secondary_children\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_source_associations(node_id, opts = {}) ⇒ NodeAssociationPaging
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.
852 853 854 855 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 852 def list_source_associations(node_id, opts = {}) data, _status_code, _headers = list_source_associations_with_http_info(node_id, opts) return data end |
#list_source_associations_with_http_info(node_id, opts = {}) ⇒ Array<(NodeAssociationPaging, Fixnum, Hash)>
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.
865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 865 def list_source_associations_with_http_info(node_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.list_source_associations ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.list_source_associations" end # resource path local_var_path = "/nodes/{nodeId}/sources".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NodeAssociationPaging') if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#list_source_associations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_target_associations(node_id, opts = {}) ⇒ NodeAssociationPaging
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.
916 917 918 919 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 916 def list_target_associations(node_id, opts = {}) data, _status_code, _headers = list_target_associations_with_http_info(node_id, opts) return data end |
#list_target_associations_with_http_info(node_id, opts = {}) ⇒ Array<(NodeAssociationPaging, Fixnum, Hash)>
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.
929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 929 def list_target_associations_with_http_info(node_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.list_target_associations ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.list_target_associations" end # resource path local_var_path = "/nodes/{nodeId}/targets".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NodeAssociationPaging') if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#list_target_associations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#lock_node(node_id, node_body_lock, opts = {}) ⇒ NodeEntry
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 ‘cm:content` or a subtype of `cm:content`. 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 `org.alfresco.service.cmr.lock.LockType` 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 `org.alfresco.service.cmr.lock.LockType` 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’t need to be kept over a restart of the repository. In this case you don’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.
980 981 982 983 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 980 def lock_node(node_id, node_body_lock, opts = {}) data, _status_code, _headers = lock_node_with_http_info(node_id, node_body_lock, opts) return data end |
#lock_node_with_http_info(node_id, node_body_lock, opts = {}) ⇒ Array<(NodeEntry, Fixnum, Hash)>
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 `cm:content` or a subtype of `cm:content`. 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 `org.alfresco.service.cmr.lock.LockType` 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 `org.alfresco.service.cmr.lock.LockType` 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't need to be kept over a restart of the repository. In this case you don'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.
993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 993 def lock_node_with_http_info(node_id, node_body_lock, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.lock_node ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.lock_node" end # verify the required parameter 'node_body_lock' is set if @api_client.config.client_side_validation && node_body_lock.nil? fail ArgumentError, "Missing the required parameter 'node_body_lock' when calling NodesApi.lock_node" end # resource path local_var_path = "/nodes/{nodeId}/lock".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(node_body_lock) auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NodeEntry') if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#lock_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#move_node(node_id, node_body_move, opts = {}) ⇒ NodeEntry
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.
1047 1048 1049 1050 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 1047 def move_node(node_id, node_body_move, opts = {}) data, _status_code, _headers = move_node_with_http_info(node_id, node_body_move, opts) return data end |
#move_node_with_http_info(node_id, node_body_move, opts = {}) ⇒ Array<(NodeEntry, Fixnum, Hash)>
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.
1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 1060 def move_node_with_http_info(node_id, node_body_move, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.move_node ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.move_node" end # verify the required parameter 'node_body_move' is set if @api_client.config.client_side_validation && node_body_move.nil? fail ArgumentError, "Missing the required parameter 'node_body_move' when calling NodesApi.move_node" end # resource path local_var_path = "/nodes/{nodeId}/move".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(node_body_move) auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NodeEntry') if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#move_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#unlock_node(node_id, opts = {}) ⇒ NodeEntry
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.
1113 1114 1115 1116 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 1113 def unlock_node(node_id, opts = {}) data, _status_code, _headers = unlock_node_with_http_info(node_id, opts) return data end |
#unlock_node_with_http_info(node_id, opts = {}) ⇒ Array<(NodeEntry, Fixnum, Hash)>
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.
1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 1125 def unlock_node_with_http_info(node_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.unlock_node ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.unlock_node" end # resource path local_var_path = "/nodes/{nodeId}/unlock".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NodeEntry') if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#unlock_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_node(node_id, node_body_update, opts = {}) ⇒ NodeEntry
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: “‘JSON { "name":"My new name" } “` You can also set or update one or more properties: “`JSON { "properties": { "cm:title":"Folder title" } } “` 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: “`JSON { "permissions": { "isInheritanceEnabled": false, "locallySet": [ "GROUP_special", "name": "Read", "accessStatus":"DENIED", "testuser", "name": "Contributor", "accessStatus":"ALLOWED" ] } } “` 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 "last one wins" order.
1175 1176 1177 1178 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 1175 def update_node(node_id, node_body_update, opts = {}) data, _status_code, _headers = update_node_with_http_info(node_id, node_body_update, opts) return data end |
#update_node_content(node_id, content_body_update, opts = {}) ⇒ NodeEntry
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.
1245 1246 1247 1248 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 1245 def update_node_content(node_id, content_body_update, opts = {}) data, _status_code, _headers = update_node_content_with_http_info(node_id, content_body_update, opts) return data end |
#update_node_content_with_http_info(node_id, content_body_update, opts = {}) ⇒ Array<(NodeEntry, Fixnum, Hash)>
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.
1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 1261 def update_node_content_with_http_info(node_id, content_body_update, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.update_node_content ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.update_node_content" end # verify the required parameter 'content_body_update' is set if @api_client.config.client_side_validation && content_body_update.nil? fail ArgumentError, "Missing the required parameter 'content_body_update' when calling NodesApi.update_node_content" end if @api_client.config.client_side_validation && !opts[:'name'].nil? && opts[:'name'] !~ Regexp.new(/^(?!(.*[\\\"\\*\\\\\\>\\<\\?\/\\:\\|]+.*)|(.*[\\.]?.*[\\.]+$)|(.*[ ]+$))/) fail ArgumentError, "invalid value for 'opts[:\"name\"]' when calling NodesApi.update_node_content, must conform to the pattern /^(?!(.*[\\\"\\*\\\\\\>\\<\\?\/\\:\\|]+.*)|(.*[\\.]?.*[\\.]+$)|(.*[ ]+$))/." end # resource path local_var_path = "/nodes/{nodeId}/content".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'majorVersion'] = opts[:'major_version'] if !opts[:'major_version'].nil? query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil? query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(content_body_update) auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NodeEntry') if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#update_node_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_node_with_http_info(node_id, node_body_update, opts = {}) ⇒ Array<(NodeEntry, Fixnum, Hash)>
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: ```JSON { "name":"My new name" } ``` You can also set or update one or more properties: ```JSON { "properties": { "cm:title":"Folder title" } } ``` 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: ```JSON { "permissions": { "isInheritanceEnabled": false, "locallySet": [ "GROUP_special", "name": "Read", "accessStatus":"DENIED", "testuser", "name": "Contributor", "accessStatus":"ALLOWED" ] } } ``` 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 "last one wins" order.
1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 |
# File 'lib/alfresco_api/api/nodes_api.rb', line 1188 def update_node_with_http_info(node_id, node_body_update, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: NodesApi.update_node ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling NodesApi.update_node" end # verify the required parameter 'node_body_update' is set if @api_client.config.client_side_validation && node_body_update.nil? fail ArgumentError, "Missing the required parameter 'node_body_update' when calling NodesApi.update_node" end # resource path local_var_path = "/nodes/{nodeId}".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(node_body_update) auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NodeEntry') if @api_client.config.debugging @api_client.config.logger.debug "API called: NodesApi#update_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |