BatchController.php
42 * | _in_ `oneCall` | Boolean whether to accomplish the task in one call (optional, default: _false_)
49 * | `download` | The process is finished and the next call to `continue` will trigger the file download
66 * | `download` | The process is finished and the next call to `continue` will trigger the file download
80 const DOWNLOAD_STEP_VAR = 'downloadStep'; // signals that the next continue action triggers the download
96 throw new ApplicationException($request, $response, ApplicationError::getGeneral("Current step undefined."));
101 throw new ApplicationException($request, $response, ApplicationError::getGeneral("Work packages undefined."));
118 throw new ApplicationException($request, $response, ApplicationError::getGeneral("Incomplete work package description."));
122 $this->addWorkPackage($workPackage['name'], $workPackage['size'], $workPackage['oids'], $workPackage['callback'], $args);
127 throw new ApplicationException($request, $response, ApplicationError::getGeneral("No work packages."));
201 * @param $name Display name of the package (will be supplemented by startNumber-endNumber, e.g. '1-7', '8-14', ...)
202 * @param $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)
203 * @param $oids An array of object ids (or other application specific package identifiers) that will be distributed into sub packages of given size
208 * @param $args Associative array of additional callback arguments (application specific) (default: _null_)
215 ApplicationError::getGeneral("Wrong work package description '".$name."': No callback given."));
265 throw new ApplicationException($request, $response, ApplicationError::getGeneral("Empty callback name."));
269 ApplicationError::getGeneral("Method '".$curWorkPackageDef['callback']."' must be implemented by ".get_class($this)));
318 * @param $number The number of the work package (first number is 0, number is incremented on every call)
320 * This allows to define different static work packages. If you would like to add work packages dynamically on
321 * subsequent runs this may be done by directly calling the BatchController::addWorkPackage() method.
FileDocument represents a local file.
Definition: FileDocument.php:21
getDisplayText($step)
Get the text to display for the current step.
Definition: BatchController.php:302
const NUM_STEPS_VAR
Definition: BatchController.php:79
const PACKAGES_VAR
Definition: BatchController.php:81
Response holds the response values that are used as output from Controller instances.
Definition: Response.php:20
Request holds the request values that are used as input to Controller instances.
Definition: Request.php:18
doExecute($method=null)
Definition: BatchController.php:139
const DOWNLOAD_STEP_VAR
Definition: BatchController.php:80
getLocalSessionValue($key, $default=null)
Set the value of a local session variable.
Definition: Controller.php:443
getStepNumber()
Get the number of the current step (1..number of steps).
Definition: BatchController.php:195
getWorkPackage($number)
Get definitions of work packages.
ObjectId is the unique identifier of an object.
Definition: ObjectId.php:28
static getGeneral($message, $statusCode=self::DEFAULT_ERROR_STATUS)
Factory method for creating a general error instance.
Definition: ApplicationError.php:162
const ONE_CALL_VAR
Definition: BatchController.php:77
setLocalSessionValue($key, $value)
Get the value of a local session variable.
Definition: Controller.php:454
ApplicationError is used to signal errors that occur while processing a request.
Definition: ApplicationError.php:41
static parse($oid)
Parse a serialized object id string into an ObjectId instance.
Definition: ObjectId.php:135
ApplicationException signals a general application exception.
Definition: ApplicationException.php:22
getDownloadFile()
Get the filename of the file to download at the end of processing.
Definition: BatchController.php:312
const STEP_VAR
Definition: BatchController.php:78
BatchController is used to process complex, longer running actions, that need to be divided into seve...
Definition: BatchController.php:73
addWorkPackage($name, $size, array $oids, $callback, $args=null)
Add a work package to session.
Definition: BatchController.php:210
Controller is the base class of all controllers.
Definition: Controller.php:49
initialize(Request $request, Response $response)
Definition: BatchController.php:89
getBooleanValue($name, $default=false)
Get a value as boolean.
const REQUEST_VAR
Definition: BatchController.php:76