ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilSoapInstallationInfoXMLWriter Class Reference
+ Inheritance diagram for ilSoapInstallationInfoXMLWriter:
+ Collaboration diagram for ilSoapInstallationInfoXMLWriter:

Public Member Functions

 __construct ()
 constructor More...
 
 setSettings ($settings)
 write access to property settings More...
 
 start ()
 
 addClient ($client)
 
 end ()
 
 getXML ()
 
 setExportAdvancedMetaDataDefinitions ($value)
 write access, if set to true advanced meta data definitions will be exported s well More...
 
 setExportUDFDefinitions ($value)
 write access, if set to true, user defined field definitions will be exported as well More...
 
- Public Member Functions inherited from ilXmlWriter
 __construct ($version="1.0", $outEnc="utf-8", $inEnc="utf-8")
 constructor More...
 
 _ilXmlWriter ()
 destructor public More...
 
 xmlSetDtdDef ($dtdDef)
 Sets dtd definition. More...
 
 xmlSetStSheet ($stSheet)
 Sets stylesheet. More...
 
 xmlSetGenCmt ($genCmt)
 Sets generated comment. More...
 
 xmlEncodeData ($data)
 Encodes text from input encoding into output encoding. More...
 
 xmlFormatData ($data)
 Indents text for better reading. More...
 
 xmlFormatElement ($array)
 Callback function for xmlFormatData; do not invoke directly. More...
 
 xmlHeader ()
 Writes xml header public. More...
 
 xmlStartTag ($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
 Writes a starttag. More...
 
 xmlEndTag ($tag)
 Writes an endtag. More...
 
 xmlComment ($comment)
 Writes a comment. More...
 
 xmlData ($data, $encode=TRUE, $escape=TRUE)
 Writes data. More...
 
 xmlElement ($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
 Writes a basic element (no children, just textual content) More...
 
 xmlDumpFile ($file, $format=TRUE)
 Dumps xml document from memory into a file. More...
 
 xmlDumpMem ($format=TRUE)
 Returns xml document from memory. More...
 
 appendXML ($a_str)
 append xml string to document More...
 
 xmlClear ()
 clears xmlStr public More...
 

Private Member Functions

 __buildHeader ()
 
 __buildFooter ()
 
 __buildClient ($setting)
 create client tag More...
 
 __buildInstallationInfo ()
 

Private Attributes

 $exportAdvMDDefs = false
 
 $exportUDFDefs = false
 

Additional Inherited Members

- Static Public Member Functions inherited from ilXmlWriter
static _xmlEscapeData ($data)
 Escapes reserved characters. More...
 
- Data Fields inherited from ilXmlWriter
 $xmlStr
 
 $version
 
 $outEnc
 
 $inEnc
 
 $dtdDef = ""
 
 $stSheet = ""
 
 $genCmt = "Generated by ILIAS XmlWriter"
 

Detailed Description

Definition at line 8 of file class.ilSoapInstallationInfoXMLWriter.php.

Constructor & Destructor Documentation

◆ __construct()

ilSoapInstallationInfoXMLWriter::__construct ( )

constructor

Parameters
stringxml version
stringoutput encoding
stringinput encoding public

Definition at line 20 of file class.ilSoapInstallationInfoXMLWriter.php.

21  {
22  parent::__construct();
23  }

Member Function Documentation

◆ __buildClient()

ilSoapInstallationInfoXMLWriter::__buildClient (   $setting)
private

create client tag

Parameters
ilSetting$setting

Definition at line 86 of file class.ilSoapInstallationInfoXMLWriter.php.

References $records, $style, ilAdvancedMDRecord\_getActivatedRecordsByObjectType(), ilAuthUtils\_getActiveAuthModes(), ilAdvancedMDRecord\_getAssignableObjectTypes(), ilAuthUtils\_getAuthModeName(), ilTimeZone\_getDefaultTimeZone(), ilSystemStyleSettings\_lookupActivatedStyle(), ilUserDefinedFields\_newInstance(), array, ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by addClient().

87  {
88  // determine skins/styles
89  $skin_styles = array();
90  include_once("./Services/Style/System/classes/class.ilStyleDefinition.php");
91  $skins = ilStyleDefinition::getAllSkins();
92 
93  if (is_array($skins))
94  {
95 
96  foreach($skins as $skin)
97  {
98  foreach($skin->getStyles() as $style)
99  {
100  include_once("./Services/Style/System/classes/class.ilSystemStyleSettings.php");
101  if (!ilSystemStyleSettings::_lookupActivatedStyle($skin->getId(),$style->getId()))
102  {
103  continue;
104  }
105  $skin_styles [] = $skin->getId().":".$style->getId();
106  }
107  }
108  }
109 
110  // timezones
111  include_once('Services/Calendar/classes/class.ilTimeZone.php');
112 
113 
114  $this->xmlStartTag("Client",
115  array(
116  "inst_id" => $setting->get("inst_id"),
117  "id" => $setting->clientid,
118  "enabled" => $setting->access == 1 ? "TRUE" : "FALSE",
119  "default_lang" => $setting->language,
120 
121  ));
122  $this->xmlEndTag("Client");
123 
124  return;
125 
126 
127  // END here due to security reasons.
128 
129 
130 
131  $auth_modes = ilAuthUtils::_getActiveAuthModes();
132  $auth_mode_default = strtoupper(ilAuthUtils::_getAuthModeName(array_shift($auth_modes)));
133  $auth_mode_names = array();
134  foreach ($auth_modes as $mode) {
135  $auth_mode_names[] = strtoupper(ilAuthUtils::_getAuthModeName($mode));
136  }
137 
138 
139  $this->xmlElement ("Name", null, $setting->get("inst_name"));
140  $this->xmlElement ("Description", null, $setting->description);
141  $this->xmlElement ("Institution", null, $setting->get("inst_institution"));
142  $this->xmlStartTag("Responsible");
143  $this->xmlElement ("Firstname", null, $setting->get("admin_firstname"));
144  $this->xmlElement ("Lastname", null, $setting->get("admin_lastname"));
145  $this->xmlElement ("Title", null, $setting->get("admin_title"));
146  $this->xmlElement ("Institution", null, $setting->get("admin_institution"));
147  $this->xmlElement ("Position", null, $setting->get("admin_position"));
148  $this->xmlElement ("Email", null, $setting->get("admin_email"));
149  $this->xmlElement ("Street ", null, $setting->get("admin_street"));
150  $this->xmlElement ("ZipCode ", null, $setting->get("admin_zipcode"));
151  $this->xmlElement ("City", null, $setting->get("admin_city"));
152  $this->xmlElement ("Country", null, $setting->get("admin_country"));
153  $this->xmlElement ("Phone", null, $setting->get("admin_phone"));
154  $this->xmlEndTag("Responsible");
155  $this->xmlStartTag("Settings");
156  $this->xmlElement("Setting", array("key" => "error_recipient"), $setting->get("error_recipient"));
157  $this->xmlElement("Setting", array("key" => "feedback_recipient"), $setting->get("feedback_recipient"));
158  $this->xmlElement("Setting", array("key" => "session_expiration"), $setting->session);
159  $this->xmlElement("Setting", array("key" => "soap_enabled"), $setting->get("soap_user_administration"));
160  $this->xmlElement("Setting", array("key" => "authentication_methods"), join(",", $auth_mode_names));
161  $this->xmlElement("Setting", array("key" => "authentication_default_method"), $auth_mode_default);
162  $this->xmlElement("Setting", array("key" => "skins"), join(",", $skin_styles));
163  $this->xmlElement("Setting", array("key" => "default_skin"), $setting->default_skin_style);
164  $this->xmlElement("Setting", array("key" => "default_timezone"), ilTimeZone::_getDefaultTimeZone());
165  $this->xmlElement("Setting", array("key" => "default_hits_per_page"), $setting->default_hits_per_page);
166  $this->xmlElement("Setting", array("key" => "default_show_users_online"), $setting->default_show_users_online);
167  $this->xmlEndTag("Settings");
168 
169  if ($this->exportAdvMDDefs)
170  {
171  // create advanced meta data record xml
172  include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
173  include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordXMLWriter.php';
174 
175  $record_ids = array();
177 
178  foreach($record_types as $type_info) {
179  $type = $type_info['obj_type'];
181  foreach ($records as $record){
182  $record_ids [] = $record->getRecordId();
183  }
184  }
185  $record_ids = array_unique($record_ids);
186  $this->xmlStartTag('AdvancedMetaDataRecords');
187 
188  if (count($record_ids) > 0)
189  {
190  foreach($record_ids as $record_id)
191  {
192  $record_obj = ilAdvancedMDRecord::_getInstanceByrecordId($record_id);
193  $record_obj->toXML($this);
194  }
195  }
196  $this->xmlEndTag('AdvancedMetaDataRecords');
197  }
198 
199  if ($this->exportUDFDefs)
200  {
201  // create user defined fields record xml
202  include_once ("./Services/User/classes/class.ilUserDefinedFields.php");
203  $udf_data = & ilUserDefinedFields::_newInstance();
204  $udf_data->addToXML($this);
205  }
206 
207 
208  $this->xmlEndTag("Client");
209  }
static _getDefaultTimeZone()
Calculate and set default time zone.
$style
Definition: example_012.php:70
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)
static _getActiveAuthModes()
static _lookupActivatedStyle($a_skin, $a_style)
lookup if a style is activated
$records
Definition: simple_test.php:22
static _getAuthModeName($a_auth_key)
xmlEndTag($tag)
Writes an endtag.
Create styles array
The data for the language used.
static _getActivatedRecordsByObjectType($a_obj_type, $a_sub_type="", $a_only_optional=false)
Get activated records by object type.
static _getAssignableObjectTypes($a_include_text=false)
Get assignable object type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __buildFooter()

ilSoapInstallationInfoXMLWriter::__buildFooter ( )
private

Definition at line 76 of file class.ilSoapInstallationInfoXMLWriter.php.

References ilXmlWriter\xmlEndTag().

Referenced by end().

77  {
78  $this->xmlEndTag('Installation');
79  }
xmlEndTag($tag)
Writes an endtag.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __buildHeader()

ilSoapInstallationInfoXMLWriter::__buildHeader ( )
private

Definition at line 60 of file class.ilSoapInstallationInfoXMLWriter.php.

References array, ilSoapFunctions\buildHTTPPath(), ILIAS_VERSION, ilXmlWriter\xmlHeader(), ilXmlWriter\xmlSetDtdDef(), ilXmlWriter\xmlSetGenCmt(), and ilXmlWriter\xmlStartTag().

Referenced by start().

61  {
62  // we have to build the http path here since this request is client independent!
63  $httpPath = ilSoapFunctions::buildHTTPPath();
64  $this->xmlSetDtdDef("<!DOCTYPE Installation PUBLIC \"-//ILIAS//DTD Group//EN\" \"".$httpPath ."/xml/ilias_client_3_10.dtd\">");
65  $this->xmlSetGenCmt("Export of ILIAS clients.");
66  $this->xmlHeader();
67  $this->xmlStartTag("Installation",
68  array (
69  "version" => ILIAS_VERSION,
70  "path" => $httpPath,
71  ));
72 
73  return true;
74  }
xmlSetGenCmt($genCmt)
Sets generated comment.
const ILIAS_VERSION
xmlSetDtdDef($dtdDef)
Sets dtd definition.
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
static buildHTTPPath()
builds http path if no client is available
xmlHeader()
Writes xml header public.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __buildInstallationInfo()

ilSoapInstallationInfoXMLWriter::__buildInstallationInfo ( )
private

Definition at line 211 of file class.ilSoapInstallationInfoXMLWriter.php.

References $GLOBALS, array, ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by start().

212  {
213  $this->xmlStartTag("Settings");
214  $this->xmlElement("Setting", array("key" => "default_client"), $GLOBALS['ilIliasIniFile']->readVariable("clients","default"));
215  #$this->xmlElement("Setting", array("key" => "post_max_size"), ilSoapAdministration::return_bytes(ini_get("post_max_size")));
216  #$this->xmlElement("Setting", array("key" => "upload_max_filesize"), ilSoapAdministration::return_bytes(ini_get("upload_max_filesize")));
217  $this->xmlEndTag("Settings");
218  }
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)
xmlEndTag($tag)
Writes an endtag.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addClient()

