Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
HIPO_Job Class Reference
Inheritance diagram for HIPO_Job:
MySource_Object HIPO_Job_Acquire_Locks HIPO_Job_Bulk_File_Import HIPO_Job_Clear_Cache HIPO_Job_Clone_Assets HIPO_Job_Create_Links HIPO_Job_Edit_Bundled_Assets_Status HIPO_Job_Edit_Metadata_Field_Values HIPO_Job_Edit_Metadata_Schemas HIPO_Job_Edit_Permissions HIPO_Job_Edit_Roles HIPO_Job_Edit_Status HIPO_Job_Edit_Tags HIPO_Job_Edit_Workflow_Schemas HIPO_Job_Export_Assets_To_Xml HIPO_Job_Export_Online_Quiz_To_XML HIPO_Job_Export_Thesaurus_XML HIPO_Job_Funnelback_Rebuild_Cache HIPO_Job_Funnelback_Reindex HIPO_Job_Generate_Report HIPO_Job_Import_Assets_From_Xml HIPO_Job_Import_File HIPO_Job_Import_Thesaurus_XML HIPO_Job_Purge_Trash HIPO_Job_Quick_HIPO HIPO_Job_Regenerate_Design HIPO_Job_Regenerate_Metadata HIPO_Job_ReIndex HIPO_Job_Rename_Thesaurus_Term HIPO_Job_Rollback_Management HIPO_Job_Structured_File_Import HIPO_Job_Sync_CMIS_Bridge HIPO_Job_Tool_Clear_Squid_Cache HIPO_Job_Tool_Delete_Bmail_Users HIPO_Job_Tool_Export_Files HIPO_Job_Tool_Import_Bmail_User HIPO_Job_Tool_Search_Replace HIPO_Job_Trigger_Batch_Events HIPO_Job_Update_Lookups

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
 

Detailed Description

Definition at line 29 of file hipo_job.inc.

Member Function Documentation

_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

Parameters
string$errorthe text of the error to report
boolean$warningset to TRUE if this is just a warning, not an error
Returns
void protected

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()

Parameters
int$err_noThe type of error (E_*)
string$err_msgThe error message
string$err_fileThe file the error occured in
string$err_lineThe line the error occured on
Returns
void private
See Also
HIPO_Job::process()

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

Returns
mixed NULL|object private

Definition at line 898 of file hipo_job.inc.

_paintErrorReport ( )

Paint a report of errors that were triggered during HIPO execution

Returns
void private

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()

Parameters
int$new_timethe time to set the last_updated time to - NULL defaults to the current time
Returns
void private

Definition at line 865 of file hipo_job.inc.

_updateProgress ( )

Update progress

Returns
void private

Definition at line 832 of file hipo_job.inc.

abort (   $abort_source = TRUE,
  $abort_dependant = TRUE 
)

Cancel the HIPO and cleanup

Parameters
boolean$abort_sourceWhether to abort the job's source job, if any
boolean$abort_dependantWhether to abort the job's dependant job, if any
Returns
boolean public

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

Returns
boolean public

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)

Returns
boolean public

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.

Returns
boolean public

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

Returns
string public

Definition at line 178 of file hipo_job.inc.

static getConfigVars ( )
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.

Returns
array public

Definition at line 568 of file hipo_job.inc.

getDependantHipoJob ( )

Returns the dependent HIPO jobs spawned by this job, if any

Returns
object|null public

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

Returns
array public

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.

Returns
string public

Definition at line 195 of file hipo_job.inc.

getHipoVar (   $name)

Returns one of the global hipo vars for the HIPO

Parameters
string$namename of the hipo var
Returns
mixed NULL|string public

Definition at line 346 of file hipo_job.inc.

getInitialiseMode ( )

Returns the mode that this task was initialised in

Returns
string public

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.

Returns
string public

Definition at line 214 of file hipo_job.inc.

getNextStep ( )

Return the next step to be executed by the hipo job,

Returns
int public

Definition at line 1019 of file hipo_job.inc.

getOption (   $name)

Returns one of the global options for the HIPO

Parameters
string$namename of the option
Returns
mixed NULL|string public

Definition at line 307 of file hipo_job.inc.

getRunningMode ( )

Returns the running mode of this task

Returns
string public

