ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilContainerExporter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilContainerExporter:
+ Collaboration diagram for ilContainerExporter:

Public Member Functions

 __construct ()
 
 init ()
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 
 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

ILIAS Style Content DomainService $content_style_domain
 
- 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning container structure export

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 24 of file class.ilContainerExporter.php.

Constructor & Destructor Documentation

◆ __construct()

ilContainerExporter::__construct ( )

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

References $DIC.

29  {
30  global $DIC;
31  $this->content_style_domain = $DIC->contentStyle()
32  ->domain();
33  }
global $DIC
Definition: shib_login.php:22

Member Function Documentation

◆ getValidSchemaVersions()

ilContainerExporter::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[]

Definition at line 137 of file class.ilContainerExporter.php.

137  : array
138  {
139  return [
140  "4.1.0" => [
141  "namespace" => "https://www.ilias.de/Modules/Folder/fold/4_1",
142  "xsd_file" => "ilias_fold_4_1.xsd",
143  "uses_dataset" => false,
144  "min" => "4.1.0",
145  "max" => ""
146  ]
147  ];
148  }

◆ getXmlExportTailDependencies()

ilContainerExporter::getXmlExportTailDependencies ( string  $a_entity,
string  $a_target_release,
array  $a_ids 
)

Definition at line 39 of file class.ilContainerExporter.php.

References $id, $res, and ilPageObject\_exists().

39  : array
40  {
41  if ($a_entity !== 'struct') {
42  return [];
43  }
44 
45 
46  $res = [];
47 
48  // pages
49 
50  $pg_ids = [];
51 
52  // container pages
53  foreach ($a_ids as $id) {
54  if (ilContainerPage::_exists("cont", (int) $id)) {
55  $pg_ids[] = "cont:" . $id;
56  }
57  }
58 
59  // container start objects pages
60  foreach ($a_ids as $id) {
61  if (ilContainerStartObjectsPage::_exists("cstr", (int) $id)) {
62  $pg_ids[] = "cstr:" . $id;
63  }
64  }
65 
66  if (count($pg_ids)) {
67  $res[] = [
68  "component" => "components/ILIAS/COPage",
69  "entity" => "pg",
70  "ids" => $pg_ids
71  ];
72  }
73 
74  // style
75  $style_ids = [];
76  foreach ($a_ids as $id) {
77  // see #24888
78  $style = $this->content_style_domain->styleForObjId((int) $id);
79  $style_id = $style->getExportStyleId();
80  if ($style_id > 0) {
81  $style_ids[] = $style_id;
82  }
83  }
84  if (count($style_ids)) {
85  $res[] = [
86  "component" => "components/ILIAS/Style",
87  "entity" => "sty",
88  "ids" => $style_ids
89  ];
90  }
91 
92  // service settings
93  $res[] = [
94  "component" => "components/ILIAS/ILIASObject",
95  "entity" => "common",
96  "ids" => $a_ids
97  ];
98 
99  // skill profiles
100  $res[] = [
101  "component" => "components/ILIAS/Skill",
102  "entity" => "skl_local_prof",
103  "ids" => $a_ids
104  ];
105 
106  // news settings
107  $res[] = [
108  "component" => "components/ILIAS/News",
109  "entity" => "news_settings",
110  "ids" => $a_ids
111  ];
112 
113  return $res;
114  }
$res
Definition: ltiservices.php:66
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ getXmlRepresentation()

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

Definition at line 116 of file class.ilContainerExporter.php.

References $DIC, $log, and ilObject\_getAllReferences().

116  : string
117  {
118  global $DIC;
119 
120  $log = $DIC->logger()->root();
121  if ($a_entity === 'struct') {
122  $log->debug(__METHOD__ . ': Received id = ' . $a_id);
123  $ref_ids = ilObject::_getAllReferences((int) $a_id);
124  $writer = new ilContainerXmlWriter(end($ref_ids));
125  $writer->write();
126  return $writer->xmlDumpMem(false);
127  }
128  return "";
129  }
static _getAllReferences(int $id)
get all reference ids for object ID
$log
Definition: result.php:32
global $DIC
Definition: shib_login.php:22
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ init()

ilContainerExporter::init ( )

Definition at line 35 of file class.ilContainerExporter.php.

35  : void
36  {
37  }

Field Documentation

◆ $content_style_domain

ILIAS Style Content DomainService ilContainerExporter::$content_style_domain
protected

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


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