ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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
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 = 'general'
 
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 121 of file class.ilForumExporter.php.

121  : array
122  {
123  return [
124  "5.1.0" => [
125  "namespace" => "http://www.ilias.de/Modules/Forum/frm/5_1",
126  "xsd_file" => "ilias_frm_5_1.xsd",
127  "uses_dataset" => false,
128  "min" => "7.0",
129  "max" => "7.999"
130  ],
131  "8.0" => [
132  "namespace" => "http://www.ilias.de/Modules/Forum/frm/8",
133  "xsd_file" => "ilias_frm_8.xsd",
134  "uses_dataset" => false,
135  "min" => "8.0",
136  "max" => "8.999"
137  ],
138  "9.0" => [
139  "namespace" => "http://www.ilias.de/Modules/Forum/frm/9",
140  "xsd_file" => "ilias_frm_9.xsd",
141  "uses_dataset" => false,
142  "min" => "9.0",
143  "max" => ""
144  ]
145  ];
146  }

◆ getXmlExportTailDependencies()

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

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

References ilObjectFactory\getInstanceByObjId().

59  : array
60  {
61  $deps = [];
62 
63  if ('frm' === $a_entity) {
64  $deps[] = [
65  'component' => 'components/ILIAS/ILIASObject',
66  'entity' => 'common',
67  'ids' => $a_ids
68  ];
69 
70  $deps[] = [
71  "component" => "components/ILIAS/News",
72  "entity" => "news_settings",
73  "ids" => $a_ids
74  ];
75  }
76 
77  $pageObjectIds = [];
78  $styleIds = [];
79 
80  foreach ($a_ids as $frmObjId) {
81  $frm = ilObjectFactory::getInstanceByObjId($frmObjId, false);
82  if (!$frm || !($frm instanceof ilObjForum)) {
83  continue;
84  }
85 
86  $frmPageObjIds = $frm->getPageObjIds();
87  foreach ($frmPageObjIds as $frmPageObjId) {
88  $pageObjectIds[] = self::OBJ_TYPE . ':' . $frmPageObjId;
89  }
90 
91  $style_id = $this->content_style_domain->styleForObjId((int) $frmObjId)->getStyleId();
92  if ($style_id > 0) {
93  $styleIds[$style_id] = $style_id;
94  }
95  }
96 
97  if ($pageObjectIds !== []) {
98  $deps[] = [
99  'component' => 'components/ILIAS/COPage',
100  'entity' => 'pg',
101  'ids' => $pageObjectIds,
102  ];
103  }
104 
105  if ($styleIds !== []) {
106  $deps[] = [
107  'component' => 'components/ILIAS/Style',
108  'entity' => 'sty',
109  'ids' => array_values($styleIds),
110  ];
111  }
112 
113  return $deps;
114  }
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
+ 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 ilObject\_lookupType(), ilXmlExporter\getAbsoluteExportDirectory(), 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(
49  $this->exp->getExportDirInContainer(),
51  );
52  $writer->start();
53  $xml .= $writer->getXML();
54  }
55 
56  return $xml;
57  }
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
XML writer class Class to simplify manual writing of xml documents.
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: shib_login.php:22

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: