ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilExport Class Reference
+ Inheritance diagram for ilExport:
+ Collaboration diagram for ilExport:

Public Member Functions

 __construct ()
 Default constructor. More...
 
 getConfig ($a_comp)
 Get configuration (note that configurations are optional, null may be returned!) More...
 
 _getExportFiles ($a_obj_id, $a_export_types="", $a_obj_type="")
 Get Export Files for a repository object. More...
 
 _createExportDirectory ($a_obj_id, $a_export_type="xml", $a_obj_type="")
 Create export directory. More...
 
 _generateIndexFile ($a_filename, $a_obj_id, $a_files, $a_type="")
 Generates an index.html file including links to all xml files included (for container exports) More...
 
 exportObject ($a_type, $a_id, $a_target_release="")
 Export an ILIAS object (the object type must be known by objDefinition) More...
 
 exportEntity ($a_entity, $a_id, $a_target_release, $a_component, $a_title, $a_export_dir, $a_type_for_file="")
 Export an ILIAS entity. More...
 
 processExporter ($a_comp, $a_class, $a_entity, $a_target_release, $a_id)
 Process exporter. More...
 

Static Public Member Functions

static _getValidExportSubItems ($a_ref_id)
 Get a list of subitems of a repository resource, that implement the export. More...
 
static _getLastExportFileDate ($a_obj_id, $a_type="", $a_obj_type="")
 Get date of last export file. More...
 
static _getLastExportFileInformation ($a_obj_id, $a_type="", $a_obj_type="")
 Get last export file information. More...
 
