• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Services/Migration/DBUpdate_426/classes/class.ilMDXMLParser.php

Go to the documentation of this file.
00001 <?php
00002 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDSaxParser.php';
00003 
00004 class ilMDXMLParser extends ilMDSaxParser
00005 {
00006         // So könnte bspw eine ContentObjectParser Klasse aussehen.
00007         // Alle LM spezifischen Attribute werden wie gehabt hier behandelt. Werden Metadata spezifische Attribute übergeben, werden einfach die 
00008         // entsprechenden Funktionen von ilMDSaxParser.php aufgerufen.
00009         // Wichtig ist nur, daß ein MD-Objekt mit den Object-Ids und dem Objekttyp angelegt wird ($this->setMDObject(new ilMD(...)))
00010 
00011 
00012         function ilMDXMLParser($content,$a_obj_id,$a_rbac_id,$a_type)
00013         {
00014 
00015                 $this->setMDObject(new ilMD($a_obj_id,$a_rbac_id,$a_type));
00016 
00017                 // Wenn content eine XML-Datei ist:
00018                 #parent::ilMDSaxParser($content);
00019 
00020                 // Ist content ein xml-String:
00021                 parent::ilMDSaxParser();
00022                 $this->setXMLContent($content);
00023 
00024         }
00025         function setHandlers($a_xml_parser)
00026         {
00027                 xml_set_object($a_xml_parser,$this);
00028                 xml_set_element_handler($a_xml_parser,'handlerBeginTag','handlerEndTag');
00029                 xml_set_character_data_handler($a_xml_parser,'handlerCharacterData');
00030         }
00031 
00032         function handlerBeginTag($a_xml_parser,$a_name,$a_attribs)
00033         {
00034                 if($this->in_meta_data)
00035                 {
00036                         parent::handlerBeginTag($a_xml_parser,$a_name,$a_attribs);
00037                         return true;
00038                 }
00039                         
00040 
00041                 switch($a_name)
00042                 {
00043                         case 'MetaData':
00044                                 $this->in_meta_data = true;
00045                                 parent::handlerBeginTag($a_xml_parser,$a_name,$a_attribs);
00046                                 return true;
00047                                 
00048                         default:
00049                                 // hier die Tags aller nicht-MetaData Attribute
00050                 }
00051         }
00052         function handlerEndTag($a_xml_parser,$a_name)
00053         {
00054                 if($this->in_meta_data)
00055                 {
00056                         parent::handlerEndTag($a_xml_parser,$a_name);
00057                         return true;
00058                 }
00059                 switch($a_name)
00060                 {
00061                         case 'MetaData':
00062                                 $this->in_meta_data = false;
00063                                 parent::handlerEndTag($a_xml_parser,$a_name);
00064                                 return true;
00065 
00066                         default:
00067                                 // hier die Tags aller nicht-MetaData Attribute
00068                 }
00069         }
00070 
00071         function handlerCharacterData($a_xml_parser,$a_data)
00072         {
00073                 if($this->in_meta_data)
00074                 {
00075                         parent::handlerCharacterData($a_xml_parser,$a_data);
00076                         return true;
00077                 }
00078         }
00079                 
00080                 
00081 
00082 }
00083 ?>

Generated on Fri Dec 13 2013 10:18:31 for ILIAS Release_3_5_x_branch .rev 46805 by  doxygen 1.7.1