wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
CopyController Class Reference
+ Inheritance diagram for CopyController:

Public Member Functions

 initialize (&$request, &$response)
 
 validate ()
 
 getWorkPackage ($number)
 
 getDisplayText ($step)
 
 startProcess ($oids)
 
 copyNodes ($oids)
 
 endProcess ($oid)
 
copyNode ($oid)
 
getTargetNode ($targetOID)
 
 registerCopy (&$origNode, &$copyNode)
 
 getCopyOID ($origOID)
 
getCopy ($origOID)
 
 saveToTarget (&$node)
 
loadFromTarget ($oid)
 
getTargetMapper (&$sourceMapper)
 
 modify (&$node)
 
- Public Member Functions inherited from BatchController
 initialize (&$request, &$response)
 
 addWorkPackage ($name, $size, $oids, $callback, $args=null)
 
 getWorkPackage ($number)
 
 getNumberOfSteps ()
 
 getDisplayText ($step)
 
 getSummaryText ()
 
 processPart ()
 
- Public Member Functions inherited from LongTaskController
 initialize (&$request, &$response)
 
 hasView ()
 
 executeKernel ()
 
 getStepNumber ()
 
 getNumberOfSteps ()
 
 getDisplayText ($step)
 
 getSummaryText ()
 
 initializeTask ()
 
 processPart ()
 
- Public Member Functions inherited from Controller
 Controller (&$delegate)
 
 initialize (&$request, &$response)
 
 validate ()
 
 hasView ()
 
 execute ()
 
 executeKernel ()
 
 getErrorMsg ()
 
 setErrorMsg ($msg)
 
 appendErrorMsg ($msg)
 
getRequest ()
 
getResponse ()
 
getView ()
 
getDelegate ()
 
 getViewTemplate ($controller, $context, $action)
 
 getCacheId ()
 
 assignViewDefaults (&$view)
 
 isLocalizedRequest ()
 

Public Attributes

 $REQUEST = 'CopyController.request'
 
 $OBJECT_MAP = 'CopyController.objectmap'
 
 $ITERATOR_ID = 'CopyController.iteratorid'
 
 $_targetNode = null
 
 $_targetMapper = array()
 
 $_NODES_PER_CALL = 50
 
- Public Attributes inherited from BatchController
 $WORK_PACKAGES_VARNAME = 'BatchController.workPackages'
 
 $NUM_STEPS_VARNAME = 'BatchController.numSteps'
 
 $_workPackages = array()
 
- Public Attributes inherited from LongTaskController
 $STEP_SESSION_VARNAME = 'LongTaskController.curStep'
 
 $ONE_CALL_SESSION_VARNAME = 'LongTaskController.oneCall'
 
 $_curStep = 1
 
- Public Attributes inherited from Controller
 $_request = null
 
 $_response = null
 
 $_errorMsg = ''
 
 $_view = null
 
 $_delegate = null
 

Detailed Description

CopyController is a controller that copies Nodes.

wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH

Licensed under the terms of any of the following licenses at your choice:

See the license.txt file distributed with this work for additional information.

Id:
class.CopyController.php 1462 2014-02-04 23:52:27Z iherwig

Input actions:

  • move Move the given Node and its children to the given target Node (delete original Node)
  • copy Copy the given Node and its children to the given target Node (do not delete original Node)

Output actions:

  • ok In any case
Parameters
[in]oidThe oid of the Node to copy. The Node and all of its children will be copied
[in]targetoidThe oid of the parent to attach the copy to (if it does not accept the Node type an error occurs) (optional, if empty the new Node has no parent)
[in]nodes_per_callThe number of nodes to process in one call, default: 50
[in]target_initparamsThe name of the configuration section that holds the initparams for the target mappers. This allows to copy nodes to a different store, optional, does not work for move action
[in]recursiveTrue/False wether to copy children too, only applies when copy action, default: true
[out]oidThe object id of the newly created Node.
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 48 of file class.CopyController.php.

Member Function Documentation

CopyController::initialize ( $request,
$response 
)
See Also
Controller::initialize()

Definition at line 64 of file class.CopyController.php.

References SessionData\getInstance().

+ Here is the call graph for this function:

CopyController::getWorkPackage (   $number)
See Also
BatchController::getWorkPackage()

Definition at line 148 of file class.CopyController.php.

References Message\get().

+ Here is the call graph for this function:

CopyController::getDisplayText (   $step)
CopyController::startProcess (   $oids)

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

Parameters
oidsThe oids to process

Definition at line 177 of file class.CopyController.php.

References BatchController\addWorkPackage(), BUILDDEPTH_SINGLE, copyNode(), endProcess(), Message\get(), SessionData\getInstance(), getTargetNode(), Log\info(), Log\isInfoEnabled(), modify(), saveToTarget(), and WCMFException\throwEx().

