ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilTestQuestionPoolExporter Class Reference
+ Inheritance diagram for ilTestQuestionPoolExporter:
+ Collaboration diagram for ilTestQuestionPoolExporter:

Public Member Functions

 init ()
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 Returns the final XML content for the question pool. More...
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Collects export tail dependencies for the question pool. More...
 
 getValidSchemaVersions (string $a_entity)
 Returns schema versions that the component can export to. More...
 
- Public Member Functions inherited from ilXmlExporter
 __construct ()
 
 setExport (ilExport $a_exp)
 
 getExport ()
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 init ()
 
 setExportDirectories (string $a_dir_relative, string $a_dir_absolute)
 
 getRelativeExportDirectory ()
 
 getAbsoluteExportDirectory ()
 
 getXmlExportHeadDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get head dependencies. More...
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get tail dependencies. More...
 
 getValidSchemaVersions (string $a_entity)
 Returns schema versions that the component can export to. More...
 
 determineSchemaVersion (string $a_entity, string $a_target_release)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilXmlExporter
static lookupExportDirectory (string $a_obj_type, int $a_obj_id, string $a_export_type='xml', string $a_entity="")
 
- Protected Attributes inherited from ilXmlExporter
ilExport $exp
 

Detailed Description

Definition at line 24 of file class.ilTestQuestionPoolExporter.php.

Member Function Documentation

◆ getValidSchemaVersions()

ilTestQuestionPoolExporter::getValidSchemaVersions ( string  $a_entity)

Returns schema versions that the component can export to.

ILIAS chooses the first one, that has min/max constraints which fit to the target release.

Reimplemented from ilXmlExporter.

Definition at line 87 of file class.ilTestQuestionPoolExporter.php.

87 : array
88 {
89 return [
90 '4.1.0' => [
91 'namespace' => 'http://www.ilias.de/Modules/TestQuestionPool/htlm/4_1',
92 'xsd_file' => 'ilias_qpl_4_1.xsd',
93 'uses_dataset' => false,
94 'min' => '4.1.0',
95 'max' => ''
96 ]
97 ];
98 }

◆ getXmlExportTailDependencies()

ilTestQuestionPoolExporter::getXmlExportTailDependencies ( string  $a_entity,
string  $a_target_release,
array  $a_ids 
)

Collects export tail dependencies for the question pool.

The export framework calls this method before getXmlRepresentation(). Therefore this method only prepares and processes the export in memory using the export context. The export context is created if it does not exist yet.

Reimplemented from ilXmlExporter.

Definition at line 61 of file class.ilTestQuestionPoolExporter.php.

61 : array
62 {
63 if ($a_entity !== 'qpl') {
64 throw new InvalidArgumentException("Invalid entity for question pool export: {$a_entity}");
65 }
66
67 // If the default export option was used, the context is not initialized yet.
68 if (
69 !$this->context_holder->exists()
70 || $this->context_holder->get()->getPhase() !== ExportPhase::Init
71 ) {
72 $this->initExportContext(
73 'components/ILIAS/TestQuestionPool',
74 $a_target_release,
75 $a_entity,
76 $a_ids
77 );
78 }
79
80 return $this->processExport()->getDependencies();
81 }
initExportContext(string $component, string $target_release, string $type, array $object_ids, string $option='')
processExport()
Processes the export in memory using the request export context.

References ILIAS\TestQuestionPool\ExportImport\Foundation\Export\initExportContext(), and ILIAS\TestQuestionPool\ExportImport\Foundation\Export\processExport().

+ Here is the call graph for this function:

◆ getXmlRepresentation()

ilTestQuestionPoolExporter::getXmlRepresentation ( string  $a_entity,
string  $a_schema_version,
string  $a_id 
)

Returns the final XML content for the question pool.

This method is called after getXmlExportTailDependencies(). At this point the export writer and export directory are available, so the preprocessed export can be written to disk and returned as xml.

Reimplemented from ilXmlExporter.

Definition at line 45 of file class.ilTestQuestionPoolExporter.php.

45 : string
46 {
47 if ($a_entity !== 'qpl') {
48 throw new InvalidArgumentException("Invalid entity for question pool export: {$a_entity}");
49 }
50
51 return $this->finalizeExport()->getContent();
52 }
finalizeExport()
Finalizes the export by setting the path info and writer and calling the write phase of the exporter.

References ILIAS\TestQuestionPool\ExportImport\Foundation\Export\finalizeExport().

+ Here is the call graph for this function:

◆ init()

ilTestQuestionPoolExporter::init ( )

Reimplemented from ilXmlExporter.

Definition at line 28 of file class.ilTestQuestionPoolExporter.php.

28 : void
29 {
30 $local_dic = QuestionPoolDIC::dic();
31
32 $this->export_handler = new ExportHandler();
33 $this->context_holder = $local_dic['exportimport.export_context_holder'];
34 $this->exporter = $local_dic['exportimport.exporter'];
35 $this->logger = $local_dic['exportimport.logging']();
36 }

References ILIAS\Repository\logger().

+ Here is the call graph for this function:

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