ILIAS  release_7 Revision v7.30-3-g800a261c036
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 @access 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 @access 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 @access 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 @access public

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

21 {
23 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ __buildClient()

ilSoapInstallationInfoXMLWriter::__buildClient (   $setting)
private

create client tag

Parameters
ilSetting$setting

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

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

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

Referenced by addClient().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __buildFooter()

ilSoapInstallationInfoXMLWriter::__buildFooter ( )
private

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

79 {
80 $this->xmlEndTag('Installation');
81 }

References ilXmlWriter\xmlEndTag().

Referenced by end().

+ 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.

61 {
62 // we have to build the http path here since this request is client independent!
64 $this->xmlSetDtdDef("<!DOCTYPE Installation PUBLIC \"-//ILIAS//DTD InstallationInfo//EN\" \"" . $httpPath . "/xml/ilias_installation_info_5_3.dtd\">");
65 $this->xmlSetGenCmt("Export of ILIAS clients.");
66 $this->xmlHeader();
67 $this->xmlStartTag(
68 "Installation",
69 array(
70 "version" => ILIAS_VERSION,
71 "path" => $httpPath,
72 )
73 );
74
75 return true;
76 }
static buildHTTPPath()
builds http path if no client is available
xmlSetGenCmt($genCmt)
Sets generated comment.
xmlHeader()
Writes xml header @access public.
xmlSetDtdDef($dtdDef)
Sets dtd definition.
const ILIAS_VERSION

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

Referenced by start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __buildInstallationInfo()

ilSoapInstallationInfoXMLWriter::__buildInstallationInfo ( )
private

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

207 {
208 $this->xmlStartTag("Settings");
209 $this->xmlElement("Setting", array("key" => "default_client"), $GLOBALS['DIC']['ilIliasIniFile']->readVariable("clients", "default"));
210 #$this->xmlElement("Setting", array("key" => "post_max_size"), ilSoapAdministration::return_bytes(ini_get("post_max_size")));
211 #$this->xmlElement("Setting", array("key" => "upload_max_filesize"), ilSoapAdministration::return_bytes(ini_get("upload_max_filesize")));
212 $this->xmlEndTag("Settings");
213 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
readVariable($a_group, $a_var_name)
reads a single variable from a group @access public

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

Referenced by start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addClient()

ilSoapInstallationInfoXMLWriter::addClient (   $client)

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

43 {
44 if (is_object($client)) {
45 $this->__buildClient($client);
46 }
47 }
if($_SERVER['argc']< 4) $client
Definition: cron.php:12

References $client, and __buildClient().

+ Here is the call graph for this function:

◆ end()

ilSoapInstallationInfoXMLWriter::end ( )

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

50 {
51 $this->xmlEndTag("Clients");
52 $this->__buildFooter();
53 }

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

+ Here is the call graph for this function:

◆ getXML()

ilSoapInstallationInfoXMLWriter::getXML ( )

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

56 {
57 return $this->xmlDumpMem(false);
58 }
xmlDumpMem($format=true)
Returns xml document from memory.

References ilXmlWriter\xmlDumpMem().

+ 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 220 of file class.ilSoapInstallationInfoXMLWriter.php.

221 {
222 $this->exportAdvMDDefs = $value ? true : false;
223 }
return true
Flag indicating whether or not HTTP headers will be sent when outputting captcha image/audio.

References true.

◆ 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 231 of file class.ilSoapInstallationInfoXMLWriter.php.

232 {
233 $this->exportUDFDefs = $value ? true: false;
234 }

◆ 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.

31 {
32 $this->settings = $settings;
33 }
settings()
Definition: settings.php:2

References settings().

+ Here is the call graph for this function:

◆ start()

ilSoapInstallationInfoXMLWriter::start ( )

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: