Examples of IPersonAttributes


Examples of org.jasig.services.persondir.IPersonAttributes

         // Populate the person object using the PersonDirectory if applicable
         if (PropertiesManager.getPropertyAsBoolean("org.jasig.portal.services.Authentication.usePersonDirectory")) {
            // Retrieve all of the attributes associated with the person logging in
            final IPersonAttributeDao pa = PersonDirectory.getPersonAttributeDao();
            final String username = this.getUsername(person);
            final IPersonAttributes personAttributes = pa.getPerson(username);

            if (personAttributes != null) {
              // attribs may be null.  IPersonAttributeDao returns null when it does not recognize a user at all, as
              // distinguished from returning an empty Map of attributes when it recognizes a user has having no
              // attributes.
               
                person.setAttributes(personAttributes.getAttributes());
            }

         }
         // Make sure the the user's fullname is set
         if (person.getFullName() == null) {
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

    protected Map<String, List<Object>> getPropertiesHash(EntityIdentifier entityID) {
        final String entityIdKey = entityID.getKey();
        Map<String, List<Object>> ht = cache.get(entityIdKey);
        if (ht == null) {
            try {
                final IPersonAttributes personAttributes = pa.getPerson(entityIdKey);
                ht = personAttributes.getAttributes();
            } catch (Exception e) {
                log.error("Error getting properties hash for entityID [" + entityID + "]", e);
                ht = Collections.emptyMap();
            }
            cache.put(entityIdKey, ht);
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

     * @param key - entity key which in this case is a unique identifier for a user
     * @return the display name for the identified user
     */
    private String primGetName (String key) {
        String name = key;
        final IPersonAttributes personAttributes = this.paDao.getPerson(name);
        if (personAttributes != null)
        {
            Object displayName = personAttributes.getAttributeValue("displayName");
            String displayNameStr = "";
            if (displayName != null) {
                displayNameStr = String.valueOf(displayName);
                if (StringUtils.isNotEmpty(displayNameStr)) {
                    name = displayNameStr;
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

     * @return A Map of user attributes for the user and windows
     * @throws PortletContainerException
     */
    protected Map<String, String> getUserInfo(String remoteUser, HttpServletRequest httpServletRequest, IPortletWindow portletWindow) throws PortletContainerException {
        //Get the list of user attributes the portal knows about the user
        final IPersonAttributes personAttributes = this.personAttributeDao.getPerson(remoteUser);
        if (personAttributes == null) {
            return Collections.emptyMap();
        }
        final List<UserAttributeDD> expectedUserAttributes = this.getExpectedUserAttributes(httpServletRequest, portletWindow);
       
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

            final String remoteUser = portletRequest.getRemoteUser();
            if (remoteUser == null) {
                return null;
            }
           
            final IPersonAttributes personAttributes = this.personAttributeDao.getPerson(remoteUser);
            if (personAttributes == null) {
                return Collections.emptyMap();
            }
           
            final IPortletWindow portletWindow = this.portletWindowRegistry.convertPortletWindow(httpServletRequest, plutoPortletWindow);
            final List<UserAttributeDD> expectedUserAttributes = this.getExpectedUserAttributes(httpServletRequest, portletWindow);
           
            final Map<String, List<Object>> portletMultivaluedAttributes = new HashMap<String, List<Object>>(expectedUserAttributes.size());
           
            //Copy expected attributes to the USER_INFO Map
            final Map<String, List<Object>> attributes = personAttributes.getAttributes();
            for (final UserAttributeDD userAttributeDD : expectedUserAttributes) {
                final String attributeName = userAttributeDD.getName();

                //containsKey check to handle attributes with a single null value
                if (attributes.containsKey(attributeName)) {
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

         if (member.getEntityType() != IPERSON_CLASS)
             { return false; }
         IPerson person = null;
         try {
             IPersonAttributeDao pa = PersonDirectory.getPersonAttributeDao();
             final IPersonAttributes personAttributes = pa.getPerson(member.getKey());

             RestrictedPerson rp = PersonFactory.createRestrictedPerson();
             if (personAttributes != null) {
                 rp.setAttributes(personAttributes.getAttributes());
             }
            
             person = rp;
         }
         catch (Exception ex) {
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.