private List<Identity> loadPeople(int index, int length, Type type) throws Exception { Identity[] result = null; Space space = getSpace(); if (Type.MEMBER.equals(type)) { ProfileFilter filter = uiSearchMemberOfSpace.getProfileFilter(); setMemberListAccess( Utils.getIdentityManager().getSpaceIdentityByProfileFilter(space, filter, type, true)); setMemberNum(getMemberListAccess().getSize()); uiSearchMemberOfSpace.setPeopleNum(getMemberNum()); result = getMemberListAccess().load(index, length); } else if (Type.MANAGER.equals(type)) { ProfileFilter filter = uiSearchMemberOfSpace.getProfileFilter(); setManagerListAccess( Utils.getIdentityManager().getSpaceIdentityByProfileFilter(space, filter, type, true)); result = getManagerListAccess().load(index, length); } return Arrays.asList(result); }
private List<Identity> loadPeople(int index, int length) throws Exception { lastOwner = Utils.getOwnerIdentity(); ProfileFilter filter = uiProfileUserSearch.getProfileFilter(); ListAccess<Identity> listAccess = Utils.getRelationshipManager().getIncomingByFilter(lastOwner, filter); Identity[] identities = listAccess.load(index, length); setPeopleNum( identities.length < RECEIVED_INVITATION_PER_PAGE ? identities.length : listAccess.getSize()); setPeopleListAccess(listAccess); uiProfileUserSearch.setPeopleNum(getPeopleNum()); return Arrays.asList(identities); }