ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilCourseExporter.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 
5 include_once './Modules/Course/classes/class.ilCourseXMLWriter.php';
6 include_once './Services/Export/classes/class.ilXmlExporter.php';
7 
18 {
19  private $writer = null;
20 
24  public function __construct()
25  {
26  }
27 
32  public function init()
33  {
34 
35  }
36 
45  public function getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
46  {
47  include_once './Services/Export/classes/class.ilExportOptions.php';
49 
50  $obj_id = end($a_ids);
51  if($eo->getOption(ilExportOptions::KEY_ROOT) != $obj_id)
52  {
53  return array();
54  }
55  if(count(ilExportOptions::getInstance()->getSubitemsForExport()) > 1)
56  {
57  return array(
58  array(
59  'component' => 'Services/Container',
60  'entity' => 'struct',
61  'ids' => $a_ids
62  )
63  );
64  }
65  return array();
66  }
67 
68 
76  public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
77  {
78  $course_ref_id = end(ilObject::_getAllReferences($a_id));
79  $course = ilObjectFactory::getInstanceByRefId($course_ref_id,false);
80 
81  if(!$course instanceof ilObjCourse)
82  {
83  $GLOBALS['ilLog']->write(__METHOD__. $a_id . ' is not instance of type course');
84  return '';
85  }
86 
87  $this->writer = new ilCourseXMLWriter($course);
88  $this->writer->setMode(ilCourseXMLWriter::MODE_EXPORT);
89  $this->writer->start();
90  return $this->writer->xmlDumpMem(false);
91  }
92 
100  public function getValidSchemaVersions($a_entity)
101  {
102  return array (
103  "4.1.0" => array(
104  "namespace" => "http://www.ilias.de/Modules/Course/crs/4_1",
105  "xsd_file" => "ilias_course_4_1.xsd",
106  "uses_dataset" => false,
107  "min" => "4.1.0",
108  "max" => "")
109  );
110  }
111 }
112 ?>