ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilExportFileParser Class Reference

Export file parser. More...

+ Inheritance diagram for ilExportFileParser:
+ Collaboration diagram for ilExportFileParser:

Public Member Functions

 __construct (string $a_file, object $a_callback_obj, string $a_callback_func)
 ilExportFileParser constructor. More...
 
 setHandlers ($a_xml_parser)
 
 startParsing ()
 
 handleBeginTag ($a_xml_parser, string $a_name, array $a_attribs)
 
 handleEndTag ($a_xml_parser, string $a_name)
 
 handleCharacterData ($a_xml_parser, string $a_data)
 End Tag. More...
 
- Public Member Functions inherited from ilSaxParser
 __construct (?string $path_to_file='', ?bool $throw_exception=false)
 
 setXMLContent (string $a_xml_content)
 
 getXMLContent ()
 
 getInputType ()
 
 startParsing ()
 stores xml data in array More...
 
 createParser ()
 
 setHandlers ($a_xml_parser)
 
 parse ($a_xml_parser, $a_fp=null)
 

Protected Attributes

string $item_xml = ""
 
bool $in_export_item = false
 
string $chr_data = ""
 
- Protected Attributes inherited from ilSaxParser
ilLanguage $lng = null
 

Private Attributes

string $entity = ''
 
string $install_id = ''
 
string $install_url = ''
 
string $schema_version = ''
 
array $expfiles = []
 
string $current_id = ''
 
object $callback_obj
 
string $callback_func
 
ilXmlWriter $export_item_writer = null
 

Additional Inherited Members

- Data Fields inherited from ilSaxParser
string $xml_file
 
bool $throw_exception = false
 
- Protected Member Functions inherited from ilSaxParser
 openXMLFile ()
 
 handleError (string $message)
 
 setThrowException (bool $throw_exception)
 

Detailed Description

Export file parser.

Author
Aleex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

Definition at line 22 of file class.ilExportFileParser.php.

Constructor & Destructor Documentation

◆ __construct()

ilExportFileParser::__construct ( string  $a_file,
object  $a_callback_obj,
string  $a_callback_func 
)

ilExportFileParser constructor.

Definition at line 43 of file class.ilExportFileParser.php.

References ILIAS\GlobalScreen\Provider\__construct(), and startParsing().

44  {
45  $this->callback_obj = $a_callback_obj;
46  $this->callback_func = $a_callback_func;
47 
48  parent::__construct($a_file, true);
49  $this->startParsing();
50  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ handleBeginTag()

ilExportFileParser::handleBeginTag (   $a_xml_parser,
string  $a_name,
array  $a_attribs 
)

Definition at line 70 of file class.ilExportFileParser.php.

70  : void
71  {
72  if ($this->in_export_item) {
73  $this->export_item_writer->xmlStartTag($a_name, $a_attribs);
74  }
75 
76  switch ($a_name) {
77  case "exp:Export":
78  $this->entity = $a_attribs["Entity"];
79  $this->install_id = $a_attribs["InstallationId"];
80  $this->install_url = $a_attribs["InstallationUrl"];
81  $this->schema_version = $a_attribs["SchemaVersion"];
82  break;
83 
84  case "exp:ExportItem":
85  $this->in_export_item = true;
86  $this->current_id = $a_attribs["Id"];
87  $this->export_item_writer = new ilXmlWriter();
88  $this->item_xml = "";
89  $this->expfiles[] = array(
90  "component" => $a_attribs["Component"] ?? null,
91  "path" => $a_attribs["Path"] ?? null
92  );
93  break;
94  }
95  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ handleCharacterData()

ilExportFileParser::handleCharacterData (   $a_xml_parser,
string  $a_data 
)

End Tag.

Definition at line 125 of file class.ilExportFileParser.php.

125  : void
126  {
127  $this->chr_data .= $a_data;
128  if ($this->in_export_item) {
129  $this->export_item_writer->xmlData($a_data);
130  }
131  }

◆ handleEndTag()

ilExportFileParser::handleEndTag (   $a_xml_parser,
string  $a_name 
)

Definition at line 97 of file class.ilExportFileParser.php.

References $callback_func, $install_id, and $install_url.

97  : void
98  {
99  switch ($a_name) {
100  case "exp:ExportItem":
101  $this->in_export_item = false;
102  $cf = $this->callback_func;
103  $this->callback_obj->$cf(
104  $this->entity,
105  $this->schema_version,
106  $this->current_id,
107  $this->export_item_writer->xmlDumpMem(false),
110  );
111  break;
112 
113  }
114 
115  if ($this->in_export_item) {
116  $this->export_item_writer->xmlEndTag($a_name);
117  }
118 
119  $this->chr_data = "";
120  }

◆ setHandlers()

ilExportFileParser::setHandlers (   $a_xml_parser)

Definition at line 55 of file class.ilExportFileParser.php.

55  : void
56  {
57  xml_set_object($a_xml_parser, $this);
58  xml_set_element_handler($a_xml_parser, 'handleBeginTag', 'handleEndTag');
59  xml_set_character_data_handler($a_xml_parser, 'handleCharacterData');
60  }

◆ startParsing()

ilExportFileParser::startParsing ( )

Definition at line 65 of file class.ilExportFileParser.php.

Referenced by __construct().

65  : void
66  {
67  parent::startParsing();
68  }
+ Here is the caller graph for this function:

Field Documentation

◆ $callback_func

string ilExportFileParser::$callback_func
private

Definition at line 36 of file class.ilExportFileParser.php.

Referenced by handleEndTag().

◆ $callback_obj

object ilExportFileParser::$callback_obj
private

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

◆ $chr_data

string ilExportFileParser::$chr_data = ""
protected

Definition at line 33 of file class.ilExportFileParser.php.

◆ $current_id

string ilExportFileParser::$current_id = ''
private

Definition at line 30 of file class.ilExportFileParser.php.

◆ $entity

string ilExportFileParser::$entity = ''
private

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

◆ $expfiles

array ilExportFileParser::$expfiles = []
private

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

◆ $export_item_writer

ilXmlWriter ilExportFileParser::$export_item_writer = null
private

Definition at line 37 of file class.ilExportFileParser.php.

◆ $in_export_item

bool ilExportFileParser::$in_export_item = false
protected

Definition at line 32 of file class.ilExportFileParser.php.

◆ $install_id

string ilExportFileParser::$install_id = ''
private

Definition at line 25 of file class.ilExportFileParser.php.

Referenced by handleEndTag().

◆ $install_url

string ilExportFileParser::$install_url = ''
private

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

Referenced by handleEndTag().

◆ $item_xml

string ilExportFileParser::$item_xml = ""
protected

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

◆ $schema_version

string ilExportFileParser::$schema_version = ''
private

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


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