ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilnetucateResponse Class Reference

process reponse from Centra Server (c) Sascha Hofmann, 2004 More...

+ Inheritance diagram for ilnetucateResponse:
+ Collaboration diagram for ilnetucateResponse:

Public Member Functions

 ilnetucateResponse ($a_str)
 Constructor @access public. More...
 
 validateInput ($a_str)
 
 isError ()
 
 getErrorMsg ()
 
 getResultMsg ()
 
 getFirstID ()
 
 setHandlers ($a_xml_parser)
 set event handler should be overwritten by inherited class @access private More...
 
 startParsing ()
 start the parser More...
 
 parse ($a_xml_parser, $a_xml_str)
 parse xml file More...
 
 handlerBeginTag ($a_xml_parser, $a_name, $a_attribs)
 handler for begin of element More...
 
 handlerEndTag ($a_xml_parser, $a_name)
 
 handlerCharacterData ($a_xml_parser, $a_data)
 handler for character data More...
 
- Public Member Functions inherited from ilSaxParser
 ilSaxParser ($a_xml_file='', $throwException=false)
 Constructor setup ILIAS global object @access 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 @access 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...
 

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

process reponse from Centra Server (c) Sascha Hofmann, 2004

Author
Sascha Hofmann sasch.nosp@m.ahof.nosp@m.mann@.nosp@m.gmx..nosp@m.de
Version
$Id$

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

Member Function Documentation

◆ getErrorMsg()

ilnetucateResponse::getErrorMsg ( )

Definition at line 77 of file class.ilnetucateResponse.php.

78 {
79 if ($this->data['response']['status'] == "error" or $this->data['response']['status'] == "")
80 {
81 return trim($this->data['result']['cdata']);
82 }
83 }

◆ getFirstID()

ilnetucateResponse::getFirstID ( )

Definition at line 90 of file class.ilnetucateResponse.php.

91 {
92 reset($this->data['id']);
93 return current($this->data['id']);
94 }

◆ getResultMsg()

ilnetucateResponse::getResultMsg ( )

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

86 {
87 return trim($this->data['result']['cdata']);
88 }

◆ handlerBeginTag()

ilnetucateResponse::handlerBeginTag (   $a_xml_parser,
  $a_name,
  $a_attribs 
)

handler for begin of element

Definition at line 141 of file class.ilnetucateResponse.php.

142 {
143 global $ilErr;
144
145 switch($a_name)
146 {
147 case "netucate.API.Response":
148 $this->data['response']['failureCount'] = $a_attribs['failureCount'];
149 $this->data['response']['operationTotal'] = $a_attribs['operationTotal'];
150 $this->data['response']['status'] = $a_attribs['status'];
151 $this->data['response']['successCount'] = $a_attribs['successCount'];
152 break;
153
154 case "netucate.Result":
155 $this->data['result']['code'] = $a_attribs['code'];
156 $this->data['result']['id'] = $a_attribs['id'];
157 $this->data['result']['name'] = $a_attribs['name'];
158 $this->data['result']['request'] = $a_attribs['request'];
159 break;
160
161 case "netucate.ElementID":
162 $this->data['element']['type'] = $a_attribs['type'];
163 break;
164
165 case "netucate.URL":
166 break;
167
168 case "netucate.ID":
169 break;
170
171 case "netucate.Class.List":
172 case "netucate.User.List":
173 break;
174
175 case "netucate.Class":
176 $this->data['classes'][$a_attribs['classid']] = array (
177 'name' => $a_attribs['name'],
178 'instructoruserid' => $a_attribs['instructoruserid'],
179 'bandwidth' => $a_attribs['bandwidth'],
180 'appsharebandwidth' => $a_attribs['appsharebandwidth'],
181 'description' => $a_attribs['description'],
182 'password' => $a_attribs['password'],
183 'message' => $a_attribs['message'],
184 'floorpolicy' => $a_attribs['floorpolicy'],
185 'conferencetypeid' => $a_attribs['conferencetypeid'],
186 'videobandwidth' => $a_attribs['videobandwidth'],
187 'videoframerate' => $a_attribs['videoframerate'],
188 'enablepush' => $a_attribs['enablepush'],
189 'issecure' => $a_attribs['issecure'],
190 'alwaysopen' => $a_attribs['alwaysopen'],
191 'akclassvalue1' => $a_attribs['akclassvalue1'],
192 'akclassvalue2' => $a_attribs['akclassvalue2']
193 );
194 break;
195
196 case "netucate.User":
197 $this->data['users'][$a_attribs['userid']] = array (
198 'fullname' => $a_attribs['fullname'],
199 'authority' => $a_attribs['authority'],
200 'email' => $a_attribs['email'],
201 'homepage' => $a_attribs['homepage'],
202 'contactinfo' => $a_attribs['contactinfo'],
203 'comment' => $a_attribs['comments'],
204 'phonenumber' => $a_attribs['phonenumber'],
205 'akuservalue1' => $a_attribs['akuservalue1'],
206 'akuservalue2' => $a_attribs['akuservalue2'],
207 );
208 break;
209 }
210 }