Definition at line 966 of file hipo_job.inc.

& getRunningVars ( )

Returns the vars that the HIPO steps use

Returns
array public

Definition at line 253 of file hipo_job.inc.

getThreshold ( )

Returns the maximum number of assets we can process in FreeStyle mode

Returns
int public

Definition at line 581 of file hipo_job.inc.

getThresholdPercentageRequired ( )

Returns what percentage of our threshold value is needed for this job

Returns
int public

Definition at line 601 of file hipo_job.inc.

HIPO_Job (   $code_name = '')

Constructor

Parameters
string$code_namea 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

Parameters
string$source_code_namethe code name of the top level hipo job that this job is being run under
Returns
string public

Definition at line 423 of file hipo_job.inc.

jobAborted ( )

Called to do any clean-up for this job

Returns
boolean public

Definition at line 1521 of file hipo_job.inc.

load (   $code_name)

Load the HIPO vars from the database

Parameters
string$code_namea unique code_name the HIPO
Returns
boolean public

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

Parameters
object&$oBackend_Outputter, reference to the backend outputter
boolean$nestedTRUE if the steps are nested
Returns
void public

Definition at line 1069 of file hipo_job.inc.

static paintConfig ( $o,
  $class,
  $write_access 
)
static

Paints backend of this job

Parameters
object&$oBackend_Outputter, reference to the backend outputter
string$classcalling class name
boolean$write_accesswrite access priviledge to the current asset
Returns
void private

Definition at line 546 of file hipo_job.inc.

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' 
)
static

Paint a progress bar for a HIPO

Parameters
float$percent_donethe percentage of progress completed
string$messagea status message to display above the progress bar
string$label_classthe css class for the progress bar label ($message)
string$percent_classthe css class for the percentage done figure ($percentage)
string$bar_main_classthe css class for the base of the progress bar
string$bar_done_classthe css class for the completed part of the progress bar
Returns
void public

Definition at line 1623 of file hipo_job.inc.

paintStepDefault ( $step_data,
$o,
  $prefix 
)

A default function for painting the progess of a step

Parameters
array&$step_dataa reference to the array of information about the current step
object&$oHipo_Backend_Outputter, the backend outputter class
string$prefixprefix for form vars
Returns
void public

Definition at line 1598 of file hipo_job.inc.

percentDone ( )

How much of it's work has this HIPO_Job done

Returns
int public

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

Returns
boolean public

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.

Returns
boolean public

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.

Parameters
array&$step_dataa reference to the array of information about the current step
string$prefixprefix for form vars
Returns
boolean public

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.

Parameters
array&$step_dataa reference to the array of information about the current step
string$prefixprefix for form vars
Returns
boolean public

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

Parameters
boolean$ignore_running_modewhether to ignore the running mode check or not (SHOULD ONLY BE USED BY setRunningMode())
Returns
boolean public

Definition at line 747 of file hipo_job.inc.

setHipoVar (   $name,
  $value 
)

Set one of the global hipo vars for the HIPO

Parameters
string$namename of the hipo var
string$valuenew value to assign it
Returns
void public

Definition at line 327 of file hipo_job.inc.

setOption (   $name,
  $value 
)

Set one of the global options for the HIPO

Parameters
string$namename of the option
string$valuenew value to assign it
Returns
void public

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

Parameters
string$mode[web|server]
string$server_taskidwhen the $mode == 'server' this must be supplied, it is the taskid given to it by the server
Returns
boolean public

Definition at line 938 of file hipo_job.inc.

setRunningVars ( $vars)

Resets the vars that the HIPO steps use

Parameters
array&$varsvariables used in hipo job
Returns
void public

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

Parameters
int$stepidthe array index of the step
Returns
boolean public

Definition at line 1047 of file hipo_job.inc.

Field Documentation

$_hipo_vars
Initial value:
= Array(
'current_step' => 0,
'percent_done' => 0,
'initialise_mode' => '',
'running_mode' => '',
'aborted' => FALSE,
'server_taskid' => '',
'message' => '',
'job_dir' => '',
'errors' => Array(),
)

Definition at line 83 of file hipo_job.inc.

$_options
Initial value:
= Array(
'on_complete_url' => '',
'auto_complete' => TRUE,
)

Definition at line 101 of file hipo_job.inc.


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