ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilSurveyExporter Class Reference

Used for container export with tests. More...

+ Inheritance diagram for ilSurveyExporter:
+ Collaboration diagram for ilSurveyExporter:

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

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

Member Function Documentation

◆ getValidSchemaVersions()

ilSurveyExporter::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

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

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

◆ getXmlExportTailDependencies()

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

Get tail dependencies.

Parameters
string$a_enitityentity
string$a_target_releasetarget release
array$a_idsids
Returns
array array of array with keys "component", entity", "ids"

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

65  {
66  if ($a_entity == "svy") {
67  return array(
68  array(
69  "component" => "Modules/Survey",
70  "entity" => "svy_quest_skill",
71  "ids" => $a_ids),
72  array(
73  "component" => "Modules/Survey",
74  "entity" => "svy_skill_threshold",
75  "ids" => $a_ids),
76  array(
77  "component" => "Services/Object",
78  "entity" => "common",
79  "ids" => $a_ids)
80  );
81  }
82  return array();
83  }

◆ getXmlRepresentation()

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

Get xml representation.

Parameters
string$a_enitityentity
string$a_target_releasetarget release
string$a_idid
Returns
string xml string

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

References $GLOBALS, and ilUtil\unzip().

38  {
39  if ($a_entity == "svy") {
40  $svy = new ilObjSurvey($a_id, false);
41  $svy->loadFromDb();
42 
43  $svy_exp = new ilSurveyExport($svy, 'xml');
44  $zip = $svy_exp->buildExportFile();
45 
46  // Unzip, since survey deletes this dir
47  ilUtil::unzip($zip);
48 
49  $GLOBALS['ilLog']->write(__METHOD__ . ': Created zip file ' . $zip);
50  return "";
51  } else {
52  return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
53  }
54  }
Class ilObjSurvey.
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
Export class for surveys.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the call graph for this function:

◆ init()

ilSurveyExporter::init ( )

Initialisation.

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

22  {
23  $this->ds = new ilSurveyDataSet();
24  $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
25  $this->ds->setDSPrefix("ds");
26  }
Survey Data set class.

Field Documentation

◆ $ds

ilSurveyExporter::$ds
private

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


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