Action: CopyNodes

Purpose: Copies a Node and, optionally the sub-tree underneath it, from one DOM to another. The top copied Node is appended as the last child of a specified parent Node in the other DOM.

Action-specific name/value pairs:

Parameter Name Description
SourceNodeOID The Node to be copied.
ToParentOID The Node in another Document to which you wish to append the copied SourceNode.
DeepCopy Possible values are true or false.

If set to false, the SourceNode is copied but its sub-tree of child nodes is ignored.

If set to true, a deep copy is performed, so the SourceNode and its sub-tree will be copied into the other DOM.

Alternatively, the parameters above can be incorporated into a single JSON string and specified using the parameter name JSON, eg:

{SourceNodeOID:"1-3",ToParentOID:"2-4",DeepCopy:true}

Example Request

Action=CopyNodes
&DeepCopy=true
&MDBAccessKeyId=[your access key id]
&Signature=[computed signature]
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Timestamp=2009-06-14T13%3A19%3A41
&SourceNodeOID=1-3
&ToParentOID=2-4
&Version=2009-04-15
&db=mdbx

or:

Action=CopyNodes
&JSON=%7BSourceNodeOID%3A%221-3%22%2CToParentOID%3A%222-4%22%2CDeepCopy%3Atrue%7D
&MDBAccessKeyId=[your access key id]
&OutputFormat=JSON
&Signature=[computed signature]
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Timestamp=2009-06-14T13%3A19%3A41
&Version=2009-04-15
&db=mdbx

Example Response

XML

<?xml version='1.0'?>
<CopyNodesResponse xmlns="http://mdbx.mgateway.com/doc/2009-06-05/">
   <CopyNodesResult>
      <nodeOID>
         2-10
      </nodeOID>
   </CopyNodesResult>
</CopyNodesResponse>

JSON (ie if OutputFormat=JSON specified in the Request)

{NodeOID:"2-10"}

The OID assigned to the newly-created copy of the SourceNode was 2-10.