ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilWebResourceExporter.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
25 {
27 
28  protected ilLogger $logger;
29 
33  public function __construct()
34  {
35  global $DIC;
36 
38  $this->logger = $DIC->logger()->webr();
39  }
40 
44  public function getXmlRepresentation(
45  string $a_entity,
46  string $a_schema_version,
47  string $a_id
48  ): string {
49  try {
50  $this->writer = new ilWebLinkXmlWriter(false);
51  $this->writer->setObjId((int) $a_id);
52  $this->writer->write();
53  return $this->writer->xmlDumpMem(false);
54  } catch (UnexpectedValueException $e) {
55  $this->logger->warning("Caught error: " . $e->getMessage());
56  return '';
57  }
58  }
59 
64  string $a_entity,
65  string $a_target_release,
66  array $a_ids
67  ): array {
68  $deps = [];
69  // service settings
70  $deps[] = [
71  "component" => "components/ILIAS/ILIASObject",
72  "entity" => "common",
73  "ids" => $a_ids
74  ];
75 
76  $md_ids = [];
77  foreach ($a_ids as $id) {
78  $md_ids[] = $id . ':0:webr';
79  }
80  if (!empty($md_ids)) {
81  $deps[] = [
82  'component' => 'components/ILIAS/MetaData',
83  'entity' => 'md',
84  'ids' => $md_ids,
85  ];
86  }
87 
88  return $deps;
89  }
90 
94  public function getValidSchemaVersions(string $a_entity): array
95  {
96  return array(
97  "4.1.0" => array(
98  "namespace" => "http://www.ilias.de/Modules/WebResource/webr/4_1",
99  "xsd_file" => "ilias_webr_4_1.xsd",
100  "uses_dataset" => false,
101  "min" => "4.1.0",
102  "max" => ""
103  )
104  );
105  }
106 
107  public function init(): void
108  {
109  }
110 }
getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id)
getValidSchemaVersions(string $a_entity)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:26
getXmlExportTailDependencies(string $a_entity, string $a_target_release, array $a_ids)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
__construct(Container $dic, ilPlugin $plugin)