ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilSumOfWorkspaceFileSizesTooLargeInteraction Class Reference
+ Inheritance diagram for ilSumOfWorkspaceFileSizesTooLargeInteraction:
+ Collaboration diagram for ilSumOfWorkspaceFileSizesTooLargeInteraction:

Public Member Functions

 __construct ()
 
 getInputTypes ()
 
 getOutputType ()
 
 getRemoveOption ()
 
Returns
Option An Option to remove the current task and do some cleanup if possible. This Option is displayed if the Bucket is completed. You do not have to provide an additional Option to remove in your UserInteraction, the remove-Option is added to the list of Options (last position)
See also
self::getAbortOption();
More...
 
 interaction (array $input, Option $user_selected_option, Bucket $bucket)
 
 getOptions (array $input)
 
 getMessage (array $input)
 @inheritDoc More...
 
 canBeSkipped (array $input)
 @inheritDoc More...
 
 getSkippedValue (array $input)
 
 isFinal ()
 
 getMessage (array $input)
 @inheritDoc More...
 
 canBeSkipped (array $input)
 @inheritDoc More...
 
 getSkippedValue (array $input)
 
 isFinal ()
 
- Public Member Functions inherited from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask
 setInput (array $values)
 
 getOutput ()
 
 getInput ()
 
 getType ()
 
 unfoldTask ()
 Unfold the task. More...
 
 getRemoveOption ()
 
Returns
Option An Option to remove the current task and do some cleanup if possible. This Option is displayed if the Bucket is completed. You do not have to provide an additional Option to remove in your UserInteraction, the remove-Option is added to the list of Options (last position)
See also
self::getAbortOption();
More...
 
 getAbortOption ()
 
Returns
Option In case a Job is failed or did not respond for some time, an Abort-Option is displayed. There is already a Standard-Abort-Option registered, you can override with your own and do some cleanup if possible.
More...
 
 getType ()
 
 getInputTypes ()
 
 getOutputType ()
 
 getOutput ()
 
 setInput (array $values)
 
 getInput ()
 
 unfoldTask ()
 
 getRemoveOption ()
 
 getAbortOption ()
 
 getOptions (array $input)
 
 canBeSkipped (array $input)
 Decide whether the UserInteraction is presented to the user and he has to decide or user UserInteraction is skipped by the TaskManager. More...
 
 getSkippedValue (array $input)
 
 isFinal ()
 
 interaction (array $input, Option $user_selected_option, Bucket $bucket)
 
 getMessage (array $input)
 

Data Fields

const OPTION_OK = 'ok'
 
const OPTION_SKIP = 'skip'
 
- Data Fields inherited from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask
const MAIN_REMOVE = 'bt_main_remove'
 
const MAIN_ABORT = 'bt_main_abort'
 

Protected Attributes

ilLanguage $lng
 
- Protected Attributes inherited from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask
array $input = []
 
Value $output
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask
 checkTypes (array $values)
 
 extractType ($value)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSumOfWorkspaceFileSizesTooLargeInteraction::__construct ( )

Definition at line 33 of file class.ilSumOfWorkspaceFileSizesTooLargeInteraction.php.

34 {
35 global $DIC;
36 $this->lng = $DIC->language();
37 $this->lng->loadLanguageModule('background_tasks');
38 }
global $DIC
Definition: shib_login.php:26

References $DIC, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ canBeSkipped()

ilSumOfWorkspaceFileSizesTooLargeInteraction::canBeSkipped ( array  $input)

@inheritDoc

Reimplemented from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractUserInteraction.

Definition at line 80 of file class.ilSumOfWorkspaceFileSizesTooLargeInteraction.php.

80 : bool
81 {
82 $copy_definition = $input[0];
83 if ($copy_definition->getAdheresToLimit()->getValue()) {
84 // skip the user interaction if the adherence to the global limit for the sum of file sizes
85 // hasn't been violated (as this interaction is used as an error message and mustn't be
86 // shown when everything is fine))
87
88 return true;
89 } else {
90 return false;
91 }
92 }

◆ getInputTypes()

ilSumOfWorkspaceFileSizesTooLargeInteraction::getInputTypes ( )
Returns
Type[] A list of types that are taken as input.