ilSoapInstallationInfoXMLWriter::addClient (   $client)

Definition at line 41 of file class.ilSoapInstallationInfoXMLWriter.php.

References $client, and __buildClient().

41  {
42  if (is_object($client))
43  {
44  $this->__buildClient ($client);
45  }
46 
47  }
$client
+ Here is the call graph for this function:

◆ end()

ilSoapInstallationInfoXMLWriter::end ( )

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

References __buildFooter(), and ilXmlWriter\xmlEndTag().

49  {
50  $this->xmlEndTag("Clients");
51  $this->__buildFooter();
52 
53  }
xmlEndTag($tag)
Writes an endtag.
+ Here is the call graph for this function:

◆ getXML()

ilSoapInstallationInfoXMLWriter::getXML ( )

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

References ilXmlWriter\xmlDumpMem().

56  {
57  return $this->xmlDumpMem(FALSE);
58  }
xmlDumpMem($format=TRUE)
Returns xml document from memory.
+ Here is the call graph for this function:

◆ setExportAdvancedMetaDataDefinitions()

ilSoapInstallationInfoXMLWriter::setExportAdvancedMetaDataDefinitions (   $value)

write access, if set to true advanced meta data definitions will be exported s well

Parameters
boolean$value

Definition at line 225 of file class.ilSoapInstallationInfoXMLWriter.php.

