ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSumOfWorkspaceFileSizesTooLargeInteraction Class Reference

Class ilSumOfFileSizesTooLargeInteraction. More...

+ Inheritance diagram for ilSumOfWorkspaceFileSizesTooLargeInteraction:
+ Collaboration diagram for ilSumOfWorkspaceFileSizesTooLargeInteraction:

Public Member Functions

 __construct ()
 
 getInputTypes ()
 
Returns
Type[] A list of types that are taken as input.
More...
 
 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)
 
Parameters
Value[]$input The input value of this task.
Returns
Option[] Options are buttons the user can press on this interaction.
More...
 
 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)
More...
 
 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.
Returns
bool
See also
getSkippedValue.
More...
 
 getSkippedValue (array $input)
 
Parameters
Value[]$input
Returns
Value
See also
canBeSkipped, whenever you decide to skip the UserInteraction, you have to return a valid Value to proceed.
More...
 
- 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...
 

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

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

Private Attributes

 $logger = null
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSumOfWorkspaceFileSizesTooLargeInteraction::__construct ( )

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

References $DIC, and ilLoggerFactory\getLogger().

31  {
32  global $DIC;
33  $this->logger = ilLoggerFactory::getLogger("pwsp");
34  $this->lng = $DIC->language();
35  $this->lng->loadLanguageModule('background_tasks');
36  }
$DIC
Definition: xapitoken.php:46
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

Member Function Documentation

◆ canBeSkipped()

ilSumOfWorkspaceFileSizesTooLargeInteraction::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.
Returns
bool
See also
getSkippedValue.

Implements ILIAS\BackgroundTasks\Task\UserInteraction.

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

103  : bool
104  {
105  $copy_definition = $input[0];
106  if ($copy_definition->getAdheresToLimit()->getValue()) {
107  // skip the user interaction if the adherence to the global limit for the sum of file sizes
108  // hasn't been violated (as this interaction is used as an error message and mustn't be
109  // shown when everything is fine))
110 
111  return true;
112  } else {
113  return false;
114  }
115  }

◆ getInputTypes()

ilSumOfWorkspaceFileSizesTooLargeInteraction::getInputTypes ( )

Returns
Type[] A list of types that are taken as input.

Implements ILIAS\BackgroundTasks\Task.

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

43  {
44  return [
45  new SingleType(ilWorkspaceCopyDefinition::class),
46  ];
47  }

◆ getMessage()

ilSumOfWorkspaceFileSizesTooLargeInteraction::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 94 of file class.ilSumOfWorkspaceFileSizesTooLargeInteraction.php.

References $message.

95  {
96  return $message = $this->lng->txt('ui_msg_files_violate_maxsize');
97  }
$message
Definition: xapiexit.php:14

◆ getOptions()

ilSumOfWorkspaceFileSizesTooLargeInteraction::getOptions ( array  $input)

Parameters
Value[]$input The 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 85 of file class.ilSumOfWorkspaceFileSizesTooLargeInteraction.php.

86  {
87  return array();
88  }

◆ getOutputType()

ilSumOfWorkspaceFileSizesTooLargeInteraction::getOutputType ( )

Implements ILIAS\BackgroundTasks\Task.

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

54  {
55  return new SingleType(ilWorkspaceCopyDefinition::class);
56  }

◆ 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();

Implements ILIAS\BackgroundTasks\Task.

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

◆ getSkippedValue()

ilSumOfWorkspaceFileSizesTooLargeInteraction::getSkippedValue ( array  $input)

Parameters
Value[]$input
Returns
Value
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 121 of file class.ilSumOfWorkspaceFileSizesTooLargeInteraction.php.

◆ interaction()

ilSumOfWorkspaceFileSizesTooLargeInteraction::interaction ( array  $input,
Option  $user_selected_option,
Bucket  $bucket 
)

Implements ILIAS\BackgroundTasks\Task\UserInteraction.

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

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

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

Field Documentation

◆ $lng

ilSumOfWorkspaceFileSizesTooLargeInteraction::$lng
protected

◆ $logger

ilSumOfWorkspaceFileSizesTooLargeInteraction::$logger = null
private

◆ 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: