ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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)
 @inheritDoc More...
 
 startParsing ()
 @inheritDoc More...
 
 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 25 of file class.ilExportFileParser.php.

Constructor & Destructor Documentation

◆ __construct()

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

ilExportFileParser constructor.

@inheritDoc

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

47 {
48 $this->callback_obj = $a_callback_obj;
49 $this->callback_func = $a_callback_func;
50
51 parent::__construct($a_file, true);
52 $this->startParsing();
53 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ 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 72 of file class.ilExportFileParser.php.

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

Referenced by setHandlers().

+ Here is the caller graph for this function:

◆ handleCharacterData()

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

End Tag.

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

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

Referenced by setHandlers().

+ Here is the caller graph for this function:

◆ handleEndTag()

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

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

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

References $callback_func.

Referenced by setHandlers().

+ Here is the caller graph for this function:

◆ setHandlers()

ilExportFileParser::setHandlers (   $a_xml_parser)

@inheritDoc

Reimplemented from ilSaxParser.

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

58 : void
59 {
60 xml_set_element_handler($a_xml_parser, $this->handleBeginTag(...), $this->handleEndTag(...));
61 xml_set_character_data_handler($a_xml_parser, $this->handleCharacterData(...));
62 }
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.

References handleBeginTag(), handleCharacterData(), and handleEndTag().

+ Here is the call graph for this function:

◆ startParsing()

ilExportFileParser::startParsing ( )

@inheritDoc

Reimplemented from ilSaxParser.

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

67 : void
68 {
69 parent::startParsing();
70 }

Referenced by __construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $callback_func

string ilExportFileParser::$callback_func
private

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

Referenced by handleEndTag().

◆ $callback_obj

object ilExportFileParser::$callback_obj
private

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

◆ $chr_data

string ilExportFileParser::$chr_data = ""
protected

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

◆ $current_id

string ilExportFileParser::$current_id = ''
private

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

◆ $entity

string ilExportFileParser::$entity = ''
private

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

◆ $expfiles

array ilExportFileParser::$expfiles = []
private

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

◆ $export_item_writer

ilXmlWriter ilExportFileParser::$export_item_writer = null
private

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

◆ $in_export_item

bool ilExportFileParser::$in_export_item = false
protected

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

◆ $install_id

string ilExportFileParser::$install_id = ''
private

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

◆ $install_url

string ilExportFileParser::$install_url = ''
private

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

◆ $item_xml

string ilExportFileParser::$item_xml = ""
protected

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

◆ $schema_version

string ilExportFileParser::$schema_version = ''
private

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


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