225  {
226  $this->exportAdvMDDefs = $value ? true : false;
227  }

◆ setExportUDFDefinitions()

ilSoapInstallationInfoXMLWriter::setExportUDFDefinitions (   $value)

write access, if set to true, user defined field definitions will be exported as well

Parameters
boolean$value

Definition at line 235 of file class.ilSoapInstallationInfoXMLWriter.php.

236  {
237  $this->exportUDFDefs = $value ? true: false;
238  }

◆ setSettings()

ilSoapInstallationInfoXMLWriter::setSettings (   $settings)

write access to property settings

Parameters
array$settingsis an array of ilSetting Objects

Definition at line 30 of file class.ilSoapInstallationInfoXMLWriter.php.

References settings().

30  {
31  $this->settings = $settings;
32  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:

◆ start()

ilSoapInstallationInfoXMLWriter::start ( )

Definition at line 34 of file class.ilSoapInstallationInfoXMLWriter.php.

References __buildHeader(), __buildInstallationInfo(), and ilXmlWriter\xmlStartTag().

35  {
36  $this->__buildHeader();
37  $this->__buildInstallationInfo();
38  $this->xmlStartTag("Clients");
39  }
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
+ Here is the call graph for this function:

Field Documentation

◆ $exportAdvMDDefs

ilSoapInstallationInfoXMLWriter::$exportAdvMDDefs = false
private

Definition at line 10 of file class.ilSoapInstallationInfoXMLWriter.php.

◆ $exportUDFDefs

ilSoapInstallationInfoXMLWriter::$exportUDFDefs = false
private

Definition at line 11 of file class.ilSoapInstallationInfoXMLWriter.php.


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