Examples of IPersonAttributes


Examples of org.jasig.services.persondir.IPersonAttributes

                    }
                }
            }
        }
       
        final IPersonAttributes newPerson;
       
        final String name = person.getName();
        if (name != null) {
            newPerson = new NamedPersonImpl(name, mappedAttributes);
        }
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

                swappableAttributes = new TreeSet<String>(possibleAttributes);
            }
            //If no possible names try getting the current user's attributes and use the key set
            else {
                final Principal currentUser = externalContext.getCurrentUser();
                final IPersonAttributes baseUserAttributes = this.getOriginalUserAttributes(currentUser.getName());
               
                if (baseUserAttributes != null) {
                    final Map<String, List<Object>> attributes = baseUserAttributes.getAttributes();
                    swappableAttributes = new LinkedHashSet<String>(attributes.keySet());
                }
                else {
                    swappableAttributes = Collections.emptySet();
                }
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

     * @see org.jasig.portal.portlets.swapper.IAttributeSwapperHelper#populateSwapRequest(org.springframework.webflow.context.ExternalContext, org.jasig.portal.portlets.swapper.AttributeSwapRequest)
     */
    public void populateSwapRequest(ExternalContext externalContext, AttributeSwapRequest attributeSwapRequest) {
        final Principal currentUser = externalContext.getCurrentUser();
        final String uid = currentUser.getName();
        final IPersonAttributes person = this.overwritingPersonAttributeDao.getPerson(uid);
       
        final Map<String, Attribute> currentAttributes = attributeSwapRequest.getCurrentAttributes();
        currentAttributes.clear();
       
        final Set<String> swappableAttributes = this.getSwappableAttributes(externalContext);
        for (final String attribute : swappableAttributes) {
            final Object value = person.getAttributeValue(attribute);
            if (value != null) {
                currentAttributes.put(attribute, new Attribute(String.valueOf(value)));
            }
        }
    }
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

        final Map<String, Attribute> attributesToCopy = attributeSwapRequest.getAttributesToCopy();
        this.copyAttributes(attributes, attributesToCopy);
       
        final Principal currentUser = externalContext.getCurrentUser();
        final String uid = currentUser.getName();
        final IPersonAttributes originalUserAttributes = this.getOriginalUserAttributes(uid);
       
        //Filter out unchanged attributes
        for (final Iterator<Map.Entry<String, Object>> overrideAttrEntryItr = attributes.entrySet().iterator(); overrideAttrEntryItr.hasNext();) {
            final Entry<String, Object> overrideAttrEntry = overrideAttrEntryItr.next();
            final String attribute = overrideAttrEntry.getKey();
           
            final Object originalValue = originalUserAttributes.getAttributeValue(attribute);
            final Object overrideValue = overrideAttrEntry.getValue();
            if (originalValue == overrideValue || (originalValue != null && originalValue.equals(overrideValue))) {
                overrideAttrEntryItr.remove();
            }
        }
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

            for (final String attribute : overriddenAttributes) {
                person.setAttribute(attribute, null);
            }
        }
       
        final IPersonAttributes originalUserAttributes = this.getOriginalUserAttributes(uid);
        final Map<String, List<Object>> attributes = originalUserAttributes.getAttributes();
        person.setAttributes(attributes);
    }
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

                    this.logger.debug("Gathering attributes for the current user ["
                                    + currentUid + "];  impersonating=" + value);
                }
                final List<Object> values = Collections.singletonList((Object) value);
                final Map<String,List<Object>> attrs = Collections.singletonMap(IMPERSONATING_ATTRIBUTE_NAME, values);
                final IPersonAttributes ipa = new CaseInsensitiveNamedPersonImpl(currentUid, attrs);
                rslt = Collections.singleton(ipa);
            }

        }
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

    /* (non-Javadoc)
     * @see org.jasig.services.persondir.IPersonAttributeDao#getPerson(java.lang.String)
     */
    public IPersonAttributes getPerson(String uid) {
        final IPersonAttributes person = this.delegatePersonAttributeDao.getPerson(uid);
        if (person == null) {
            return person;
        }
       
        return this.getOverriddenPerson(person);
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

        }
       
        final Set<IPersonAttributes> modifiedPeople = new LinkedHashSet<IPersonAttributes>();
       
        for (final IPersonAttributes person : people) {
            final IPersonAttributes mergedPerson = this.getOverriddenPerson(person);
            modifiedPeople.add(mergedPerson);
        }
       
        return modifiedPeople;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.