ILIAS  release_8 Revision v8.23
ilTestExporter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilTestExporter:
+ Collaboration diagram for ilTestExporter:

Public Member Functions

 init ()
 Initialisation. More...
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 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...
 
- 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)
 

Private Member Functions

 getDependingTaxonomyIds ($testObjIds)
 

Private Attributes

 $ds
 

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
string $dir_relative = ""
 
string $dir_absolute = ""
 
ilExport $exp
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Used for container export with tests

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 26 of file class.ilTestExporter.php.

Member Function Documentation

◆ getDependingTaxonomyIds()

ilTestExporter::getDependingTaxonomyIds (   $testObjIds)
private
Parameters
array$testObjIds
Returns
array $taxIds

Definition at line 91 of file class.ilTestExporter.php.

References ilObjTaxonomy\getUsageOfObject().

Referenced by getXmlExportTailDependencies().

91  : array
92  {
93  include_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
94 
95  $taxIds = array();
96 
97  foreach ($testObjIds as $testObjId) {
98  foreach (ilObjTaxonomy::getUsageOfObject($testObjId) as $taxId) {
99  $taxIds[$taxId] = $taxId;
100  }
101  }
102 
103  return $taxIds;
104  }
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValidSchemaVersions()

ilTestExporter::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. Please put the newest on top.

Parameters
string$a_entity
Returns
array

Definition at line 113 of file class.ilTestExporter.php.

113  : array
114  {
115  return array(
116  "4.1.0" => array(
117  "namespace" => "http://www.ilias.de/Modules/Test/htlm/4_1",
118  "xsd_file" => "ilias_tst_4_1.xsd",
119  "uses_dataset" => false,
120  "min" => "4.1.0",
121  "max" => "")
122  );
123  }

◆ getXmlExportTailDependencies()

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

Get tail dependencies.

Parameters
stringentity
stringtarget release
arrayids
Returns
array array of array with keys "component", entity", "ids"

Definition at line 59 of file class.ilTestExporter.php.

References getDependingTaxonomyIds().

59  : array
60  {
61  if ($a_entity == 'tst') {
62  $deps = array();
63 
64  $taxIds = $this->getDependingTaxonomyIds($a_ids);
65 
66  if (count($taxIds)) {
67  $deps[] = array(
68  'component' => 'Services/Taxonomy',
69  'entity' => 'tax',
70  'ids' => $taxIds
71  );
72  }
73 
74  // service settings
75  $deps[] = array(
76  "component" => "Services/Object",
77  "entity" => "common",
78  "ids" => $a_ids
79  );
80 
81  return $deps;
82  }
83 
84  return parent::getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids);
85  }
getDependingTaxonomyIds($testObjIds)
+ Here is the call graph for this function:

◆ getXmlRepresentation()

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

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

References $DIC.

37  : string
38  {
39  include_once './Modules/Test/classes/class.ilObjTest.php';
40  $tst = new ilObjTest($a_id, false);
41 
42  require_once 'Modules/Test/classes/class.ilTestExportFactory.php';
43  $expFactory = new ilTestExportFactory($tst);
44  $testExport = $expFactory->getExporter('xml');
45  $zip = $testExport->buildExportFile();
46 
47  global $DIC; /* @var ILIAS\DI\Container $DIC */
48  $DIC['ilLog']->write(__METHOD__ . ': Created zip file ' . $zip);
49  return ''; // Sagt mjansen
50  }
global $DIC
Definition: feed.php:28

◆ init()

ilTestExporter::init ( )

Initialisation.

Definition at line 33 of file class.ilTestExporter.php.

33  : void
34  {
35  }

Field Documentation

◆ $ds

ilTestExporter::$ds
private

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


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