Detailed Description

CopyController is used to copy or move Node instances.

The controller supports the following actions:

Action move
Move the given Node and its children to the given target Node (delete original 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)
out oid The object id of the newly created Node
Action copy
Copy the given Node and its children to the given target Node (keep original 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.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 57 of file CopyController.php.

+ Inheritance diagram for CopyController:

Public Member Functions

 initialize (Request $request, Response $response)
 
- Public Member Functions inherited from BatchController
 initialize (Request $request, Response $response)
 
- Public Member Functions inherited from Controller
 __construct (Session $session, PersistenceFacade $persistenceFacade, PermissionManager $permissionManager, ActionMapper $actionMapper, Localization $localization, Message $message, Configuration $configuration)
 
 initialize (Request $request, Response $response)
 
 execute ($method=null)
 
 getRequest ()
 
 getResponse ()
 

Protected Member Functions

 validate ()
 
 getWorkPackage ($number)
 
 startProcess ($oids)
 
 copyNodes ($oids)
 
 endProcess (ObjectId $oid)
 
 copyNode (ObjectId $oid)
 
 getTargetNode (ObjectId $targetOID)
 
 registerCopy (PersistentObject $origNode, PersistentObject $copyNode)
 
 updateCopyOIDs (array $oidMap)
 
 getCopyOID (ObjectId $origOID)
 
 getCopy (ObjectId $origOID)
 
 modify (PersistentObject $node)
 
- Protected Member Functions inherited from BatchController
 doExecute ()
 
 getStepNumber ()
 
 addWorkPackage ($name, $size, $oids, $callback, $args=null)
 
 processPart ()
 
 getNumberOfSteps ()
 
 getDisplayText ($step)
 
 getDownloadFile ()
 
 getWorkPackage ($number)
 
- Protected Member Functions inherited from Controller
 validate ()
 
 executeSubAction ($action)
 
 getLogger ()
 
 getSession ()
 
 getPersistenceFacade ()
 
 getPermissionManager ()
 
 getActionMapper ()
 
 getLocalization ()
 
 getMessage ()
 
 getConfiguration ()
 
 assignResponseDefaults ()
 
 isLocalizedRequest ()
 
 checkLanguageParameter ()
 

Additional Inherited Members

- Public Attributes inherited from BatchController
const ONE_CALL_SESSION_VARNAME = 'BatchController.oneCall'
 
const STEP_SESSION_VARNAME = 'BatchController.curStep'
 
const NUM_STEPS_VARNAME = 'BatchController.numSteps'
 
const DOWNLOAD_STEP = 'BatchController.downloadStep'
 
const WORK_PACKAGES_VARNAME = 'BatchController.workPackages'
 

Member Function Documentation

initialize ( Request  $request,
Response  $response 
)
See also
Controller::initialize()

Definition at line 72 of file CopyController.php.

validate ( )
protected
See also
Controller::validate()

Definition at line 97 of file CopyController.php.

getWorkPackage (   $number)
protected
See also
BatchController::getWorkPackage()

Definition at line 153 of file CopyController.php.

startProcess (   $oids)
protected

Copy/Move the first node (oids parameter will be ignored)

Parameters
$oidsThe oids to process

Definition at line 177 of file CopyController.php.

copyNodes (   $oids)
protected

Copy nodes provided by the persisted iterator (oids parameter will be ignored)

Parameters
$oidsThe oids to process

Definition at line 256 of file CopyController.php.

endProcess ( ObjectId  $oid)
protected

Finish the process and set the result.

Parameters
$oidThe object id of the newly created Node

Definition at line 309 of file CopyController.php.

copyNode ( ObjectId  $oid)
protected

Create a copy of the node with the given object id.

The returned node is already persisted.

Parameters
$oidThe oid of the node to copy
Returns
The copied Node or null

Definition at line 328 of file CopyController.php.

getTargetNode ( ObjectId  $targetOID)
protected

Get the target node from the request parameter targetoid.

Parameters
$targetOIDThe oid of the target node
Returns
Node instance

Definition at line 394 of file CopyController.php.

registerCopy ( PersistentObject  $origNode,
PersistentObject  $copyNode 
)
protected

Register a copied node in the session for later reference.

Parameters
$origNodeA reference to the original node
$copyNodeA reference to the copied node

Definition at line 409 of file CopyController.php.

updateCopyOIDs ( array  $oidMap)
protected

Update the copied oids in the registry.

Parameters
$oidMapMap of changed oids (key: old value, value: new value)

Definition at line 421 of file CopyController.php.

getCopyOID ( ObjectId  $origOID)
protected

Get the object id of the copied node for a node id.

Parameters
$origOIDThe object id of the original node
Returns
ObjectId or null, if it does not exist already

Definition at line 444 of file CopyController.php.

getCopy ( ObjectId  $origOID)
protected

Get the copied node for a node id.

Parameters
$origOIDThe object id of the original node
Returns
Copied Node or null, if it does not exist already

Definition at line 467 of file CopyController.php.

modify ( PersistentObject  $node)
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
$nodeA reference to the Node to modify.
Returns
Boolean whether the Node was modified (default: false)

Definition at line 485 of file CopyController.php.