ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTestExportOptionXMLRES Class Reference
+ Inheritance diagram for ilTestExportOptionXMLRES:
+ Collaboration diagram for ilTestExportOptionXMLRES:

Public Member Functions

 init (Container $DIC)
 
 getExportType ()
 
 getExportOptionId ()
 
 getSupportedRepositoryObjectTypes ()
 
 getLabel ()
 
 onDeleteFiles (ilExportHandlerConsumerContextInterface $context, ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers)
 
 onDownloadFiles (ilExportHandlerConsumerContextInterface $context, ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers)
 
 onDownloadWithLink (ReferenceId $reference_id, ilExportHandlerConsumerFileIdentifierInterface $file_identifier)
 
 getFiles (ilExportHandlerConsumerContextInterface $context)
 
 getFileSelection (ilExportHandlerConsumerContextInterface $context, ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers)
 
 onExportOptionSelected (ilExportHandlerConsumerContextInterface $context)
 
- Public Member Functions inherited from ILIAS\Export\ExportHandler\Consumer\ExportOption\BasicHandler
 __construct ()
 
 isObjectSupported (ObjectId $object_id)
 
 isPublicAccessPossible ()
 

Data Fields

const OPTIONS_ID = 'test_exp_option_xmlres'
 

Protected Member Functions

 buildElements (ilExportHandlerConsumerContextInterface $context, ObjectId $object_id, ?array $file_identifiers=null)
 

Private Attributes

ilLanguage $lng
 
ResourceStorage $irss
 
DataFactory $data_factory
 
DBRepository $repository
 

Detailed Description

Definition at line 35 of file class.ilTestExportOptionXMLRES.php.

Member Function Documentation

◆ buildElements()

ilTestExportOptionXMLRES::buildElements ( ilExportHandlerConsumerContextInterface  $context,
ObjectId  $object_id,
?array  $file_identifiers = null 
)
protected

Definition at line 131 of file class.ilTestExportOptionXMLRES.php.

References null, ILIAS\UI\examples\Deck\repository(), and ILIAS\Data\ObjectId\toInt().

Referenced by getFiles(), and getFileSelection().

135  : ilExportHandlerFileInfoCollectionInterface {
136  if ($file_identifiers === null) {
137  $file_identifiers = array_map(
138  static fn(array $v): string => $v['rid'],
139  $this->repository->getFor($object_id->toInt())
140  );
141  }
142  $collection_builder = $context->fileCollectionBuilder();
143  foreach ($file_identifiers as $file_identifier) {
144  $collection_builder = $collection_builder->withResourceIdentifier(
145  $this->irss->manage()->find($file_identifier),
146  $object_id,
147  $this
148  );
149  }
150  return $collection_builder->collection();
151  }
$context
Definition: webdav.php:31
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExportOptionId()

ilTestExportOptionXMLRES::getExportOptionId ( )

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

57  : string
58  {
59  return self::OPTIONS_ID;
60  }

◆ getExportType()

ilTestExportOptionXMLRES::getExportType ( )

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

52  : string
53  {
54  return 'ZIP Results';
55  }

◆ getFiles()

ilTestExportOptionXMLRES::getFiles ( ilExportHandlerConsumerContextInterface  $context)

Definition at line 105 of file class.ilTestExportOptionXMLRES.php.

References buildElements().

107  : ilExportHandlerFileInfoCollectionInterface {
108  return $this->buildElements(
109  $context,
110  $this->data_factory->objId($context->exportObject()->getId())
111  );
112  }
$context
Definition: webdav.php:31
buildElements(ilExportHandlerConsumerContextInterface $context, ObjectId $object_id, ?array $file_identifiers=null)
+ Here is the call graph for this function:

◆ getFileSelection()

ilTestExportOptionXMLRES::getFileSelection ( ilExportHandlerConsumerContextInterface  $context,
ilExportHandlerConsumerFileIdentifierCollectionInterface  $file_identifiers 
)

Definition at line 114 of file class.ilTestExportOptionXMLRES.php.

References buildElements().

117  : ilExportHandlerFileInfoCollectionInterface {
118  return $this->buildElements(
119  $context,
120  $this->data_factory->objId($context->exportObject()->getId()),
121  $file_identifiers->toStringArray()
122  );
123  }
$context
Definition: webdav.php:31
buildElements(ilExportHandlerConsumerContextInterface $context, ObjectId $object_id, ?array $file_identifiers=null)
+ Here is the call graph for this function:

