Package org.apache.directory.shared.ldap.schema.syntax

Examples of org.apache.directory.shared.ldap.schema.syntax.AttributeTypeDescription


                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_ATTRIBUTETYPES ) )
                {
                    AttributeTypeDescriptionSchemaParser parser = new AttributeTypeDescriptionSchemaParser();
                    parser.setQuirksMode( true );
                    AttributeTypeDescription atd = parser.parseAttributeTypeDescription( value );
                    atd.addExtension( RAW_SCHEMA_DEFINITION_LDIF_VALUE, ldifValues );
                    addAttributeTypeDescription( atd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_LDAPSYNTAXES ) )
                {
                    LdapSyntaxDescriptionSchemaParser parser = new LdapSyntaxDescriptionSchemaParser();
View Full Code Here


        else
        {
            // DUMMY
            List<String> attributeTypes = new ArrayList<String>();
            attributeTypes.add( attributeType );
            AttributeTypeDescription atd = new AttributeTypeDescription();
            atd.setNumericOid( attributeType );
            atd.setNames( attributeTypes );
            atd.setUserModifiable( false );
            atd.setUsage( UsageEnum.USER_APPLICATIONS );
            atd.setExtensions( DUMMY_EXTENSIONS );
            return atd;
        }
    }
View Full Code Here

            attributeValuesText.setText( "" + valCount );
            attributeSizeText.setText( Utils.formatBytes( bytes ) );

            if ( schema.hasAttributeTypeDescription( attribute.getDescription() ) )
            {
                AttributeTypeDescription atd = schema.getAttributeTypeDescription( attribute.getDescription() );

                atdOidText.setText( atd.getNumericOid() );
                String atdNames = atd.getNames().toString();
                atdNamesText.setText( atdNames.substring( 1, atdNames.length() - 1 ) );
                atdDescText.setText( Utils.getNonNullString( atd.getDescription() ) );
                atdUsageText.setText( Utils.getNonNullString( atd.getUsage() ) );

                singleValuedFlag.setSelection( atd.isSingleValued() );
                noUserModificationFlag.setSelection( !atd.isUserModifiable() );
                collectiveFlag.setSelection( atd.isCollective() );
                obsoleteFlag.setSelection( atd.isObsolete() );

                String syntaxNumericOid = SchemaUtils.getSyntaxNumericOidTransitive( atd, schema );
                int syntaxLength = SchemaUtils.getSyntaxLengthTransitive( atd, schema );
                String syntaxDescription = syntaxNumericOid != null ? schema
                    .getLdapSyntaxDescription( syntaxNumericOid ).getDescription() : null;
View Full Code Here

    {
        if ( schema != null )
        {
            for ( String possibleAttributeType : possibleAttributeTypes.keySet() )
            {
                AttributeTypeDescription description = possibleAttributeTypes.get( possibleAttributeType );
                if ( possibleAttributeType.toUpperCase().startsWith( attributeType.toUpperCase() ) )
                {
                    String replacementString = possibleAttributeType;
                    String displayString = possibleAttributeType;
                    if ( displayString.equals( description.getNumericOid() ) )
                    {
                        displayString += " (" + SchemaUtils.toString( description ) + ")";
                    }
                    else
                    {
                        displayString += " (" + description.getNumericOid() + ")";
                    }
                    String info = SchemaUtils.getLdifLine( description );
                    ICompletionProposal proposal = new CompletionProposal( replacementString, offset, attributeType
                        .length(), replacementString.length(), getAttributeTypeImage(), displayString, null, info );
                    proposalList.add( proposal );
View Full Code Here

                {
                    Collection<String> mustAttrs = SchemaUtils.getMustAttributeTypeDescriptionNamesTransitive( ocd,
                        schema );
                    for ( String mustAttr : mustAttrs )
                    {
                        AttributeTypeDescription atd = entry.getBrowserConnection().getSchema()
                            .getAttributeTypeDescription( mustAttr );
                        remainingAttributeSet.add( atd );
                    }
                    Collection<String> mayAttrs = SchemaUtils.getMayAttributeTypeDescriptionNamesTransitive( ocd,
                        schema );
                    for ( String mayAttr : mayAttrs )
                    {
                        AttributeTypeDescription atd = entry.getBrowserConnection().getSchema()
                            .getAttributeTypeDescription( mayAttr );
                        remainingAttributeSet.add( atd );
                    }
                }
            }
View Full Code Here

                {
                    if ( relation.getAttributeNumericOidOrType() != null )
                    {
                        if ( attributeNames2AtdMap.containsKey( relation.getAttributeNumericOidOrType() ) )
                        {
                            AttributeTypeDescription atd = ( AttributeTypeDescription ) attributeNames2AtdMap
                                .get( relation.getAttributeNumericOidOrType() );
                            String s = atd.getNumericOid();
                            for ( String name : atd.getNames() )
                            {
                                if ( !relation.getAttributeNumericOidOrType().equals( name ) )
                                {
                                    s += ", " + name;
                                }
                            }
                            return s;
                        }
                        else if ( attributeOid2AtdMap.containsKey( relation.getAttributeNumericOidOrType() ) )
                        {
                            AttributeTypeDescription atd = ( AttributeTypeDescription ) attributeOid2AtdMap
                                .get( relation.getAttributeNumericOidOrType() );
                            return atd.toString();
                        }
                    }
                }
                else if ( index == 2 )
                {
View Full Code Here

        if ( schema == null )
        {
            return description;
        }

        AttributeTypeDescription atd = schema.getAttributeTypeDescription( parsedAttributeType );
        String oidString = atd.getNumericOid();

        if ( !parsedLangList.isEmpty() )
        {
            for ( Iterator<String> it = parsedLangList.iterator(); it.hasNext(); )
            {
View Full Code Here

        {
            return false;
        }

        // check type
        AttributeTypeDescription myAtd = schema.getAttributeTypeDescription( this.getParsedAttributeType() );
        AttributeTypeDescription otherAtd = schema.getAttributeTypeDescription( other.getParsedAttributeType() );
        if ( myAtd != otherAtd )
        {
            AttributeTypeDescription superiorAtd = null;
            String superiorName = myAtd.getSuperType();
            while ( superiorName != null )
            {
                superiorAtd = schema.getAttributeTypeDescription( superiorName );
                if ( superiorAtd == otherAtd )
                {
                    break;
                }
                superiorName = superiorAtd.getSuperType();
            }
            if ( superiorAtd != otherAtd )
            {
                return false;
            }
View Full Code Here

                {
                    if ( attribute.getAttributeNumericOidOrName() != null )
                    {
                        if ( attributeNames2AtdMap.containsKey( attribute.getAttributeNumericOidOrName() ) )
                        {
                            AttributeTypeDescription atd = ( AttributeTypeDescription ) attributeNames2AtdMap
                                .get( attribute.getAttributeNumericOidOrName() );
                            String s = atd.getNumericOid();
                            for ( String attributeName : atd.getNames() )
                            {
                                if ( !attribute.getAttributeNumericOidOrName().equals( attributeName ) )
                                {
                                    s += ", " + attributeName;
                                }
                            }
                            return s;
                        }
                        else if ( attributeOid2AtdMap.containsKey( attribute.getAttributeNumericOidOrName() ) )
                        {
                            AttributeTypeDescription atd = ( AttributeTypeDescription ) attributeOid2AtdMap
                                .get( attribute.getAttributeNumericOidOrName() );
                            return SchemaUtils.toString( atd );
                        }
                    }
                }
View Full Code Here

        {
            return userSelectedValueEditor;
        }

        // check attribute preferences
        AttributeTypeDescription atd = schema.getAttributeTypeDescription( attributeType );
        Map<String, String> attributeValueEditorMap = BrowserCommonActivator.getDefault().getValueEditorsPreferences()
            .getAttributeValueEditorMap();
        if ( atd.getNumericOid() != null && attributeValueEditorMap.containsKey( atd.getNumericOid().toLowerCase() ) )
        {
            return ( IValueEditor ) class2ValueEditors.get( attributeValueEditorMap.get( atd.getNumericOid()
                .toLowerCase() ) );
        }
        List<String> names = atd.getNames();
        for ( String name : names )
        {
            if ( attributeValueEditorMap.containsKey( name.toLowerCase() ) )
            {
                return ( IValueEditor ) class2ValueEditors.get( attributeValueEditorMap.get( name.toLowerCase() ) );
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.schema.syntax.AttributeTypeDescription

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.