Copies a node version to a new node, or to a new version of an existing node.
<password>password</password> <nodeVersionIdentifierFrom/> <nodeVersionReferenceFrom/> <nodeReferenceTo/> <nodeReferencePackageTo/> <nodeLocalReferenceTo/> <nodeNameTo/> <nodeVersionCommentTo/> <copyType>simple|inherit|extended</copyType> <extendedType>package|node|contents</extendedType> <extendedAction>insert|overwrite|merge|synchronize</extendedAction> <extendedVersions>preserve|latest|current|best</extendedVersions> </CopyNode>
The node from which to copy is identified by nodeVersionIdentifierFrom or nodeVersionReferenceFrom. If both are given, the identifier is used.
The reference for the new node is given in nodeReferenceTo, or by the combination of nodeReferencePackageTo and nodeLocalReferenceTo. If both are passed, If this node does not exist, the node is created and a copy of the existing node is made as version 1.
If the new node does exist, a new version is created and a copy of the existing node is made as version 1.
If copType is set to simple (the default), then the data from the the from node is copied to the to node.
If copyType is inherit, then the data from the from node is not copied to the to node, but an inherits from link will be created on the to node so that it inherits data from the from node.
If copyType is extended, an export/import is carried out. The following parameters are used:
- extendedType indicates whether just the from node (node), from and all its contents (package) or just its contents (contents) should be copied. The default is package.
- extendedAction indicate the import action. The default, insert, will fail if any of the to nodes already exist.
- extensionVersions indicate the import versions. The default, preserve, will preserve versions.
Name for new node
Whether or not inherit is used, the name of the new node is set to the value of the nodeNameTo parameter, provided that either system.NODE_NAME or system.NODE_NAME_MANDATORY is present and there is a node name. If nodeNameTo parameter is missing or blank:
- If the package of the "to" node is different from the package of the "from" node, the name of the from node is used.
- If the node reference of the "to" node is the same as the node reference of the "from" node, the name of the from node is used.
- If the from and to node are in the same package, but are not the same node, the name of the from node with " - Copy" appended is used.
Or, in simple terms, if this duplicates an existing node in the same package, "- Copy" is appended.
The comment on the new node is set to the value of nodeVersionCommentTo.
To copy from a node, the user must be authorised to administer, link to, or read all members of the from node. To copy from a node with the inherit option, the user must be authorised to administer or link to the from node. To copy using the extended option, the user must be authorised to read all of the source nodes and administer all of the target nodes.
The user must be authorised to use the node's type.
In simple mode, if the to node already exists, the user must be authorised to administer it and the latest version must be frozen.
<errorNumber>0</errorNumber> <nodeVersionIdentifier/> <nodeVersionReference/> <nodeName/>
CopyNode returns the identifier, reference and name of the newly created node.
101 - Not authorised
102 - Not found
103 - Parameter error
105 - User error
106 - state error (e.g. development version already exists)
Any errors that relate to the nodeReferenceTo field are returned as user errors.