◆ getLabel()

ilTestExportOptionXMLRES::getLabel ( )

Definition at line 67 of file class.ilTestExportOptionXMLRES.php.

References ILIAS\Repository\lng().

67  : string
68  {
69  $this->lng->loadLanguageModule('exp');
70  $this->lng->loadLanguageModule('assessment');
71  return $this->lng->txt("exp_format_dropdown-xml") . " (" . $this->lng->txt('ass_create_export_file_with_results') . ")";
72  }
+ Here is the call graph for this function:

◆ getSupportedRepositoryObjectTypes()

ilTestExportOptionXMLRES::getSupportedRepositoryObjectTypes ( )

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

62  : array
63  {
64  return ['tst'];
65  }

◆ init()

ilTestExportOptionXMLRES::init ( Container  $DIC)

Definition at line 43 of file class.ilTestExportOptionXMLRES.php.

References ILIAS\Repository\lng(), and ILIAS\UI\examples\Deck\repository().

45  : void {
46  $this->lng = $DIC['lng'];
47  $this->irss = $DIC['resource_storage'];
48  $this->data_factory = new DataFactory();
49  $this->repository = TestDIC::dic()['exportimport.repository'];
50  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ onDeleteFiles()

ilTestExportOptionXMLRES::onDeleteFiles ( ilExportHandlerConsumerContextInterface  $context,
ilExportHandlerConsumerFileIdentifierCollectionInterface  $file_identifiers 
)

Definition at line 74 of file class.ilTestExportOptionXMLRES.php.

References ILIAS\UI\examples\Deck\repository().

77  : void {
78  $object_id = new ObjectId($context->exportObject()->getId());
79  foreach ($file_identifiers as $file_identifier) {
80  $rid = $this->irss->manage()->find($file_identifier->getIdentifier());
81  $this->repository->delete($rid);
82  $this->irss->manage()->remove($rid, new ResultsExportStakeholder());
83  }
84  }
$context
Definition: webdav.php:31
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ onDownloadFiles()

ilTestExportOptionXMLRES::onDownloadFiles ( ilExportHandlerConsumerContextInterface  $context,
ilExportHandlerConsumerFileIdentifierCollectionInterface  $file_identifiers 
)

Definition at line 86 of file class.ilTestExportOptionXMLRES.php.

89  : void {
90  $object_id = new ObjectId($context->exportObject()->getId());
91  foreach ($file_identifiers as $file_identifier) {
92  $this->irss->consume()->download(
93  $this->irss->manage()->find($file_identifier->getIdentifier())
94  )->run();
95  }
96  }
$context
Definition: webdav.php:31

◆ onDownloadWithLink()

ilTestExportOptionXMLRES::onDownloadWithLink ( ReferenceId  $reference_id,
ilExportHandlerConsumerFileIdentifierInterface  $file_identifier 
)

Definition at line 98 of file class.ilTestExportOptionXMLRES.php.

101  : void {
102  $this->irss->consume()->download($reference_id)->run();
103  }

◆ onExportOptionSelected()

ilTestExportOptionXMLRES::onExportOptionSelected ( ilExportHandlerConsumerContextInterface  $context)

Definition at line 125 of file class.ilTestExportOptionXMLRES.php.

127  : void {
128  $context->exportGUIObject()->createTestExportWithResults();
129  }
$context
Definition: webdav.php:31

Field Documentation

◆ $data_factory

DataFactory ilTestExportOptionXMLRES::$data_factory
private

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

◆ $irss

ResourceStorage ilTestExportOptionXMLRES::$irss
private

Definition at line 39 of file class.ilTestExportOptionXMLRES.php.

◆ $lng

ilLanguage ilTestExportOptionXMLRES::$lng
private

Definition at line 38 of file class.ilTestExportOptionXMLRES.php.

◆ $repository

DBRepository ilTestExportOptionXMLRES::$repository
private

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

◆ OPTIONS_ID

const ilTestExportOptionXMLRES::OPTIONS_ID = 'test_exp_option_xmlres'

Definition at line 37 of file class.ilTestExportOptionXMLRES.php.


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