Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table plus
applyColStyleToCelltrue
columnTypess,s,s,s
heading0
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

clonePageTree(sourcePageId, targetPageId, titlePrefix, copyPermissions)

Package

Alias

Pkg Usage

Description

Excerpt
hiddentrue

Clones the page tree with its permissions.

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

Table plus
applyColStyleToCelltrue
columnTypess,s,s,s
heading0
multiplefalse
enableSortingfalse

Parameter name

Type

Required

Description

sourcePageId

...

String

Yes

...

ID of the selected page to clone.

targetPageId

...

String

Yes

...

ID of the target parent page. If the page is at the root level (top level) the parent page should be the spaces home page.

titlePrefix

...

String

Yes

The page name prefix to add to avoid conflicts.

copyPermissions

...

Boolean

Yes

...

Parameter to specify whether the page permissions should be cloned, true/false.

Return

...

Type

booleanBoolean (true/false)

Returns true if pages and permissions are cloned successfully.

Example

Example 1

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

See also

Filter by label (Content by label)
showLabelsfalse
max25
showSpacefalse
cqllabel = "

...

page_

...

routines" and space = currentSpace ( )
labels

...

array_routines
We've encountered an issue exporting this macro. Please try exporting this page again later.