+ Here is the call graph for this function:

CopyController::copyNodes (   $oids)

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

Parameters
oidsThe oids to process

Definition at line 258 of file class.CopyController.php.

References BatchController\addWorkPackage(), copyNode(), endProcess(), Message\get(), getCopyOID(), SessionData\getInstance(), and PersistentIterator\load().

+ Here is the call graph for this function:

CopyController::endProcess (   $oid)

Finish the process and set the result

Parameters
oidThe object id of the newly created Node

Definition at line 313 of file class.CopyController.php.

References SessionData\getInstance().

Referenced by copyNodes(), and startProcess().

+ Here is the call graph for this function:

& CopyController::copyNode (   $oid)

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
A reference to the copied node or null

Definition at line 331 of file class.CopyController.php.

References BUILDDEPTH_SINGLE, Log\debug(), getCopy(), PersistenceFacade\getInstance(), Log\info(), Log\isDebugEnabled(), Log\isInfoEnabled(), registerCopy(), saveToTarget(), and WCMFException\throwEx().

Referenced by copyNodes(), and startProcess().

+ Here is the call graph for this function:

& CopyController::getTargetNode (   $targetOID)

Get the target node from the request parameter targetoid

Parameters
targetOIDThe oid of the target node or null
Returns
A reference to the node, an empty node, if targetoid is null

Definition at line 404 of file class.CopyController.php.

References $_targetNode, BUILDDEPTH_SINGLE, and loadFromTarget().

Referenced by startProcess(), and validate().

+ Here is the call graph for this function:

CopyController::registerCopy ( $origNode,
$copyNode 
)

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 424 of file class.CopyController.php.

References SessionData\getInstance().

Referenced by copyNode().

+ Here is the call graph for this function:

CopyController::getCopyOID (   $origOID)

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

Parameters
oidThe object id of the original node
Returns
The object id or null, if it does not exist already

Definition at line 438 of file class.CopyController.php.

References BUILDDEPTH_SINGLE, PersistenceFacade\composeOID(), Log\debug(), PersistenceFacade\decomposeOID(), PersistenceFacade\getInstance(), SessionData\getInstance(), and Log\isDebugEnabled().

Referenced by copyNodes(), and getCopy().

+ Here is the call graph for this function:

& CopyController::getCopy (   $origOID)

Get the copied node for a node id

Parameters
oidThe object id of the original node
Returns
A reference to the copied node or null, if it does not exist already

Definition at line 479 of file class.CopyController.php.

References getCopyOID(), and loadFromTarget().

Referenced by copyNode().

+ Here is the call graph for this function:

CopyController::saveToTarget ( $node)

Save a node to the target store

Parameters
nodeA reference to the node

Definition at line 495 of file class.CopyController.php.

References PersistenceFacade\getInstance(), and getTargetMapper().

Referenced by copyNode(), and startProcess().

+ Here is the call graph for this function:

& CopyController::loadFromTarget (   $oid)

Load a node from the target store

Parameters
oidThe object id of the node
Returns
A reference to the node

Definition at line 511 of file class.CopyController.php.

References BUILDDEPTH_SINGLE, PersistenceFacade\getInstance(), PersistenceFacade\getOIDParameter(), and getTargetMapper().

Referenced by getCopy(), and getTargetNode().

+ Here is the call graph for this function:

& CopyController::getTargetMapper ( $sourceMapper)

Get the target mapper for a source mapper (maybe saving to another store)

Parameters
sourceMapperA reference to the source mapper
targetMapperA reference to the target mapper

Definition at line 530 of file class.CopyController.php.

References InifileParser\getInstance(), SessionData\getInstance(), and WCMFException\throwEx().

Referenced by loadFromTarget(), and saveToTarget().

+ Here is the call graph for this function:

CopyController::modify ( $node)

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
True/False whether the Node was modified [default: false].

Definition at line 564 of file class.CopyController.php.

Referenced by startProcess().

Member Data Documentation

CopyController::$REQUEST = 'CopyController.request'

Definition at line 51 of file class.CopyController.php.

CopyController::$OBJECT_MAP = 'CopyController.objectmap'

Definition at line 52 of file class.CopyController.php.

CopyController::$ITERATOR_ID = 'CopyController.iteratorid'

Definition at line 53 of file class.CopyController.php.

CopyController::$_targetNode = null

Definition at line 55 of file class.CopyController.php.

Referenced by getTargetNode().

CopyController::$_targetMapper = array()

Definition at line 56 of file class.CopyController.php.

CopyController::$_NODES_PER_CALL = 50

Definition at line 59 of file class.CopyController.php.


The documentation for this class was generated from the following file: