SchedulerModuleController
Scheduler backend module.
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 : SchedulerManagementAction
- $iconFactory : IconFactory
- $moduleTemplateFactory : ModuleTemplateFactory
- $scheduler : Scheduler
- $taskRepository : SchedulerTaskRepository
- $taskSerializer : TaskSerializer
- $taskService : TaskService
- $uriBuilder : UriBuilder
Methods
- __construct() : mixed
- getCurrentAction() : SchedulerManagementAction
- 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
$context read-only
protected
Context
$context
$currentAction
protected
SchedulerManagementAction
$currentAction
$iconFactory read-only
protected
IconFactory
$iconFactory
$moduleTemplateFactory read-only
protected
ModuleTemplateFactory
$moduleTemplateFactory
$scheduler read-only
protected
Scheduler
$scheduler
$taskRepository read-only
protected
SchedulerTaskRepository
$taskRepository
$taskSerializer read-only
protected
TaskSerializer
$taskSerializer
$taskService read-only
protected
TaskService
$taskService
$uriBuilder read-only
protected
UriBuilder
$uriBuilder
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() : SchedulerManagementAction
Return values
SchedulerManagementActionhandleRequest()
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
ResponseInterfaceaddDocHeaderAddTaskButton()
protected
addDocHeaderAddTaskButton(ModuleTemplate $moduleTemplate) : void
Parameters
- $moduleTemplate : ModuleTemplate
addDocHeaderCloseAndSaveButtons()
protected
addDocHeaderCloseAndSaveButtons(ModuleTemplate $moduleTemplate) : void
Parameters
- $moduleTemplate : ModuleTemplate
addDocHeaderDeleteButton()
protected
addDocHeaderDeleteButton(ModuleTemplate $moduleTemplate, int $taskUid) : void
Parameters
- $moduleTemplate : ModuleTemplate
- $taskUid : int
addDocHeaderNewButton()
protected
addDocHeaderNewButton(ModuleTemplate $moduleTemplate) : void
Parameters
- $moduleTemplate : ModuleTemplate
addDocHeaderReloadButton()
protected
addDocHeaderReloadButton(ModuleTemplate $moduleTemplate) : void
Parameters
- $moduleTemplate : ModuleTemplate
addDocHeaderShortcutButton()
protected
addDocHeaderShortcutButton(ModuleTemplate $moduleTemplate, string $name[, string $action = '' ][, int $taskUid = 0 ]) : void
Parameters
- $moduleTemplate : ModuleTemplate
- $name : string
- $action : string = ''
- $taskUid : int = 0
addMessage()
Add a flash message to the flash message queue of this module.
protected
addMessage(ModuleTemplate $moduleTemplate, string $message[, ContextualFeedbackSeverity $severity = ContextualFeedbackSeverity::OK ]) : void
Parameters
- $moduleTemplate : ModuleTemplate
- $message : string
- $severity : ContextualFeedbackSeverity = ContextualFeedbackSeverity::OK
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
intdeleteTask()
Set a task to deleted.
protected
deleteTask(ModuleTemplate $view, int $taskUid) : void
Parameters
- $view : ModuleTemplate
- $taskUid : int
executeTasks()
Execute a list of tasks.
protected
executeTasks(ModuleTemplate $view, string $taskUids) : void
Parameters
- $view : ModuleTemplate
- $taskUids : string
getBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetHumanReadableTaskName()
protected
getHumanReadableTaskName(AbstractTask $task) : string
Parameters
- $task : AbstractTask
Return values
stringgetLanguageService()
protected
getLanguageService() : LanguageService
Return values
LanguageServicegetRegisteredTaskGroups()
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
Return values
intisSubmittedTaskDataValid()
protected
isSubmittedTaskDataValid(ModuleTemplate $view, ServerRequestInterface $request, bool $isNewTask) : bool
Parameters
- $view : ModuleTemplate
- $request : ServerRequestInterface
- $isNewTask : bool
Return values
boolrenderAddTaskFormView()
Render add task form.
protected
renderAddTaskFormView(ModuleTemplate $view, ServerRequestInterface $request) : ResponseInterface
Parameters
- $view : ModuleTemplate
- $request : ServerRequestInterface
Return values
ResponseInterfacerenderEditTaskFormView()
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
ResponseInterfacerenderListTasksView()
Assemble display of list of scheduled tasks
protected
renderListTasksView(ModuleTemplate $view, ModuleData $moduleData) : ResponseInterface
Parameters
- $view : ModuleTemplate
- $moduleData : ModuleData
Return values
ResponseInterfacescheduleCrons()
Schedule selected tasks to be executed on next cron run
protected
scheduleCrons(ModuleTemplate $view, string $taskUids) : void
Parameters
- $view : ModuleTemplate
- $taskUids : string
setTaskDataFromRequest()
protected
setTaskDataFromRequest(AbstractTask $task, ServerRequestInterface $request) : AbstractTask
Parameters
- $task : AbstractTask
- $request : ServerRequestInterface
Return values
AbstractTaskstopTask()
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
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