@SuppressWarnings("deprecation") private boolean hasSpaces(String userId) { try { SpaceService spaceService = (SpaceService) ExoContainerContext.getCurrentContainer() .getComponentInstanceOfType(SpaceService.class); Space[] spaces = spaceService.getAccessibleSpacesWithListAccess(userId).load(0, 1); return spaces != null && spaces.length > 0; } catch (Exception e) { LOG.debug("Error in gettingStarted REST service: " + e.getMessage(), e); return false; } }
public Collection findUserProfiles() throws Exception { List<UserProfile> profiles = new LinkedList<UserProfile>(); UserHandler userHandler = this.orgService.getUserHandler(); //This should find enabled user ListAccess<User> users = userHandler.findAllUsers(); int size = users.getSize(); for(User u : users.load(0, size)) { UserProfile profile = this.getProfile(u.getUserName()); if(profile != null) { profiles.add(profile); } } return profiles; }
Space[] spaces = publicSpaces.load(0, publicSpaces.getSize()); if (spaces != null && spaces.length > 0) { for (Space space : spaces) {
if (totalConnections > maxConnectionsToLoad) { int startIndex = random.nextInt(totalConnections - maxConnectionsToLoad); connections = connectionsLA.load(startIndex, maxConnectionsToLoad); } else { connections = connectionsLA.load(0, totalConnections); suggestedSpaces = suggestedSpacesLA.load(startIndex, maxSpacesToLoad); } else { suggestedSpaces = suggestedSpacesLA.load(0, size);
RequestLifeCycle.begin(impl); IdentitySession session = idmService.getIdentitySession(); User[] tmp = usrs.load(startBatch, endBatch - startBatch); try { for (User u : tmp) {
public void writeProfiles(ZipOutputStream zos) throws Exception { RequestLifeCycle.begin(PortalContainer.getInstance()); try { ListAccess<User> usersListAccess = organizationService.getUserHandler().findAllUsers(); XStream xstream_ = new XStream(new XppDriver()); int i = 0; while (i <= usersListAccess.getSize()) { int length = i + SerializationUtils.MAX_USERS_IN_FILE_PARAM_NAME <= usersListAccess.getSize() ? SerializationUtils.MAX_USERS_IN_FILE_PARAM_NAME : usersListAccess.getSize() - i; User[] users = usersListAccess.load(i, length); for (User user : users) { UserProfile userProfile = organizationService.getUserProfileHandler().findUserProfileByName(user.getUserName()); if ((userProfile != null) && (userProfile.getUserInfoMap() != null) && !userProfile.getUserInfoMap().isEmpty()) { xstream_.alias("user-profile", userProfile.getClass()); String xml = xstream_.toXML(userProfile); zos.putNextEntry(new ZipEntry(SerializationUtils.PROFILES_FOLDER_NAME + userProfile.getUserName() + SerializationUtils.PROFILE_FILE_SUFFIX)); zos.write(xml.getBytes()); zos.closeEntry(); if (LOG.isDebugEnabled()) { LOG.debug("Adding entry for userProfile: " + userProfile.getUserName()); } } } i += SerializationUtils.MAX_USERS_IN_FILE_PARAM_NAME; } } finally { RequestLifeCycle.end(); } }
int length = i + SerializationUtils.MAX_USERS_IN_FILE_PARAM_NAME <= usersListAccess.getSize() ? SerializationUtils.MAX_USERS_IN_FILE_PARAM_NAME : usersListAccess.getSize() - i; User[] users = usersListAccess.load(i, length); for (User user : users) { if (user != null) {
users = userHandler.findUsersByQuery(query, UserStatus.ANY); if(users != null && users.getSize() > 0) { foundUser = users.load(0, 1)[0]; users = userHandler.findUsersByQuery(query, UserStatus.ANY); if(users != null && users.getSize() > 0) { foundUser = users.load(0, 1)[0]; users = userHandler.findUsersByQuery(query, UserStatus.ANY); if(users != null && users.getSize() > 0) { foundUser = users.load(0, 1)[0];
Identity[] myConnections = confirmedContacts.load(0, confirmedContacts.getSize()); for(Identity contact : myConnections){
int length = i + SerializationUtils.MAX_USERS_IN_FILE_PARAM_NAME <= usersListAccess.getSize() ? SerializationUtils.MAX_USERS_IN_FILE_PARAM_NAME : usersListAccess.getSize() - i; User[] users = usersListAccess.load(i, length); for (User user : users) { OrganizationConfig.User orgConfigUser = convertUserToSerializableObject(user);
while (i <= usersListAccess.getSize()) { int length = i + 10 <= usersListAccess.getSize() ? 10 : usersListAccess.getSize() - i; User[] users = usersListAccess.load(i, length); for (User user : users) { activatedUsers.remove(user.getUserName()); while (i <= usersListAccess.getSize()) { int length = i + 10 <= usersListAccess.getSize() ? 10 : usersListAccess.getSize() - i; User[] users = usersListAccess.load(i, length); for (User user : users) { if (!activatedUsers.contains(user.getUserName())) {