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

Public Member Functions

 init ()
 
 importXmlRepresentation (string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
 
- Public Member Functions inherited from ilXmlImporter
 __construct ()
 
 setImport (ilImport $a_val)
 
 getImport ()
 
 init ()
 
 setInstallId (string $a_val)
 
 getInstallId ()
 
 setInstallUrl (string $a_val)
 
 getInstallUrl ()
 
 setSchemaVersion (string $a_val)
 
 getSchemaVersion ()
 
 setImportDirectory (string $a_val)
 
 getImportDirectory ()
 
 setSkipEntities (array $a_val)
 
 getSkipEntities ()
 
 exportedFromSameInstallation ()
 
 importXmlRepresentation (string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
 
 finalProcessing (ilImportMapping $a_mapping)
 
 afterContainerImportProcessing (ilImportMapping $mapping)
 

Protected Attributes

StandardXMLReader $reader
 
RepositoryInterface $repository
 
ilLogger $logger
 
- Protected Attributes inherited from ilXmlImporter
array $skip_entities = array()
 
ilImport $imp
 
string $install_id
 
string $install_url
 
string $schema_version
 
string $import_directory
 

Detailed Description

Definition at line 26 of file class.ilMetaDataImporter.php.

Member Function Documentation

◆ importXmlRepresentation()

ilMetaDataImporter::importXmlRepresentation ( string  $a_entity,
string  $a_id,
string  $a_xml,
ilImportMapping  $a_mapping 
)

Reimplemented from ilXmlImporter.

Definition at line 43 of file class.ilMetaDataImporter.php.

48 : void {
49 $new_id = $a_mapping->getMapping("components/ILIAS/MetaData", "md", $a_id);
50
51 if (!is_string($new_id) || $new_id === "") {
52 $this->logger->error(
53 'Import of LOM aborted for ' . $new_id . ', ID mapping failed.'
54 );
55 return;
56 }
57
58 $id = explode(":", $new_id);
59
60 $obj_id = (int) $id[0];
61 $sub_id = (int) $id[1];
62 $type = (string) $id[2];
63
64 if ($sub_id === 0) {
65 $sub_id = $obj_id;
66 }
67
68 $version = Version::tryFrom($this->getSchemaVersion());
69 if (is_null($version)) {
70 $this->logger->error(
71 'Import of LOM aborted for ' . $new_id .
72 ', invalid schema version: ' . $this->getSchemaVersion()
73 );
74 return;
75 }
76
77 $md = $this->reader->read(
78 new SimpleXMLElement($a_xml),
80 );
81 $this->repository->transferMD($md, $obj_id, $sub_id, $type, false);
82 }
$version
Definition: plugin.php:24
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
getMapping(string $a_comp, string $a_entity, string $a_old_id)

References ILIAS\Repository\logger().

+ Here is the call graph for this function:

◆ init()

ilMetaDataImporter::init ( )

Reimplemented from ilXmlImporter.

Definition at line 32 of file class.ilMetaDataImporter.php.

32 : void
33 {
34 global $DIC;
35
36 $services = new InternalServices($DIC);
37
38 $this->reader = $services->xml()->standardReader();
39 $this->repository = $services->repository()->repository();
40 $this->logger = $DIC->logger()->meta();
41 }
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Field Documentation

◆ $logger

ilLogger ilMetaDataImporter::$logger
protected

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

◆ $reader

StandardXMLReader ilMetaDataImporter::$reader
protected

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

◆ $repository

RepositoryInterface ilMetaDataImporter::$repository
protected

Definition at line 29 of file class.ilMetaDataImporter.php.


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