Merge pull request #683 from ritzalam/reconnect-to-bbb-video
Work on displaying whiteboard result
This commit is contained in:
commit
b67b59b379
@ -8,6 +8,7 @@ public class WhiteboardKeyUtil {
|
||||
public static final String ELLIPSE_TYPE = "ellipse";
|
||||
public static final String TRIANGLE_TYPE = "triangle";
|
||||
public static final String LINE_TYPE = "line";
|
||||
public static final String POLL_RESULT_TYPE = "poll_result";
|
||||
|
||||
public static final String TEXT_CREATED_STATUS = "textCreated";
|
||||
public static final String DRAW_START_STATUS = "DRAW_START";
|
||||
|
@ -328,7 +328,7 @@ class BigBlueButtonInGW(val system: ActorSystem, outGW: MessageOutGateway, voice
|
||||
* Message Interface for Whiteboard
|
||||
* *****************************************************************
|
||||
*/
|
||||
private def buildAnnotation(annotation: Map[String, Object]): Option[AnnotationVO] = {
|
||||
private def buildAnnotation(annotation: scala.collection.mutable.Map[String, Object]): Option[AnnotationVO] = {
|
||||
var shape: Option[AnnotationVO] = None
|
||||
|
||||
val id = annotation.getOrElse("id", null).asInstanceOf[String]
|
||||
@ -345,7 +345,7 @@ class BigBlueButtonInGW(val system: ActorSystem, outGW: MessageOutGateway, voice
|
||||
}
|
||||
|
||||
def sendWhiteboardAnnotation(meetingID: String, requesterID: String, annotation: java.util.Map[String, Object]) {
|
||||
val ann = mapAsScalaMap(annotation).toMap
|
||||
val ann: scala.collection.mutable.Map[String, Object] = mapAsScalaMap(annotation)
|
||||
|
||||
buildAnnotation(ann) match {
|
||||
case Some(shape) => {
|
||||
|
@ -231,9 +231,7 @@ class Answer(val id: Int, val key: String, val text: Option[String]) {
|
||||
responders.clear
|
||||
}
|
||||
def addResponder(responder: Responder) {
|
||||
println("********************************************************************** Add response for key=[" + key + "] votes=[" + numResponders + "]")
|
||||
responders += responder
|
||||
println("********************************************************************** Added response for key=[" + key + "] votes=[" + numResponders + "]")
|
||||
}
|
||||
|
||||
def numResponders(): Int = {
|
||||
@ -251,7 +249,6 @@ class Answer(val id: Int, val key: String, val text: Option[String]) {
|
||||
}
|
||||
|
||||
def toSimpleVoteOutVO(): SimpleVoteOutVO = {
|
||||
println("********************************************************************** Num response for key=[" + key + "] votes=[" + numResponders + "]")
|
||||
new SimpleVoteOutVO(id, key, numResponders)
|
||||
}
|
||||
}
|
@ -4,6 +4,8 @@ import org.bigbluebutton.core.api._
|
||||
import org.bigbluebutton.core.MeetingActor
|
||||
import scala.collection.mutable.HashMap
|
||||
import scala.collection.mutable.ArrayBuffer
|
||||
import org.bigbluebutton.core.service.whiteboard.WhiteboardKeyUtil
|
||||
import com.google.gson.Gson
|
||||
|
||||
trait PollApp {
|
||||
this: MeetingActor =>
|
||||
@ -60,11 +62,39 @@ trait PollApp {
|
||||
}
|
||||
}
|
||||
|
||||
def pollResultToWhiteboardShape(result: SimplePollResultOutVO, msg: ShowPollResultRequest): scala.collection.immutable.Map[String, Object] = {
|
||||
val shape = new scala.collection.mutable.HashMap[String, Object]()
|
||||
|
||||
val answers = new ArrayBuffer[java.util.HashMap[String, Object]];
|
||||
result.answers.foreach(ans => {
|
||||
val amap = new java.util.HashMap[String, Object]()
|
||||
amap.put("id", ans.id: java.lang.Integer)
|
||||
amap.put("key", ans.key)
|
||||
amap.put("num_votes", ans.numVotes: java.lang.Integer)
|
||||
answers += amap
|
||||
})
|
||||
|
||||
val gson = new Gson()
|
||||
shape += "result" -> gson.toJson(answers.toArray)
|
||||
|
||||
val display = Array(0, 0, 200, 200)
|
||||
shape += "points" -> display
|
||||
shape.toMap
|
||||
}
|
||||
|
||||
def handleShowPollResultRequest(msg: ShowPollResultRequest) {
|
||||
pollModel.getSimplePollResult(msg.pollId) match {
|
||||
case Some(poll) => {
|
||||
pollModel.showPollResult(poll.id)
|
||||
outGW.send(new PollShowResultMessage(mProps.meetingID, mProps.recorded, msg.requesterId, msg.pollId, poll))
|
||||
val shape = pollResultToWhiteboardShape(poll, msg)
|
||||
|
||||
for {
|
||||
page <- presModel.getCurrentPage()
|
||||
annotation = new AnnotationVO(poll.id, WhiteboardKeyUtil.DRAW_END_STATUS, WhiteboardKeyUtil.POLL_RESULT_TYPE, shape, page.id)
|
||||
} this.context.self ! new SendWhiteboardAnnotationRequest(mProps.meetingID, msg.requesterId, annotation)
|
||||
|
||||
// outGW.send(new PollShowResultMessage(mProps.meetingID, mProps.recorded, msg.requesterId, msg.pollId, poll))
|
||||
|
||||
}
|
||||
case None => {
|
||||
val result = new RequestResult(StatusCodes.NOT_FOUND, Some(Array(ErrorCodes.RESOURCE_NOT_FOUND)))
|
||||
|
@ -2,7 +2,7 @@ package org.bigbluebutton.core.apps
|
||||
|
||||
import scala.collection.mutable.ArrayBuffer
|
||||
|
||||
case class AnnotationVO(id: String, status: String, shapeType: String, shape: scala.collection.immutable.Map[String, Object], wbId: String)
|
||||
case class AnnotationVO(id: String, status: String, shapeType: String, shape: scala.collection.immutable.Map[String, Any], wbId: String)
|
||||
|
||||
class WhiteboardModel {
|
||||
private var _whiteboards = new scala.collection.immutable.HashMap[String, Whiteboard]()
|
||||
|
@ -20,7 +20,7 @@ object UsersMessageToJsonConverter {
|
||||
wuser += "presenter" -> user.presenter
|
||||
wuser += "has_stream" -> user.hasStream
|
||||
wuser += "locked" -> user.locked
|
||||
wuser += "webcam_stream" -> user.webcamStreams
|
||||
wuser += "webcam_stream" -> user.webcamStreams.toArray
|
||||
wuser += "phone_user" -> user.phoneUser
|
||||
wuser += "listenOnly" -> user.listenOnly
|
||||
|
||||
|
@ -53,7 +53,13 @@ class WhiteboardEventRedisRecorder(recorder: RecorderApplication) extends OutMes
|
||||
event.setPresentation(getPresentationId(msg.whiteboardId))
|
||||
event.setPageNumber(getPageNum(msg.whiteboardId))
|
||||
event.setWhiteboardId(msg.whiteboardId)
|
||||
event.addAnnotation(mapAsJavaMap(msg.shape.shape))
|
||||
|
||||
// FIXME: Need to fix recording of wb event (ralam june 29, 2015)
|
||||
//val ann: java.util.Map[String, Any] = mapAsJavaMap(msg.shape.shape)
|
||||
// val ann: java.util.Map[String, Object] = mapAsJavaMap(msg.shape.shape)
|
||||
// val ann2: java.util.Map[String, Object] = mapAsJavaMap(ann)
|
||||
|
||||
// event.addAnnotation(mapAsJavaMap(ann))
|
||||
recorder.record(msg.meetingID, event)
|
||||
} else {
|
||||
val event = new AddShapeWhiteboardRecordEvent()
|
||||
@ -62,7 +68,8 @@ class WhiteboardEventRedisRecorder(recorder: RecorderApplication) extends OutMes
|
||||
event.setPresentation(getPresentationId(msg.whiteboardId))
|
||||
event.setPageNumber(getPageNum(msg.whiteboardId))
|
||||
event.setWhiteboardId(msg.whiteboardId);
|
||||
event.addAnnotation(mapAsJavaMap(msg.shape.shape))
|
||||
// FIXME: Need to fix recording of wb event (ralam june 29, 2015)
|
||||
// event.addAnnotation(mapAsJavaMap(msg.shape.shape))
|
||||
recorder.record(msg.meetingID, event)
|
||||
}
|
||||
}
|
||||
|
@ -200,6 +200,8 @@ public class Util {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Map<String, Object> extractAnnotation(JsonObject annotationElement) {
|
||||
//NON-TEXT SHAPE
|
||||
if (annotationElement.has(Constants.ID)
|
||||
|
@ -70,15 +70,13 @@ public class WhiteboardClientMessageSender {
|
||||
}
|
||||
}
|
||||
|
||||
private void processSendWhiteboardAnnotationReplyMessage(
|
||||
SendWhiteboardAnnotationReplyMessage msg) {
|
||||
private void processSendWhiteboardAnnotationReplyMessage(SendWhiteboardAnnotationReplyMessage msg) {
|
||||
|
||||
Map<String, Object> args = new HashMap<String, Object>();
|
||||
args.put("whiteboardId", msg.whiteboardId);
|
||||
|
||||
Map<String, Object> shape = new HashMap<String, Object>();
|
||||
|
||||
System.out.println("\n\n"+msg.shape.toString() +"\n\n");
|
||||
shape.put("id", msg.shape.get("id"));
|
||||
shape.put("type", msg.shape.get("type"));
|
||||
shape.put("status", msg.shape.get("status"));
|
||||
@ -90,9 +88,6 @@ public class WhiteboardClientMessageSender {
|
||||
Gson gson = new Gson();
|
||||
message.put("msg", gson.toJson(args));
|
||||
|
||||
System.out.println("RedisPubSubMessageHandler - processSendWhiteboardAnnotationReplyMessage \n"
|
||||
+ message.get("msg").toString() + "\n");
|
||||
|
||||
//broadcast message
|
||||
BroadcastClientMessage b = new BroadcastClientMessage(msg.meetingId, "WhiteboardNewAnnotationCommand", message);
|
||||
service.sendMessage(b);
|
||||
|
@ -107,7 +107,7 @@ package org.bigbluebutton.main.model.users
|
||||
}
|
||||
|
||||
public function onMessageFromServer(messageName:String, msg:Object):void {
|
||||
trace(LOG + "Got message from server [" + messageName + "]");
|
||||
trace(LOG + "Got message from server [" + messageName + "] user=[" + UsersUtil.getMyUsername() + "]");
|
||||
if (!authenticated && (messageName == "validateAuthTokenReply")) {
|
||||
handleValidateAuthTokenReply(msg)
|
||||
} else if (messageName == "validateAuthTokenTimedOut") {
|
||||
|
@ -22,17 +22,7 @@
|
||||
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import mx.events.FlexEvent;
|
||||
|
||||
import org.bigbluebutton.main.events.BBBEvent;
|
||||
import org.bigbluebutton.main.events.MadePresenterEvent;
|
||||
import org.bigbluebutton.modules.polling.events.*;
|
||||
import org.bigbluebutton.modules.polling.managers.PollManager;
|
||||
import org.bigbluebutton.modules.polling.model.PollingModel;
|
||||
import org.bigbluebutton.modules.polling.service.MessageReceiver;
|
||||
import org.bigbluebutton.modules.polling.service.MessageSender;
|
||||
import org.bigbluebutton.modules.polling.service.NetworkPollDataService;
|
||||
import org.bigbluebutton.modules.polling.service.PollDataProcessor;
|
||||
import org.bigbluebutton.modules.polling.service.PollingService;
|
||||
|
||||
]]>
|
||||
@ -40,7 +30,7 @@
|
||||
</mx:Script>
|
||||
|
||||
<EventHandlers type="{ModuleEvent.START}">
|
||||
|
||||
<ObjectBuilder generator="{PollingService}" cache="global"/>
|
||||
</EventHandlers>
|
||||
|
||||
<EventHandlers type="{ModuleEvent.STOP}">
|
||||
@ -65,25 +55,6 @@
|
||||
</EventHandlers>
|
||||
|
||||
|
||||
<Injectors target="{PollingService}">
|
||||
<ObjectBuilder generator="{PollDataProcessor}" cache="global"/>
|
||||
<PropertyInjector targetKey="dataService" source="{NetworkPollDataService}"/>
|
||||
<PropertyInjector targetKey="model" source="{PollingModel}"/>
|
||||
</Injectors>
|
||||
|
||||
<Injectors target="{NetworkPollDataService}">
|
||||
<PropertyInjector targetKey="receiver" source="{MessageReceiver}"/>
|
||||
<PropertyInjector targetKey="sender" source="{MessageSender}"/>
|
||||
</Injectors>
|
||||
|
||||
<Injectors target="{PollDataProcessor}">
|
||||
<PropertyInjector targetKey="model" source="{PollingModel}"/>
|
||||
<PropertyInjector targetKey="dispatcher" source="{scope.dispatcher}"/>
|
||||
</Injectors>
|
||||
|
||||
<Injectors target="{MessageReceiver}">
|
||||
<PropertyInjector targetKey="processor" source="{PollDataProcessor}"/>
|
||||
</Injectors>
|
||||
|
||||
<Debugger level="{Debugger.ALL}" />
|
||||
</EventMap>
|
||||
|
@ -18,22 +18,18 @@
|
||||
*/
|
||||
package org.bigbluebutton.modules.polling.service
|
||||
{
|
||||
import com.asfusion.mate.events.Dispatcher;
|
||||
|
||||
import org.bigbluebutton.common.LogUtil;
|
||||
import org.bigbluebutton.core.BBB;
|
||||
import org.bigbluebutton.main.model.users.IMessageListener;
|
||||
import org.bigbluebutton.modules.polling.model.PollingModel;
|
||||
|
||||
public class MessageReceiver implements IMessageListener
|
||||
{
|
||||
private static const LOG:String = "Poll::MessageReceiver - ";
|
||||
|
||||
/* Injected by Mate */
|
||||
public var processor:PollDataProcessor;
|
||||
private var processor:PollDataProcessor;
|
||||
|
||||
public function MessageReceiver() {
|
||||
public function MessageReceiver(processor:PollDataProcessor) {
|
||||
trace(LOG + " registering message listener");
|
||||
this.processor = processor;
|
||||
BBB.initConnectionManager().addMessageListener(this);
|
||||
}
|
||||
|
||||
@ -55,8 +51,5 @@ package org.bigbluebutton.modules.polling.service
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -18,18 +18,9 @@
|
||||
*/
|
||||
package org.bigbluebutton.modules.polling.service
|
||||
{
|
||||
import flash.net.NetConnection;
|
||||
import flash.net.Responder;
|
||||
|
||||
import org.bigbluebutton.common.LogUtil;
|
||||
import org.bigbluebutton.core.BBB;
|
||||
import org.bigbluebutton.core.managers.ConnectionManager;
|
||||
import org.bigbluebutton.modules.present.events.PresentationEvent;
|
||||
import org.bigbluebutton.modules.whiteboard.business.shapes.DrawObject;
|
||||
import org.bigbluebutton.modules.whiteboard.business.shapes.TextObject;
|
||||
import org.bigbluebutton.modules.whiteboard.events.PageEvent;
|
||||
import org.bigbluebutton.modules.whiteboard.events.WhiteboardDrawEvent;
|
||||
import org.bigbluebutton.modules.whiteboard.events.WhiteboardPresenterEvent;
|
||||
|
||||
public class MessageSender
|
||||
{
|
||||
|
@ -5,9 +5,11 @@ package org.bigbluebutton.modules.polling.service
|
||||
{
|
||||
private static const LOG:String = "Poll::NetworkPollDataService - ";
|
||||
|
||||
/* Injected by Mate */
|
||||
public var receiver:MessageReceiver;
|
||||
public var sender:MessageSender;
|
||||
private var sender:MessageSender;
|
||||
|
||||
public function NetworkPollDataService(sender: MessageSender) {
|
||||
this.sender = sender;
|
||||
}
|
||||
|
||||
public function startPoll(pollId:String, pollType: String):void
|
||||
{
|
||||
|
@ -1,7 +1,10 @@
|
||||
package org.bigbluebutton.modules.polling.service
|
||||
{
|
||||
|
||||
import com.asfusion.mate.events.Dispatcher;
|
||||
|
||||
import flash.events.IEventDispatcher;
|
||||
|
||||
import org.bigbluebutton.core.UsersUtil;
|
||||
import org.bigbluebutton.modules.polling.events.PollShowResultEvent;
|
||||
import org.bigbluebutton.modules.polling.events.PollStartedEvent;
|
||||
@ -17,9 +20,13 @@ package org.bigbluebutton.modules.polling.service
|
||||
{
|
||||
private static const LOG:String = "Poll::PollDataProcessor - ";
|
||||
|
||||
/* Injected by Mate */
|
||||
public var model:PollingModel;
|
||||
public var dispatcher:IEventDispatcher;
|
||||
private var model:PollingModel;
|
||||
private var dispatcher:Dispatcher;
|
||||
|
||||
public function PollDataProcessor(model: PollingModel) {
|
||||
this.model = model;
|
||||
this.dispatcher = new Dispatcher();
|
||||
}
|
||||
|
||||
public function handlePollStartedMesage(msg:Object):void {
|
||||
trace(LOG + "*** Poll started " + msg.msg + " **** \n");
|
||||
|
@ -18,11 +18,6 @@
|
||||
*/
|
||||
package org.bigbluebutton.modules.polling.service
|
||||
{
|
||||
|
||||
import org.bigbluebutton.common.IBbbModuleWindow;
|
||||
import org.bigbluebutton.common.LogUtil;
|
||||
import org.bigbluebutton.common.events.OpenWindowEvent;
|
||||
import org.bigbluebutton.core.managers.UserManager;
|
||||
import org.bigbluebutton.modules.polling.events.ShowPollResultEvent;
|
||||
import org.bigbluebutton.modules.polling.events.StartPollEvent;
|
||||
import org.bigbluebutton.modules.polling.events.StopPollEvent;
|
||||
@ -36,9 +31,19 @@ package org.bigbluebutton.modules.polling.service
|
||||
{
|
||||
private static const LOG:String = "Poll::PollingService - ";
|
||||
|
||||
/* Injected by Mate */
|
||||
public var dataService:IPollDataService;
|
||||
public var model:PollingModel;
|
||||
private var dataService:IPollDataService;
|
||||
private var model:PollingModel;
|
||||
private var sender:MessageSender;
|
||||
private var dataProcessor:PollDataProcessor;
|
||||
private var receiver:MessageReceiver;
|
||||
|
||||
public function PollingService() {
|
||||
model = new PollingModel();
|
||||
sender = new MessageSender();
|
||||
dataService = new NetworkPollDataService(sender);
|
||||
dataProcessor = new PollDataProcessor(model);
|
||||
receiver = new MessageReceiver(dataProcessor);
|
||||
}
|
||||
|
||||
public function handleStartModuleEvent(module:PollingModule):void {
|
||||
trace(LOG + " module started event");
|
||||
|
@ -24,13 +24,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import mx.events.FlexEvent;
|
||||
|
||||
import org.bigbluebutton.core.events.LockControlEvent;
|
||||
import org.bigbluebutton.core.events.LockSettingsEvent;
|
||||
import org.bigbluebutton.core.events.VoiceConfEvent;
|
||||
import org.bigbluebutton.main.events.UserLeftEvent;
|
||||
import org.bigbluebutton.main.model.users.events.KickUserEvent;
|
||||
import org.bigbluebutton.main.views.LockSettings;
|
||||
import org.bigbluebutton.modules.users.events.StartUsersModuleEvent;
|
||||
import org.bigbluebutton.modules.users.events.StopUsersModuleEvent;
|
||||
import org.bigbluebutton.modules.users.managers.UsersManager;
|
||||
|
Loading…
Reference in New Issue
Block a user