2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Cindy Qi Li, Harris Wong */
6 /* Adaptive Technology Resource Centre / University of Toronto */
9 /* This program is free software. You can redistribute it and/or */
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /************************************************************************/
13 // $Id: SOAP_openmeetings.php 7575 2008-06-02 18:17:14Z hwong $
14 if (!defined('AT_INCLUDE_PATH')) { exit; }
16 //require(AT_INCLUDE_PATH . 'classes/nusoap.php');
17 require('nusoap.php'); //newer version, come with the module
21 * Class for using the SOAP service for openmeetings
22 * Please refer to the following API:
23 * http://code.google.com/p/openmeetings/wiki/SoapMethods
28 class SOAP_openmeetings {
29 var $_sid = ""; //session id
30 var $_soapClient = NULL; //soap connector
31 var $_wsdl = ""; //soap service link
33 function SOAP_openmeetings($wsdl) {
35 $this->_soapClient = new nusoap_client($this->_wsdl, true);
36 $getSession_obj = $this->_performAPICall('getSession', '');
38 if (!$getSession_obj){
39 $this->_sid = session_id(); //openmeeting will return error code on this
41 $this->_sid = $getSession_obj['return']['session_id'];
46 * Login as an user and sets a session
52 function login($parameters = array()) {
53 if (!isset($parameters["username"])) {
56 return $this->_performAPICall(
61 "username" => $parameters["username"],
62 "userpass" => $parameters["userpass"]
74 function saveUserInstance($parameters = array()) {
75 return $this->_performAPICall(
80 "username" => $parameters["username"],
81 "firstname" => $parameters["firstname"],
82 "lastname" => $parameters["lastname"],
83 "profilePictureUrl" => $parameters[""],
84 "email" => $parameters["email"]
92 function getError($code){
93 return $this->_performAPICall(
106 function addRoom($parameters = array()){
107 return $this->_performAPICall(
111 "SID" => $parameters["SID"],
112 'name' => $parameters["name"],
113 'roomtypes_id' => $parameters["roomtypes_id"],
114 'comment' => 'Room created by ATutor',
115 'numberOfPartizipants' => $parameters["numberOfPartizipants"],
116 'ispublic' => $parameters["ispublic"],
117 'videoPodWidth' => $parameters["videoPodWidth"],
118 'videoPodHeight' => $parameters["videoPodHeight"],
119 'videoPodXPosition' => 2,
120 'videoPodYPosition' => 2,
121 'moderationPanelXPosition' => 400,
122 'showWhiteBoard' => $parameters["showWhiteBoard"],
123 'whiteBoardPanelXPosition' => 276,
124 'whiteBoardPanelYPosition' => 2,
125 'whiteBoardPanelHeight' => $parameters["whiteBoardPanelHeight"],
126 'whiteBoardPanelWidth' => $parameters["whiteBoardPanelWidth"],
127 'showFilesPanel' => $parameters["showFilesPanel"],
128 'filesPanelXPosition' => 2,
129 'filesPanelYPosition' => 284,
130 'filesPanelHeight' => $parameters["filesPanelHeight"],
131 'filesPanelWidth' => $parameters["filesPanelWidth"]
140 function updateRoom($parameters = array()){
141 return $this->_performAPICall(
145 'SID' => $parameters["SID"],
146 'rooms_id' => $parameters["rooms_id"],
147 'name' => $parameters["name"],
148 'roomtypes_id' => $parameters["roomtypes_id"],
149 'comment' => 'Room created by ATutor',
150 'numberOfPartizipants' => $parameters["numberOfPartizipants"],
151 'ispublic' => $parameters["ispublic"],
152 'videoPodWidth' => $parameters["videoPodWidth"],
153 'videoPodHeight' => $parameters["videoPodHeight"],
154 'videoPodXPosition' => 2,
155 'videoPodYPosition' => 2,
156 'moderationPanelXPosition' => 400,
157 'showWhiteBoard' => $parameters["showWhiteBoard"],
158 'whiteBoardPanelXPosition' => 276,
159 'whiteBoardPanelYPosition' => 2,
160 'whiteBoardPanelHeight' => $parameters["whiteBoardPanelHeight"],
161 'whiteBoardPanelWidth' => $parameters["whiteBoardPanelWidth"],
162 'showFilesPanel' => $parameters["showFilesPanel"],
163 'filesPanelXPosition' => 2,
164 'filesPanelYPosition' => 284,
165 'filesPanelHeight' => $parameters["filesPanelHeight"],
166 'filesPanelWidth' => $parameters["filesPanelWidth"]
175 function deleteRoom($parameters = array()){
176 return $this->_performAPICall(
179 "SID" => $parameters["SID"],
180 "rooms_id" => $parameters["rooms_id"]
187 * return the session id.
196 function getRoomById($parameters = array()){
197 return $this->_performAPICall(
200 "SID" => $parameters["SID"],
201 "rooms_id" => $parameters["rooms_id"]
214 function _performAPICall($apiCall, $parameters) {
215 $result = $this->_soapClient->call(
220 if ($this->_soapClient->fault){
222 } elseif ($this->_soapClient->getError()){
226 // if (!PEAR::isError($result)) {
227 if (is_array($result)) {
235 return $this->_soapClient->getError();