Package org.apache.directory.ldapstudio.browser.core.model

Examples of org.apache.directory.ldapstudio.browser.core.model.IAttribute


        Set valueSet = new LinkedHashSet();
        for ( int i = 0; i < getSelectedAttributeHierarchies().length; i++ )
        {
            for ( Iterator it = getSelectedAttributeHierarchies()[i].iterator(); it.hasNext(); )
            {
                IAttribute att = ( IAttribute ) it.next();
                valueSet.addAll( Arrays.asList( att.getValues() ) );
            }
        }
        for ( int i = 0; i < getSelectedAttributes().length; i++ )
        {
            valueSet.addAll( Arrays.asList( getSelectedAttributes()[i].getValues() ) );
View Full Code Here


            // check schema modifyable
            boolean isOneModifyable = false;
            for ( Iterator it = ah.iterator(); it.hasNext(); )
            {
                IAttribute attribute = ( IAttribute ) it.next();
                if ( SchemaUtils.isModifyable( attribute.getAttributeTypeDescription() ) )
                {
                    isOneModifyable = true;
                    break;
                }
            }
            if ( !isOneModifyable )
            {
                return false;
            }

            // check if property is valid for the entry
            boolean isOneValid = false;
            for ( Iterator it = ah.iterator(); it.hasNext(); )
            {
                IAttribute attribute = ( IAttribute ) it.next();
                if ( attribute.isObjectClassAttribute() || attribute.isMustAttribute() || attribute.isMayAttribute() )
                {
                    isOneValid = true;
                    break;
                }
            }
View Full Code Here

    private String detectByVendorName( IRootDSE rootDSE )
    {

        String result = null;

        IAttribute vnAttribute = rootDSE.getAttribute( "vendorName" );
        IAttribute vvAttribute = rootDSE.getAttribute( "vendorVersion" );

        if ( vnAttribute != null && vnAttribute.getStringValues().length > 0 && vvAttribute != null
            && vvAttribute.getStringValues().length > 0 )
        {
            if ( vnAttribute.getStringValues()[0].indexOf( "Apache Software Foundation" ) > -1 )
            {
                result = "Apache Directory Server";
            }
            if ( vnAttribute.getStringValues()[0].indexOf( "Novell" ) > -1
                || vvAttribute.getStringValues()[0].indexOf( "eDirectory" ) > -1 )
            {
                result = "Novell eDirectory";
            }
            if ( vnAttribute.getStringValues()[0].indexOf( "Sun" ) > -1
                || vvAttribute.getStringValues()[0].indexOf( "Sun" ) > -1 )
            {
                result = "Sun Directory Server";
            }
            if ( vnAttribute.getStringValues()[0].indexOf( "Netscape" ) > -1
                || vvAttribute.getStringValues()[0].indexOf( "Netscape" ) > -1 )
            {
                result = "Netscape Directory Server";
            }
            if ( vnAttribute.getStringValues()[0].indexOf( "International Business Machines" ) > -1
                && ( ( vvAttribute.getStringValues()[0].indexOf( "6.0" ) > -1 ) )
                || ( vvAttribute.getStringValues()[0].indexOf( "5.2" ) > -1 ) )
            {
                result = "IBM Tivoli Directory Server";
            }
        }
View Full Code Here

    {

        String result = null;

        // check active directory
        IAttribute rdncAttribute = rootDSE.getAttribute( "rootDomainNamingContext" );
        if ( rdncAttribute != null )
        {
            IAttribute ffAttribute = rootDSE.getAttribute( "forestFunctionality" );
            if ( ffAttribute != null )
            {
                result = "Microsoft Active Directory 2003";
            }
            else
View Full Code Here

    private String detectSiemensDirX( IRootDSE rootDSE )
    {

        String result = null;

        IAttribute ssseAttribute = rootDSE.getAttribute( "subSchemaSubentry" );
        if ( ssseAttribute != null )
        {
            for ( int i = 0; i < ssseAttribute.getStringValues().length; i++ )
            {
                if ( "cn=LDAPGlobalSchemaSubentry".equals( ssseAttribute.getStringValues()[i] ) )
                {
                    result = "Siemens DirX";
                }
            }
        }
View Full Code Here

        String result = null;
        boolean typeDetected = false;

        // check OpenLDAP
        IAttribute ocAttribute = rootDSE.getAttribute( "objectClass" );
        if ( ocAttribute != null )
        {
            for ( int i = 0; i < ocAttribute.getStringValues().length; i++ )
            {
                if ( "OpenLDAProotDSE".equals( ocAttribute.getStringValues()[i] ) )
                {
                    IAttribute ccAttribute = rootDSE.getAttribute( "configContext" );
                    if ( ccAttribute != null )
                    {
                        result = "OpenLDAP 2.3";
                        typeDetected = true;
                    }
                    if ( !typeDetected )
                    {
                        IAttribute scAttribute = rootDSE.getAttribute( "supportedControl" );
                        if ( scAttribute != null )
                        {
                            for ( int sci = 0; sci < scAttribute.getStringValues().length; sci++ )
                            {
                                // if("1.2.840.113556.1.4.319".equals(scAttribute.getStringValues()[sci]))
                                // {
                                if ( "2.16.840.1.113730.3.4.18".equals( scAttribute.getStringValues()[sci] ) )
                                {
                                    result = "OpenLDAP 2.2";
                                    typeDetected = true;
                                }
                            }
                        }

                    }
                    if ( !typeDetected )
                    {
                        IAttribute seAttribute = rootDSE.getAttribute( "supportedExtension" );
                        if ( seAttribute != null )
                        {
                            for ( int sei = 0; sei < seAttribute.getStringValues().length; sei++ )
                            {
                                if ( "1.3.6.1.4.1.4203.1.11.3".equals( seAttribute.getStringValues()[sei] ) )
                                {
                                    result = "OpenLDAP 2.1";
                                    typeDetected = true;
                                }
                            }
                        }
                    }
                    if ( !typeDetected )
                    {
                        IAttribute sfAttribute = rootDSE.getAttribute( "supportedFeatures" );
                        if ( sfAttribute != null )
                        {
                            for ( int sfi = 0; sfi < sfAttribute.getStringValues().length; sfi++ )
                            {
                                if ( "1.3.6.1.4.1.4203.1.5.4".equals( sfAttribute.getStringValues()[sfi] ) )
                                {
                                    result = "OpenLDAP 2.0";
                                    typeDetected = true;
                                }
                            }
View Full Code Here

        Set filterSet = new LinkedHashSet();
        for ( int i = 0; i < getSelectedAttributeHierarchies().length; i++ )
        {
            for ( Iterator it = getSelectedAttributeHierarchies()[i].iterator(); it.hasNext(); )
            {
                IAttribute att = ( IAttribute ) it.next();
                IValue[] values = att.getValues();
                for ( int v = 0; v < values.length; v++ )
                {
                    filterSet.add( LdapFilterUtils.getFilter( values[v] ) );
                }
            }
View Full Code Here

            this.actionGroup.getOpenDefaultEditorAction() );

        // start edit mode if an empty value exists
        for ( Iterator it = attributeHierarchie.iterator(); it.hasNext(); )
        {
            IAttribute attribute = ( IAttribute ) it.next();
            IValue[] values = attribute.getValues();
            for ( int i = 0; i < values.length; i++ )
            {
                IValue value = values[i];
                if ( value.isEmpty() )
                {
View Full Code Here

    private void dialogClosed()
    {

        for ( Iterator it = attributeHierarchie.iterator(); it.hasNext(); )
        {
            IAttribute attribute = ( IAttribute ) it.next();
            if ( attribute != null )
            {

                // remove empty values
                IValue[] values = attribute.getValues();
                for ( int i = 0; i < values.length; i++ )
                {
                    if ( values[i].isEmpty() )
                    {
                        attribute.deleteEmptyValue();
                    }
                }

                // are all values deleted?
                if ( attribute.getValueSize() == 0 )
                {
                    try
                    {
                        attribute.getEntry().deleteAttribute( attribute );
                    }
                    catch ( ModelModificationException e )
                    {
                    }
                    // new DeleteAttributeValueCommand(attribute).execute();
View Full Code Here

                String newAttributeDescription = wizard.getAttributeDescription();
                if ( newAttributeDescription != null && !"".equals( newAttributeDescription ) )
                {
                    try
                    {
                        IAttribute att = entry.getAttribute( newAttributeDescription );
                        if ( att == null )
                        {
                            att = new Attribute( entry, newAttributeDescription );
                            entry.addAttribute( att ) ;
                        }

                        att.addEmptyValue();
                    }
                    catch ( ModelModificationException mme )
                    {
                        MessageDialog.openError( Display.getDefault().getActiveShell(), "Error While Adding Attribute",
                            mme.getMessage() );
View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.browser.core.model.IAttribute

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.