ILIAS  release_7 Revision v7.30-3-g800a261c036
ilTestExporter Class Reference

Used for container export with tests. More...

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

Public Member Functions

 init ()
 Initialisation. More...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_id)
 Get xml representation. More...
 
 getXmlExportTailDependencies ($a_entity, $a_target_release, $a_ids)
 Get tail dependencies. More...
 
 getValidSchemaVersions ($a_entity)
 Returns schema versions that the component can export to. More...
 
- Public Member Functions inherited from ilXmlExporter
 __construct ()
 Constructor. More...
 
 setExport (ilExport $a_exp)
 Set export object. More...
 
 getExport ()
 Get export. More...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_id)
 Get xml representation. More...
 
 init ()
 
 setExportDirectories ($a_dir_relative, $a_dir_absolute)
 Export directories. More...
 
 getRelativeExportDirectory ()
 Get relative export directory. More...
 
 getAbsoluteExportDirectory ()
 Get absolute export directory. More...
 
 getXmlExportHeadDependencies ($a_entity, $a_target_release, $a_ids)
 Get head dependencies. More...
 
 getXmlExportTailDependencies ($a_entity, $a_target_release, $a_ids)
 Get tail dependencies. More...
 
 getValidSchemaVersions ($a_entity)
 Returns schema versions that the component can export to. More...
 
 determineSchemaVersion ($a_entity, $a_target_release)
 Determine schema version. More...
 

Private Member Functions

 getDependingTaxonomyIds ($testObjIds)
 

Private Attributes

 $ds
 

Additional Inherited Members

- Static Public Member Functions inherited from ilXmlExporter
static lookupExportDirectory ($a_obj_type, $a_obj_id, $a_export_type='xml', $a_entity="")
 export directory lookup More...
 
- Protected Attributes inherited from ilXmlExporter
 $dir_relative
 
 $dir_absolute
 
 $exp
 

Detailed Description

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 13 of file class.ilTestExporter.php.

Member Function Documentation

◆ getDependingTaxonomyIds()

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

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

88 {
89 include_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
90
91 $taxIds = array();
92
93 foreach ($testObjIds as $testObjId) {
94 foreach (ilObjTaxonomy::getUsageOfObject($testObjId) as $taxId) {
95 $taxIds[$taxId] = $taxId;
96 }
97 }
98
99 return $taxIds;
100 }
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.

References ilObjTaxonomy\getUsageOfObject().

Referenced by getXmlExportTailDependencies().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValidSchemaVersions()

ilTestExporter::getValidSchemaVersions (   $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.

Returns

Reimplemented from ilXmlExporter.

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

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

◆ getXmlExportTailDependencies()

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

Get tail dependencies.

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

Reimplemented from ilXmlExporter.

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

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

References getDependingTaxonomyIds().

+ Here is the call graph for this function:

◆ getXmlRepresentation()

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

Get xml representation.

Parameters
stringentity
stringschema version
stringid
Returns
string xml string

Reimplemented from ilXmlExporter.

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

34 {
35 include_once './Modules/Test/classes/class.ilObjTest.php';
36 $tst = new ilObjTest($a_id, false);
37
38 require_once 'Modules/Test/classes/class.ilTestExportFactory.php';
39 $expFactory = new ilTestExportFactory($tst);
40 $testExport = $expFactory->getExporter('xml');
41 $zip = $testExport->buildExportFile();
42
43 global $DIC; /* @var ILIAS\DI\Container $DIC */
44 $DIC['ilLog']->write(__METHOD__ . ': Created zip file ' . $zip);
45 }
global $DIC
Definition: goto.php:24

References $DIC.

◆ init()

ilTestExporter::init ( )

Initialisation.

Reimplemented from ilXmlExporter.

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

21 {
22 }

Field Documentation

◆ $ds

ilTestExporter::$ds
private

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


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