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; }
public boolean hasSpaces(String userId) { try { ListAccess<Space> spaces = spaceService.getAccessibleSpacesWithListAccess(userId); if (spaces != null) { return spaces.getSize() > 0; } } catch (Exception ex) { LOG.error("Can't get space number. Error during get accessible spaces", ex); } return false; }
@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; } }
@Override public void processUpgrade(String oldVersion, String newVersion) { try { int totalFoldersCountApproximation = organizationService.getUserHandler().findAllUsers(UserStatus.ANY).getSize(); // Number of users + Number of user profile + three memberships per user totalFoldersCountApproximation = totalFoldersCountApproximation * 5; LOG.info("Attempt to delete JCR folders of Organization Integration service (approximatively {} folders)", totalFoldersCountApproximation); super.processUpgrade(oldVersion, newVersion); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException("An error occurred while Deleting Organization Integration service folders"); } }
public boolean hasContacts(String userId) { Identity identity = identityManager.getOrCreateIdentity(OrganizationIdentityProvider.NAME, userId, false); if (identity != null) { try { ListAccess<Identity> identities = relManager.getConnections(identity); if (identities != null) { return identities.getSize() > 0; } } catch (Exception ex) { LOG.error("Error during get connections", ex); } } return false; } }
RequestLifeCycle.begin(impl); IdentitySession session = idmService.getIdentitySession(); User[] tmp = usrs.load(startBatch, endBatch - startBatch); try { for (User u : tmp) {
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) { if (user != null) {
int size = connectionList.getSize(); Map<Identity, Integer> suggestions; if (size > 0) {
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(); } }
@SuppressWarnings("deprecation") private boolean hasContacts(String userId) { try { IdentityManager identityManager = (IdentityManager) ExoContainerContext.getCurrentContainer() .getComponentInstanceOfType(IdentityManager.class); RelationshipManager relationshipManager = (RelationshipManager) ExoContainerContext.getCurrentContainer() .getComponentInstanceOfType(RelationshipManager.class); Identity identity = identityManager.getOrCreateIdentity(OrganizationIdentityProvider.NAME, userId); ListAccess<Identity> confirmedContacts = relationshipManager.getConnections(identity); return confirmedContacts.getSize() > 0; } catch (Exception e) { LOG.debug("Error in gettingStarted REST service: " + e.getMessage(), e); return false; } }
RequestLifeCycle.begin(impl); users = handler.findAllUsers(UserStatus.ANY); size = users.getSize(); } catch (Exception ex) { LOG.error(ex);
query.setUserName(username); users = userHandler.findUsersByQuery(query, UserStatus.ANY); if(users != null && users.getSize() > 0) { foundUser = users.load(0, 1)[0]; query.setEmail(email); users = userHandler.findUsersByQuery(query, UserStatus.ANY); if(users != null && users.getSize() > 0) { foundUser = users.load(0, 1)[0]; query.setUserName(username); users = userHandler.findUsersByQuery(query, UserStatus.ANY); if(users != null && users.getSize() > 0) { foundUser = users.load(0, 1)[0];
query.setEmail(email); ListAccess<User> users = orgService.getUserHandler().findUsersByQuery(query, UserStatus.ANY); if (users != null && users.getSize() > 0) { errorFields.add("emailAddress"); errorMessages.add(bundle.resolve("UIAccountInputSet.msg.email-exist", email));
int size = suggestedSpacesLA.getSize(); if (size == 0) { jsonGlobal.put(ITEMS,jsonArray); int maxSpacesToLoad = 50; int maxSuggestions = 10; int totalConnections = connectionsLA.getSize(); Random random = new Random(); Identity[] connections; 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);
List<OrganizationConfig.User> orgConfigUsersInSigleFile = new ArrayList<OrganizationConfig.User>(); 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) { 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()); int i = 0; int k = 0; 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())) {