19 declare(strict_types=1);
46 $this->export_handler =
new ilExportHandlerFactory();
65 # The standard xml export is a special case. 66 # It is by default always enabled, independend of the object types returned. 67 # Therefore no object types are returned. 68 # The only exception are the special cases: Test, TestQuestionPool 79 return $this->
lng->txt(
"exp_format_dropdown-xml");
83 ilExportHandlerConsumerContextInterface
$context 85 $this->
ctrl->redirect($context->exportGUIObject(), $context->exportGUIObject()::CMD_EXPORT_XML);
89 ilExportHandlerConsumerContextInterface
$context,
90 ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers
92 $object_id = $this->data_factory->objId($context->exportObject()->getId());
93 $keys = $this->export_handler->repository()->key()->collection();
94 foreach ($file_identifiers as $file_identifier) {
95 $keys = $keys->withElement($this->export_handler->repository()->key()->handler()
96 ->withObjectId($object_id)
97 ->withResourceIdSerialized($file_identifier->getIdentifier()));
99 $this->export_handler->repository()->handler()->deleteElements(
101 $this->export_handler->repository()->stakeholder()->handler()->withOwnerId($this->
user->getId())
106 ilExportHandlerConsumerContextInterface
$context,
107 ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers
109 $object_id = $this->data_factory->objId($context->exportObject()->getId());
110 $keys = $this->export_handler->repository()->key()->collection();
111 foreach ($file_identifiers as $file_identifier) {
112 $keys = $keys->withElement($this->export_handler->repository()->key()->handler()
113 ->withObjectId($object_id)
114 ->withResourceIdSerialized($file_identifier->getIdentifier()));
116 $elements = $this->export_handler->repository()->handler()->getElements($keys);
117 foreach ($elements as $element) {
118 $element->getIRSS()->download();
124 ilExportHandlerConsumerFileIdentifierInterface $file_identifier
127 $keys = $this->export_handler->repository()->key()->collection()
128 ->withElement($this->export_handler->repository()->key()->handler()
129 ->withObjectId($object_id)
130 ->withResourceIdSerialized($file_identifier->getIdentifier()));
131 $elements = $this->export_handler->repository()->handler()->getElements($keys);
132 foreach ($elements as $element) {
133 $element->getIRSS()->download();
138 ilExportHandlerConsumerContextInterface
$context 139 ): ilExportHandlerFileInfoCollectionInterface {
140 $object_id = $this->data_factory->objId($context->exportObject()->getId());
145 ilExportHandlerConsumerContextInterface
$context,
146 ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers
147 ): ilExportHandlerFileInfoCollectionInterface {
148 $object_id = $this->data_factory->objId($context->exportObject()->getId());
149 return $this->
buildElements($context, $object_id, $file_identifiers->toStringArray());
153 ilExportHandlerConsumerContextInterface
$context,
155 array $file_identifiers,
156 bool $all_elements =
false 157 ): ilExportHandlerFileInfoCollectionInterface {
158 $keys = $this->export_handler->repository()->key()->collection();
160 $keys = $keys->withElement($this->export_handler->repository()->key()->handler()->withObjectId($object_id));
162 if (!$all_elements) {
163 foreach ($file_identifiers as
$id) {
164 $keys = $keys->withElement($this->export_handler->repository()->key()->handler()
165 ->withObjectId($object_id)
166 ->withResourceIdSerialized($id));
169 $elements = $this->export_handler->repository()->handler()->getElements($keys);
170 $object_id = $this->data_factory->objId($context->exportObject()->getId());
171 $collection_builder = $context->fileCollectionBuilder();
172 foreach ($elements as $element) {
173 $collection_builder = $collection_builder->withResourceIdentifier(
174 $element->getIRSSInfo()->getResourceId(),
179 return $collection_builder->collection();
getFileSelection(ilExportHandlerConsumerContextInterface $context, ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers)
user()
Get the current user.
onDownloadWithLink(ReferenceId $reference_id, ilExportHandlerConsumerFileIdentifierInterface $file_identifier)
buildElements(ilExportHandlerConsumerContextInterface $context, ObjectId $object_id, array $file_identifiers, bool $all_elements=false)
ilExportHandlerFactoryInterface $export_handler
Customizing of pimple-DIC for ILIAS.
onDownloadFiles(ilExportHandlerConsumerContextInterface $context, ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers)
onDeleteFiles(ilExportHandlerConsumerContextInterface $context, ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers)
ilDataFactory $data_factory
getFiles(ilExportHandlerConsumerContextInterface $context)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
language()
Get interface to the i18n service.
getSupportedRepositoryObjectTypes()
onExportOptionSelected(ilExportHandlerConsumerContextInterface $context)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
ctrl()
Get the interface to the control structure.