From f3252728e0bdb049333c8597fbdcf69586b70527 Mon Sep 17 00:00:00 2001 From: Jonata Teixeira Pastro Date: Fri, 15 Aug 2014 21:14:13 +0000 Subject: [PATCH] Using server to provide sharednotes numbering. --- .../conference/service/sharedNotes/SharedNotesRoom.java | 6 ++++-- .../modules/sharednotes/maps/SharedNotesEventMap.mxml | 8 -------- .../sharednotes/views/AdditionalSharedNotesWindow.as | 7 ------- .../modules/sharednotes/views/SharedNotesWindow.mxml | 8 ++------ 4 files changed, 6 insertions(+), 23 deletions(-) diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/sharedNotes/SharedNotesRoom.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/sharedNotes/SharedNotesRoom.java index 4b77c0fef0..6e32c25fa8 100644 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/sharedNotes/SharedNotesRoom.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/sharedNotes/SharedNotesRoom.java @@ -52,12 +52,14 @@ public class SharedNotesRoom { private Map documents = new ConcurrentHashMap(); private static final Object syncObject = new Object(); private diff_match_patch diffPatch = new diff_match_patch(); + private Integer noteCounter; public SharedNotesRoom(String name) { this.name = name; this.listeners = new ConcurrentHashMap(); this.clients = new ConcurrentSkipListSet(); - documents.put("MAIN_WINDOW",""); + this.documents.put("MAIN_WINDOW",""); + this.noteCounter=1; } public String getName() { @@ -133,8 +135,8 @@ public class SharedNotesRoom { } public void createAdditionalNotes() { - String noteId = UUID.randomUUID().toString(); synchronized (syncObject) { + String noteId = (noteCounter++).toString(); documents.put(noteId, ""); for (Map.Entry entry : listeners.entrySet()) { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/maps/SharedNotesEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/maps/SharedNotesEventMap.mxml index a7a207b34f..d6cb1ab9cd 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/maps/SharedNotesEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/maps/SharedNotesEventMap.mxml @@ -60,14 +60,6 @@ - - - - - - - - diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/AdditionalSharedNotesWindow.as b/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/AdditionalSharedNotesWindow.as index 23d2103d0c..536f8ad2e1 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/AdditionalSharedNotesWindow.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/AdditionalSharedNotesWindow.as @@ -12,8 +12,6 @@ package org.bigbluebutton.modules.sharednotes.views public class AdditionalSharedNotesWindow extends SharedNotesWindow { - private static var windowsAcc:int = 1; - private var _windowId:int = windowsAcc++; public function AdditionalSharedNotesWindow(notesId:String) { trace("AdditionalSharedNotesWindow: in-constructor additional notes " + notesId); @@ -46,10 +44,5 @@ package org.bigbluebutton.modules.sharednotes.views return MainCanvas.POPUP; } - override protected function resourcesChanged():void { - super.resourcesChanged(); - - title = ResourceUtil.getInstance().getString('bbb.sharedNotes.title') + " " + _windowId; - } } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/SharedNotesWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/SharedNotesWindow.mxml index 0fa5f5fe4d..5d588b9e9c 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/SharedNotesWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/SharedNotesWindow.mxml @@ -96,8 +96,10 @@ if(_notesId == "MAIN_WINDOW"){ btnNew.visible = btnNew.includeInLayout = true; _dispatcher.dispatchEvent(new GetCurrentDocumentEvent()); + title = ResourceUtil.getInstance().getString('bbb.sharedNotes.title'); } else { btnNew.visible = btnNew.includeInLayout = false; + title = ResourceUtil.getInstance().getString('bbb.sharedNotes.title') + " " + _notesId; } } @@ -173,12 +175,6 @@ super.close(event); } - override protected function resourcesChanged():void { - super.resourcesChanged(); - - title = ResourceUtil.getInstance().getString('bbb.sharedNotes.title'); - } - ]]>