ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
ilManifestParser Class Reference

Manifest parser for ILIAS standard export files. More...

+ Inheritance diagram for ilManifestParser:
+ Collaboration diagram for ilManifestParser:

Public Member Functions

 __construct ($a_file)
 Constructor. More...
 
 setInstallId ($a_val)
 Set Installation ID. More...
 
 getInstallId ()
 Get Installation ID. More...
 
 setInstallUrl ($a_val)
 Set Installation Url. More...
 
 getInstallUrl ()
 Get Installation Url. More...
 
 setMainEntity ($a_val)
 Set main entity. More...
 
 getMainEntity ()
 Get main entity. More...
 
 setTitle ($a_val)
 Set title. More...
 
 getTitle ()
 Get title. More...
 
 setTargetRelease ($a_val)
 Set target release. More...
 
 getTargetRelease ()
 Get target release. More...
 
 getExportFiles ()
 Get xml files. More...
 
 getExportSets ()
 
 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
 ilSaxParser ($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
 PEAR ($error_class=null)
 Constructor. More...
 
 _PEAR ()
 Destructor (the emulated type of...). More...
 
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...
 
 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...
 
 setErrorHandling ($mode=null, $options=null)
 Sets how errors generated by this object should be handled. 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

 $expfiles = array()
 
 $expsets = array()
 

Additional Inherited Members

- 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

Manifest parser for ILIAS standard export files.

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

Definition at line 13 of file class.ilManifestParser.php.

Constructor & Destructor Documentation

◆ __construct()

ilManifestParser::__construct (   $a_file)

Constructor.

Parameters

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

References startParsing().

25  {
26  parent::ilSaxParser($a_file, true);
27  $this->startParsing();
28  }
startParsing()
Start parser.
+ Here is the call graph for this function:

Member Function Documentation

◆ getExportFiles()

ilManifestParser::getExportFiles ( )

Get xml files.

Returns
array of strings xml file pathes

Definition at line 135 of file class.ilManifestParser.php.

References $expfiles.

136  {
137  return $this->expfiles;
138  }

◆ getExportSets()

ilManifestParser::getExportSets ( )

Definition at line 140 of file class.ilManifestParser.php.

References $expsets.

141  {
142  return $this->expsets;
143  }

◆ getInstallId()

ilManifestParser::getInstallId ( )
final

Get Installation ID.

Returns
string Installation ID

Definition at line 45 of file class.ilManifestParser.php.

46  {
47  return $this->install_id;
48  }

◆ getInstallUrl()

ilManifestParser::getInstallUrl ( )
final

Get Installation Url.

Returns
string Installation Url

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

66  {
67  return $this->install_url;
68  }

◆ getMainEntity()

ilManifestParser::getMainEntity ( )

Get main entity.

Returns
string main entity

Definition at line 85 of file class.ilManifestParser.php.

86  {
87  return $this->main_entity;
88  }

◆ getTargetRelease()

ilManifestParser::getTargetRelease ( )

Get target release.

Returns
string target release

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

126  {
127  return $this->target_release;
128  }

◆ getTitle()

ilManifestParser::getTitle ( )

Get title.

Returns
string title

Definition at line 105 of file class.ilManifestParser.php.

106  {
107  return $this->title;
108  }

◆ handleBeginTag()

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

Begin Tag.

Definition at line 170 of file class.ilManifestParser.php.

References setInstallId(), setInstallUrl(), setMainEntity(), setTargetRelease(), and setTitle().

171  {
172  switch ($a_name)
173  {
174  case "Manifest":
175  $this->setInstallId($a_attribs["InstallationId"]);
176  $this->setInstallUrl($a_attribs["InstallationUrl"]);
177  $this->setTitle($a_attribs["Title"]);
178  $this->setTargetRelease($a_attribs["TargetRelease"]);
179  $this->setMainEntity($a_attribs["MainEntity"]);
180  break;
181 
182  case "ExportFile":
183  $this->expfiles[] = array("component" => $a_attribs["Component"],
184  "path" => $a_attribs["Path"]);
185  break;
186 
187  case "ExportSet":
188  $this->expsets[] = array(
189  'path' => $a_attribs['Path'],
190  'type' => $a_attribs['Type']
191  );
192  break;
193  }
194  }
setInstallUrl($a_val)
Set Installation Url.
setTitle($a_val)
Set title.
setTargetRelease($a_val)
Set target release.
setMainEntity($a_val)
Set main entity.
setInstallId($a_val)
Set Installation ID.
+ Here is the call graph for this function:

◆ handleCharacterData()

ilManifestParser::handleCharacterData (   $a_xml_parser,
  $a_data 
)

End Tag.

Definition at line 208 of file class.ilManifestParser.php.

209  {
210  //$a_data = str_replace("<","&lt;",$a_data);
211  //$a_data = str_replace(">","&gt;",$a_data);
212  // DELETE WHITESPACES AND NEWLINES OF CHARACTER DATA
213  //$a_data = preg_replace("/\n/","",$a_data);
214  //$a_data = preg_replace("/\t+/","",$a_data);
215 
216  $this->chr_data .= $a_data;
217  }

◆ handleEndTag()

ilManifestParser::handleEndTag (   $a_xml_parser,
  $a_name 
)

End Tag.

Definition at line 199 of file class.ilManifestParser.php.

200  {
201 
202  $this->chr_data = "";
203  }

◆ setHandlers()

ilManifestParser::setHandlers (   $a_xml_parser)

Set event handlers.

Parameters
resourcereference to the xml parser private

Definition at line 151 of file class.ilManifestParser.php.

152  {
153  xml_set_object($a_xml_parser,$this);
154  xml_set_element_handler($a_xml_parser, 'handleBeginTag', 'handleEndTag');
155  xml_set_character_data_handler($a_xml_parser, 'handleCharacterData');
156  }

◆ setInstallId()

ilManifestParser::setInstallId (   $a_val)
final

Set Installation ID.

Parameters
stringInstallation ID

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

Referenced by handleBeginTag().

36  {
37  $this->install_id = $a_val;
38  }
+ Here is the caller graph for this function:

◆ setInstallUrl()

ilManifestParser::setInstallUrl (   $a_val)
final

Set Installation Url.

Parameters
stringInstallation Url

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

Referenced by handleBeginTag().

56  {
57  $this->install_url = $a_val;
58  }
+ Here is the caller graph for this function:

◆ setMainEntity()

ilManifestParser::setMainEntity (   $a_val)

Set main entity.

Parameters
stringmain entity

Definition at line 75 of file class.ilManifestParser.php.

Referenced by handleBeginTag().

76  {
77  $this->main_entity = $a_val;
78  }
+ Here is the caller graph for this function:

◆ setTargetRelease()

ilManifestParser::setTargetRelease (   $a_val)

Set target release.

Parameters
stringtarget release

Definition at line 115 of file class.ilManifestParser.php.

Referenced by handleBeginTag().

116  {
117  $this->target_release = $a_val;
118  }
+ Here is the caller graph for this function:

◆ setTitle()

ilManifestParser::setTitle (   $a_val)

Set title.

Parameters
stringtitle

Definition at line 95 of file class.ilManifestParser.php.

Referenced by handleBeginTag().

96  {
97  $this->title = $a_val;
98  }
+ Here is the caller graph for this function:

◆ startParsing()

ilManifestParser::startParsing ( )

Start parser.

Definition at line 162 of file class.ilManifestParser.php.

Referenced by __construct().

163  {
164  parent::startParsing();
165  }
+ Here is the caller graph for this function:

Field Documentation

◆ $expfiles

ilManifestParser::$expfiles = array()
protected

Definition at line 15 of file class.ilManifestParser.php.

Referenced by getExportFiles().

◆ $expsets

ilManifestParser::$expsets = array()
protected

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

Referenced by getExportSets().


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