static _getExportDirectory ($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
 Get export directory for an repository object. More...
 

Static Public Attributes

static $new_file_structure = array('cat','exc','crs','sess','file','grp','frm', 'usr', 'catr', 'crsr')
 
static $export_implementer = array("tst", "lm", "glo")
 

Protected Attributes

 $configs = array()
 

Detailed Description

Definition at line 13 of file class.ilExport.php.

Constructor & Destructor Documentation

◆ __construct()

ilExport::__construct ( )

Default constructor.

Returns

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

27  {
28  }

Member Function Documentation

◆ _createExportDirectory()

ilExport::_createExportDirectory (   $a_obj_id,
  $a_export_type = "xml",
  $a_obj_type = "" 
)

Create export directory.

Definition at line 231 of file class.ilExport.php.

References $ilErr, _getExportDirectory(), ilObject\_lookupType(), and ilUtil\makeDirParents().

Referenced by ilPortfolioHTMLExport\buildExportFile(), ilWikiHTMLExport\buildExportFile(), ilObjBlogGUI\buildExportFile(), ilObjGlossary\createExportDirectory(), ilObjFileBasedLMGUI\exportHTML(), ilExportContainer\exportObject(), exportObject(), and ilOrgUnitExporter\sendAndCreateSimpleExportFile().

232  {
233  global $ilErr;
234 
235  if ($a_obj_type == "")
236  {
237  $a_obj_type = ilObject::_lookupType($a_obj_id);
238  }
239 
240  $edir = ilExport::_getExportDirectory($a_obj_id,$a_export_type,$a_obj_type);
241  ilUtil::makeDirParents($edir);
242  return true;
243  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _generateIndexFile()

ilExport::_generateIndexFile (   $a_filename,
  $a_obj_id,
  $a_files,
  $a_type = "" 
)

Generates an index.html file including links to all xml files included (for container exports)

Definition at line 249 of file class.ilExport.php.

References $file, $lng, ilObject\_lookupTitle(), ilObject\_lookupType(), and ilUtil\getStyleSheetLocation().

Referenced by ilCourseArchives\addXML().

250  {
251  global $lng;
252 
253  $lng->loadLanguageModule("export");
254 
255  if ($a_type == "")
256  {
257  $a_type = ilObject::_lookupType($a_obj_id);
258  }
259  $a_tpl = new ilTemplate("tpl.main.html", true, true);
260  $location_stylesheet = ilUtil::getStyleSheetLocation();
261  $a_tpl->setVariable("LOCATION_STYLESHEET",$location_stylesheet);
262  $a_tpl->getStandardTemplate();
263  $a_tpl->setTitle(ilObject::_lookupTitle($a_obj_id));
264  $a_tpl->setDescription($lng->txt("export_export_date").": ".
265  date('Y-m-d H:i:s', time())." (".date_default_timezone_get().")");
266  $f_tpl = new ilTemplate("tpl.export_list.html", true, true, "Services/Export");
267  foreach ($a_files as $file)
268  {
269  $f_tpl->setCurrentBlock("file_row");
270  $f_tpl->setVariable("TITLE", $file["title"]);
271  $f_tpl->setVariable("TYPE", $lng->txt("obj_".$file["type"]));
272  $f_tpl->setVariable("FILE", $file["file"]);
273  $f_tpl->parseCurrentBlock();
274  }
275  $a_tpl->setContent($f_tpl->get());
276  $index_content = $a_tpl->get("DEFAULT", false, false, false, true, false, false);
277 
278  $f = fopen ($a_filename, "w");
279  fwrite($f, $index_content);
280  fclose($f);
281  }
print $file
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static _lookupTitle($a_id)
lookup object title
special template class to simplify handling of ITX/PEAR
static _lookupType($a_id, $a_reference=false)
lookup object type
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getExportDirectory()

static ilExport::_getExportDirectory (   $a_obj_id,
  $a_type = "xml",
  $a_obj_type = "",
  $a_entity = "" 
)
static

Get export directory for an repository object.

Parameters
int$a_obj_idobject id
string$a_typeexport type ("xml", "html", ...), default "xml"
string$a_obj_typeobject type (optional, if not given, type is looked up)
Returns
string export directory

Definition at line 131 of file class.ilExport.php.

References $GLOBALS, ilFileSystemStorage\_createPathFromId(), ilObject\_lookupType(), and ilUtil\getDataDir().

Referenced by ilCourseArchives\__addZipFiles(), _createExportDirectory(), _getExportFiles(), ilExportContainer\addSubitems(), ilPortfolioHTMLExport\buildExportFile(), ilWikiHTMLExport\buildExportFile(), ilObjBlogGUI\buildExportFile(), ilExportGUI\delete(), ilExportGUI\download(), ilObjFileBasedLMGUI\exportHTML(), ilExportContainer\exportObject(), exportObject(), ilObjUser\exportPersonalData(), ilObjGlossary\getExportDirectory(), ilObjQuestionPool\getExportDirectory(), ilObjUser\getPersonalDataExportFile(), ilWikiHTMLExport\getUserExportFile(), ilOrgUnitExporter\sendAndCreateSimpleExportFile(), and ilObjUser\sendPersonalDataFile().

132  {
133  global $objDefinition;
134 
135  $ent = ($a_entity == "")
136  ? ""
137  : "_".$a_entity;
138 
139 
140  if ($a_obj_type == "")
141  {
142  $a_obj_type = ilObject::_lookupType($a_obj_id);
143  }
144 
145  if(in_array($a_obj_type, self::$new_file_structure))
146  {
147  include_once './Services/FileSystem/classes/class.ilFileSystemStorage.php';
148  $dir = ilUtil::getDataDir().DIRECTORY_SEPARATOR;
149  $dir .= 'il'.$objDefinition->getClassName($a_obj_type).$ent.DIRECTORY_SEPARATOR;
150  $dir .= ilFileSystemStorage::_createPathFromId($a_obj_id, $a_obj_type).DIRECTORY_SEPARATOR;
151  $dir .= ($a_type == 'xml' ? 'export' : 'export_'.$a_type);
152  return $dir;
153  }
154 
155  include_once './Services/Export/classes/class.ilImportExportFactory.php';
156  $exporter_class = ilImportExportFactory::getExporterClass($a_obj_type);
157  $export_dir = call_user_func(array($exporter_class,'lookupExportDirectory'),$a_obj_type,$a_obj_id,$a_type,$a_entity);
158 
159  $GLOBALS['ilLog']->write(__METHOD__.': Export dir is '.$export_dir);
160  return $export_dir;
161  }
static _createPathFromId($a_container_id, $a_name)
Create a path from an id: e.g 12345 will be converted to 12/34/<name>_5.
static _lookupType($a_id, $a_reference=false)
lookup object type
static getDataDir()
get data directory (outside webspace)
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getExportFiles()

ilExport::_getExportFiles (   $a_obj_id,
  $a_export_types = "",
  $a_obj_type = "" 
)

Get Export Files for a repository object.

Definition at line 166 of file class.ilExport.php.

References $file, $GLOBALS, _getExportDirectory(), and ilObject\_lookupType().

Referenced by _getLastExportFileDate(), _getLastExportFileInformation(), ilExportTableGUI\getExportFiles(), and ilObjGlossary\getExportFiles().

167  {
168  $GLOBALS['ilLog']->write(__METHOD__);
169 
170  if ($a_obj_type == "")
171  {
172  $a_obj_type = ilObject::_lookupType($a_obj_id);
173  }
174 
175  if ($a_export_types == "")
176  {
177  $a_export_types = array("xml");
178  }
179  if (!is_array($a_export_types))
180  {
181  $a_export_types = array($a_export_types);
182  }
183 
184  // initialize array
185  $file = array();
186 
187  $types = $a_export_types;
188 
189  foreach($types as $type)
190  {
191  $dir = ilExport::_getExportDirectory($a_obj_id, $type, $a_obj_type);
192 
193  // quit if import dir not available
194  if (!@is_dir($dir) or
195  !is_writeable($dir))
196  {
197  continue;
198  }
199 
200  // open directory
201  $h_dir = dir($dir);
202 
203  // get files and save the in the array
204  while ($entry = $h_dir->read())
205  {
206  if ($entry != "." and
207  $entry != ".." and
208  substr($entry, -4) == ".zip" and
209  ereg("^[0-9]{10}_{2}[0-9]+_{2}(".$a_obj_type."_)*[0-9]+\.zip\$", $entry))
210  {
211  $ts = substr($entry, 0, strpos($entry, "__"));
212  $file[$entry.$type] = array("type" => $type, "file" => $entry,
213  "size" => filesize($dir."/".$entry),
214  "timestamp" => $ts);
215  }
216  }
217 
218  // close import directory
219  $h_dir->close();
220  }
221 
222  // sort files
223  ksort ($file);
224  reset ($file);
225  return $file;
226  }
print $file
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getLastExportFileDate()

static ilExport::_getLastExportFileDate (   $a_obj_id,
  $a_type = "",
  $a_obj_type = "" 
)
static

Get date of last export file.

Parameters
int$a_obj_idobject id
string$a_typeexport type ("xml", "html", ...), default "xml"
string$a_obj_typeobject type (optional, if not given, type is looked up)

Definition at line 93 of file class.ilExport.php.

References _getExportFiles(), and ilUtil\sortArray().

Referenced by _getValidExportSubItems().

94  {
95  $files = ilExport::_getExportFiles($a_obj_id, $a_type, $a_obj_type);
96  if (is_array($files))
97  {
98  $files = ilUtil::sortArray($files, "timestamp", "desc");
99  return $files[0]["timestamp"];
100  }
101  return false;
102  }
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
_getExportFiles($a_obj_id, $a_export_types="", $a_obj_type="")
Get Export Files for a repository object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getLastExportFileInformation()

static ilExport::_getLastExportFileInformation (   $a_obj_id,
  $a_type = "",
  $a_obj_type = "" 
)
static

Get last export file information.

Parameters
int$a_obj_idobject id
string$a_typeexport type ("xml", "html", ...), default "xml"
string$a_obj_typeobject type (optional, if not given, type is looked up)

Definition at line 111 of file class.ilExport.php.

References _getExportFiles(), and ilUtil\sortArray().

Referenced by ilCourseArchives\__addZipFiles().

112  {
113  $files = ilExport::_getExportFiles($a_obj_id, $a_type, $a_obj_type);
114  if (is_array($files))
115  {
116  $files = ilUtil::sortArray($files, "timestamp", "desc");
117  return $files[0];
118  }
119  return false;
120  }
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
_getExportFiles($a_obj_id, $a_export_types="", $a_obj_type="")
Get Export Files for a repository object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getValidExportSubItems()

static ilExport::_getValidExportSubItems (   $a_ref_id)
static

Get a list of subitems of a repository resource, that implement the export.

Includes also information on last export file.

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

References _getLastExportFileDate().

Referenced by ilSubItemSelectionTableGUI\ilSubItemSelectionTableGUI().

67  {
68  global $tree;
69 
70  $valid_items = array();
71  $sub_items = $tree->getSubTree($tree->getNodeData($a_ref_id));
72  foreach ($sub_items as $sub_item)
73  {
74  if (in_array($sub_item["type"], self::$export_implementer))
75  {
76  $valid_items[] = array("type" => $sub_item["type"],
77  "title" => $sub_item["title"], "ref_id" => $sub_item["child"],
78  "obj_id" => $sub_item["obj_id"],
79  "timestamp" =>
80  ilExport::_getLastExportFileDate($sub_item["obj_id"], "xml", $sub_item["type"]));
81  }
82  }
83  return $valid_items;
84  }
static _getLastExportFileDate($a_obj_id, $a_type="", $a_obj_type="")
Get date of last export file.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportEntity()

ilExport::exportEntity (   $a_entity,
  $a_id,
  $a_target_release,
  $a_component,
  $a_title,
  $a_export_dir,
  $a_type_for_file = "" 
)

Export an ILIAS entity.

Parameters
string$a_entityentity type, e.g. "sty"
mixed$a_identity id
string$a_target_releasetarget release
string$a_componentcomponent that exports (e.g. "Services/Style")
Returns
array success and info array

Definition at line 392 of file class.ilExport.php.

References $success, $tpl, ilUtil\delDir(), ilUtil\makeDirParents(), processExporter(), and ilUtil\zip().

394  {
395  global $objDefinition, $tpl;
396 
397  if ($a_type_for_file == "")
398  {
399  $a_type_for_file = $a_entity;
400  }
401 
402  $comp = $a_component;
403  $c = explode("/", $comp);
404  $class = "il".$c[1]."Exporter";
405 
406  // manifest writer
407  include_once "./Services/Xml/classes/class.ilXmlWriter.php";
408  $this->manifest_writer = new ilXmlWriter();
409  $this->manifest_writer->xmlHeader();
410  $this->manifest_writer->xmlStartTag(
411  'Manifest',
412  array(
413  "MainEntity" => $a_entity,
414  "Title" => $a_title,
415  "TargetRelease" => $a_target_release,
416  "InstallationId" => IL_INST_ID,
417  "InstallationUrl" => ILIAS_HTTP_PATH));
418 
419  $export_dir = $a_export_dir;
420  $ts = time();
421 
422  // determine file name and subdirectory
423  $sub_dir = $ts.'__'.IL_INST_ID.'__'.$a_type_for_file.'_'.$a_id;
424  $new_file = $sub_dir.'.zip';
425 
426  $this->export_run_dir = $export_dir."/".$sub_dir;
427  ilUtil::makeDirParents($this->export_run_dir);
428 
429  $this->cnt = array();
430 
431  $success = $this->processExporter($comp, $class, $a_entity, $a_target_release, $a_id);
432 
433  $this->manifest_writer->xmlEndTag('Manifest');
434 
435  $this->manifest_writer->xmlDumpFile($this->export_run_dir."/manifest.xml", false);
436 
437  // zip the file
438  ilUtil::zip($this->export_run_dir, $export_dir."/".$new_file);
439  ilUtil::delDir($this->export_run_dir);
440 
441  return array(
442  "success" => $success,
443  "file" => $new_file,
444  "directory" => $export_dir
445  );
446  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
XML writer class.
global $tpl
Definition: ilias.php:8
$success
Definition: Utf8Test.php:87
processExporter($a_comp, $a_class, $a_entity, $a_target_release, $a_id)
Process exporter.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ exportObject()

ilExport::exportObject (   $a_type,
  $a_id,
  $a_target_release = "" 
)

Export an ILIAS object (the object type must be known by objDefinition)

Parameters
string$a_typerepository object type
int$a_idid of object or entity that shoudl be exported
string$a_target_releasetarget release
Returns
array success and info array

Definition at line 311 of file class.ilExport.php.

References $success, $tpl, _createExportDirectory(), _getExportDirectory(), ilObject\_lookupTitle(), ilUtil\delDir(), IL_CAL_UNIX, ILIAS_VERSION_NUMERIC, ilUtil\makeDirParents(), processExporter(), and ilUtil\zip().

312  {
313  global $objDefinition, $tpl;
314 
315  // if no target release specified, use latest major release number
316  if ($a_target_release == "")
317  {
318  $v = explode(".", ILIAS_VERSION_NUMERIC);
319  $a_target_release = $v[0].".".$v[1].".0";
320  }
321 
322  $comp = $objDefinition->getComponentForType($a_type);
323  $c = explode("/", $comp);
324  $class = "il".$c[1]."Exporter";
325 
326  // manifest writer
327  include_once "./Services/Xml/classes/class.ilXmlWriter.php";
328  $this->manifest_writer = new ilXmlWriter();
329  $this->manifest_writer->xmlHeader();
330  $this->manifest_writer->xmlStartTag(
331  'Manifest',
332  array(
333  "MainEntity" => $a_type,
334  "Title" => ilObject::_lookupTitle($a_id),
335  "TargetRelease" => $a_target_release,
336  "InstallationId" => IL_INST_ID,
337  "InstallationUrl" => ILIAS_HTTP_PATH));
338 
339  // get export class
340  ilExport::_createExportDirectory($a_id, "xml", $a_type);
341  $export_dir = ilExport::_getExportDirectory($a_id, "xml", $a_type);
342  $ts = time();
343 
344  // Workaround for test assessment
345  $sub_dir = $ts.'__'.IL_INST_ID.'__'.$a_type.'_'.$a_id;
346  $new_file = $sub_dir.'.zip';
347 
348  $this->export_run_dir = $export_dir."/".$sub_dir;
349  ilUtil::makeDirParents($this->export_run_dir);
350 
351  $this->cnt = array();
352 
353  $success = $this->processExporter($comp, $class, $a_type, $a_target_release, $a_id);
354 
355  $this->manifest_writer->xmlEndTag('Manifest');
356 
357  $this->manifest_writer->xmlDumpFile($this->export_run_dir."/manifest.xml", false);
358 
359  // zip the file
360  ilUtil::zip($this->export_run_dir, $export_dir."/".$new_file);
361  ilUtil::delDir($this->export_run_dir);
362 
363  // Store info about export
364  if($success)
365  {
366  include_once './Services/Export/classes/class.ilExportFileInfo.php';
367  $exp = new ilExportFileInfo($a_id);
368  $exp->setVersion($a_target_release);
369  $exp->setCreationDate(new ilDateTime($ts,IL_CAL_UNIX));
370  $exp->setExportType('xml');
371  $exp->setFilename($new_file);
372  $exp->create();
373  }
374 
375  return array(
376  "success" => $success,
377  "file" => $new_file,
378  "directory" => $export_dir
379  );
380  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
const ILIAS_VERSION_NUMERIC
_createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
Create export directory.
XML writer class.
static _lookupTitle($a_id)
lookup object title
const IL_CAL_UNIX
global $tpl
Definition: ilias.php:8
$success
Definition: Utf8Test.php:87
processExporter($a_comp, $a_class, $a_entity, $a_target_release, $a_id)
Process exporter.
Stores information of creation date and versions of export files
Date and time handling
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ getConfig()

ilExport::getConfig (   $a_comp)

Get configuration (note that configurations are optional, null may be returned!)

Parameters
string$a_compcomponent (e.g. "Modules/Glossary")
Returns
ilExportConfig $a_comp configuration object or null
Exceptions
ilExportException

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

38  {
39  // if created, return existing config object
40  if (isset($this->configs[$a_comp]))
41  {
42  return $this->configs[$a_comp];
43  }
44 
45  // create instance of export config object
46  $comp_arr = explode("/", $a_comp);
47  $a_class = "il".$comp_arr[1]."ExportConfig";
48  $export_config_file = "./".$a_comp."/classes/class.".$a_class.".php";
49  if (!is_file($export_config_file))
50  {
51  include_once("./Services/Export/exceptions/class.ilExportException.php");
52  throw new ilExportException('Component "'.$a_comp.'" does not provide ExportConfig class.');
53  }
54  include_once($export_config_file);
55  $exp_config = new $a_class();
56  $this->configs[$a_comp] = $exp_config;
57 
58  return $exp_config;
59  }
General export exception.

◆ processExporter()

ilExport::processExporter (   $a_comp,
  $a_class,
  $a_entity,
  $a_target_release,
  $a_id 
)

Process exporter.

Parameters

Definition at line 454 of file class.ilExport.php.

References $success, and ilUtil\makeDirParents().

Referenced by exportEntity(), and exportObject().

455  {
456  $success = true;
457 
458  if (!is_array($a_id))
459  {
460  if ($a_id == "")
461  {
462  return;
463  }
464  $a_id = array($a_id);
465  }
466 
467  // get exporter object
468  $export_class_file = "./".$a_comp."/classes/class.".$a_class.".php";
469 //echo "1-".$export_class_file."-"; exit;
470  if (!is_file($export_class_file))
471  {
472  include_once("./Services/Export/exceptions/class.ilExportException.php");
473  throw new ilExportException('Export class file "'.$export_class_file.'" not found.');
474  }
475  include_once($export_class_file);
476  $exp = new $a_class();
477  $exp->setExport($this);
478  if (!isset($this->cnt[$a_comp]))
479  {
480  $this->cnt[$a_comp] = 1;
481  }
482  else
483  {
484  $this->cnt[$a_comp]++;
485  }
486  $set_dir_relative = $a_comp."/set_".$this->cnt[$a_comp];
487  $set_dir_absolute = $this->export_run_dir."/".$set_dir_relative;
488  ilUtil::makeDirParents($set_dir_absolute);
489  $exp->init();
490 
491  $sv = $exp->determineSchemaVersion($a_entity, $a_target_release);
492 
493  // process head dependencies
494  $sequence = $exp->getXmlExportHeadDependencies($a_entity, $a_target_release, $a_id);
495  foreach ($sequence as $s)
496  {
497  $comp = explode("/", $s["component"]);
498  $exp_class = "il".$comp[1]."Exporter";
499  $s = $this->processExporter($s["component"], $exp_class,
500  $s["entity"], $a_target_release, $s["ids"]);
501  if (!$s)
502  {
503  $success = false;
504  }
505  }
506 
507  // write export.xml file
508  $export_writer = new ilXmlWriter();
509  $export_writer->xmlHeader();
510 
511  $attribs = array("InstallationId" => IL_INST_ID,
512  "InstallationUrl" => ILIAS_HTTP_PATH,
513  "Entity" => $a_entity, "SchemaVersion" => $sv["schema_version"], "TargetRelease" => $a_target_release,
514  "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
515  "xmlns:exp" => "http://www.ilias.de/Services/Export/exp/4_1",
516  "xsi:schemaLocation" => "http://www.ilias.de/Services/Export/exp/4_1 ".ILIAS_HTTP_PATH."/xml/ilias_export_4_1.xsd"
517  );
518  if ($sv["namespace"] != "" && $sv["xsd_file"] != "")
519  {
520  $attribs["xsi:schemaLocation"].= " ".$sv["namespace"]." ".
521  ILIAS_HTTP_PATH."/xml/".$sv["xsd_file"];
522  $attribs["xmlns"] = $sv["namespace"];
523  }
524  if ($sv["uses_dataset"])
525  {
526  $attribs["xsi:schemaLocation"].= " ".
527  "http://www.ilias.de/Services/DataSet/ds/4_3 ".ILIAS_HTTP_PATH."/xml/ilias_ds_4_3.xsd";
528  $attribs["xmlns:ds"] = "http://www.ilias.de/Services/DataSet/ds/4_3";
529  }
530 
531 
532  $export_writer->xmlStartTag('exp:Export', $attribs);
533 
534  $dir_cnt = 1;
535  foreach ($a_id as $id)
536  {
537  $exp->setExportDirectories($set_dir_relative."/expDir_".$dir_cnt,
538  $set_dir_absolute."/expDir_".$dir_cnt);
539  $export_writer->xmlStartTag('exp:ExportItem', array("Id" => $id));
540  //$xml = $exp->getXmlRepresentation($a_entity, $a_target_release, $id);
541  $xml = $exp->getXmlRepresentation($a_entity, $sv["schema_version"], $id);
542  $export_writer->appendXml($xml);
543  $export_writer->xmlEndTag('exp:ExportItem');
544  $dir_cnt++;
545  }
546 
547  $export_writer->xmlEndTag('exp:Export');
548  $export_writer->xmlDumpFile($set_dir_absolute."/export.xml", false);
549 
550  $this->manifest_writer->xmlElement("ExportFile",
551  array("Component" => $a_comp, "Path" => $set_dir_relative."/export.xml"));
552 
553  // process tail dependencies
554  $sequence = $exp->getXmlExportTailDependencies($a_entity, $a_target_release, $a_id);
555  foreach ($sequence as $s)
556  {
557  $comp = explode("/", $s["component"]);
558  $exp_class = "il".$comp[1]."Exporter";
559  $s = $this->processExporter($s["component"], $exp_class,
560  $s["entity"], $a_target_release, $s["ids"]);
561  if (!$s)
562  {
563  $success = false;
564  }
565  }
566 
567  return $success;
568  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
XML writer class.
General export exception.
$success
Definition: Utf8Test.php:87
processExporter($a_comp, $a_class, $a_entity, $a_target_release, $a_id)
Process exporter.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $configs

ilExport::$configs = array()
protected

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

◆ $export_implementer

ilExport::$export_implementer = array("tst", "lm", "glo")
static

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

◆ $new_file_structure

ilExport::$new_file_structure = array('cat','exc','crs','sess','file','grp','frm', 'usr', 'catr', 'crsr')
static

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


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