ILIAS  release_8 Revision v8.23
ilForumExporter Class Reference

Exporter class for sessions. More...

+ Inheritance diagram for ilForumExporter:
+ Collaboration diagram for ilForumExporter:

Public Member Functions

 init ()
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 
 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
string $dir_relative = ""
 
string $dir_absolute = ""
 
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="")
 
- Data Fields inherited from ilForumObjectConstants
const OBJ_TYPE = 'frm'
 
const UI_TAB_ID_INFO = 'info_short'
 
const UI_TAB_ID_SETTINGS = 'settings'
 
const UI_TAB_ID_MODERATORS = 'frm_moderators'
 
const UI_TAB_ID_THREADS = 'forums_threads'
 
const UI_TAB_ID_STATS = 'frm_statistics'
 
const UI_TAB_ID_EXPORT = 'export'
 
const UI_TAB_ID_PERMISSIONS = 'perm_settings'
 
const UI_SUB_TAB_ID_BASIC_SETTINGS = 'basic_settings'
 
const UI_SUB_TAB_ID_NOTIFICATIONS = 'notifications'
 
const UI_SUB_TAB_ID_NEWS = 'cont_news_settings'
 
const UI_SUB_TAB_ID_STYLE = 'cont_style'
 
const UI_CMD_COPAGE_DOWNLOAD_FILE = 'downloadFile'
 
const UI_CMD_COPAGE_DISPLAY_FULLSCREEN = 'displayMediaFullscreen'
 
const UI_CMD_COPAGE_DOWNLOAD_PARAGRAPH = 'download_paragraph'
 

Detailed Description

Exporter class for sessions.

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

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

Member Function Documentation

◆ getValidSchemaVersions()

ilForumExporter::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.

Definition at line 118 of file class.ilForumExporter.php.

118  : array
119  {
120  return [
121  "4.1.0" => [
122  "namespace" => "http://www.ilias.de/Modules/Forum/frm/4_1",
123  "xsd_file" => "ilias_frm_4_1.xsd",
124  "uses_dataset" => false,
125  "min" => "4.1.0",
126  "max" => "4.4.999"
127  ],
128  "4.5.0" => [
129  "namespace" => "http://www.ilias.de/Modules/Forum/frm/4_5",
130  "xsd_file" => "ilias_frm_4_5.xsd",
131  "uses_dataset" => false,
132  "min" => "4.5.0",
133  "max" => "5.0.999"
134  ],
135  "5.1.0" => [
136  "namespace" => "http://www.ilias.de/Modules/Forum/frm/5_1",
137  "xsd_file" => "ilias_frm_5_1.xsd",
138  "uses_dataset" => false,
139  "min" => "5.1.0",
140  "max" => "7.999"
141  ],
142  "8.0" => [
143  "namespace" => "http://www.ilias.de/Modules/Forum/frm/8",
144  "xsd_file" => "ilias_frm_8.xsd",
145  "uses_dataset" => false,
146  "min" => "8.0",
147  "max" => ""
148  ]
149  ];
150  }

◆ getXmlExportTailDependencies()

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

Definition at line 56 of file class.ilForumExporter.php.

References ilObjectFactory\getInstanceByObjId().

56  : array
57  {
58  $deps = [];
59 
60  if ('frm' === $a_entity) {
61  $deps[] = [
62  'component' => 'Services/Object',
63  'entity' => 'common',
64  'ids' => $a_ids
65  ];
66 
67  $deps[] = [
68  "component" => "Services/News",
69  "entity" => "news_settings",
70  "ids" => $a_ids
71  ];
72  }
73 
74  $pageObjectIds = [];
75  $styleIds = [];
76 
77  foreach ($a_ids as $frmObjId) {
78  $frm = ilObjectFactory::getInstanceByObjId($frmObjId, false);
79  if (!$frm || !($frm instanceof ilObjForum)) {
80  continue;
81  }
82 
83  $frmPageObjIds = $frm->getPageObjIds();
84  foreach ($frmPageObjIds as $frmPageObjId) {
85  $pageObjectIds[] = self::OBJ_TYPE . ':' . $frmPageObjId;
86  }
87 
88  $style_id = $this->content_style_domain->styleForObjId((int) $frmObjId)->getStyleId();
89  if ($style_id > 0) {
90  $styleIds[$style_id] = $style_id;
91  }
92  }
93 
94  if (count($pageObjectIds) > 0) {
95  $deps[] = [
96  'component' => 'Services/COPage',
97  'entity' => 'pg',
98  'ids' => $pageObjectIds,
99  ];
100  }
101 
102  if (count($styleIds) > 0) {
103  $deps[] = [
104  'component' => 'Services/Style',
105  'entity' => 'sty',
106  'ids' => array_values($styleIds),
107  ];
108  }
109 
110  return $deps;
111  }
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
Class ilObjForum.
+ Here is the call graph for this function:

◆ getXmlRepresentation()

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

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

References $xml, ilObject\_lookupType(), ilXmlExporter\getAbsoluteExportDirectory(), ilXmlExporter\getRelativeExportDirectory(), and ilFileUtils\makeDirParents().

40  : string
41  {
42  $xml = '';
43 
44  if (ilObject::_lookupType((int) $a_id) === 'frm') {
45  $writer = new ilForumXMLWriter();
46  $writer->setForumId((int) $a_id);
48  $writer->setFileTargetDirectories($this->getRelativeExportDirectory(), $this->getAbsoluteExportDirectory());
49  $writer->start();
50  $xml .= $writer->getXML();
51  }
52 
53  return $xml;
54  }
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
XML writer class Class to simplify manual writing of xml documents.
$xml
Definition: metadata.php:351
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ init()

ilForumExporter::init ( )

Definition at line 31 of file class.ilForumExporter.php.

References $DIC.

31  : void
32  {
33  global $DIC;
34  $this->content_style_domain = $DIC
35  ->contentStyle()
36  ->domain();
37  }
global $DIC
Definition: feed.php:28

Field Documentation

◆ $content_style_domain

ILIAS Style Content DomainService ilForumExporter::$content_style_domain
protected

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


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