ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilSumOfFileSizesTooLargeInteraction Class Reference

Class ilSumOfFileSizesTooLargeInteraction. More...

+ Inheritance diagram for ilSumOfFileSizesTooLargeInteraction:
+ Collaboration diagram for ilSumOfFileSizesTooLargeInteraction:

Public Member Functions

 __construct ()
 
 getInputTypes ()
 
 getOutputType ()
 
 getRemoveOption ()
 
 interaction (array $input, Option $user_selected_option, Bucket $bucket)
 
 getOptions (array $input)
 
 getMessage (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 ()
 
- Public Member Functions inherited from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractUserInteraction
 getMessage (array $input)
 
 canBeSkipped (array $input)
 
 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...
 

Protected Attributes

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

Private Attributes

const OPTION_OK = 'ok'
 

Additional Inherited Members

- Data Fields inherited from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask
const MAIN_REMOVE = 'bt_main_remove'
 
const MAIN_ABORT = 'bt_main_abort'
 
- Protected Member Functions inherited from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask
 checkTypes (array $values)
 
 extractType ($value)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSumOfFileSizesTooLargeInteraction::__construct ( )

Definition at line 41 of file class.ilSumOfFileSizesTooLargeInteraction.php.

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

42  {
43  global $DIC;
44  $this->lng = $DIC->language();
45  $this->lng->loadLanguageModule('background_tasks');
46  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ canBeSkipped()

ilSumOfFileSizesTooLargeInteraction::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.

You must return a valid Value then,

Parameters
Value[]$input The input value of this task.
See also
getSkippedValue.

Implements ILIAS\BackgroundTasks\Task\UserInteraction.

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

94  : bool
95  {
96  $copy_definition = $input[0];
97  // skip the user interaction if the adherence to the global limit for the sum of file sizes
98  // hasn't been violated (as this interaction is used as an error message and mustn't be
99  // shown when everything is fine))
100  return (bool) $copy_definition->getAdheresToLimit()->getValue();
101  }

◆ getInputTypes()

ilSumOfFileSizesTooLargeInteraction::getInputTypes ( )
Returns
SingleType[]

Implements ILIAS\BackgroundTasks\Task.

Definition at line 51 of file class.ilSumOfFileSizesTooLargeInteraction.php.

51  : array
52  {
53  return [
54  new SingleType(ilCopyDefinition::class),
55  ];
56  }

◆ getMessage()

ilSumOfFileSizesTooLargeInteraction::getMessage ( array  $input)
Parameters
Value[]$input The input value of this task.
Returns
string $message enables the UserInteraction to be used as a notification (for example when a bucket fails due to an expected condition not being met)

Implements ILIAS\BackgroundTasks\Task\UserInteraction.

Definition at line 88 of file class.ilSumOfFileSizesTooLargeInteraction.php.

References ILIAS\Repository\lng().

88  : string
89  {
90  return $this->lng->txt('ui_msg_files_violate_maxsize');
91  }
+ Here is the call graph for this function:

◆ getOptions()

ilSumOfFileSizesTooLargeInteraction::getOptions ( array  $input)
Returns
mixed[]

Implements ILIAS\BackgroundTasks\Task\UserInteraction.

Definition at line 82 of file class.ilSumOfFileSizesTooLargeInteraction.php.

82  : array
83  {
84  return [];
85  }

◆ getOutputType()

ilSumOfFileSizesTooLargeInteraction::getOutputType ( )

Implements ILIAS\BackgroundTasks\Task.

Definition at line 58 of file class.ilSumOfFileSizesTooLargeInteraction.php.

58  : Type
59  {
60  return new SingleType(ilCopyDefinition::class);
61  }

◆ getRemoveOption()

ilSumOfFileSizesTooLargeInteraction::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();

Implements ILIAS\BackgroundTasks\Task.

Definition at line 64 of file class.ilSumOfFileSizesTooLargeInteraction.php.

◆ getSkippedValue()

ilSumOfFileSizesTooLargeInteraction::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.

Implements ILIAS\BackgroundTasks\Task\UserInteraction.

Definition at line 104 of file class.ilSumOfFileSizesTooLargeInteraction.php.

◆ interaction()

ilSumOfFileSizesTooLargeInteraction::interaction ( array  $input,
Option  $user_selected_option,
Bucket  $bucket 
)
Parameters
Value[]$input The 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 69 of file class.ilSumOfFileSizesTooLargeInteraction.php.

References ILIAS\BackgroundTasks\Task\UserInteraction\Option\getValue(), and ILIAS\BackgroundTasks\Bucket\setState().

69  : Value
70  {
71  if ($user_selected_option->getValue() === self::OPTION_OK) {
72  // Set state to finished to stop the BackgroundTask and remove it from the popover.
73  $bucket->setState(3);
74  }
75 
76  return $input[0];
77  }
+ Here is the call graph for this function:

◆ isFinal()

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

Implements ILIAS\BackgroundTasks\Task\UserInteraction.

Definition at line 110 of file class.ilSumOfFileSizesTooLargeInteraction.php.

110  : bool
111  {
112  return false;
113  }

Field Documentation

◆ $lng

ilLanguage ilSumOfFileSizesTooLargeInteraction::$lng
protected

◆ OPTION_OK

const ilSumOfFileSizesTooLargeInteraction::OPTION_OK = 'ok'
private

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