SchedulerModuleController

Scheduler backend module.

Internal

This class is a specific Backend controller implementation and is not considered part of the Public TYPO3 API.

Attributes
#[AsController]

Table of Contents

Properties

$context  : Context
$currentAction  : Action
$iconFactory  : IconFactory
$moduleTemplateFactory  : ModuleTemplateFactory
$scheduler  : Scheduler
$taskRepository  : SchedulerTaskRepository
$taskSerializer  : TaskSerializer
$taskService  : TaskService
$uriBuilder  : UriBuilder

Methods

__construct()  : mixed
getCurrentAction()  : Action
This is (unfortunately) used by additional field providers to distinct between "create new task" and "edit task".
handleRequest()  : ResponseInterface
Entry dispatcher method.
addDocHeaderAddTaskButton()  : void
addDocHeaderCloseAndSaveButtons()  : void
addDocHeaderDeleteButton()  : void
addDocHeaderNewButton()  : void
addDocHeaderReloadButton()  : void
addDocHeaderShortcutButton()  : void
addMessage()  : void
Add a flash message to the flash message queue of this module.
addPreparedAdditionalFields()  : array<string|int, mixed>
Prepared additional fields from field providers for rendering.
createTask()  : int
Create a new task and persist. Return its new uid.
deleteTask()  : void
Set a task to deleted.
executeTasks()  : void
Execute a list of tasks.
getBackendUser()  : BackendUserAuthentication
getHumanReadableTaskName()  : string
getLanguageService()  : LanguageService
getRegisteredTaskGroups()  : array<string|int, mixed>
Fetch list of all task groups.
getTimestampFromDateString()  : int
Convert input to DateTime and retrieve timestamp.
isSubmittedTaskDataValid()  : bool
renderAddTaskFormView()  : ResponseInterface
Render add task form.
renderEditTaskFormView()  : ResponseInterface
Render edit task form.
renderListTasksView()  : ResponseInterface
Assemble display of list of scheduled tasks
scheduleCrons()  : void
Schedule selected tasks to be executed on next cron run
setTaskDataFromRequest()  : AbstractTask
stopTask()  : void
Clears the registered running executions from the task.
toggleDisabledFlag()  : void
Toggle the disabled state of a task and register for next execution if task is of type "single execution".
updateTask()  : void
Update data of an existing task.

Properties

Methods

__construct()

public __construct(Scheduler $scheduler, TaskSerializer $taskSerializer, SchedulerTaskRepository $taskRepository, IconFactory $iconFactory, UriBuilder $uriBuilder, ModuleTemplateFactory $moduleTemplateFactory, Context $context, TaskService $taskService) : mixed
Parameters
$scheduler : Scheduler
$taskSerializer : TaskSerializer
$taskRepository : SchedulerTaskRepository
$iconFactory : IconFactory
$uriBuilder : UriBuilder
$moduleTemplateFactory : ModuleTemplateFactory
$context : Context
$taskService : TaskService

getCurrentAction()

This is (unfortunately) used by additional field providers to distinct between "create new task" and "edit task".

public getCurrentAction() : Action
Return values
Action

handleRequest()

Entry dispatcher method.

public handleRequest(ServerRequestInterface $request) : ResponseInterface

There are two arguments involved regarding main module routing:

  • 'action': add, edit, delete, toggleHidden, ...
  • 'CMD': "save", "close", "new" when adding / editing a task. A better naming would be "nextAction", but the split button ModuleTemplate and DocumentSaveActions.ts can not cope with a renaming here and need "CMD".
Parameters
$request : ServerRequestInterface
Return values
ResponseInterface

addDocHeaderShortcutButton()

protected addDocHeaderShortcutButton(ModuleTemplate $moduleTemplate, string $name[, string $action = '' ][, int $taskUid = 0 ]) : void
Parameters
$moduleTemplate : ModuleTemplate
$name : string
$action : string = ''
$taskUid : int = 0

addPreparedAdditionalFields()

Prepared additional fields from field providers for rendering.

protected addPreparedAdditionalFields(array<string|int, mixed> $currentAdditionalFields, array<string|int, mixed> $newAdditionalFields, string $class) : array<string|int, mixed>
Parameters
$currentAdditionalFields : array<string|int, mixed>
$newAdditionalFields : array<string|int, mixed>
$class : string
Return values
array<string|int, mixed>

createTask()

Create a new task and persist. Return its new uid.

protected createTask(ModuleTemplate $view, ServerRequestInterface $request) : int
Parameters
$view : ModuleTemplate
$request : ServerRequestInterface
Return values
int

getRegisteredTaskGroups()

Fetch list of all task groups.

protected getRegisteredTaskGroups() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTimestampFromDateString()

Convert input to DateTime and retrieve timestamp.

protected getTimestampFromDateString(string $input) : int
Parameters
$input : string
Tags
throws
InvalidDateException
Return values
int

isSubmittedTaskDataValid()

protected isSubmittedTaskDataValid(ModuleTemplate $view, ServerRequestInterface $request, bool $isNewTask) : bool
Parameters
$view : ModuleTemplate
$request : ServerRequestInterface
$isNewTask : bool
Return values
bool

renderAddTaskFormView()

Render add task form.

protected renderAddTaskFormView(ModuleTemplate $view, ServerRequestInterface $request) : ResponseInterface
Parameters
$view : ModuleTemplate
$request : ServerRequestInterface
Return values
ResponseInterface

renderEditTaskFormView()

Render edit task form.

protected renderEditTaskFormView(ModuleTemplate $view, ServerRequestInterface $request[, int|null $taskUid = null ]) : ResponseInterface
Parameters
$view : ModuleTemplate
$request : ServerRequestInterface
$taskUid : int|null = null
Return values
ResponseInterface

scheduleCrons()

Schedule selected tasks to be executed on next cron run

protected scheduleCrons(ModuleTemplate $view, string $taskUids) : void
Parameters
$view : ModuleTemplate
$taskUids : string

stopTask()

Clears the registered running executions from the task.

protected stopTask(ModuleTemplate $view, int $taskUid) : void

Note this doesn't actually stop the running script. It just unmark execution.

Parameters
$view : ModuleTemplate
$taskUid : int
Tags
todo

find a way to really kill the running task.

toggleDisabledFlag()

Toggle the disabled state of a task and register for next execution if task is of type "single execution".

protected toggleDisabledFlag(ModuleTemplate $view, int $taskUid) : void
Parameters
$view : ModuleTemplate
$taskUid : int

updateTask()

Update data of an existing task.

protected updateTask(ModuleTemplate $view, ServerRequestInterface $request) : void
Parameters
$view : ModuleTemplate
$request : ServerRequestInterface

        
On this page

Search results