Commit b2e35410 authored by michael.simon's avatar michael.simon
Browse files

Filter and Sort with edit groups

parent 15b89a22
......@@ -11,9 +11,9 @@
package edu.kit.scc.webreg.bean.admin.group;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
......@@ -90,7 +90,7 @@ public class GroupAdminEditLocalGroupBean implements Serializable {
private LazyDataModel<UserEntity> userList;
private LazyDataModel<GroupEntity> groupList;
private Set<UserEntity> usersInGroup;
private List<UserEntity> usersInGroup;
private Long serviceId;
private Long groupId;
......@@ -109,7 +109,7 @@ public class GroupAdminEditLocalGroupBean implements Serializable {
groupFlagList = groupFlagService.findByGroup(entity);
if (groupFlagList.size() == 0)
throw new NotAuthorizedException("Gruppe ist diesem Service nicht zugeordnet");
usersInGroup = new HashSet<UserEntity>(userService.findByGroup(entity));
usersInGroup = new ArrayList<UserEntity>(userService.findByGroup(entity));
}
if (! authBean.isUserInRoles(entity.getAdminRoles())) {
......@@ -118,7 +118,7 @@ public class GroupAdminEditLocalGroupBean implements Serializable {
}
public String save() {
allGroupService.updateGroupMembers(entity, usersInGroup);
allGroupService.updateGroupMembers(entity, new HashSet<UserEntity>(usersInGroup));
for (ServiceGroupFlagEntity flag : groupFlagList) {
flag.setStatus(ServiceGroupStatus.DIRTY);
......@@ -192,7 +192,7 @@ public class GroupAdminEditLocalGroupBean implements Serializable {
return groupList;
}
public Set<UserEntity> getUsersInGroup() {
public List<UserEntity> getUsersInGroup() {
return usersInGroup;
}
......
......@@ -89,21 +89,21 @@
<div class="panel">
<p:panel id="memberPanel" header="#{messages.members}">
<p:dataTable id="memberData" style="min-width: 500px;"
value="#{groupAdminEditLocalGroupBean.usersInGroup.toArray()}" var="user">
<p:column>
<p:dataTable id="memberData" style="min-width: 500px;" paginator="true" rows="15"
value="#{groupAdminEditLocalGroupBean.usersInGroup}" var="user">
<p:column sortBy="#{user.eppn}" filterBy="#{user.eppn}">
<f:facet name="header">
<h:outputText value="#{messages.eppn}" />
</f:facet>
<h:outputText value="#{user.eppn}" />
</p:column>
<p:column>
<p:column sortBy="#{user.surName}" filterBy="#{user.surName}">
<f:facet name="header">
<h:outputText value="#{messages.sur_name}" />
</f:facet>
<h:outputText value="#{user.surName}" />
</p:column>
<p:column>
<p:column sortBy="#{user.givenName}" filterBy="#{user.givenName}">
<f:facet name="header">
<h:outputText value="#{messages.given_name}" />
</f:facet>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment