ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilExportFileParser Class Reference

Export file parser. More...

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

Public Member Functions

 __construct ($a_file, $a_callback_obj, $a_callback_func)
 Constructor. More...
 
 setHandlers ($a_xml_parser)
 Set event handlers. More...
 
 startParsing ()
 Start parser. More...
 
 handleBeginTag ($a_xml_parser, $a_name, $a_attribs)
 Begin Tag. More...
 
 handleEndTag ($a_xml_parser, $a_name)
 End Tag. More...
 
 handleCharacterData ($a_xml_parser, $a_data)
 End Tag. More...
 
- Public Member Functions inherited from ilSaxParser
 __construct ($a_xml_file='', $throwException=false)
 Constructor setup ILIAS global object public. More...
 
 setXMLContent ($a_xml_content)
 
 getXMLContent ()
 
 getInputType ()
 
 startParsing ()
 stores xml data in array More...
 
 createParser ()
 create parser More...
 
 setOptions ($a_xml_parser)
 set parser options More...
 
 setHandlers ($a_xml_parser)
 set event handler should be overwritten by inherited class private More...
 
 openXMLFile ()
 open xml file More...
 
 parse ($a_xml_parser, $a_fp=null)
 parse xml file More...
 
 freeParser ($a_xml_parser)
 free xml parser handle More...
 
 setThrowException ($throwException)
 set error handling More...
 
- Public Member Functions inherited from PEAR
 __construct ($error_class=null)
 Constructor. More...
 
 _PEAR ()
 Destructor (the emulated type of...). More...
 
 registerShutdownFunc ($func, $args=array())
 Use this function to register a shutdown method for static classes. More...
 
 isError ($data, $code=null)
 Tell whether a value is a PEAR error. More...
 
 expectError ($code=' *')
 This method is used to tell which errors you expect to get. More...
 
 popExpect ()
 This method pops one element off the expected error codes stack. More...
 
 _checkDelExpect ($error_code)
 This method checks unsets an error code if available. More...
 
 delExpect ($error_code)
 This method deletes all occurences of the specified element from the expected error codes stack. More...
 
raiseError ($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
 This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied. More...
 
throwError ($message=null, $code=null, $userinfo=null)
 Simpler form of raiseError with fewer options. More...
 
 staticPushErrorHandling ($mode, $options=null)
 
 staticPopErrorHandling ()
 
 pushErrorHandling ($mode, $options=null)
 Push a new error handler on top of the error handler options stack. More...
 
 popErrorHandling ()
 Pop the last error handler used. More...
 
 loadExtension ($ext)
 OS independant PHP extension load. More...
 

Protected Attributes

 $item_xml = ""
 

Additional Inherited Members

- Static Public Member Functions inherited from PEAR
static & getStaticProperty ($class, $var)
 If you have a class that's mostly/entirely static, and you need static properties, you can use this method to simulate them. More...
 
static setErrorHandling ($mode=null, $options=null)
 Sets how errors generated by this object should be handled. More...
 
- Data Fields inherited from ilSaxParser
 $input_type = null
 
 $xml_content = ''
 
 $ilias
 
 $lng
 
 $xml_file
 
 $throwException = false
 
- Data Fields inherited from PEAR
 $_debug = false
 
 $_default_error_mode = null
 
 $_default_error_options = null
 
 $_default_error_handler = ''
 
 $_error_class = 'PEAR_Error'
 
 $_expected_errors = array()
 
- Protected Member Functions inherited from ilSaxParser
 handleError ($message, $code)
 use given error handler to handle error message or internal ilias error message handle More...
 

Detailed Description

Export file parser.

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

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters

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

References startParsing().

25  {
26  $this->callback_obj = $a_callback_obj;
27  $this->callback_func = $a_callback_func;
28 
29  parent::__construct($a_file, true);
30  $this->startParsing();
31  }
+ Here is the call graph for this function:

Member Function Documentation

◆ handleBeginTag()

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

Begin Tag.

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

58  {
59  if ($this->in_export_item) {
60  $this->export_item_writer->xmlStartTag($a_name, $a_attribs);
61  }
62 
63  switch ($a_name) {
64  case "exp:Export":
65  $this->entity = $a_attribs["Entity"];
66  $this->install_id = $a_attribs["InstallationId"];
67  $this->install_url = $a_attribs["InstallationUrl"];
68  $this->schema_version = $a_attribs["SchemaVersion"];
69  break;
70 
71  case "exp:ExportItem":
72  $this->in_export_item = true;
73  $this->current_id = $a_attribs["Id"];
74 
75  $this->export_item_writer = new ilXmlWriter();
76 
77  $this->item_xml = "";
78  $this->expfiles[] = array("component" => $a_attribs["Component"],
79  "path" => $a_attribs["Path"]);
80  break;
81  }
82  }
XML writer class.

◆ handleCharacterData()

ilExportFileParser::handleCharacterData (   $a_xml_parser,
  $a_data 
)

End Tag.

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

117  {
118  //$a_data = str_replace("<","&lt;",$a_data);
119  //$a_data = str_replace(">","&gt;",$a_data);
120  // DELETE WHITESPACES AND NEWLINES OF CHARACTER DATA
121  //$a_data = preg_replace("/\n/","",$a_data);
122  //$a_data = preg_replace("/\t+/","",$a_data);
123 
124  $this->chr_data .= $a_data;
125 
126  if ($this->in_export_item) {
127  $this->export_item_writer->xmlData($a_data);
128  }
129  }

◆ handleEndTag()

ilExportFileParser::handleEndTag (   $a_xml_parser,
  $a_name 
)

End Tag.

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

88  {
89  switch ($a_name) {
90  case "exp:ExportItem":
91  $this->in_export_item = false;
92  $cf = $this->callback_func;
93  $this->callback_obj->$cf(
94  $this->entity,
95  $this->schema_version,
96  $this->current_id,
97  $this->export_item_writer->xmlDumpMem(false),
98  $this->install_id,
99  $this->install_url
100  );
101  break;
102 
103  }
104 
105  if ($this->in_export_item) {
106  $this->export_item_writer->xmlEndTag($a_name);
107  }
108 
109 
110  $this->chr_data = "";
111  }

◆ setHandlers()

ilExportFileParser::setHandlers (   $a_xml_parser)

Set event handlers.

Parameters
resourcereference to the xml parser private

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

40  {
41  xml_set_object($a_xml_parser, $this);
42  xml_set_element_handler($a_xml_parser, 'handleBeginTag', 'handleEndTag');
43  xml_set_character_data_handler($a_xml_parser, 'handleCharacterData');
44  }

◆ startParsing()

ilExportFileParser::startParsing ( )

Start parser.

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

Referenced by __construct().

50  {
51  parent::startParsing();
52  }
+ Here is the caller graph for this function:

Field Documentation

◆ $item_xml

ilExportFileParser::$item_xml = ""
protected

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


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