ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ilSurveyExporter Class Reference

Used for container export with tests. 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)
 

Protected Attributes

InternalDomainService $domain
 
- Protected Attributes inherited from ilXmlExporter
ilExport $exp
 

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="")
 

Detailed Description

Used for container export with tests.

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

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

Member Function Documentation

◆ getValidSchemaVersions()

ilSurveyExporter::getValidSchemaVersions ( string  $a_entity)

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

114  : array {
115  if ($a_entity === "svy") {
116  return array(
117  "4.1.0" => array(
118  "namespace" => "https://www.ilias.de/Modules/Survey/htlm/4_1",
119  "xsd_file" => "ilias_svy_4_1.xsd",
120  "uses_dataset" => false,
121  "min" => "4.1.0",
122  "max" => "")
123  );
124  } else {
125  return array(
126  "5.1.0" => array(
127  "namespace" => "https://www.ilias.de/Modules/Survey/svy/5_1",
128  "xsd_file" => "ilias_svy_5_1.xsd",
129  "uses_dataset" => true,
130  "min" => "5.1.0",
131  "max" => "")
132  );
133  }
134  }

◆ getXmlExportTailDependencies()

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

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

References $id.

76  : array {
77  if ($a_entity === "svy") {
78  $dependencies = [
79  [
80  "component" => "components/ILIAS/Survey",
81  "entity" => "svy_quest_skill",
82  "ids" => $a_ids
83  ],
84  [
85  "component" => "components/ILIAS/Survey",
86  "entity" => "svy_skill_threshold",
87  "ids" => $a_ids
88  ],
89  [
90  "component" => "components/ILIAS/ILIASObject",
91  "entity" => "common",
92  "ids" => $a_ids
93  ]
94  ];
95 
96  $md_ids = [];
97  foreach ($a_ids as $id) {
98  $md_ids[] = $id . ":0:svy";
99  }
100  if ($md_ids !== []) {
101  $dependencies[] = [
102  "component" => "components/ILIAS/MetaData",
103  "entity" => "md",
104  "ids" => $md_ids
105  ];
106  }
107  return $dependencies;
108  }
109  return array();
110  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

◆ getXmlRepresentation()

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

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

References $GLOBALS, and ilFileUtils\makeDirParents().

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

◆ init()

ilSurveyExporter::init ( )

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

References $DIC.

31  : void
32  {
33  global $DIC;
34 
35  $this->domain = $DIC->survey()->internal()->domain();
36  $this->ds = new ilSurveyDataSet();
37  $this->ds->initByExporter($this);
38  $this->ds->setDSPrefix("ds");
39  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:26

Field Documentation

◆ $domain

InternalDomainService ilSurveyExporter::$domain
protected

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

◆ $ds

ilSurveyDataSet ilSurveyExporter::$ds
private

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


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