Package org.apache.directory.studio.ldapbrowser.core.model

Examples of org.apache.directory.studio.ldapbrowser.core.model.IAttribute


                    List<IValue> valueList = new ArrayList<IValue>( Arrays.asList( values ) );

                    // filter empty attributes and values
                    for ( Iterator<IAttribute> it = attributeList.iterator(); it.hasNext(); )
                    {
                        IAttribute att = it.next();
                        IValue[] vals = att.getValues();
                        for ( IValue value : vals )
                        {
                            if ( value.isEmpty() )
                            {
                                att.deleteEmptyValue();
                            }
                        }
                        if ( att.getValueSize() == 0 )
                        {
                            att.getEntry().deleteAttribute( att );
                            it.remove();
                        }
                    }
                    for ( Iterator<IValue> it = valueList.iterator(); it.hasNext(); )
                    {
View Full Code Here


            int count = ( ( Integer ) attributeNameToSelectedValuesCountMap.get( value.getAttribute().getDescription() ) )
                .intValue() + 1;
            attributeNameToSelectedValuesCountMap.put( value.getAttribute().getDescription(), new Integer( count ) );
            if ( count >= value.getAttribute().getValueSize() )
            {
                IAttribute attribute = value.getAttribute();
                if ( attribute != null && !attributeList.contains( attribute ) )
                {
                    attributeList.add( attribute );
                }
            }
View Full Code Here

    {
        String oidString = attributeToDelete.getAttributeDescription().toOidString( getBrowserConnection().getSchema() );
        AttributeInfo ai = getBrowserConnectionImpl().getAttributeInfo( this );
        if ( ai != null && ai.attributeMap != null && ai.attributeMap.containsKey( oidString.toLowerCase() ) )
        {
            IAttribute attribute = ( IAttribute ) ai.attributeMap.get( oidString.toLowerCase() );
            ai.attributeMap.remove( oidString.toLowerCase() );
            if ( ai.attributeMap.isEmpty() )
            {
                getBrowserConnectionImpl().setAttributeInfo( this, null );
            }
View Full Code Here

            // check objectclass attribute
            if ( !ai.attributeMap.containsKey( IAttribute.OBJECTCLASS_ATTRIBUTE_OID.toLowerCase() ) )
            {
                return false;
            }
            IAttribute ocAttribute = ( IAttribute ) ai.attributeMap.get( IAttribute.OBJECTCLASS_ATTRIBUTE_OID
                .toLowerCase() );
            String[] ocValues = ocAttribute.getStringValues();
            boolean structuralObjectClassAvailable = false;
            for ( int i = 0; i < ocValues.length; i++ )
            {
                ObjectClassDescription ocd = getBrowserConnection().getSchema().getObjectClassDescription( ocValues[i] );
                if ( ocd.isStructural() )
View Full Code Here

        }
        else
        {
            List<IAttribute> attributeList = new ArrayList<IAttribute>();

            IAttribute myAttribute = getAttribute( attributeDescription );
            if ( myAttribute != null )
            {
                attributeList.add( myAttribute );
            }
View Full Code Here

                AttributeHierarchy ah = result.getAttributeWithSubtypes( property );
                if ( ah != null )
                {
                    for ( int i = 0; i < ah.getAttributes().length; i++ )
                    {
                        IAttribute attribute = ah.getAttributes()[i];
                        if ( attribute.isObjectClassAttribute() )
                        {
                            FontData[] fontData = PreferenceConverter.getFontDataArray( BrowserCommonActivator.getDefault()
                                .getPreferenceStore(), BrowserCommonConstants.PREFERENCE_OBJECTCLASS_FONT );
                            return BrowserCommonActivator.getDefault().getFont( fontData );
                        }
                        else if ( attribute.isMustAttribute() )
                        {
                            FontData[] fontData = PreferenceConverter.getFontDataArray( BrowserCommonActivator.getDefault()
                                .getPreferenceStore(), BrowserCommonConstants.PREFERENCE_MUSTATTRIBUTE_FONT );
                            return BrowserCommonActivator.getDefault().getFont( fontData );
                        }
                        else if ( attribute.isOperationalAttribute() )
                        {
                            FontData[] fontData = PreferenceConverter.getFontDataArray( BrowserCommonActivator.getDefault()
                                .getPreferenceStore(), BrowserCommonConstants.PREFERENCE_OPERATIONALATTRIBUTE_FONT );
                            return BrowserCommonActivator.getDefault().getFont( fontData );
                        }
View Full Code Here

                // necessary when navigating back, modifying object classes
                // and DN and navigation forward again.
                String[] oldMust = newEntry.getSubschema().getMustAttributeNames();
                for ( int i = 0; i < oldMust.length; i++ )
                {
                    IAttribute attribute = newEntry.getAttribute( oldMust[i] );
                    if ( attribute != null )
                    {
                        IValue[] values = attribute.getValues();
                        for ( int v = 0; v < values.length; v++ )
                        {
                            if ( values[v].isEmpty() )
                            {
                                attribute.deleteValue( values[v] );
                            }
                        }
                        if ( attribute.getValueSize() == 0 )
                        {
                            newEntry.deleteAttribute( attribute );
                        }
                    }
                }

                // add must attributes
                String[] newMust = newEntry.getSubschema().getMustAttributeNames();
                for ( int i = 0; i < newMust.length; i++ )
                {
                    if ( newEntry.getAttribute( newMust[i] ) == null )
                    {
                        IAttribute att = new Attribute( newEntry, newMust[i] );
                        newEntry.addAttribute( att );
                        att.addEmptyValue();

                        if ( editValue == null )
                        {
                            editValue = att.getValues()[0];
                        }
                    }
                }
            }
            finally
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

TOP

Related Classes of org.apache.directory.studio.ldapbrowser.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.