ILIAS  release_8 Revision v8.23
ilSurveyExporter 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 ilSurveyExporter:
+ Collaboration diagram for ilSurveyExporter:

Public Member Functions

 init ()
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 
 getValidSchemaVersions (string $a_entity)
 
- 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 Attributes

ilSurveyDataSet $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

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

Member Function Documentation

◆ getValidSchemaVersions()

ilSurveyExporter::getValidSchemaVersions ( string  $a_entity)

Definition at line 90 of file class.ilSurveyExporter.php.

92  : array {
93  if ($a_entity === "svy") {
94  return array(
95  "4.1.0" => array(
96  "namespace" => "https://www.ilias.de/Modules/Survey/htlm/4_1",
97  "xsd_file" => "ilias_svy_4_1.xsd",
98  "uses_dataset" => false,
99  "min" => "4.1.0",
100  "max" => "")
101  );
102  } else {
103  return array(
104  "5.1.0" => array(
105  "namespace" => "https://www.ilias.de/Modules/Survey/svy/5_1",
106  "xsd_file" => "ilias_svy_5_1.xsd",
107  "uses_dataset" => true,
108  "min" => "5.1.0",
109  "max" => "")
110  );
111  }
112  }

◆ getXmlExportTailDependencies()

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

Definition at line 66 of file class.ilSurveyExporter.php.

70  : array {
71  if ($a_entity === "svy") {
72  return array(
73  array(
74  "component" => "Modules/Survey",
75  "entity" => "svy_quest_skill",
76  "ids" => $a_ids),
77  array(
78  "component" => "Modules/Survey",
79  "entity" => "svy_skill_threshold",
80  "ids" => $a_ids),
81  array(
82  "component" => "Services/Object",
83  "entity" => "common",
84  "ids" => $a_ids)
85  );
86  }
87  return array();
88  }

◆ getXmlRepresentation()

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

Definition at line 35 of file class.ilSurveyExporter.php.

References $GLOBALS, ilFileUtils\makeDirParents(), and ilFileUtils\unzip().

39  : string {
40  if ($a_entity === "svy") {
41  $svy = new ilObjSurvey($a_id, false);
42  $svy->loadFromDb();
43 
44  $svy_exp = new ilSurveyExport($svy, 'xml');
45  $zip = $svy_exp->buildExportFile();
46 
47  // Unzip, since survey deletes this dir
48  ilFileUtils::unzip($zip);
49 
50  // unzip does not extract the included directory
51  // Modules/Survey/set_1 anymore (since 7/2023)
52  $missing = $svy_exp->export_dir . "/" . $svy_exp->subdir .
53  "/Modules/Survey/set_1";
55 
56  // here: svy_data/svy_301/export/1698817474__0__svy_301
57  // svy_301/export/1698817474__0__svy_301/Modules/Survey/set_1
58  // svy_data/svy_301/export/1698817474__0__svy_301.zip
59  $GLOBALS['ilLog']->write(__METHOD__ . ': Created zip file ' . $zip);
60  return "";
61  } else {
62  return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id], "", true, true);
63  }
64  }
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
static unzip(string $path_to_zip_file, bool $overwrite_existing=false, bool $unpack_flat=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the call graph for this function:

◆ init()

ilSurveyExporter::init ( )

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

28  : void
29  {
30  $this->ds = new ilSurveyDataSet();
31  $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
32  $this->ds->setDSPrefix("ds");
33  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Field Documentation

◆ $ds

ilSurveyDataSet ilSurveyExporter::$ds
private

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


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