wCMF
3.6
|
Public Member Functions | |
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 | |
$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 | |
LongTaskController is a controller that may be used as base class for tasks, that require a long execution time such as construction of a list of pages.
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.
This is accomplished by breaking up the task into n pieces (steps: 1..n) and calling this controller recurringly until all n pieces are finished. The pieces are processed by the processPart() method that must be implemented by subclasses. Information about the the progress is provided by the methods getNumberOfSteps() and getStepNumber().
To do the recurring calls without user interaction the controller needs a view that calls the submitAction('continue') function in the onLoad() event of the HTML page. If the parameter oneCall is set to true, the controller tries to accomplish the task in one call.
A possible configuration could be:
Input actions:
Output actions:
[in] | oneCall | True/False wether to accomplish the task in one call (optional, default: false) |
[out] | stepNumber | The current step starting with 1, ending with numberOfSteps+1 |
[out] | numberOfSteps | Total number of steps |
[out] | stepsArray | An arry of dots which size is equal to stepNumber (useful for views to iterate over) |
[out] | displayText | The display text for the current step |
[out] | summaryText | The summary text (only available in the last step) |
Definition at line 70 of file class.LongTaskController.php.
LongTaskController::initialize | ( | & | $request, |
& | $response | ||
) |
Definition at line 82 of file class.LongTaskController.php.
References SessionData\getInstance(), initializeTask(), and WCMFException\throwEx().
LongTaskController::hasView | ( | ) |
Definition at line 108 of file class.LongTaskController.php.
LongTaskController::executeKernel | ( | ) |
Do processing and assign Node data to View.
Definition at line 118 of file class.LongTaskController.php.
References getDisplayText(), SessionData\getInstance(), getNumberOfSteps(), getSummaryText(), and processPart().
LongTaskController::getStepNumber | ( | ) |
Get the number of the current step (1..number of steps).
Definition at line 162 of file class.LongTaskController.php.
Referenced by SearchIndexController\index(), SimpleLongTaskController\processPart(), and BatchController\processPart().
LongTaskController::getNumberOfSteps | ( | ) |
Get the total number of steps.
Definition at line 173 of file class.LongTaskController.php.
References WCMFException\throwEx().
Referenced by executeKernel().
LongTaskController::getDisplayText | ( | $step | ) |
Get the display text for a step.
step | The step to get the text for. |
Definition at line 183 of file class.LongTaskController.php.
References WCMFException\throwEx().
Referenced by executeKernel().
LongTaskController::getSummaryText | ( | ) |
Get the summary text for the last step.
Definition at line 192 of file class.LongTaskController.php.
References WCMFException\throwEx().
Referenced by executeKernel().
LongTaskController::initializeTask | ( | ) |
Initialize the task e.g. store some configuration in the session. This method is called on start up.
Definition at line 201 of file class.LongTaskController.php.
Referenced by initialize().
LongTaskController::processPart | ( | ) |
Process one part of the task.
Definition at line 206 of file class.LongTaskController.php.
References WCMFException\throwEx().
Referenced by executeKernel().
LongTaskController::$STEP_SESSION_VARNAME = 'LongTaskController.curStep' |
Definition at line 73 of file class.LongTaskController.php.
LongTaskController::$ONE_CALL_SESSION_VARNAME = 'LongTaskController.oneCall' |
Definition at line 74 of file class.LongTaskController.php.
LongTaskController::$_curStep = 1 |
Definition at line 77 of file class.LongTaskController.php.