Author: seba.wagner
Date: Fri Jun 19 04:26:21 2009
New Revision: 2081
Modified:
trunk/plugins/moodle_plugin/db/install.xml
trunk/plugins/moodle_plugin/lib.php
trunk/plugins/moodle_plugin/mod_form.php
trunk/plugins/moodle_plugin/openmeetings_gateway.php
trunk/plugins/moodle_plugin/videoconference.php
trunk/plugins/moodle_plugin/view.php
Log:
Fixes:
edit nusoap_client to nusoap_client_om to fix creation of rooms.
Enhances:
Create different Types of Rooms via Moodle Plugin
Set different Languages for each Room via Moodle Plugin
Set number of Max Participants for each Room via Moodle Plugin
Set if the Room is Moderated or not via Moodle Plugin
Usage of new SOAP-Calls
The Files contain some debug that must be sort out before a package is done
Modified: trunk/plugins/moodle_plugin/db/install.xml
==============================================================================
--- trunk/plugins/moodle_plugin/db/install.xml (original)
+++ trunk/plugins/moodle_plugin/db/install.xml Fri Jun 19 04:26:21 2009
@@ -8,8 +8,12 @@
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true"
UNSIGNED="true" SEQUENCE="true" ENUM="false" COMMENT="id of the table"
NEXT="course"/>
<FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true"
UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Course
whiteboard activity belongs to" PREVIOUS="id" NEXT="teacher"/>
- <FIELD NAME="teacher" TYPE="int" LENGTH="10" NOTNULL="true"
UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Teacher
id" PREVIOUS="course" NEXT="name"/>
- <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true"
SEQUENCE="false" ENUM="false" COMMENT="name field for moodle instances"
PREVIOUS="teacher" NEXT="intro"/>
+ <FIELD NAME="teacher" TYPE="int" LENGTH="10" NOTNULL="true"
UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Teacher
id" PREVIOUS="course" NEXT="type"/>
+ <FIELD NAME="type" TYPE="int" LENGTH="10" NOTNULL="true"
UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" COMMENT="RoomType
id" PREVIOUS="teacher" NEXT="is_moderated_room"/>
+ <FIELD NAME="is_moderated_room" TYPE="int" LENGTH="10"
NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false"
COMMENT="RoomType id" PREVIOUS="type" NEXT="max_user"/>
+ <FIELD NAME="max_user" TYPE="int" LENGTH="10" NOTNULL="true"
UNSIGNED="true" DEFAULT="4" SEQUENCE="false" ENUM="false" COMMENT="RoomType
id" PREVIOUS="is_moderated_room" NEXT="language"/>
+ <FIELD NAME="language" TYPE="int" LENGTH="10" NOTNULL="true"
UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" COMMENT="RoomType
id" PREVIOUS="max_user" NEXT="name"/>
+ <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true"
SEQUENCE="false" ENUM="false" COMMENT="name field for moodle instances"
PREVIOUS="language" NEXT="intro"/>
<FIELD NAME="intro" TYPE="text" LENGTH="medium" NOTNULL="false"
SEQUENCE="false" ENUM="false" COMMENT="General introduction of the
whiteboard activity" PREVIOUS="name" NEXT="introformat"/>
<FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true"
UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Format
of the intro field (MOODLE, HTML, MARKDOWN...)" PREVIOUS="intro"
NEXT="timecreated"/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true"
UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false"
PREVIOUS="introformat" NEXT="timemodified"/>
Modified: trunk/plugins/moodle_plugin/lib.php
==============================================================================
--- trunk/plugins/moodle_plugin/lib.php (original)
+++ trunk/plugins/moodle_plugin/lib.php Fri Jun 19 04:26:21 2009
@@ -36,10 +36,10 @@
function openmeetings_add_instance($openmeetings) {
global $USER, $CFG;
-
+
$openmeetings_gateway = new openmeetings_gateway();
if ($openmeetings_gateway->openmeetings_loginuser()) {
- $openmeetings->room_id =
$openmeetings_gateway->openmeetings_createroom($openmeetings,1);
+ $openmeetings->room_id =
$openmeetings_gateway->openmeetings_createroomwithmod($openmeetings);
} else {
echo "Could not login User to OpenMeetings, check your OpenMeetings
Module Configuration";
exit();
Modified: trunk/plugins/moodle_plugin/mod_form.php
==============================================================================
--- trunk/plugins/moodle_plugin/mod_form.php (original)
+++ trunk/plugins/moodle_plugin/mod_form.php Fri Jun 19 04:26:21 2009
@@ -13,11 +13,50 @@
/// Adding the "general" fieldset, where all the common settings are
showed
$mform->addElement('header', 'general',
get_string('general', 'form'));
/// Adding the standard "name" field
- $mform->addElement('text', 'name',
get_string('openmeetingsname', 'openmeetings'), array('size'=>'64'));
+ $mform->addElement('text', 'name', get_string('Room
Name', 'openmeetings'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');
+
+ /// Adding the "Room Type" field
+ $mform->addElement('select', 'type', get_string('Room
Type', 'openmeetings'), array('1'=>'Conference Room', '2'=>'Audience
Room'));
+ $mform->addRule('type', null, 'required', null, 'client');
+
+ /// Adding the "Number of Participants" field
+ $mform->addElement('select', 'max_user', get_string('Max
User', 'openmeetings'),
array('2'=>'2', '4'=>'4', '8'=>'8', '16'=>'16', '24'=>'24', '36'=>'36', '50'=>'50', '100'=>'100', '200'=>'200', '500'=>'500', '1000'=>'1000'));
+ $mform->addRule('max_user', null, 'required', null, 'client');
+
+ /// Adding the "Is Moderated Room" field
+ $mform->addElement('select', 'is_moderated_room', get_string('Wait
for teacher', 'openmeetings'), array('1'=>'Participants need to wait till
the teacher enters the room','2' => 'Participants can already start (first
User in Room becomes Moderator)'));
+ $mform->addRule('is_moderated_room', null, 'required',
null, 'client');
+
+ /// Adding the "Room Language" field
+ $language_array = array ('1' => 'english',
+ '2' => 'deutsch',
+ '3' => 'french',
+ '4' => 'italian',
+ '5' => 'portugues',
+ '6' => 'spanish',
+ '7' => 'russian',
+ '8' => 'swedish',
+ '9' => 'chinese simplified',
+ '10' => 'chinese traditional',
+ '11' => 'korean',
+ '12' => 'arabic',
+ '13' => 'japanese',
+ '14' => 'indonesian',
+ '15' => 'hungarian',
+ '16' => 'turkish',
+ '17' => 'ukrainian',
+ '18' => 'thai',
+ '19' => 'persian',
+ '20' => 'czech',
+ '21' => 'galician');
+
+ $mform->addElement('select', 'language', get_string('Room
Language', 'openmeetings'), $language_array);
+ $mform->addRule('language', null, 'required', null, 'client');
+
/// Adding the optional "intro" and "introformat" pair of fields
- $mform->addElement('htmleditor', 'intro',
get_string('openmeetingsintro', 'openmeetings'));
+ $mform->addElement('htmleditor', 'intro',
get_string('Comment', 'openmeetings'));
$mform->setType('intro', PARAM_RAW);
$mform->addRule('intro', get_string('required'), 'required',
null, 'client');
$mform->setHelpButton('intro', array('writing', 'richtext'),
false, 'editorhelpbutton');
Modified: trunk/plugins/moodle_plugin/openmeetings_gateway.php
==============================================================================
--- trunk/plugins/moodle_plugin/openmeetings_gateway.php (original)
+++ trunk/plugins/moodle_plugin/openmeetings_gateway.php Fri Jun 19
04:26:21 2009
@@ -16,6 +16,8 @@
//<loginUser
xmlns="
http://services.axis.openmeetings.org"><SID>93e7e34036e1b0a243a481c12bd4fb7d</SID><username>SebastianWagner</username><userpass>asdasd</userpass></loginUser>
//addRoom
xmlns="
http://services.axis.openmeetings.org"><SID>e4477f29c7c99bca7768c06a75e35cdc</SID><name>MOODLE_COURSE_ID_6_NAME_asdasdasd</name><roomtypes_id>1</roomtypes_id><comment>Created
by SOAP-Gateway for Moodle
Platform</comment><numberOfPartizipants>4</numberOfPartizipants><ispublic>true</ispublic><videoPodWidth>270</videoPodWidth><videoPodHeight>280</videoPodHeight><videoPodXPosition>2</videoPodXPosition><videoPodYPosition>2</videoPodYPosition><moderationPanelXPosition>400</moderationPanelXPosition><showWhiteBoard>true</showWhiteBoard><whiteBoardPanelXPosition>276</whiteBoardPanelXPosition><whiteBoardPanelYPosition>2</whiteBoardPanelYPosition><whiteBoardPanelHeight>592</whiteBoardPanelHeight><whiteBoardPanelWidth>660</whiteBoardPanelWidth><showFilesPanel>true</showFilesPanel><filesPanelXPosition>2</filesPanelXPosition><filesPanelYPosition>284</filesPanelYPosition><filesPanelHeight>310</filesPanelHeight><filesPanelWidth>270</filesPanelWidth></addRoom>
+//echo "DIRROOT: ".$CFG->dirroot."<br/>";
+
require_once($CFG->dirroot.'/mod/openmeetings/lib/nusoap.php');
//require_once($CFG->dirroot.'/lib/soaplib.php');
@@ -35,7 +37,9 @@
// echo "USER: ".$CFG->openmeetings_openmeetingsAdminUser."<br/>";
// echo "Pass: ".$CFG->openmeetings_openmeetingsAdminUserPass."<br/>";
- $client_userService = new
nusoap_client("http://".$CFG->openmeetings_red5host.":".$CFG->openmeetings_red5port."/openmeetings/services/UserService?wsdl", "wsdl");
+ //echo "DIRROOT: ".$CFG->dirroot."<br/>";
+
+ $client_userService = new
nusoap_client_om("http://".$CFG->openmeetings_red5host.":".$CFG->openmeetings_red5port."/openmeetings/services/UserService?wsdl", "wsdl");
$client_userService->setUseCurl(true);
//echo "Client inited"."<br/>";
$err = $client_userService->getError();
@@ -89,6 +93,9 @@
/**
* TODO: Check Error handling
+ *
+ * @deprecated this method is deprecated
+ *
*/
function openmeetings_createroom($openmeetings,$roomtypes_id) {
global $USER, $CFG;
@@ -103,7 +110,7 @@
//echo $client_userService."<br/>";
- $client_roomService = new
nusoap_client("http://".$CFG->openmeetings_red5host.":".$CFG->openmeetings_red5port."/openmeetings/services/RoomService?wsdl",
true);
+ $client_roomService = new
nusoap_client_om("http://".$CFG->openmeetings_red5host.":".$CFG->openmeetings_red5port."/openmeetings/services/RoomService?wsdl",
true);
$err = $client_roomService->getError();
if ($err) {
@@ -149,10 +156,64 @@
return -1;
}
+ function openmeetings_createroomwithmod($openmeetings) {
+ global $USER, $CFG;
+
+ // echo $CFG->openmeetings_red5host."<br/>";
+ // echo $CFG->openmeetings_red5port."<br/>";
+ // foreach ($CFG as $key => $value){
+ // echo "KEY: ".$key." Value: ".$value."<br/>";
+ // }
+ $course_name
= 'MOODLE_COURSE_ID_'.$openmeetings->course.'_NAME_'.$openmeetings->name;
+ //echo "CourseName: ".$course_name."<br/>";
+
+ //echo $client_userService."<br/>";
+
+ $client_roomService = new
nusoap_client_om("http://".$CFG->openmeetings_red5host.":".$CFG->openmeetings_red5port."/openmeetings/services/RoomService?wsdl",
true);
+
+ $err = $client_roomService->getError();
+ if ($err) {
+ echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
+ echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(),
ENT_QUOTES) . '</pre>';
+ exit();
+ }
+
+ $isModeratedRoom = false;
+ if ($openmeetings->is_moderated_room == 1) {
+ $isModeratedRoom = true;
+ }
+
+ $params = array(
+ 'SID' => $this->session_id,
+ 'name' => $course_name,
+ 'roomtypes_id' => $openmeetings->type,
+ 'comment' => 'Created by SOAP-Gateway for Moodle Platform',
+ 'numberOfPartizipants' => $openmeetings->max_user,
+ 'ispublic' => true,
+ 'appointment' => false,
+ 'isDemoRoom' => false,
+ 'demoTime' => 0,
+ 'isModeratedRoom' => $isModeratedRoom
+ );
+ $result = $client_roomService->call('addRoomWithModeration',$params);
+ if ($client_roomService->fault) {
+ echo '<h2>Fault (Expect - The request contains an invalid SOAP
body)</h2><pre>'; print_r($result); echo '</pre>';
+ } else {
+ $err = $client_roomService->getError();
+ if ($err) {
+ echo '<h2>Error</h2><pre>' . $err . '</pre>';
+ } else {
+ //echo '<h2>Result</h2><pre>'; print_r($result["return"]);
echo '</pre>';
+ return $result["return"];
+ }
+ }
+ return -1;
+ }
+
function openmeetings_setUserObject($username, $firstname, $lastname,
$profilePictureUrl, $email) {
global $USER, $CFG;
- $client_userService = new
nusoap_client("http://".$CFG->openmeetings_red5host.":".$CFG->openmeetings_red5port."/openmeetings/services/UserService?wsdl",
true);
+ $client_userService = new
nusoap_client_om("http://".$CFG->openmeetings_red5host.":".$CFG->openmeetings_red5port."/openmeetings/services/UserService?wsdl",
true);
$err = $client_userService->getError();
if ($err) {
Modified: trunk/plugins/moodle_plugin/videoconference.php
==============================================================================
--- trunk/plugins/moodle_plugin/videoconference.php (original)
+++ trunk/plugins/moodle_plugin/videoconference.php Fri Jun 19 04:26:21 2009
@@ -15,9 +15,25 @@
$openmeetings_swfURL
= "http://".$_GET["red5host"].":".$_GET["red5httpPort"]."/openmeetings/main.lzx.swf8.swf?" .
"roomid=".$_GET["roomid"] .
"&sid=".$_GET["sid"] .
- "&language=".$_GET["language"];
-
-//echo $openmeetings_swfURL;
+ "&language=".$_GET["language"] .
+ "&picture=".$_GET["picture"] .
+ "&user_id=".$_GET["user_id"] .
+ "&wwwroot=".$_GET["wwwroot"] .
+ "&moodleRoom=1";
+
+/*
+ * For Debugging
+ */
+$openmeetings_swfURL
= "
http://192.168.0.31:8080/lps-4.3.0/openmeetings/maindebug.lzx?lzt=swf&lzr=swf8&lzproxied=solo" .
+ "&roomid=".$_GET["roomid"] .
+ "&sid=".$_GET["sid"] .
+ "&language=".$_GET["language"] .
+ "&picture=".$_GET["picture"] .
+ "&user_id=".$_GET["user_id"] .
+ "&wwwroot=".$_GET["wwwroot"] .
+ "&moodleRoom=1";
+
+echo $openmeetings_swfURL;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
Modified: trunk/plugins/moodle_plugin/view.php
==============================================================================
--- trunk/plugins/moodle_plugin/view.php (original)
+++ trunk/plugins/moodle_plugin/view.php Fri Jun 19 04:26:21 2009
@@ -107,11 +107,24 @@
if ($show != "false") {
-// echo $USER->username."<br/>";
-// echo $USER->firstname."<br/>";
-// echo $USER->lastname."<br/>";
-// echo $USER->email."<br/>";
-// echo $USER->picture."<br/>";
+ echo $USER->id."<br/>";
+ echo $USER->username."<br/>";
+ echo $USER->firstname."<br/>";
+ echo $USER->lastname."<br/>";
+ echo $USER->email."<br/>";
+ echo $USER->picture."<br/>";
+ echo $CFG->wwwroot."<br/>";
+
+ echo $USER->access->rdef."<br/>";
+
+ foreach ($USER->access as $key => $value) {
+ echo $key." => ".$value."<br/>";
+ }
+
+ foreach ($USER->access['rdef'] as $key => $value) {
+ echo $key." => ".$value."<br/>";
+ }
+
$openmeetings_gateway = new openmeetings_gateway();
if ($openmeetings_gateway->openmeetings_loginuser()) {
@@ -122,9 +135,12 @@
$iframe_d = "videoconference.php?" .
"sid=".$openmeetings_gateway->session_id .
"&roomid=".$openmeetings->room_id .
- "&language=".$CFG->openmeetings_openmeetingsLanguage .
+ "&language=".$openmeetings->language .
"&red5host=".$CFG->openmeetings_red5host .
- "&red5httpPort=".$CFG->openmeetings_red5port;
+ "&red5httpPort=".$CFG->openmeetings_red5port .
+ "&picture=".$USER->picture .
+ "&user_id=".$USER->id .
+ "&wwwroot=".$CFG->wwwroot;
printf("<iframe src='%s' width='%s' height='%s' />",$iframe_d,
$CFG->openmeetings_openmeetingsiFrameWidth,