References $ilErr.

◆ handlerCharacterData()

ilnetucateResponse::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

handler for character data

Definition at line 250 of file class.ilnetucateResponse.php.

251 {
252 if(!empty($a_data))
253 {
254 $this->cdata .= $a_data;
255 }
256 }

◆ handlerEndTag()

ilnetucateResponse::handlerEndTag (   $a_xml_parser,
  $a_name 
)

Definition at line 213 of file class.ilnetucateResponse.php.

214 {
215 switch($a_name)
216 {
217 case "netucate.API.Response":
218 $this->data['response']['cdata'] = $this->cdata;
219 break;
220
221 case "netucate.Result":
222 $this->data['result']['cdata'] = $this->cdata;
223 break;
224
225 case "netucate.ElementID":
226 //$this->data['element']['cdata'] = $this->cdata;
227 break;
228
229 case "netucate.URL":
230 $this->data['url']['cdata'] = trim($this->cdata);
231 break;
232
233 case "netucate.ID":
234 $this->data['id'][trim($this->cdata)] = trim($this->cdata);
235 break;
236
237 case "netucate.Class.List":
238 case "netucate.Class":
239 case "netucate.User.List":
240 case "netucate.User":
241 break;
242 }
243
244 $this->cdata = '';
245 }

◆ ilnetucateResponse()

ilnetucateResponse::ilnetucateResponse (   $a_str)

Constructor @access public.

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

42 {
43 $xml_str = $this->validateInput($a_str);
44
45 parent::ilSaxParser($xml_str);
46
47 $this->startParsing();
48 }
startParsing()
start the parser

References startParsing(), and validateInput().

+ Here is the call graph for this function:

◆ isError()

ilnetucateResponse::isError ( )

Definition at line 67 of file class.ilnetucateResponse.php.

68 {
69 if ($this->data['response']['status'] == "error" or $this->data['response']['status'] == "")
70 {
71 return true;
72 }
73
74 return false;
75 }

◆ parse()

ilnetucateResponse::parse (   $a_xml_parser,
  $a_xml_str 
)

parse xml file

@access private

Reimplemented from ilSaxParser.

Definition at line 127 of file class.ilnetucateResponse.php.

128 {
129 $parseOk = xml_parse($a_xml_parser,$a_xml_str,true);
130
131 if (!$parseOk && (xml_get_error_code($a_xml_parser) != XML_ERROR_NONE))
132 {
133 $this->ilias->raiseError("XML Parse Error: ".xml_error_string(xml_get_error_code($a_xml_parser)),$this->ilias->error_obj->FATAL);
134 }
135 }
redirection script todo: (a better solution should control the processing via a xml file)

Referenced by startParsing().

+ Here is the caller graph for this function:

◆ setHandlers()

ilnetucateResponse::setHandlers (   $a_xml_parser)

set event handler should be overwritten by inherited class @access private

Reimplemented from ilSaxParser.

Definition at line 102 of file class.ilnetucateResponse.php.

103 {
104 xml_set_object($a_xml_parser,$this);
105 xml_set_element_handler($a_xml_parser,'handlerBeginTag','handlerEndTag');
106 xml_set_character_data_handler($a_xml_parser,'handlerCharacterData');
107 }

Referenced by startParsing().

+ Here is the caller graph for this function:

◆ startParsing()

ilnetucateResponse::startParsing ( )

start the parser

Reimplemented from ilSaxParser.

Definition at line 112 of file class.ilnetucateResponse.php.

113 {
114 $xml_parser = $this->createParser();
115 $this->setOptions($xml_parser);
116 $this->setHandlers($xml_parser);
117 $this->parse($xml_parser,$this->xml_file);
118 $this->freeParser($xml_parser);
119 return true;
120 }
freeParser($a_xml_parser)
free xml parser handle
createParser()
create parser
setOptions($a_xml_parser)
set parser options
parse($a_xml_parser, $a_xml_str)
parse xml file
setHandlers($a_xml_parser)
set event handler should be overwritten by inherited class @access private

References ilSaxParser\createParser(), ilSaxParser\freeParser(), parse(), setHandlers(), and ilSaxParser\setOptions().

Referenced by ilnetucateResponse().

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

◆ validateInput()

ilnetucateResponse::validateInput (   $a_str)

Definition at line 50 of file class.ilnetucateResponse.php.

51 {
52 $response = split("\r\n\r\n",$a_str);
53
54 $header = $response[0];
55 $response_data = $response[1];
56
57 if (strpos($response_data,"<?xml") === false)
58 {
59 echo "netucateResponse::validateInput() : No valid response data!<br/>";
60 var_dump($header,$response_data);
61 exit;
62 }
63
64 return chop($response_data);
65 }
exit
Definition: login.php:54

References exit.

Referenced by ilnetucateResponse().

+ Here is the caller graph for this function:

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