Package org.apache.jetspeed.security.mapping.model.impl

Examples of org.apache.jetspeed.security.mapping.model.impl.AttributeImpl


            {
                SecurityAttribute sa = sas.getAttribute(attrDef.getMappedName());
                if (sa != null)
                {
                    // currently only single-valued attributes are supported
                    AttributeImpl attr = new AttributeImpl(attrDef);
                    attr.setValue(sa.getStringValue());
                    ldapAttrValues.add(attr);
                }
            }
        }
        return internalCreateEntity(principal.getName(), null, ldapAttrValues);
View Full Code Here


        {
            List<String> values = null;
            values = getStringAttributes(attrs, attrDef.getName(), attrDef.requiresDnDefaultValue());
            if (values != null)
            {
                Attribute a = new AttributeImpl(attrDef);
                if (attrDef.isMultiValue())
                {
                    // remove the dummy value for required fields when present.
                    if (attrDef.isRequired())
                    {
                        String defaultValue = attrDef.requiresDnDefaultValue() ? dn : attrDef.getRequiredDefaultValue();
                        values.remove(defaultValue);
                    }
                       
                    if (values.size() != 0)
                    {
                        a.setValues(values);
                    }
                       
                    else
                    {
                        attributes.add(a);
                    }                       
                }
                else
                {
                    String value = values.get(0);
                    if (attrDef.isEntityIdAttribute())
                    {
                        entityId = value;
                    }
                    a.setValue(value);
                }
                attributes.add(a);
            }
        }
        if (entityId == null)
View Full Code Here

        {
            SecurityAttribute sa = sas.getAttribute(attrDef.getMappedName());
            if (sa != null)
            {
                // currently only single-valued attributes are supported
                AttributeImpl attr = new AttributeImpl(attrDef);
                attr.setValue(sa.getStringValue());
                ldapAttrValues.add(attr);
            }
        }
        return internalCreateEntity(principal.getName(), null, ldapAttrValues);
    }
View Full Code Here

                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            if (values != null && values.length > 0)
            {
                Attribute a = new AttributeImpl(attrDef);
                if (attrDef.isMultiValue())
                {
                    Collection<String> attrValues = new ArrayList<String>();
                    attrValues.addAll(Arrays.asList(values));
                    // remove the dummy value for required fields when present.
                    if (attrDef.isRequired() && attrDef.getRequiredDefaultValue() != null && attrValues.contains(attrDef.getRequiredDefaultValue()))
                    {
                        attrValues.remove(attrDef.getRequiredDefaultValue());
                    }
                    if (attrValues.size() != 0)
                    {
                        a.setValues(attrValues);
                        attributes.add(a);
                    }else{
                        attributes.add(a);
                    }
                }
                else
                {
                    if (attrDef.getName().equals(searchConfiguration.getLdapIdAttribute()))
                    {
                        entityId = values[0];
                    }
                    if (values[0] != null)
                    {
                        // check if the value is not the required default value (a dummy value) If it is, ignore the attribute.
                        if (!(attrDef.isRequired() && attrDef.getRequiredDefaultValue() != null && values[0].equals(attrDef.getRequiredDefaultValue())))
                        {
                            a.setValue(values[0]);
                            attributes.add(a);
                        }
                    }
                }
            }
View Full Code Here

            {
                SecurityAttribute sa = sas.getAttribute(attrDef.getMappedName());
                if (sa != null)
                {
                    // currently only single-valued attributes are supported
                    AttributeImpl attr = new AttributeImpl(attrDef);
                    attr.setValue(sa.getStringValue());
                    ldapAttrValues.add(attr);
                }
            }
        }
        return internalCreateEntity(principal.getName(), null, ldapAttrValues);
View Full Code Here

            {
                List<String> values = null;
                values = getStringAttributes(attrs, attrDef.getName(), attrDef.requiresDnDefaultValue());
                if (values != null)
                {
                    Attribute a = new AttributeImpl(attrDef);
                    if (attrDef.isMultiValue())
                    {
                        // remove the dummy value for required fields when present.
                        if (attrDef.isRequired())
                        {
                            String defaultValue = attrDef.requiresDnDefaultValue() ? dn : attrDef.getRequiredDefaultValue();
                            values.remove(defaultValue);
                        }
                        if (values.size() != 0)
                        {
                            a.setValues(values);
                        }
                        else
                        {
                            attributes.add(a);
                        }
                    }
                    else
                    {
                        String value = values.get(0);
                        if (attrDef.isEntityIdAttribute())
                        {
                            entityId = value;
                        }
                        a.setValue(value);
                    }
                    attributes.add(a);
                }
            }
            if (entityId == null)
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.security.mapping.model.impl.AttributeImpl

Copyright © 2018 www.massapicom. 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.