Squiz Matrix
4.12.2
|
Public Member Functions | |
HIPO_Job ($code_name='') | |
getCodeName () | |
getHipoName () | |
getInitialStepData () | |
complete () | |
percentDone () | |
& | getRunningVars () |
setRunningVars (&$vars) | |
setOption ($name, $value) | |
getOption ($name) | |
setHipoVar ($name, $value) | |
getHipoVar ($name) | |
_addError ($error, $warning=FALSE) | |
getErrors () | |
prepare () | |
initialise ($source_code_name=NULL) | |
getThreshold () | |
getThresholdPercentageRequired () | |
freestyle () | |
load ($code_name) | |
save ($ignore_running_mode=FALSE) | |
_updateProgress () | |
_renewLastUpdated ($new_time=NULL) | |
& | _getSubJob () |
getInitialiseMode () | |
setRunningMode ($mode, $server_taskid='') | |
getRunningMode () | |
autoStep () | |
getNextStep () | |
skipStep ($stepid=0) | |
paint (&$o, $nested=FALSE) | |
process () | |
processWeb (&$step_data, $prefix) | |
processServer (&$step_data, $prefix) | |
abort ($abort_source=TRUE, $abort_dependant=TRUE) | |
jobAborted () | |
_paintErrorReport () | |
paintStepDefault (&$step_data, &$o, $prefix) | |
_errorHandler ($err_no, $err_msg, $err_file, $err_line) | |
getDependantHipoJob () | |
Public Member Functions inherited from MySource_Object | |
MySource_Object () | |
__sleep () | |
__wakeup () | |
Static Public Member Functions | |
static | paintConfig (&$o, $class, $write_access) |
static | getConfigVars () |
static | paintProgressBar ($percent_done, $message='', $label_class='sq-hipo-progress-bar-label', $percent_class='sq-hipo-progress-bar-percent', $bar_main_class='sq-hipo-progress-bar-main', $bar_done_class='sq-hipo-progress-bar-done') |
Data Fields | |
$code_name = '' | |
$source_code_name = '' | |
$userid = 0 | |
$last_updated = 0 | |
$hipo_name = '' | |
$is_prepared = FALSE | |
$uses_trans = TRUE | |
$_hipo_vars | |
$_options | |
$_running_vars = Array() | |
$_current_mode = 'web' | |
$_steps = Array() | |
Data Fields inherited from MySource_Object | |
$_tmp | |
Definition at line 29 of file hipo_job.inc.
_addError | ( | $error, | |
$warning = FALSE |
|||
) |
Add an error to the HIPO job to be reported at the end
This function will automatically log the time of the error for the report
string | $error | the text of the error to report |
boolean | $warning | set to TRUE if this is just a warning, not an error |
Definition at line 368 of file hipo_job.inc.
_errorHandler | ( | $err_no, | |
$err_msg, | |||
$err_file, | |||
$err_line | |||
) |
This function captures all errors and warnings that occur during the execution of process()
int | $err_no | The type of error (E_*) |
string | $err_msg | The error message |
string | $err_file | The file the error occured in |
string | $err_line | The line the error occured on |
Definition at line 1666 of file hipo_job.inc.
& _getSubJob | ( | ) |
If we are currently in a hipo_job step then it returns the job that we are executing Otherwise returns NULL
Definition at line 898 of file hipo_job.inc.
_paintErrorReport | ( | ) |
Paint a report of errors that were triggered during HIPO execution
Definition at line 1536 of file hipo_job.inc.
_renewLastUpdated | ( | $new_time = NULL | ) |
Updates the last_updated time directly in the database, rather than modifying the hipo_job object and waiting for it to save()
int | $new_time | the time to set the last_updated time to - NULL defaults to the current time |
Definition at line 865 of file hipo_job.inc.
_updateProgress | ( | ) |
abort | ( | $abort_source = TRUE , |
|
$abort_dependant = TRUE |
|||
) |
Cancel the HIPO and cleanup
boolean | $abort_source | Whether to abort the job's source job, if any |
boolean | $abort_dependant | Whether to abort the job's dependant job, if any |
Definition at line 1434 of file hipo_job.inc.
autoStep | ( | ) |
Whether we want to auto_step in the paint mode for this job or not
Definition at line 979 of file hipo_job.inc.
complete | ( | ) |
Determines whether the HIPO job has finished its run (ie. is complete or was aborted)
Definition at line 227 of file hipo_job.inc.
freestyle | ( | ) |
Performs the duties of this hipo, without showing any output on the frontend, in the one execution cycle.
Definition at line 614 of file hipo_job.inc.
getCodeName | ( | ) |
Returns a unique code_name the HIPO can use to ensure it is not being run twice
Definition at line 178 of file hipo_job.inc.
|
static |
Gets the config vars that this hipo requires.
Config vars should be in the format:
Array( 'SQ_DEFINE_1' => Array('editable' => 0, 'default' => FALSE), 'SQ_DEFINE_2' => Array('editable' => 1, 'default' => ''), );
This method is called statically.
Definition at line 568 of file hipo_job.inc.
getDependantHipoJob | ( | ) |
Returns the dependent HIPO jobs spawned by this job, if any
Definition at line 1709 of file hipo_job.inc.
getErrors | ( | ) |
Get all the errors that have been produced by this running of this HIPO_Job
Definition at line 388 of file hipo_job.inc.
getHipoName | ( | ) |
Returns the (localised) HIPO name
This will return the hipo_name variable for backward compatibility reasons. Please override this with a translate()'d call with the string code containing the HIPO name.
Definition at line 195 of file hipo_job.inc.
getHipoVar | ( | $name | ) |
Returns one of the global hipo vars for the HIPO
string | $name | name of the hipo var |
Definition at line 346 of file hipo_job.inc.
getInitialiseMode | ( | ) |
Returns the mode that this task was initialised in
Definition at line 921 of file hipo_job.inc.
getInitialStepData | ( | ) |
Returns the steps in this hipo, possibly with localised step names and messages
This will return the steps member variable for backward compatibilty purposes. Please override this with the proper step data, which should be the same as the old steps variable but with all appropriate fields translate()'d.
Definition at line 214 of file hipo_job.inc.
getNextStep | ( | ) |
Return the next step to be executed by the hipo job,
Definition at line 1019 of file hipo_job.inc.
getOption | ( | $name | ) |
Returns one of the global options for the HIPO
string | $name | name of the option |
Definition at line 307 of file hipo_job.inc.
getRunningMode | ( | ) |
Returns the running mode of this task
Definition at line 966 of file hipo_job.inc.
& getRunningVars | ( | ) |
Returns the vars that the HIPO steps use
Definition at line 253 of file hipo_job.inc.
getThreshold | ( | ) |
Returns the maximum number of assets we can process in FreeStyle mode
Definition at line 581 of file hipo_job.inc.
getThresholdPercentageRequired | ( | ) |
Returns what percentage of our threshold value is needed for this job
Definition at line 601 of file hipo_job.inc.
HIPO_Job | ( | $code_name = '' | ) |
Constructor
string | $code_name | a unique code_name the HIPO |
Definition at line 164 of file hipo_job.inc.
initialise | ( | $source_code_name = NULL | ) |
Set database information that the HIPO will need to run
This function should be run before any painting or processing of the HIPO. It will write the initial database entry for the HIPO so that the vars needed by the HIPO are available on successive reloads This function returns the code_name for the new job
string | $source_code_name | the code name of the top level hipo job that this job is being run under |
Definition at line 423 of file hipo_job.inc.
jobAborted | ( | ) |
Called to do any clean-up for this job
Definition at line 1521 of file hipo_job.inc.
load | ( | $code_name | ) |
Load the HIPO vars from the database
string | $code_name | a unique code_name the HIPO |
Definition at line 629 of file hipo_job.inc.
paint | ( | & | $o, |
$nested = FALSE |
|||
) |
Paint information about the process of the HIPO
This function calls the paint function for the step currently being run and also outputs a progress bar to indicate to the user where they are in the HIPO process
object | &$o | Backend_Outputter, reference to the backend outputter |
boolean | $nested | TRUE if the steps are nested |
Definition at line 1069 of file hipo_job.inc.
|
static |
Paints backend of this job
object | &$o | Backend_Outputter, reference to the backend outputter |
string | $class | calling class name |
boolean | $write_access | write access priviledge to the current asset |
Definition at line 546 of file hipo_job.inc.
|
static |
Paint a progress bar for a HIPO
float | $percent_done | the percentage of progress completed |
string | $message | a status message to display above the progress bar |
string | $label_class | the css class for the progress bar label ($message) |
string | $percent_class | the css class for the percentage done figure ($percentage) |
string | $bar_main_class | the css class for the base of the progress bar |
string | $bar_done_class | the css class for the completed part of the progress bar |
Definition at line 1623 of file hipo_job.inc.
paintStepDefault | ( | & | $step_data, |
& | $o, | ||
$prefix | |||
) |
A default function for painting the progess of a step
array | &$step_data | a reference to the array of information about the current step |
object | &$o | Hipo_Backend_Outputter, the backend outputter class |
string | $prefix | prefix for form vars |
Definition at line 1598 of file hipo_job.inc.
percentDone | ( | ) |
How much of it's work has this HIPO_Job done
Definition at line 240 of file hipo_job.inc.
prepare | ( | ) |
Prepares and sets up the running vars of this hipo. This is run before initialise(), because initialise() may not be run at all if this Job can be freestyle()'d
Definition at line 402 of file hipo_job.inc.
process | ( | ) |
Process the current step of a HIPO
This function decides, based on the current running_mode, which process function to call. It will also switch to server mode if required based on the step data. This function also handles cancel (abort) requests from the user.
This function sets the _completed flag of the HIPO to indicate if the HIPO is completed and saves all HIPO var information to the database.
Definition at line 1136 of file hipo_job.inc.
processServer | ( | & | $step_data, |
$prefix | |||
) |
Process the current step of a HIPO in a server environment
This function should only be called by a HIPO running on the HIPO server, so we assume no timeouts here and continually call the process function of the current step until it is completed.
array | &$step_data | a reference to the array of information about the current step |
string | $prefix | prefix for form vars |
Definition at line 1345 of file hipo_job.inc.
processWeb | ( | & | $step_data, |
$prefix | |||
) |
Process the current step of a HIPO in the web interface
This function calls the process function for the step currently being run - and that's it.
array | &$step_data | a reference to the array of information about the current step |
string | $prefix | prefix for form vars |
Definition at line 1262 of file hipo_job.inc.
save | ( | $ignore_running_mode = FALSE | ) |
Save the HIPO vars to the database OR delete from database if complete
boolean | $ignore_running_mode | whether to ignore the running mode check or not (SHOULD ONLY BE USED BY setRunningMode()) |
Definition at line 747 of file hipo_job.inc.
setHipoVar | ( | $name, | |
$value | |||
) |
Set one of the global hipo vars for the HIPO
string | $name | name of the hipo var |
string | $value | new value to assign it |
Definition at line 327 of file hipo_job.inc.
setOption | ( | $name, | |
$value | |||
) |
Set one of the global options for the HIPO
string | $name | name of the option |
string | $value | new value to assign it |
Definition at line 288 of file hipo_job.inc.
setRunningMode | ( | $mode, | |
$server_taskid = '' |
|||
) |
Set the mode that we are running (ie processing) in Returns whether or not the set was successful
string | $mode | [web|server] |
string | $server_taskid | when the $mode == 'server' this must be supplied, it is the taskid given to it by the server |
Definition at line 938 of file hipo_job.inc.
setRunningVars | ( | & | $vars | ) |
Resets the vars that the HIPO steps use
array | &$vars | variables used in hipo job |
Definition at line 268 of file hipo_job.inc.
skipStep | ( | $stepid = 0 | ) |
called when a step in the hip job process needs to be skipped
int | $stepid | the array index of the step |
Definition at line 1047 of file hipo_job.inc.
$_hipo_vars |
Definition at line 83 of file hipo_job.inc.
$_options |
Definition at line 101 of file hipo_job.inc.