ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilFileExporter Class Reference

Exporter class for files. More...

+ Inheritance diagram for ilFileExporter:
+ Collaboration diagram for ilFileExporter:

Public Member Functions

 init ()
 Initialisation. More...
 
 getXmlExportTailDependencies ($a_entity, $a_target_release, $a_ids)
 Get tail dependencies. More...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_id)
 Get xml representation. 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...
 

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

Exporter class for files.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id

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

Member Function Documentation

◆ getValidSchemaVersions()

ilFileExporter::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

Reimplemented from ilXmlExporter.

Definition at line 84 of file class.ilFileExporter.php.

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 }

◆ getXmlExportTailDependencies()

ilFileExporter::getXmlExportTailDependencies (   $a_entity,
  $a_target_release,
  $a_ids 
)

Get tail dependencies.

Parameters
stringentity
stringtarget release
arrayids
Returns
array array of array with keys "component", entity", "ids"

Reimplemented from ilXmlExporter.

Definition at line 31 of file class.ilFileExporter.php.

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 }

◆ getXmlRepresentation()

ilFileExporter::getXmlRepresentation (   $a_entity,
  $a_schema_version,
  $a_id 
)

Get xml representation.

Parameters
stringentity
stringtarget release
stringid
Returns
string xml string

Reimplemented from ilXmlExporter.

Definition at line 55 of file class.ilFileExporter.php.

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 }
print $file
XML writer class.
Class ilObjFile.
static _lookupType($a_id, $a_reference=false)
lookup object type
static makeDirParents($a_dir)
Create a new directory and all parent directories.
getRelativeExportDirectory()
Get relative export directory.
getAbsoluteExportDirectory()
Get absolute export directory.

References ilFileXMLWriter\$CONTENT_ATTACH_COPY, $file, ilObject\_lookupType(), ilXmlExporter\getAbsoluteExportDirectory(), ilXmlExporter\getRelativeExportDirectory(), and ilUtil\makeDirParents().

+ Here is the call graph for this function:

◆ init()

ilFileExporter::init ( )

Initialisation.

Reimplemented from ilXmlExporter.

Definition at line 19 of file class.ilFileExporter.php.

20 {
21 }

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