ILIAS  release_7 Revision v7.30-3-g800a261c036
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 94 of file class.ilFileExporter.php.

95 {
96 return array(
97 "4.1.0" => array(
98 "namespace" => "http://www.ilias.de/Modules/File/file/4_1",
99 "xsd_file" => "ilias_file_4_1.xsd",
100 "min" => "4.1.0",
101 "max" => "",
102 ),
103 );
104 }

◆ 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 33 of file class.ilFileExporter.php.

34 {
35 $md_ids = [];
36 foreach ($a_ids as $file_id) {
37 $md_ids[] = $file_id . ":0:file";
38 }
39
40 return [
41 [
42 "component" => "Services/MetaData",
43 "entity" => "md",
44 "ids" => $md_ids,
45 ],
46 [
47 "component" => "Services/Object",
48 "entity" => "common",
49 "ids" => $a_ids
50 ]
51 ];
52 }

◆ 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 64 of file class.ilFileExporter.php.

65 {
66 include_once("./Modules/File/classes/class.ilObjFile.php");
67 include_once("./Modules/File/classes/class.ilFileXMLWriter.php");
68 if (ilObject::_lookupType($a_id) == "file") {
69 $file = new ilObjFile($a_id, false);
70 $writer = new ilFileXMLWriter();
71 $writer->setFile($file);
72 $writer->setOmitHeader(true);
73 $writer->setAttachFileContents(ilFileXMLWriter::$CONTENT_ATTACH_COPY);
75 $writer->setFileTargetDirectories(
78 );
79 $writer->start();
80 $xml .= $writer->getXml();
81 }
82
83 return $xml;
84 }
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.
$xml
Definition: metadata.php:332

References ilFileXMLWriter\$CONTENT_ATTACH_COPY, $xml, 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: