redo the edition of layouts feature; now moderators receive the broadcasted layout as well as presenter and viewers

This commit is contained in:
Felipe Cecagno 2015-01-26 11:21:04 -02:00
parent ab9753344a
commit eb4e5aa360
8 changed files with 42 additions and 8 deletions

View File

@ -12,7 +12,8 @@ trait LayoutApp {
private var setByUser:String = "system";
private var currentLayout = "";
private var layoutLocked = false
private var viewersOnly = true
// this is not being set by the client, and we need to apply the layouts to all users, not just viewers, so will keep the default value of this as false
private var viewersOnly = false
def handleGetCurrentLayoutRequest(msg: GetCurrentLayoutRequest) {
outGW.send(new GetCurrentLayoutReply(msg.meetingID, recorded, msg.requesterID, currentLayout, permissions.lockedLayout, setByUser))

View File

@ -30,10 +30,10 @@ class LayoutClientMessageSender(service: ConnectionInvokerService) extends OutMe
private def handleBroadcastLayoutEvent(msg: BroadcastLayoutEvent) {
val message = new java.util.HashMap[String, Object]()
message.put("locked", msg.locked:java.lang.Boolean);
message.put("setByUserID", msg.setByUserID);
message.put("setByUserID", msg.requesterID);
message.put("layout", msg.layoutID);
msg.applyTo foreach {u =>
msg.applyTo.filter(_.userID != msg.requesterID) foreach {u =>
var m = new DirectClientMessage(msg.meetingID, u.userID, "syncLayout", message);
service.sendMessage(m);
}

View File

@ -285,7 +285,7 @@ bbb.toolbar.deskshare.toolTip.stop = Stop Sharing Your Desktop
bbb.toolbar.video.toolTip.start = Share Your Webcam
bbb.toolbar.video.toolTip.stop = Stop Sharing Your Webcam
bbb.layout.addButton.toolTip = Add the custom layout to the list
bbb.layout.broadcastButton.toolTip = Apply Current Layout to All Viewers
bbb.layout.broadcastButton.toolTip = Apply Current Layout to All Participants
bbb.layout.combo.toolTip = Change Your Layout
bbb.layout.loadButton.toolTip = Load layouts from a file
bbb.layout.saveButton.toolTip = Save layouts to a file

View File

@ -138,7 +138,7 @@
<module name="LayoutModule" url="http://HOST/client/LayoutModule.swf?v=VERSION"
uri="rtmp://HOST/bigbluebutton"
layoutConfig="http://HOST/client/conf/layout.xml"
enableEdit="false"
enableEdit="true"
/>
<!--

View File

@ -137,8 +137,25 @@ package org.bigbluebutton.modules.layout.managers
_fileRef.save(_layoutModel.toString(), "layouts.xml");
}
public function loadLayoutsFromFile():void {
var loader:LayoutLoader = new LayoutLoader();
loader.addEventListener(LayoutsLoadedEvent.LAYOUTS_LOADED_EVENT, function(e:LayoutsLoadedEvent):void {
if (e.success) {
_layoutModel.addLayouts(e.layouts);
applyLayout(_layoutModel.getDefaultLayout());
broadcastLayouts();
Alert.show(ResourceUtil.getInstance().getString('bbb.layout.load.complete'), "", Alert.OK, _canvas);
} else
Alert.show(ResourceUtil.getInstance().getString('bbb.layout.load.failed'), "", Alert.OK, _canvas);
});
loader.loadFromLocalFile();
}
public function addCurrentLayoutToList():void {
_currentLayout.name += " " + (++_customLayoutsCount);
_layoutModel.addLayout(_currentLayout);
updateCurrentLayout(_currentLayout);
broadcastLayouts();
var redefineLayout:LayoutFromRemoteEvent = new LayoutFromRemoteEvent();
redefineLayout.layout = _currentLayout;
@ -334,6 +351,7 @@ package org.bigbluebutton.modules.layout.managers
_currentLayout = layout;
layout.currentLayout = true;
} else {
_globalDispatcher.dispatchEvent(new LayoutEvent(LayoutEvent.INVALIDATE_LAYOUT_EVENT));
_currentLayout = LayoutDefinition.getLayout(_canvas, ResourceUtil.getInstance().getString('bbb.layout.combo.customName'));
}

View File

@ -112,6 +112,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<MethodInvoker generator="{LayoutManager}" method="saveLayoutsToFile" />
</EventHandlers>
<EventHandlers type="{LayoutEvent.LOAD_LAYOUTS_EVENT}">
<MethodInvoker generator="{LayoutManager}" method="loadLayoutsFromFile" />
</EventHandlers>
<EventHandlers type="{LayoutEvent.ADD_CURRENT_LAYOUT_EVENT}">
<MethodInvoker generator="{LayoutManager}" method="addCurrentLayoutToList" />
</EventHandlers>

View File

@ -64,7 +64,12 @@ package org.bigbluebutton.modules.layout.services
lockLayout(message.locked, message.setById);
_dispatcher.dispatchEvent(new LayoutEvent(LayoutEvent.APPLY_DEFAULT_LAYOUT_EVENT));
if (message.layout == "") {
_dispatcher.dispatchEvent(new LayoutEvent(LayoutEvent.APPLY_DEFAULT_LAYOUT_EVENT));
} else {
// it means that the moderator has used the broadcast layout method before the user joins
handleSyncLayout(message);
}
_dispatcher.dispatchEvent(new ModuleLoadEvent(ModuleLoadEvent.LAYOUT_MODULE_STARTED));
}

View File

@ -31,6 +31,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mate:Listener type="{LayoutsReadyEvent.LAYOUTS_READY}" method="populateLayoutsList"/>
<mate:Listener type="{LockControlEvent.CHANGED_LOCK_SETTINGS}" method="lockSettingsChanged" />
<mate:Listener type="{LocaleChangeEvent.LOCALE_CHANGED}" method="localeChanged" />
<mate:Listener type="{LayoutEvent.INVALIDATE_LAYOUT_EVENT}" method="invalidadeLayout" />
<mx:Script>
<![CDATA[
@ -150,6 +151,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
_dispatcher.dispatchEvent(new ChangeLayoutEvent(e.currentTarget.selectedItem.localeKey));
}
private function invalidadeLayout(e:Event):void {
selectedIndex = -1;
prompt = ResourceUtil.getInstance().getString('bbb.layout.combo.custom');
}
]]>
</mx:Script>
</mx:ComboBox>