ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilChatroomExporter.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/Export/classes/class.ilXmlExporter.php';
5
10{
14 public function init()
15 {
16 }
17
21 public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
22 {
23 $chat = ilObjectFactory::getInstanceByObjId($a_id, false);
24 if (!($chat instanceof ilObjChatroom)) {
25 $GLOBALS['DIC']->logger()->root()->warning($a_id . ' is not id of chatroom instance. Skipped generation of export XML.');
26 return '';
27 }
28
29 require_once 'Modules/Chatroom/classes/class.ilChatroomXMLWriter.php';
30 $writer = new ilChatroomXMLWriter($chat);
31 $writer->start();
32
33 return $writer->getXml();
34 }
35
39 public function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
40 {
41 $deps = [];
42
43 if ('chtr' === $a_entity) {
44 $deps[] = [
45 'component' => 'Services/Object',
46 'entity' => 'common',
47 'ids' => $a_ids
48 ];
49 }
50
51 return $deps;
52 }
53
57 public function getValidSchemaVersions($a_entity)
58 {
59 return array(
60 '5.3.0' => array(
61 'namespace' => 'http://www.ilias.de/Modules/Chatroom/chtr/5_3',
62 'xsd_file' => 'ilias_chtr_5_3.xsd',
63 'uses_dataset' => false,
64 'min' => '5.3.0',
65 'max' => '5.3.999'
66 )
67 );
68 }
69}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
An exception for terminatinating execution or to throw for unit testing.
Class ilChatroomExporter.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml representation.string xml string
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.ILIAS chooses the first one,...
getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
Get tail dependencies.array array of array with keys "component", entity", "ids"
Class ilChatroomXMLWriter.
Class ilObjChatroom.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Xml Exporter class.