Detailed Description
CopyController is used to copy or move Node instances.
The controller supports the following actions:
Parameter | Description |
---|---|
in oid | The object id of the Node to move. The Node and all of its children will be moved |
in targetOid | The object id of the parent to attach the moved Node to (if it does not accept the Node type an error occurs) (optional, if empty the new Node has no parent) |
out oid | The object id of the newly created Node |
Parameter | Description |
---|---|
in oid | The object id of the Node to move. The Node and all of its children will be moved |
in targetOid | The object id of the parent to attach the moved Node to (if it does not accept the Node type an error occurs) (optional, if empty the new Node has no parent) |
in nodesPerCall | The number of Node instances to copy in one call (default: 50) |
in recursive | Boolean whether to copy children too (default: true) |
For additional actions and parameters see BatchController actions.
Definition at line 68 of file CopyController.php.
Public Member Functions | |
__construct (Session $session, PersistenceFacade $persistenceFacade, PermissionManager $permissionManager, ActionMapper $actionMapper, Localization $localization, Message $message, Configuration $configuration, EventManager $eventManager) | |
__destruct () | |
initialize (Request $request, Response $response) | |
afterCommit (TransactionEvent $event) | |
Public Member Functions inherited from Controller | |
__construct (Session $session, PersistenceFacade $persistenceFacade, PermissionManager $permissionManager, ActionMapper $actionMapper, Localization $localization, Message $message, Configuration $configuration) | |
execute ($method=null) | |
getRequest () | |
getResponse () | |
Public Attributes | |
const | OBJECT_MAP_VAR = 'objectmap' |
const | ACTION_VAR = 'action' |
const | ITERATOR_ID_VAR = 'CopyController.iteratorid' |
const | NODES_PER_CALL = 50 |
Public Attributes inherited from BatchController | |
const | REQUEST_VAR = 'request' |
const | ONE_CALL_VAR = 'oneCall' |
const | STEP_VAR = 'step' |
const | NUM_STEPS_VAR = 'numSteps' |
const | DOWNLOAD_STEP_VAR = 'downloadStep' |
const | PACKAGES_VAR = 'packages' |
Public Attributes inherited from Controller | |
const | CSRF_TOKEN_PARAM = 'csrf_token' |
Constructor & Destructor Documentation
◆ __construct()
__construct | ( | Session | $session, |
PersistenceFacade | $persistenceFacade, | ||
PermissionManager | $permissionManager, | ||
ActionMapper | $actionMapper, | ||
Localization | $localization, | ||
Message | $message, | ||
Configuration | $configuration, | ||
EventManager | $eventManager | ||
) |
Constructor.
- Parameters
-
$session $persistenceFacade $permissionManager $actionMapper $localization $message $configuration $eventManager
Definition at line 94 of file CopyController.php.
◆ __destruct()
__destruct | ( | ) |
Destructor.
Definition at line 112 of file CopyController.php.
Member Function Documentation
◆ initialize()
- See also
- Controller::initialize()
Reimplemented from BatchController.
Definition at line 119 of file CopyController.php.
◆ validate()
|
protected |
- See also
- Controller::validate()
Reimplemented from Controller.
Definition at line 146 of file CopyController.php.
◆ getWorkPackage()
|
protected |
Reimplemented from BatchController.
Definition at line 202 of file CopyController.php.
◆ startProcess()
|
protected |
Copy/Move the first node (object ids parameter will be ignored)
- Parameters
-
$oids The object ids to process
Definition at line 226 of file CopyController.php.
◆ copyNodes()
|
protected |
Copy nodes provided by the persisted iterator (object ids parameter will be ignored)
- Parameters
-
$oids The object ids to process
Definition at line 299 of file CopyController.php.
◆ endProcess()
|
protected |
Finish the process and set the result.
- Parameters
-
$oid The object id of the newly created Node
Definition at line 344 of file CopyController.php.
◆ copyNode()
|
protected |
Create a copy of the node with the given object id.
The returned node is already persisted.
- Parameters
-
$oid The object id of the node to copy
- Returns
- The copied Node or null
Definition at line 355 of file CopyController.php.
◆ afterCommit()
afterCommit | ( | TransactionEvent | $event | ) |
◆ getTargetNode()
|
protected |
Get the target node from the request parameter targetoid.
- Parameters
-
$targetOID The object id of the target node
- Returns
- Node instance
Definition at line 427 of file CopyController.php.
◆ registerCopy()
|
protected |
Register a copied node in the session for later reference.
- Parameters
-
$origNode The original Node instance $copyNode The copied Node instance
Definition at line 442 of file CopyController.php.
◆ updateCopyOIDs()
|
protected |
Update the copied object ids in the registry.
- Parameters
-
$oidMap Map of changed object ids (key: old value, value: new value)
Definition at line 453 of file CopyController.php.
◆ getCopyOID()
|
protected |
Get the object id of the copied node for a node id.
- Parameters
-
$origOID The object id of the original node
- Returns
- ObjectId or null, if it does not exist already
Definition at line 475 of file CopyController.php.
◆ getCopy()
|
protected |
Get the copied node for a node id.
- Parameters
-
$origOID The object id of the original node
- Returns
- Copied Node or null, if it does not exist already
Definition at line 497 of file CopyController.php.
◆ modify()
|
protected |
Modify the given Node before save action (Called only for the copied root Node, not for its children)
- Note
- Subclasses will override this to implement special application requirements.
- Parameters
-
$node The Node instance to modify.
Definition at line 514 of file CopyController.php.
Member Data Documentation
◆ OBJECT_MAP_VAR
const OBJECT_MAP_VAR = 'objectmap' |
Definition at line 71 of file CopyController.php.
◆ ACTION_VAR
const ACTION_VAR = 'action' |
Definition at line 72 of file CopyController.php.
◆ ITERATOR_ID_VAR
const ITERATOR_ID_VAR = 'CopyController.iteratorid' |
Definition at line 75 of file CopyController.php.
◆ NODES_PER_CALL
const NODES_PER_CALL = 50 |
Definition at line 81 of file CopyController.php.