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

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

commit b4beda5064826ba61fbff0bbea0d731c12709d21
Author: Maxim Solodovnik <solomax...@gmail.com>
AuthorDate: Thu Apr 12 07:54:19 2018 +0700

    [OPENMEETINGS-1864] basic work on display deleted users
---
 .../db/dao/IGroupAdminDataProviderDao.java         | 27 ++++++++++++++++++++--
 .../apache/openmeetings/db/dao/room/RoomDao.java   |  4 ++--
 .../apache/openmeetings/db/dao/user/GroupDao.java  |  4 ++--
 .../apache/openmeetings/db/dao/user/UserDao.java   |  4 ++--
 .../openmeetings/web/admin/rooms/RoomForm.java     |  2 +-
 .../openmeetings/web/common/GeneralUserForm.java   |  2 +-
 .../web/data/SearchableGroupAdminDataProvider.java |  4 ++--
 7 files changed, 35 insertions(+), 12 deletions(-)

diff --git 
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/IGroupAdminDataProviderDao.java
 
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/IGroupAdminDataProviderDao.java
index 6946af4..504fc7e 100644
--- 
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/IGroupAdminDataProviderDao.java
+++ 
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/IGroupAdminDataProviderDao.java
@@ -33,7 +33,20 @@ public interface IGroupAdminDataProviderDao<T extends 
IDataProviderEntity> exten
         * @param order - column and sort order
         * @return list of instances in the range specified
         */
-       List<T> get(String search, Long adminId, int start, int count, String 
order);
+       List<T> adminGet(String search, Long adminId, int start, int count, 
String order);
+
+       /**
+        * Get a list of instances of {@link T}
+        *
+        * @param search - string search criteria to filter entities
+        * @param start - the start to range to retrieve
+        * @param count - maximum instance count to retrieve
+        * @param order - column and sort order
+        * @return list of instances in the range specified
+        */
+       default List<T> adminGet(String search, int start, int count, String 
order) {
+               return get(search, start, count, order);
+       }
 
        /**
         * Count the number of instances of {@link T}
@@ -42,5 +55,15 @@ public interface IGroupAdminDataProviderDao<T extends 
IDataProviderEntity> exten
         * @param adminId - id of group admin user
         * @return count of instances satisfying given search criteria
         */
-       long count(String search, Long adminId);
+       long adminCount(String search, Long adminId);
+
+       /**
+        * Count the number of instances of {@link T}
+        *
+        * @param search - string search criteria to filter entities
+        * @return count of instances satisfying given search criteria
+        */
+       default long adminCount(String search) {
+               return count(search);
+       }
 }
diff --git 
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/room/RoomDao.java
 
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/room/RoomDao.java
index f98e5ec..743b4cd 100644
--- 
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/room/RoomDao.java
+++ 
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/room/RoomDao.java
@@ -137,7 +137,7 @@ public class RoomDao implements 
IGroupAdminDataProviderDao<Room> {
        }
 
        @Override
