/** {@inheritDoc} */ @Override public Map<String, GenericValue> getPrincipalPropertiesByName(Session session, String principal) throws PrincipalNotExistsException, InternalException { Map<String, GenericValue> ret = new HashMap<String, GenericValue>(); try { UserManager userManager = AccessControlUtil.getUserManager(session); Authorizable authorizable = userManager.getAuthorizable(principal); if (authorizable == null) { throw new PrincipalNotExistsException("Principal does not exist: " + principal); } Iterator<String> iter = authorizable.getPropertyNames(); while (iter.hasNext()) { String key = iter.next(); GenericValue value = GenericValue.getGenericValueFromObject(authorizable.getProperty(key)); ret.put(key, value); } } catch (RepositoryException e) { throw new InternalException("Repository exception", e); } finally { } return ret; }
for (Object key : properties.keySet()) { if (properties.get(key) != null) { GenericValue val = GenericValue.getGenericValueFromObject(properties.get(key)); if (val.isMultiValue()) { group.setProperty((String) key, val.getValues());
/** {@inheritDoc} */ @Override public void changePasswordByName(Session session, String userName, String password) throws UserNotExistsException, PrincipalIsNotUserException, InternalException { try { UserManager userManager = AccessControlUtil.getUserManager(session); Authorizable authorizable = userManager.getAuthorizable(userName); if (authorizable == null) { throw new UserNotExistsException( "User does not exist: " + userName); } if (authorizable.isGroup()) { throw new PrincipalIsNotUserException("Principal is not user: " + userName); } User user = (User) authorizable; user.changePassword(password); user.setProperty("jcr:Password", GenericValue.getGenericValueFromObject(password).get()); } catch (RepositoryException e) { throw new InternalException("Repository exception", e); } finally { } }
GenericValue val = GenericValue.getGenericValueFromObject(properties.get(key)); if (val.isMultiValue()) {