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; }
@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"); } }
LOG.debug("Adding entries for each user, additional fields are missing: LastLoginTime & CreatedDate"); ListAccess<User> usersListAccess = organizationService.getUserHandler().findAllUsers(); XStream xstream_ = new XStream(new XppDriver()); int i = 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(); } }
try { RequestLifeCycle.begin(impl); users = handler.findAllUsers(UserStatus.ANY); size = users.getSize(); } catch (Exception ex) {
ListAccess<User> usersListAccess = organizationService.getUserHandler().findAllUsers(); List<OrganizationConfig.User> orgConfigUsersInSigleFile = new ArrayList<OrganizationConfig.User>(); int i = 0;
List<String> activatedUsers = Util.getActivatedUsers(session); ListAccess<User> usersListAccess = organizationService.getUserHandler().findAllUsers(); LOG.debug("\tAll new users intagration: Search for already existing users in Datasource but not integrated yet."); ListAccess<User> usersListAccess = organizationService.getUserHandler().findAllUsers(); int i = 0; int k = 0;