ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilFileExporter.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 include_once("./Services/Export/classes/class.ilXmlExporter.php");
5 
14 {
15 
19  function init()
20  {
21  }
22 
31  public function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
32  {
33  $md_ids = array();
34  foreach ($a_ids as $file_id)
35  {
36  $md_ids[] = $file_id.":0:file";
37  }
38 
39  return array (
40  array(
41  "component" => "Services/MetaData",
42  "entity" => "md",
43  "ids" => $md_ids)
44  );
45  }
46 
55  public function getXmlRepresentation($a_entity, $a_target_release, $a_id)
56  {
57 
58  include_once("./Modules/File/classes/class.ilObjFile.php");
59  include_once("./Modules/File/classes/class.ilFileXMLWriter.php");
60  if (ilObject::_lookupType($a_id) == "file")
61  {
62  $file = new ilObjFile($a_id, false);
63  $writer = new ilFileXMLWriter();
64  $writer->setFile($file);
65  $writer->setOmitHeader(true);
66  $writer->setAttachFileContents(ilFileXMLWriter::$CONTENT_ATTACH_COPY);
68  $writer->setFileTargetDirectories($this->getRelativeExportDirectory(),
70  $writer->start();
71  $xml.= $writer->getXml();
72  }
73 
74  return $xml;
75  }
76 
84  function getValidSchemaVersions($a_entity)
85  {
86  return array (
87  "4.1.0" => array(
88  "namespace" => "http://www.ilias.de/Modules/File/file/4_1",
89  "xsd_file" => "ilias_file_4_1.xsd",
90  "min" => "4.1.0",
91  "max" => "")
92  );
93  }
94 
95 }
96 
97 ?>