obj objRef copy

Available for: Content Management Server

Task: The specified file is copied and the copy receives a draft version.

Syntax:

obj (withId objId) | (withPath path) | root copy {parameter value}

Additional information: If the source file has a released version, it is copied to the new draft version. If there is no released version, an attempt is made to use the committed version. If this is not available either, the draft version is used. If this does not exist, the file receives an empty draft version.

Function parameters:

  • parameter specifies the name of a parameter that specifies important data for copying (the target folder for example). The following values are allowed:
    • parent: Specifies that value specifies the path or the ID of the target folder. If this parameter is missing, the folder the file is located in is assumed to be the target folder.
    • name: Specifies that value contains the name that the file copy is to receive. If this name is missing, the name of the file to be copied is used. If it already exists in the target folder, a new name is calculated according to the Namex pattern, with x being a number.
    • recursive: If the file concerned is a folder, value specifies whether files contained in it are copied as well (recursively) (YES , TRUE or 1) or not (NO, FALSE or 0). Links inside the tree to be copied point to the copies whereas links to files outside the tree still point to the same link targets. Default: FALSE.
  • value contains the value of the respective parameter.

Return value if successful: the ID of the new file (string)

Necessary permissions (CM only):

  • The user must have the permissionRead permission for the source file.
  • The user must have the permissionCreateChildren permission in the target folder.
  • The user must have the global file creation permission defined in the format of the target file.

Example:

CM>obj withId 20099 copy parent /news/latestnews name incoming
65811