This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git


The following commit(s) were added to refs/heads/master by this push:
     new ca61e92  [OPENMEETINGS-1830] user list in room admin, displays users
ca61e92 is described below

commit ca61e92fb4f511a131a8a32d208e9264195322f4
Author: Maxim Solodovnik <solomax...@gmail.com>
AuthorDate: Tue Feb 13 12:26:20 2018 +0700

    [OPENMEETINGS-1830] user list in room admin, displays users
---
 .../apache/openmeetings/web/admin/rooms/RoomForm.java | 19 +++++++++----------
 .../org/apache/openmeetings/web/app/Application.java  |  5 +++++
 .../org/apache/openmeetings/web/room/RoomPanel.java   |  4 ----
 .../openmeetings/web/room/sidebar/RoomSidebar.java    |  3 ++-
 4 files changed, 16 insertions(+), 15 deletions(-)

diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/rooms/RoomForm.java
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/rooms/RoomForm.java
index 6cb680c..998c195 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/rooms/RoomForm.java
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/rooms/RoomForm.java
@@ -22,6 +22,7 @@ import static 
org.apache.openmeetings.db.util.AuthLevelUtil.hasGroupAdminLevel;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.ATTR_CLASS;
 import static 
org.apache.openmeetings.web.admin.AdminUserChoiceProvider.PAGE_SIZE;
 import static org.apache.openmeetings.web.app.Application.getBean;
+import static org.apache.openmeetings.web.app.Application.kickUser;
 import static org.apache.openmeetings.web.app.WebSession.getRights;
 import static org.apache.openmeetings.web.app.WebSession.getUserId;
 
@@ -34,22 +35,21 @@ import java.util.stream.Collectors;
 
 import org.apache.openmeetings.db.dao.file.FileItemDao;
 import org.apache.openmeetings.db.dao.room.RoomDao;
-import org.apache.openmeetings.db.dao.server.ISessionManager;
 import org.apache.openmeetings.db.dao.user.GroupDao;
 import org.apache.openmeetings.db.dao.user.UserDao;
+import org.apache.openmeetings.db.entity.basic.Client;
 import org.apache.openmeetings.db.entity.file.BaseFileItem;
 import org.apache.openmeetings.db.entity.room.Room;
 import org.apache.openmeetings.db.entity.room.Room.RoomElement;
 import org.apache.openmeetings.db.entity.room.RoomFile;
 import org.apache.openmeetings.db.entity.room.RoomGroup;
 import org.apache.openmeetings.db.entity.room.RoomModerator;
-import org.apache.openmeetings.db.entity.room.StreamClient;
 import org.apache.openmeetings.db.entity.user.Address;
 import org.apache.openmeetings.db.entity.user.Group;
 import org.apache.openmeetings.db.entity.user.User;
-import org.apache.openmeetings.service.user.UserManager;
 import org.apache.openmeetings.web.admin.AdminBaseForm;
 import org.apache.openmeetings.web.admin.AdminUserChoiceProvider;
+import org.apache.openmeetings.web.app.Application;
 import org.apache.openmeetings.web.common.ConfirmableAjaxBorder;
 import org.apache.openmeetings.web.util.RestrictiveChoiceProvider;
 import org.apache.openmeetings.web.util.RoomTypeDropDown;
