ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilAdvancedMDRecordXMLWriter.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
33 include_once('./Services/Xml/classes/class.ilXmlWriter.php');
34 
36 {
37  protected $record_ids = array();
38  protected $settings = null;
39 
47  public function __construct($a_record_ids)
48  {
49  global $ilSetting;
50 
51  parent::__construct();
52  $this->settings = $ilSetting;
53 
54  $this->record_ids = $a_record_ids ? $a_record_ids : array();
55  }
56 
63  public function write()
64  {
65  $this->buildHeader();
66 
67  $this->xmlStartTag('AdvancedMetaDataRecords');
68  foreach ($this->record_ids as $record_id) {
69  $record_obj = ilAdvancedMDRecord::_getInstanceByrecordId($record_id);
70  $record_obj->toXML($this);
71  }
72  $this->xmlEndTag('AdvancedMetaDataRecords');
73  }
74 
80  protected function buildHeader()
81  {
82  $this->xmlSetDtdDef("<!DOCTYPE AdvancedMetaDataRecords PUBLIC \"-//ILIAS//DTD AdvancedMetaDataRecords//EN\" \"" .
83  ILIAS_HTTP_PATH . "/Services/AdvancedMetaData/xml/ilias_advanced_meta_data_records_3_9.dtd\">");
84  $this->xmlSetGenCmt("Export of ILIAS Advanced meta data records of installation " . $this->settings->get('inst_id') . ".");
85  $this->xmlHeader();
86  }
87 }
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
xmlSetGenCmt($genCmt)
Sets generated comment.
xmlSetDtdDef($dtdDef)
Sets dtd definition.
XML writer class.
xmlEndTag($tag)
Writes an endtag.
xmlHeader()
Writes xml header public.
Create styles array
The data for the language used.
settings()
Definition: settings.php:2
global $ilSetting
Definition: privfeed.php:17