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

Public Member Functions

 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

 $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

BatchController allows to define work packages that will be processed in a sequence. It simplifies the usage of LongTaskController functionality for splitting different bigger tasks into many smaller (similar) tasks where the whole number of tasks isn't known at designtime.

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.BatchController.php 1462 2014-02-04 23:52:27Z iherwig

Input actions:

  • continue Process next work package if any
  • unspecified: Initialized work packages

Output actions:

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

Definition at line 38 of file class.BatchController.php.

Member Function Documentation

BatchController::initialize ( $request,
$response 
)
BatchController::addWorkPackage (   $name,
  $size,
  $oids,
  $callback,
  $args = null 
)

Add a work package to session. This package will be devided into sub packages of given size.

Parameters
nameDisplay name of the package (will be supplemented by startNumber-endNumber, e.g. '1-7', '8-14', ...)
sizeSize of one sub package. This defines how many of the oids will be passed to the callback in one call (e.g. '7' means pass 7 oids per call)
oidsAn array of oids (or other application specific package identifiers) that will be distributed into sub packages of given size
Note
The array must contain at least one value
Parameters
callbackThe name of method to call for this package type
Note
The callback method must accept the following parameters:
  • one array parameter (the oids to process in the current call)
  • optionally array parameter (the additional arguments)
Parameters
argsAssoziative array of additional callback arguments (application specific) [default: null]

Definition at line 99 of file class.BatchController.php.

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

Referenced by SearchIndexController\collect(), CopyController\copyNodes(), XMLExportController\exportNodes(), SearchIndexController\index(), XMLExportController\initExport(), initialize(), BatchDisplayController\loadNodes(), BatchDisplayController\startProcess(), and CopyController\startProcess().

+ Here is the call graph for this function:

BatchController::getWorkPackage (   $number)

Get definitions of work packages.

Parameters
numberThe number of the work package (first number is 0, number is incremented on every call)
Note
This function gets called on first initialization run as often until it returns null. This allows to define different static work packages. If you would like to add work packages dynamically on subsequent runs this may be done by directly calling the BatchController::addWorkPackage() method.
Returns
A work packages description as assoziative array with keys 'name', 'size', 'oids', 'callback' as required for BatchController::addWorkPackage() method or null to terminate.
Note
subclasses must implement this method.

Definition at line 166 of file class.BatchController.php.

References WCMFException\throwEx().

Referenced by initialize().

+ Here is the call graph for this function:

BatchController::getNumberOfSteps ( )
See Also
LongTaskController::getNumberOfSteps()

Definition at line 173 of file class.BatchController.php.

References SessionData\getInstance().

Referenced by SearchIndexController\index(), and processPart().

+ Here is the call graph for this function:

BatchController::getDisplayText (   $step)
See Also
LongTaskController::getDisplayText()

Definition at line 181 of file class.BatchController.php.

References Message\get().

+ Here is the call graph for this function:

BatchController::getSummaryText ( )
See Also
LongTaskController::getSummaryText() The default implementation returns an empty string

Definition at line 189 of file class.BatchController.php.

BatchController::processPart ( )
See Also
LongTaskController::processPart()

Definition at line 196 of file class.BatchController.php.

References getNumberOfSteps(), LongTaskController\getStepNumber(), and WCMFException\throwEx().

+ Here is the call graph for this function:

Member Data Documentation

BatchController::$WORK_PACKAGES_VARNAME = 'BatchController.workPackages'

Definition at line 41 of file class.BatchController.php.

BatchController::$NUM_STEPS_VARNAME = 'BatchController.numSteps'

Definition at line 42 of file class.BatchController.php.

BatchController::$_workPackages = array()

Definition at line 44 of file class.BatchController.php.


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