ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
33include_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::ilXmlWriter();
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 {
70 $record_obj = ilAdvancedMDRecord::_getInstanceByrecordId($record_id);
71 $record_obj->toXML($this);
72 }
73 $this->xmlEndTag('AdvancedMetaDataRecords');
74 }
75
81 protected function buildHeader()
82 {
83 $this->xmlSetDtdDef("<!DOCTYPE AdvancedMetaDataRecords PUBLIC \"-//ILIAS//DTD AdvancedMetaDataRecords//EN\" \"".
84 ILIAS_HTTP_PATH."/Services/AdvancedMetaData/xml/ilias_advanced_meta_data_records_3_9.dtd\">");
85 $this->xmlSetGenCmt("Export of ILIAS Advanced meta data records of installation ".$this->settings->get('inst_id').".");
86 $this->xmlHeader();
87 }
88}
89
90?>
XML writer class.
xmlEndTag($tag)
Writes an endtag.
xmlSetGenCmt($genCmt)
Sets generated comment.
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
xmlHeader()
Writes xml header @access public.
xmlSetDtdDef($dtdDef)
Sets dtd definition.
global $ilSetting
Definition: privfeed.php:40