ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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_schema_version, $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 ?>
static makeDirParents($a_dir)
Create a new directory and all parent directories.
getRelativeExportDirectory()
Get relative export directory.
Exporter class for files.
getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
Get tail dependencies.
Xml Exporter class.
init()
Initialisation.
Class ilObjFile.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml representation.
getAbsoluteExportDirectory()
Get absolute export directory.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
XML writer class.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file