ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\MediaCast\BackgroundTasks\DownloadAllBackgroundTask Class Reference

Download all items. More...

+ Collaboration diagram for ILIAS\MediaCast\BackgroundTasks\DownloadAllBackgroundTask:

Public Member Functions

 __construct (int $a_usr_id, int $a_mcst_ref_id, int $a_mcst_id)
 
 run ()
 

Protected Attributes

int $mcst_ref_id = 0
 
int $mcst_id = 0
 
int $user_id = null
 
ILIAS BackgroundTasks Task TaskFactory $task_factory = null
 
ILIAS BackgroundTasks TaskManager $task_manager = null
 
ilLanguage $lng
 

Private Attributes

ilLogger $logger = null
 

Detailed Description

Download all items.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 28 of file DownloadAllBackgroundTask.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MediaCast\BackgroundTasks\DownloadAllBackgroundTask::__construct ( int  $a_usr_id,
int  $a_mcst_ref_id,
int  $a_mcst_id 
)

Definition at line 38 of file DownloadAllBackgroundTask.php.

42 {
43 global $DIC;
44
45 $this->user_id = $a_usr_id;
46 $this->mcst_ref_id = $a_mcst_ref_id;
47 $this->mcst_id = $a_mcst_id;
48
49 $this->task_factory = $DIC->backgroundTasks()->taskFactory();
50 $this->task_manager = $DIC->backgroundTasks()->taskManager();
51 $this->logger = $DIC->logger()->mcst();
52 }
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ run()

ILIAS\MediaCast\BackgroundTasks\DownloadAllBackgroundTask::run ( )

Definition at line 54 of file DownloadAllBackgroundTask.php.

54 : bool
55 {
56 $bucket = new BasicBucket();
57 $bucket->setUserId($this->user_id);
58
59 $this->logger->debug("* Create task 'collect_data_job' using the following values:");
60 $this->logger->debug("job class = " . DownloadAllCollectFilesJob::class);
61 $this->logger->debug("mcst_id = " . $this->mcst_id . ", mcst_ref_id = " . $this->mcst_ref_id . ", user_id = " . (int) $this->user_id);
62
63 $collect_data_job = $this->task_factory->createTask(
64 DownloadAllCollectFilesJob::class,
65 [
66 (int) $this->user_id,
67 (int) $this->mcst_ref_id
68 ]
69 );
70
71 $this->logger->debug("* Create task 'zip job' using the following values:");
72 $this->logger->debug("job class = " . DownloadAllZipJob::class);
73 $this->logger->debug("sending as input the task called->collect_data_job");
74
75 $zip_job = $this->task_factory->createTask(DownloadAllZipJob::class, [$collect_data_job]);
76
77 $download_name = \ilFileUtils::getASCIIFilename(\ilObject::_lookupTitle($this->mcst_id));
78 $bucket->setTitle($download_name);
79
80 $this->logger->debug("* Create task 'download_interaction' using the following values:");
81 $this->logger->debug("job class = " . DownloadAllZipInteraction::class);
82 $this->logger->debug("download_name which is the same as bucket title = " . $download_name . " + the zip_job task");
83 // see comments here -> https://github.com/leifos-gmbh/ILIAS/commit/df6fc44a4c85da33bd8dd5b391a396349e7fa68f
84 $download_interaction = $this->task_factory->createTask(DownloadAllZipInteraction::class, [$zip_job, $download_name]);
85
86 //download name
87 $bucket->setTask($download_interaction);
88 $this->task_manager->run($bucket);
89 return true;
90 }
static getASCIIFilename(string $a_filename)
static _lookupTitle(int $obj_id)

References ilObject\_lookupTitle(), ilFileUtils\getASCIIFilename(), and ILIAS\Repository\logger().

+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ILIAS\MediaCast\BackgroundTasks\DownloadAllBackgroundTask::$lng
protected

Definition at line 35 of file DownloadAllBackgroundTask.php.

◆ $logger

ilLogger ILIAS\MediaCast\BackgroundTasks\DownloadAllBackgroundTask::$logger = null
private

Definition at line 36 of file DownloadAllBackgroundTask.php.

◆ $mcst_id

int ILIAS\MediaCast\BackgroundTasks\DownloadAllBackgroundTask::$mcst_id = 0
protected

Definition at line 31 of file DownloadAllBackgroundTask.php.

◆ $mcst_ref_id

int ILIAS\MediaCast\BackgroundTasks\DownloadAllBackgroundTask::$mcst_ref_id = 0
protected

Definition at line 30 of file DownloadAllBackgroundTask.php.

◆ $task_factory

ILIAS BackgroundTasks Task TaskFactory ILIAS\MediaCast\BackgroundTasks\DownloadAllBackgroundTask::$task_factory = null
protected

Definition at line 33 of file DownloadAllBackgroundTask.php.

◆ $task_manager

ILIAS BackgroundTasks TaskManager ILIAS\MediaCast\BackgroundTasks\DownloadAllBackgroundTask::$task_manager = null
protected

Definition at line 34 of file DownloadAllBackgroundTask.php.

◆ $user_id

int ILIAS\MediaCast\BackgroundTasks\DownloadAllBackgroundTask::$user_id = null
protected

Definition at line 32 of file DownloadAllBackgroundTask.php.


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