ILIAS  release_8 Revision v8.24
class.ilWebResourceExporter.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
27{
28 private ?ilWebLinkXmlWriter $writer = null;
29
30 protected ilLogger $logger;
31
35 public function __construct()
36 {
37 global $DIC;
38
40 $this->logger = $DIC->logger()->webr();
41 }
42
46 public function getXmlRepresentation(
47 string $a_entity,
48 string $a_schema_version,
49 string $a_id
50 ): string {
51 try {
52 $this->writer = new ilWebLinkXmlWriter(false);
53 $this->writer->setObjId((int) $a_id);
54 $this->writer->write();
55 return $this->writer->xmlDumpMem(false);
56 } catch (UnexpectedValueException $e) {
57 $this->logger->warning("Caught error: " . $e->getMessage());
58 return '';
59 }
60 }
61
66 string $a_entity,
67 string $a_target_release,
68 array $a_ids
69 ): array {
70 $deps = [];
71 // service settings
72 $deps[] = [
73 "component" => "Services/Object",
74 "entity" => "common",
75 "ids" => $a_ids
76 ];
77
78 return $deps;
79 }
80
84 public function getValidSchemaVersions(string $a_entity): array
85 {
86 return array(
87 "4.1.0" => array(
88 "namespace" => "http://www.ilias.de/Modules/WebResource/webr/4_1",
89 "xsd_file" => "ilias_webr_4_1.xsd",
90 "uses_dataset" => false,
91 "min" => "4.1.0",
92 "max" => ""
93 )
94 );
95 }
96
97 public function init(): void
98 {
99 }
100}
Component logger with individual log levels by component id.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getXmlExportTailDependencies(string $a_entity, string $a_target_release, array $a_ids)
@inheritDoc
getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id)
@inheritDoc
getValidSchemaVersions(string $a_entity)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
try
Definition: cron.php:23
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc