TYPO3  7.6
Public Member Functions | List of all members
TaskInterface Interface Reference
Inheritance diagram for TaskInterface:
AbstractTask AbstractGraphicalTask ImageCropScaleMaskTask ImagePreviewTask

Public Member Functions

 __construct (Resource\ProcessedFile $targetFile, array $configuration)
 
 getName ()
 
 getType ()
 
 getTargetFile ()
 
 getSourceFile ()
 
 getConfiguration ()
 
 getConfigurationChecksum ()
 
 getTargetFileName ()
 
 getTargetFileExtension ()
 
 fileNeedsProcessing ()
 
 isExecuted ()
 
 setExecuted ($successful)
 
 isSuccessful ()
 

Detailed Description

A task is a unit of work that can be performed by a file processor. This may include multiple steps in any order, details depend on the configuration of the task and the tools the processor uses.

Each task has a type and a name. The type describes the category of the task, like "image" and "video". If your task is generic or applies to multiple types of files, use "general".

A task also already has to know the target file it should be executed on, so there is no "abstract" task that just specifies the steps to be executed without a concrete file. However, new tasks can easily be created from an existing task object.

Definition at line 30 of file core/Classes/Resource/Processing/TaskInterface.php.

Constructor & Destructor Documentation

__construct ( Resource\ProcessedFile  $targetFile,
array  $configuration 
)
Parameters
\TYPO3\CMS\Core\Resource\ProcessedFile$targetFile
array$configuration

Implemented in AbstractTask.

Member Function Documentation

fileNeedsProcessing ( )

Returns TRUE if the file has to be processed at all, such as e.g. the original file does.

Note: This does not indicate if the concrete ProcessedFile attached to this task has to be (re)processed. This check is done in ProcessedFile::isOutdated().

Todo:
isOutdated()/needsReprocessing()?
Returns
bool

Implemented in ImagePreviewTask, and ImageCropScaleMaskTask.

getConfiguration ( )

Returns the configuration for this task.

Returns
array

Implemented in AbstractTask.

Referenced by LocalPreviewHelper\process().

getConfigurationChecksum ( )

Returns the configuration checksum of this task.

Returns
string

Implemented in AbstractTask.

Referenced by LocalImageProcessor\checkForExistingTargetFile(), and LocalImageProcessor\processTask().

getName ( )

Returns the name of this task.

Returns
string

Implemented in AbstractTask.

Referenced by LocalImageProcessor\canProcessTask(), and LocalImageProcessor\processTask().

getSourceFile ( )

Returns the original file this task is based on.

Returns
Resource

Implemented in AbstractTask.

Referenced by LocalCropScaleMaskHelper\getFilenameForImageCropScaleMask(), LocalPreviewHelper\process(), and LocalImageProcessor\processTask().

getTargetFile ( )
getTargetFileExtension ( )

Gets the file extension the processed file should have in the filesystem.

Returns
string

Implemented in AbstractTask, and AbstractGraphicalTask.

Referenced by LocalPreviewHelper\getTemporaryFilePath().

getTargetFileName ( )

Returns the name the processed file should have in the filesystem.

Returns
string

Implemented in ImagePreviewTask, and ImageCropScaleMaskTask.

Referenced by LocalImageProcessor\checkForExistingTargetFile(), and LocalImageProcessor\processTask().

getType ( )

Returns the type of this task.

Returns
string

Implemented in AbstractTask.

Referenced by LocalImageProcessor\canProcessTask(), and LocalImageProcessor\processTask().

isExecuted ( )

Returns TRUE if this task has been executed, no matter if the execution was successful.

Returns
bool

Implemented in AbstractTask.

isSuccessful ( )

Returns TRUE if this task has been successfully executed. Only call this method if the task has been processed at all.

Returns
bool
Exceptions
\LogicExceptionIf the task has not been executed already

Implemented in AbstractTask.

setExecuted (   $successful)

Mark this task as executed. This is used by the Processors in order to transfer the state of this task to the file processing service.

Parameters
bool$successfulSet this to FALSE if executing the task failed
Returns
void

Implemented in AbstractTask.

Referenced by LocalImageProcessor\checkForExistingTargetFile(), and LocalImageProcessor\processTask().