Implements ILIAS\BackgroundTasks\Task.

Definition at line 40 of file class.ilSumOfWorkspaceFileSizesTooLargeInteraction.php.

40 : array
41 {
42 return [
43 new SingleType(ilWorkspaceCopyDefinition::class),
44 ];
45 }

◆ getMessage()

ilSumOfWorkspaceFileSizesTooLargeInteraction::getMessage ( array  $input)

@inheritDoc

Reimplemented from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractUserInteraction.

Definition at line 75 of file class.ilSumOfWorkspaceFileSizesTooLargeInteraction.php.

75 : string
76 {
77 return $this->lng->txt('ui_msg_files_violate_maxsize');
78 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getOptions()

ilSumOfWorkspaceFileSizesTooLargeInteraction::getOptions ( array  $input)
Parameters
Value[]$inputThe input value of this task.
Returns
Option[] Options are buttons the user can press on this interaction.

Implements ILIAS\BackgroundTasks\Task\UserInteraction.

Definition at line 70 of file class.ilSumOfWorkspaceFileSizesTooLargeInteraction.php.

70 : array
71 {
72 return array();
73 }

◆ getOutputType()

ilSumOfWorkspaceFileSizesTooLargeInteraction::getOutputType ( )

Implements ILIAS\BackgroundTasks\Task.

Definition at line 47 of file class.ilSumOfWorkspaceFileSizesTooLargeInteraction.php.

47 : Type
48 {
49 return new SingleType(ilWorkspaceCopyDefinition::class);
50 }

◆ getRemoveOption()

ilSumOfWorkspaceFileSizesTooLargeInteraction::getRemoveOption ( )

Returns
Option An Option to remove the current task and do some cleanup if possible. This Option is displayed if the Bucket is completed. You do not have to provide an additional Option to remove in your UserInteraction, the remove-Option is added to the list of Options (last position)
See also
self::getAbortOption();

Reimplemented from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask.

Definition at line 52 of file class.ilSumOfWorkspaceFileSizesTooLargeInteraction.php.

◆ getSkippedValue()

ilSumOfWorkspaceFileSizesTooLargeInteraction::getSkippedValue ( array  $input)
Parameters
Value[]$input
See also
canBeSkipped, whenever you decide to skip the UserInteraction, you have to return a valid Value to proceed.

Reimplemented from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractUserInteraction.

Definition at line 94 of file class.ilSumOfWorkspaceFileSizesTooLargeInteraction.php.

94 : Value
95 {
96 return $input[0];
97 }

◆ interaction()

ilSumOfWorkspaceFileSizesTooLargeInteraction::interaction ( array  $input,
Option  $user_selected_option,
Bucket  $bucket 
)
Parameters
Value[]$inputThe input value of this task.
Option$user_selected_optionThe Option the user chose.
Bucket$bucketNotify the bucket about your progress!

Implements ILIAS\BackgroundTasks\Task\UserInteraction.

Definition at line 57 of file class.ilSumOfWorkspaceFileSizesTooLargeInteraction.php.

61 : Value {
62 if ($user_selected_option->getValue() == self::OPTION_OK) {
63 // Set state to finished to stop the BackgroundTask and remove it from the popover.
64 $bucket->setState(3);
65 }
66
67 return $input[0];
68 }

References ILIAS\BackgroundTasks\Bucket\setState().

+ Here is the call graph for this function:

◆ isFinal()

ilSumOfWorkspaceFileSizesTooLargeInteraction::isFinal ( )
Returns
bool true if this is the last skippable interaction in your chain/bucket, defaults to true.

Reimplemented from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractUserInteraction.

Definition at line 99 of file class.ilSumOfWorkspaceFileSizesTooLargeInteraction.php.

99 : bool
100 {
101 return false;
102 }

Field Documentation

◆ $lng

ilLanguage ilSumOfWorkspaceFileSizesTooLargeInteraction::$lng
protected

◆ OPTION_OK

const ilSumOfWorkspaceFileSizesTooLargeInteraction::OPTION_OK = 'ok'

◆ OPTION_SKIP

const ilSumOfWorkspaceFileSizesTooLargeInteraction::OPTION_SKIP = 'skip'

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