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; }
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) {
@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; } }
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) {
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; } }
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];
RequestLifeCycle.begin(impl); users = handler.findAllUsers(UserStatus.ANY); size = users.getSize(); } catch (Exception ex) { LOG.error(ex);
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) {
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));
while (i <= usersListAccess.getSize()) { int length = i + 10 <= usersListAccess.getSize() ? 10 : usersListAccess.getSize() - i; User[] users = usersListAccess.load(i, length); for (User user : users) { 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) {