wcmf logo wemove logo

BatchController Class Reference
[Controller]

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. More...

Inheritance diagram for BatchController:

Inheritance graph
[legend]

Public Member Functions

 initialize (&$request, &$response)
 addWorkPackage ($name, $size, $oids, $callback, $args=null)
 getWorkPackage ($number)
 getNumberOfSteps ()
 getDisplayText ($step)
 processPart ()

Data Fields

 $WORK_PACKAGES_VARNAME = 'BatchController.workPackages'
 $NUM_STEPS_VARNAME = 'BatchController.numSteps'
 $_workPackages = array()

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-2009 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 929 2009-02-22 23:20:49Z iherwig

Input actions:

Output actions:

Author:
ingo herwig <ingo@wemove.com>

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


Member Function Documentation

initialize ( &$  request,
&$  response 
)

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:
name Display name of the package (will be supplemented by startNumber-endNumber, e.g. '1-7', '8-14', ...)
size Size 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)
oids An 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:
callback The 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:
args Assoziative 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 XMLExportController::exportNodes(), XMLExportController::initExport(), and initialize().

Here is the call graph for this function:

getWorkPackage ( number  ) 

Get definitions of work packages.

Parameters:
number The 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.

Reimplemented in BackupController, SimpleBatchController, and XMLExportController.

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

References WCMFException::throwEx().

Referenced by initialize().

Here is the call graph for this function:

getNumberOfSteps (  ) 

See also:
LongTaskController::getNumberOfSteps()

Reimplemented from LongTaskController.

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

References SessionData::getInstance().

Here is the call graph for this function:

getDisplayText ( step  ) 

See also:
LongTaskController::getDisplayText()

Reimplemented from LongTaskController.

Reimplemented in XMLExportController.

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

References Message::get().

Here is the call graph for this function:

processPart (  ) 

See also:
LongTaskController::processPart()

Reimplemented from LongTaskController.

Reimplemented in PageExportController.

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

References LongTaskController::getStepNumber(), and WCMFException::throwEx().

Here is the call graph for this function:


Field Documentation

$WORK_PACKAGES_VARNAME = 'BatchController.workPackages'

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

$NUM_STEPS_VARNAME = 'BatchController.numSteps'

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

$_workPackages = array()

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


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

This page generated via doxygen 1.5.8 Mon Mar 30 01:58:42 2009.
Copyright © 2009 wemove digital solutions GmbH.
sourceforge logo