-       public List<Room> get(String search, Long adminId, int start, int 
count, String order) {
+       public List<Room> adminGet(String search, Long adminId, int start, int 
count, String order) {
                TypedQuery<Room> q = 
em.createQuery(DaoHelper.getSearchQuery("RoomGroup rg, IN(rg.room)", "r", null, 
search, true, true, false
                                , "rg.group.id IN (SELECT gu1.group.id FROM 
GroupUser gu1 WHERE gu1.moderator = true AND gu1.user.id = :adminId)", order, 
searchFields), Room.class);
                q.setParameter("adminId", adminId);
@@ -159,7 +159,7 @@ public class RoomDao implements 
IGroupAdminDataProviderDao<Room> {
        }
 
        @Override
-       public long count(String search, Long adminId) {
+       public long adminCount(String search, Long adminId) {
                TypedQuery<Long> q = 
em.createQuery(DaoHelper.getSearchQuery("RoomGroup rg, IN(rg.room)", "r", null, 
search, true, true, true
                                , "rg.group.id IN (SELECT gu1.group.id FROM 
GroupUser gu1 WHERE gu1.moderator = true AND gu1.user.id = :adminId)", null, 
searchFields), Long.class);
                q.setParameter("adminId", adminId);
diff --git 
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/GroupDao.java
 
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/GroupDao.java
index c4f2a43..c44966f 100644
--- 
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/GroupDao.java
+++ 
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/GroupDao.java
@@ -73,7 +73,7 @@ public class GroupDao implements 
IGroupAdminDataProviderDao<Group> {
        }
 
        @Override
-       public List<Group> get(String search, Long adminId, int start, int 
count, String order) {
+       public List<Group> adminGet(String search, Long adminId, int start, int 
count, String order) {
                TypedQuery<Group> q = 
em.createQuery(DaoHelper.getSearchQuery("GroupUser gu, IN(gu.group)", "g", 
null, search, true, true, false
                                , "gu.user.id = :adminId AND gu.moderator = 
true", order, searchFields), Group.class);
                q.setParameter("adminId", adminId);
@@ -95,7 +95,7 @@ public class GroupDao implements 
IGroupAdminDataProviderDao<Group> {
        }
 
        @Override
-       public long count(String search, Long adminId) {
+       public long adminCount(String search, Long adminId) {
                TypedQuery<Long> q = 
em.createQuery(DaoHelper.getSearchQuery("GroupUser gu, IN(gu.group)", "g", 
null, search, true, true, true
                                , "gu.user.id = :adminId AND gu.moderator = 
true", null, searchFields), Long.class);
                q.setParameter("adminId", adminId);
diff --git 
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserDao.java
 
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserDao.java
index 4970ca3..431ed9a 100644
--- 
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserDao.java
+++ 
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserDao.java
@@ -158,7 +158,7 @@ public class UserDao implements 
IGroupAdminDataProviderDao<User> {
        }
 
        @Override
-       public List<User> get(String search, Long adminId, int start, int 
count, String order) {
+       public List<User> adminGet(String search, Long adminId, int start, int 
count, String order) {
                TypedQuery<User> q = 
em.createQuery(DaoHelper.getSearchQuery("GroupUser gu, IN(gu.user)", "u", null, 
search, true, true, false
                                , "gu.group.id IN (SELECT gu1.group.id FROM 
GroupUser gu1 WHERE gu1.moderator = true AND gu1.user.id = :adminId)", order, 
searchFields), User.class);
                q.setParameter("adminId", adminId);
@@ -192,7 +192,7 @@ public class UserDao implements 
IGroupAdminDataProviderDao<User> {
        }
 
        @Override
-       public long count(String search, Long adminId) {
+       public long adminCount(String search, Long adminId) {
                TypedQuery<Long> q = 
em.createQuery(DaoHelper.getSearchQuery("GroupUser gu, IN(gu.user)", "u", null, 
search, true, true, true
                                , "gu.group.id IN (SELECT gu1.group.id FROM 
GroupUser gu1 WHERE gu1.moderator = true AND gu1.user.id = :adminId)", null, 
searchFields), Long.class);
                q.setParameter("adminId", adminId);
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 a9ad590..54a6ff9 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
@@ -152,7 +152,7 @@ public class RoomForm extends AdminBaseForm<Room> {
                add(new CheckBox("ispublic").setEnabled(!isGroupAdmin));
 
                List<Group> orgList = isGroupAdmin
-                               ? getBean(GroupDao.class).get(null, 
getUserId(), 0, Integer.MAX_VALUE, null)
+                               ? getBean(GroupDao.class).adminGet(null, 
getUserId(), 0, Integer.MAX_VALUE, null)
                                : getBean(GroupDao.class).get(0, 
Integer.MAX_VALUE);
                final List<RoomGroup> orgRooms = new 
ArrayList<>(orgList.size());
                for (Group org : orgList) {
diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/GeneralUserForm.java
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/GeneralUserForm.java
index 4c6eaed..3209c13 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/GeneralUserForm.java
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/GeneralUserForm.java
@@ -156,7 +156,7 @@ public class GeneralUserForm extends Form<User> {
                grpUsers.addAll(u.getGroupUsers());
                if (isAdminForm) {
                        List<Group> grpList = hasGroupAdminLevel(getRights())
-                                       ? getBean(GroupDao.class).get(null, 
getUserId(), 0, Integer.MAX_VALUE, null)
+                                       ? 
getBean(GroupDao.class).adminGet(null, getUserId(), 0, Integer.MAX_VALUE, null)
                                        : getBean(GroupDao.class).get(0, 
Integer.MAX_VALUE);
                        for (Group g : grpList) {
                                GroupUser gu = new GroupUser(g, u);
diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/SearchableGroupAdminDataProvider.java
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/SearchableGroupAdminDataProvider.java
index 4e65b41..9198c78 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/SearchableGroupAdminDataProvider.java
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/SearchableGroupAdminDataProvider.java
@@ -42,14 +42,14 @@ public class SearchableGroupAdminDataProvider<T extends 
IDataProviderEntity> ext
        @Override
        public Iterator<? extends T> iterator(long first, long count) {
                return (hasGroupAdminLevel(getRights())
-                               ? getDao().get(search, getUserId(), (int)first, 
(int)count, getSortStr())
+                               ? getDao().adminGet(search, getUserId(), 
(int)first, (int)count, getSortStr())
                                : getDao().get(search, (int)first, (int)count, 
getSortStr())).iterator();
        }
 
        @Override
        public long size() {
                return hasGroupAdminLevel(getRights())
-                               ? getDao().count(search, getUserId())
+                               ? getDao().adminCount(search, getUserId())
                                : getDao().count(search);
        }
 }

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

Reply via email to