ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMetaDataExporter Class Reference
+ Inheritance diagram for ilMetaDataExporter:
+ Collaboration diagram for ilMetaDataExporter:

Public Member Functions

 init ()
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 getValidSchemaVersions (string $a_entity)
 Returns schema versions that the component can export to. More...
 
- Public Member Functions inherited from ilXmlExporter
 __construct ()
 
 setExport (ilExport $a_exp)
 
 getExport ()
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 init ()
 
 setExportDirectories (string $a_dir_relative, string $a_dir_absolute)
 
 getRelativeExportDirectory ()
 
 getAbsoluteExportDirectory ()
 
 getXmlExportHeadDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get head dependencies. More...
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get tail dependencies. More...
 
 getValidSchemaVersions (string $a_entity)
 Returns schema versions that the component can export to. More...
 
 determineSchemaVersion (string $a_entity, string $a_target_release)
 

Protected Attributes

StandardXMLWriter $writer
 
RepositoryInterface $repository
 
- Protected Attributes inherited from ilXmlExporter
ilExport $exp
 

Additional Inherited Members

- Static Public Member Functions inherited from ilXmlExporter
static lookupExportDirectory (string $a_obj_type, int $a_obj_id, string $a_export_type='xml', string $a_entity="")
 

Detailed Description

Definition at line 25 of file class.ilMetaDataExporter.php.

Member Function Documentation

◆ getValidSchemaVersions()

ilMetaDataExporter::getValidSchemaVersions ( string  $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
array<string, array<string, string>>

Reimplemented from ilXmlExporter.

Definition at line 64 of file class.ilMetaDataExporter.php.

64 : array
65 {
66 return [
67 "10.0" => [
68 "namespace" => "http://www.ilias.de/Services/MetaData/md/10_0",
69 "xsd_file" => "ilias_md_10_0.xsd",
70 "min" => "10.0",
71 "max" => ""
72 ],
73 "4.1.0" => [
74 "namespace" => "http://www.ilias.de/Services/MetaData/md/4_1",
75 "xsd_file" => "ilias_md_4_1.xsd",
76 "min" => "4.1.0",
77 "max" => "9.99"
78 ]
79 ];
80 }

◆ getXmlRepresentation()

ilMetaDataExporter::getXmlRepresentation ( string  $a_entity,
string  $a_schema_version,
string  $a_id 
)

Reimplemented from ilXmlExporter.

Definition at line 40 of file class.ilMetaDataExporter.php.

40 : string
41 {
42 $id = explode(":", $a_id);
43
44 $obj_id = (int) $id[0];
45 $sub_id = (int) $id[1];
46 $type = (string) $id[2];
47
48 if ($sub_id === 0) {
49 $sub_id = $obj_id;
50 }
51
52 $md = $this->repository->getMD($obj_id, $sub_id, $type);
53 $xml = $this->writer->write($md);
54
55 return trim(str_replace('<?xml version="1.0"?>', '', $xml->asXML()));
56 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id, ILIAS\Repository\int(), and ILIAS\UI\examples\Deck\repository().

+ Here is the call graph for this function:

◆ init()

ilMetaDataExporter::init ( )

Reimplemented from ilXmlExporter.

Definition at line 30 of file class.ilMetaDataExporter.php.

30 : void
31 {
32 global $DIC;
33
34 $services = new InternalServices($DIC);
35
36 $this->writer = $services->xml()->standardWriter();
37 $this->repository = $services->repository()->repository();
38 }
global $DIC
Definition: shib_login.php:26

References $DIC, and ILIAS\UI\examples\Deck\repository().

+ Here is the call graph for this function:

Field Documentation

◆ $repository

RepositoryInterface ilMetaDataExporter::$repository
protected

Definition at line 28 of file class.ilMetaDataExporter.php.

◆ $writer

StandardXMLWriter ilMetaDataExporter::$writer
protected

Definition at line 27 of file class.ilMetaDataExporter.php.


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