public Set<RoleActor> getRoleActorsByType(final String type) { return delegate.getRoleActorsByType(type); }
public Collection getRoleActorTypes(ProjectRole projectRole, String type, int length) { DefaultRoleActors defaultRoleActors = projectRoleService.getDefaultRoleActors(projectRole, this); Set<RoleActor> roleActorsByType = defaultRoleActors.getRoleActorsByType(type); if (length == -1 || roleActorsByType.size() <= length) { return defaultRoleActors.getRoleActorsByType(type); } else { // Sublist the return set via an ArrayList (Sorry!) return new ArrayList<RoleActor>(defaultRoleActors.getRoleActorsByType(type)).subList(0,length); } }
public Collection getCurrentGroups() { final Collection<Group> groups = new ArrayList<Group>(); Collection<RoleActor> roleActorsByType = null; if (getProject() != null) { ProjectRoleActors projectRoleActors = projectRoleService.getProjectRoleActors(getProjectRole(), getProject(), this); if (projectRoleActors != null) { roleActorsByType = projectRoleActors.getRoleActorsByType(ProjectRoleActor.GROUP_ROLE_ACTOR_TYPE); } } else { DefaultRoleActors defaultRoleActors = projectRoleService.getDefaultRoleActors(getProjectRole(), this); if (defaultRoleActors != null) { roleActorsByType = defaultRoleActors.getRoleActorsByType(ProjectRoleActor.GROUP_ROLE_ACTOR_TYPE); } } if (roleActorsByType != null) { for (final RoleActor aRoleActorsByType : roleActorsByType) { GroupRoleActorFactory.GroupRoleActor groupRoleActor = (GroupRoleActorFactory.GroupRoleActor) aRoleActorsByType; groups.add(groupRoleActor.getGroup()); } } return groups; }
/** * Provides the currently selected users. * * @return the users. */ private Collection<ApplicationUser> getProjectRoleActorUsers() { DefaultRoleActors defaultRoleActors; if (getProject() == null) { defaultRoleActors = projectRoleService.getDefaultRoleActors(getProjectRole(), this); } else { defaultRoleActors = projectRoleService.getProjectRoleActors(getProjectRole(), getProject(), this); } SortedSet<ApplicationUser> usersByType = new TreeSet<ApplicationUser>(new UserCachingComparator(getLocale())); if (defaultRoleActors != null) { for (final RoleActor roleActor : defaultRoleActors.getRoleActorsByType(ProjectRoleActor.USER_ROLE_ACTOR_TYPE)) { ProjectRoleActor projectRoleActor = (ProjectRoleActor) roleActor; usersByType.add(getUserManager().getUserByKey(projectRoleActor.getParameter())); } } return usersByType; }