@@ -93,21 +93,20 @@ public class RoomForm extends AdminBaseForm<Room> {
        private final WebMarkupContainer moderatorContainer = new 
WebMarkupContainer("moderatorContainer");
        private final WebMarkupContainer filesContainer = new 
WebMarkupContainer("filesContainer");
        private final WebMarkupContainer clientsContainer = new 
WebMarkupContainer("clientsContainer");
-       private final ListView<StreamClient> clients = new 
ListView<StreamClient>("clients", new ArrayList<>()) {
+       private final ListView<Client> clients = new 
ListView<Client>("clients", new ArrayList<>()) {
                private static final long serialVersionUID = 1L;
 
                @Override
-               protected void populateItem(final ListItem<StreamClient> item) {
-                       StreamClient client = item.getModelObject();
-                       item.add(new Label("clientId", "" + client.getId()))
+               protected void populateItem(final ListItem<Client> item) {
+                       Client client = item.getModelObject();
+                       item.add(new Label("clientId", "" + client.getUserId()))
                                .add(new Label("clientLogin", "" + 
client.getLogin()))
                                .add(new ConfirmableAjaxBorder("clientDelete", 
getString("80"), getString("833")) {
                                        private static final long 
serialVersionUID = 1L;
 
                                        @Override
                                        protected void 
onSubmit(AjaxRequestTarget target) {
-                                               StreamClient c = 
item.getModelObject();
-                                               
getBean(UserManager.class).kickById(c.getUid());
+                                               kickUser(item.getModelObject());
                                                updateClients(target);
                                        }
                                });
@@ -420,7 +419,7 @@ public class RoomForm extends AdminBaseForm<Room> {
 
        void updateClients(AjaxRequestTarget target) {
                long roomId = getModelObject().getId() != null ? 
getModelObject().getId() : 0;
-               final List<StreamClient> clientsInRoom = 
getBean(ISessionManager.class).listByRoom(roomId);
+               final List<Client> clientsInRoom = 
Application.getRoomClients(roomId);
                clients.setDefaultModelObject(clientsInRoom);
                target.add(clientsContainer);
        }
diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
index 87ab55e..374afe6 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
@@ -76,6 +76,7 @@ import org.apache.openmeetings.db.entity.server.Sessiondata;
 import org.apache.openmeetings.db.entity.user.User;
 import org.apache.openmeetings.db.entity.user.User.Type;
 import org.apache.openmeetings.db.util.ws.RoomMessage;
+import org.apache.openmeetings.db.util.ws.TextRoomMessage;
 import org.apache.openmeetings.util.OpenmeetingsVariables;
 import org.apache.openmeetings.util.ws.IClusterWsMessage;
 import org.apache.openmeetings.web.pages.AccessDeniedPage;
@@ -415,6 +416,10 @@ public class Application extends 
AuthenticatedWebApplication implements IApplica
                }
        }
 
+       public static void kickUser(Client client) {
+               WebSocketHelper.sendRoom(new 
TextRoomMessage(client.getRoom().getId(), client, RoomMessage.Type.kick, 
client.getUid()));
+       }
+
        private static boolean hasVideo(StreamClient rcl) {
                return rcl != null && rcl.getAvsettings().contains("v");
        }
diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
index 8a0f212..01079dd 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
@@ -799,10 +799,6 @@ public class RoomPanel extends BasePanel {
                broadcast(client);
        }
 
-       public void kickUser(Client client) {
-               WebSocketHelper.sendRoom(new 
TextRoomMessage(client.getRoom().getId(), client, Type.kick, client.getUid()));
-       }
-
        public void broadcast(Client client) {
                RoomBroadcaster.sendUpdatedClient(client);
                WebSocketHelper.sendRoom(new TextRoomMessage(getRoom().getId(), 
getClient(), RoomMessage.Type.rightUpdated, client.getUid()));
diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.java
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.java
index c2b6fa4..1e1f2d3 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.java
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.java
@@ -21,6 +21,7 @@ package org.apache.openmeetings.web.room.sidebar;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.getWebAppRootKey;
 import static org.apache.openmeetings.web.app.Application.getOnlineClient;
 import static org.apache.openmeetings.web.app.Application.getRoomClients;
+import static org.apache.openmeetings.web.app.Application.kickUser;
 import static 
org.apache.openmeetings.web.room.RoomBroadcaster.sendUpdatedClient;
 import static 
org.apache.openmeetings.web.util.CallbackFunctionHelper.getNamedFunction;
 import static org.apache.wicket.ajax.attributes.CallbackParameter.explicit;
@@ -259,7 +260,7 @@ public class RoomSidebar extends Panel {
 
                        @Override
                        protected void onSubmit(AjaxRequestTarget target) {
-                               room.kickUser(kickedClient);
+                               kickUser(kickedClient);
                        }
                });
                add(form.add(confirmTrash), upload = new UploadDialog("upload", 
room, roomFiles));

-- 
To stop receiving notification emails like this one, please contact
solo...@apache.org.

Reply via email to