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

Public Member Functions

 init (Container $DIC)
 
 getExportType ()
 
 getExportOptionId ()
 
 getSupportedRepositoryObjectTypes ()
 
 isPublicAccessPossible ()
 
 getLabel ()
 
 onExportOptionSelected (ilExportHandlerConsumerContextInterface $context)
 
 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)
 
- Public Member Functions inherited from ILIAS\Export\ExportHandler\Consumer\ExportOption\BasicHandler
 __construct ()
 
 isObjectSupported (ObjectId $object_id)
 
 isPublicAccessPossible ()
 

Protected Member Functions

 buildElements (ilExportHandlerConsumerContextInterface $context, ObjectId $object_id, array $file_identifiers, bool $all_elements=false)
 

Protected Attributes

ilExportHandlerFactoryInterface $export_handler
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilObjUser $user
 
ilDataFactory $data_factory
 

Detailed Description

Definition at line 36 of file class.ilExportExportOptionXML.php.

Member Function Documentation

◆ buildElements()

ilExportExportOptionXML::buildElements ( ilExportHandlerConsumerContextInterface  $context,
ObjectId  $object_id,
array  $file_identifiers,
bool  $all_elements = false 
)
protected

Definition at line 152 of file class.ilExportExportOptionXML.php.

References $id.

Referenced by getFiles(), and getFileSelection().

157  : ilExportHandlerFileInfoCollectionInterface {
158  $keys = $this->export_handler->repository()->key()->collection();
159  if ($all_elements) {
160  $keys = $keys->withElement($this->export_handler->repository()->key()->handler()->withObjectId($object_id));
161  }
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));
167  }
168  }
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(),
175  $object_id,
176  $this
177  );
178  }
179  return $collection_builder->collection();
180  }
$context
Definition: webdav.php:31
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the caller graph for this function:

◆ getExportOptionId()

ilExportExportOptionXML::getExportOptionId ( )

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

58  : string
59  {
60  return "expxml";
61  }

◆ getExportType()

ilExportExportOptionXML::getExportType ( )

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

53  : string
54  {
55  return "xml";
56  }

◆ getFiles()

ilExportExportOptionXML::getFiles ( ilExportHandlerConsumerContextInterface  $context)

Definition at line 137 of file class.ilExportExportOptionXML.php.

References buildElements().

139  : ilExportHandlerFileInfoCollectionInterface {
140  $object_id = $this->data_factory->objId($context->exportObject()->getId());
141  return $this->buildElements($context, $object_id, [], true);
142  }
$context
Definition: webdav.php:31
buildElements(ilExportHandlerConsumerContextInterface $context, ObjectId $object_id, array $file_identifiers, bool $all_elements=false)
+ Here is the call graph for this function:

◆ getFileSelection()

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

Definition at line 144 of file class.ilExportExportOptionXML.php.

References buildElements().

147  : ilExportHandlerFileInfoCollectionInterface {
148  $object_id = $this->data_factory->objId($context->exportObject()->getId());
149  return $this->buildElements($context, $object_id, $file_identifiers->toStringArray());
150  }
$context
Definition: webdav.php:31
buildElements(ilExportHandlerConsumerContextInterface $context, ObjectId $object_id, array $file_identifiers, bool $all_elements=false)
+ Here is the call graph for this function:

◆ getLabel()

ilExportExportOptionXML::getLabel ( )

Definition at line 77 of file class.ilExportExportOptionXML.php.

References ILIAS\Repository\lng().

77  : string
78  {
79  return $this->lng->txt("exp_format_dropdown-xml");
80  }
+ Here is the call graph for this function:

◆ getSupportedRepositoryObjectTypes()

ilExportExportOptionXML::getSupportedRepositoryObjectTypes ( )

Definition at line 63 of file class.ilExportExportOptionXML.php.

63  : array
64  {
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
69  return [];
70  }

◆ init()

ilExportExportOptionXML::init ( Container  $DIC)

Definition at line 44 of file class.ilExportExportOptionXML.php.

References ILIAS\Repository\ctrl(), ILIAS\DI\Container\ctrl(), ILIAS\DI\Container\language(), ILIAS\Repository\lng(), ILIAS\Repository\user(), and ILIAS\DI\Container\user().

44  : void
45  {
46  $this->export_handler = new ilExportHandlerFactory();
47  $this->lng = $DIC->language();
48  $this->ctrl = $DIC->ctrl();
49  $this->user = $DIC->user();
50  $this->data_factory = new ilDataFactory();
51  }
user()
Get the current user.
Definition: Container.php:71
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.
Definition: Container.php:95
ctrl()
Get the interface to the control structure.
Definition: Container.php:63
+ Here is the call graph for this function:

◆ isPublicAccessPossible()

ilExportExportOptionXML::isPublicAccessPossible ( )

Definition at line 72 of file class.ilExportExportOptionXML.php.

72  : bool
73  {
74  return true;
75  }

◆ onDeleteFiles()

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

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

References ILIAS\Repository\user().

91  : void {
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()));
98  }
99  $this->export_handler->repository()->handler()->deleteElements(
100  $keys,
101  $this->export_handler->repository()->stakeholder()->handler()->withOwnerId($this->user->getId())
102  );
103  }
$context
Definition: webdav.php:31
+ Here is the call graph for this function:

◆ onDownloadFiles()

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

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

108  : void {
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()));
115  }
116  $elements = $this->export_handler->repository()->handler()->getElements($keys);
117  foreach ($elements as $element) {
118  $element->getIRSS()->download();
119  }
120  }
$context
Definition: webdav.php:31

◆ onDownloadWithLink()

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

Definition at line 122 of file class.ilExportExportOptionXML.php.

References ILIAS\Data\ReferenceId\toObjectId().

125  : void {
126  $object_id = $reference_id->toObjectId();
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();
134  }
135  }
+ Here is the call graph for this function:

◆ onExportOptionSelected()

ilExportExportOptionXML::onExportOptionSelected ( ilExportHandlerConsumerContextInterface  $context)

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

References ILIAS\Repository\ctrl().

84  : void {
85  $this->ctrl->redirect($context->exportGUIObject(), $context->exportGUIObject()::CMD_EXPORT_XML);
86  }
$context
Definition: webdav.php:31
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilExportExportOptionXML::$ctrl
protected

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

◆ $data_factory

ilDataFactory ilExportExportOptionXML::$data_factory
protected

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

◆ $export_handler

ilExportHandlerFactoryInterface ilExportExportOptionXML::$export_handler
protected

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

◆ $lng

ilLanguage ilExportExportOptionXML::$lng
protected

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

◆ $user

ilObjUser ilExportExportOptionXML::$user
protected

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


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