ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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
Version
$Id$

Definition at line 13 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 98 of file class.ilSurveyExporter.php.

References array.

99  {
100  if ($a_entity == "svy")
101  {
102  return array(
103  "4.1.0" => array(
104  "namespace" => "http://www.ilias.de/Modules/Survey/htlm/4_1",
105  "xsd_file" => "ilias_svy_4_1.xsd",
106  "uses_dataset" => false,
107  "min" => "4.1.0",
108  "max" => "")
109  );
110  }
111  else
112  {
113  return array(
114  "5.1.0" => array(
115  "namespace" => "http://www.ilias.de/Modules/Survey/svy/5_1",
116  "xsd_file" => "ilias_svy_5_1.xsd",
117  "uses_dataset" => true,
118  "min" => "5.1.0",
119  "max" => "")
120  );
121  }
122  }
Create styles array
The data for the language used.

◆ 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 72 of file class.ilSurveyExporter.php.

References array.

73  {
74  if ($a_entity == "svy")
75  {
76  return array (
77  array(
78  "component" => "Modules/Survey",
79  "entity" => "svy_quest_skill",
80  "ids" => $a_ids),
81  array(
82  "component" => "Modules/Survey",
83  "entity" => "svy_skill_threshold",
84  "ids" => $a_ids)
85  );
86 
87  }
88  return array();
89  }
Create styles array
The data for the language used.

◆ 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 40 of file class.ilSurveyExporter.php.

References $GLOBALS, and ilUtil\unzip().

41  {
42  if ($a_entity == "svy")
43  {
44  include_once './Modules/Survey/classes/class.ilObjSurvey.php';
45  $svy = new ilObjSurvey($a_id, false);
46  $svy->loadFromDb();
47 
48  include_once("./Modules/Survey/classes/class.ilSurveyExport.php");
49  $svy_exp = new ilSurveyExport($svy, 'xml');
50  $zip = $svy_exp->buildExportFile();
51 
52  // Unzip, since survey deletes this dir
53  ilUtil::unzip($zip);
54 
55  $GLOBALS['ilLog']->write(__METHOD__ . ': Created zip file ' . $zip);
56  return "";
57  }
58  else
59  {
60  return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
61  }
62  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
Export class for surveys.
+ Here is the call graph for this function:

◆ init()

ilSurveyExporter::init ( )

Initialisation.

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

24  {
25  include_once("./Modules/Survey/classes/class.ilSurveyDataSet.php");
26  $this->ds = new ilSurveyDataSet();
27  $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
28  $this->ds->setDSPrefix("ds");
29  }
Survey Data set class.

Field Documentation

◆ $ds

ilSurveyExporter::$ds
private

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


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