Skip to end of metadata
Go to start of metadata

Cprime Apps has been rebranded as Anova Apps. Please note the only effect is the company name - all of our products’ names, logos, functionalities, support, etc. is exactly the same. The new location to our documentation space is https://anovaapps.atlassian.net.

Syntax

clonePageTree(sourcePageId, targetPageId, titlePrefix, copyPermissions)

Description

Clones the page tree with its permissions.

Some examples of routine behavior:

  • If the name (prefix + source page name) matches the name of any page in this space - copying does not occur, returns false and writes an error to the logs;
  • If the name (prefix + source page name) of the source page does not match the name of any page in this space, but the names (prefix + name of the child page of the source) of its child pages match any other page in the space, all pages whose names don't match with other page names are copied;
  • If nothing matches, the whole page tree will be copied.

Parameters

Parameter name

Type

Required

Description

sourcePageId

stringYesID of the selected page to clone.
targetPageIdstringYesID of the target parent page. If the page is at the root level (top level) the parent page should be the spaces home page.
titlePrefixstringYesThe page name prefix to add to avoid conflicts.
copyPermissionsbooleanYesParameter to specify whether the page permissions should be cloned, true/false.

Return type

boolean(true/false)

Returns true if pages and permissions are cloned successfully.

Example

number targetPageId = 11003;
string titlePrefix = "Copy of ";
boolean copyPermissions = true;
return clonePageTree(sourcePageId, targetPageId, titlePrefix, copyPermissions);

See also