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

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


                .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.getKind() == ObjectClassTypeEnum.STRUCTURAL )
                {
                    structuralObjectClassAvailable = true;
                    break;
                }
            }
View Full Code Here


            {
                if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_OBJECTCLASSES ) )
                {
                    ObjectClassDescriptionSchemaParser parser = new ObjectClassDescriptionSchemaParser();
                    parser.setQuirksMode( true );
                    ObjectClassDescription ocd = parser.parseObjectClassDescription( value );
                    ocd.addExtension( RAW_SCHEMA_DEFINITION_LDIF_VALUE, ldifValues );
                    addObjectClassDescription( ocd );
                }
                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();
                    parser.setQuirksMode( true );
                    LdapSyntaxDescription lsd = parser.parseLdapSyntaxDescription( value );
                    lsd.addExtension( RAW_SCHEMA_DEFINITION_LDIF_VALUE, ldifValues );
                    addLdapSyntaxDescription( lsd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_MATCHINGRULES ) )
                {
                    MatchingRuleDescriptionSchemaParser parser = new MatchingRuleDescriptionSchemaParser();
                    parser.setQuirksMode( true );
                    MatchingRuleDescription mrd = parser.parseMatchingRuleDescription( value );
                    mrd.addExtension( RAW_SCHEMA_DEFINITION_LDIF_VALUE, ldifValues );
                    addMatchingRuleDescription( mrd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_MATCHINGRULEUSE ) )
                {
                    MatchingRuleUseDescriptionSchemaParser parser = new MatchingRuleUseDescriptionSchemaParser();
                    parser.setQuirksMode( true );
                    MatchingRuleUseDescription mrud = parser.parseMatchingRuleUseDescription( value );
                    mrud.addExtension( RAW_SCHEMA_DEFINITION_LDIF_VALUE, ldifValues );
                    addMatchingRuleUseDescription( mrud );
                }
                else if ( attributeName.equalsIgnoreCase( IAttribute.OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP ) )
                {
                    setCreateTimestamp( value );
                }
                else if ( attributeName.equalsIgnoreCase( IAttribute.OPERATIONAL_ATTRIBUTE_MODIFY_TIMESTAMP ) )
                {
                    setModifyTimestamp( value );
                }
            }
            catch ( Exception e )
            {
                System.out.println( e.getMessage() + ": " + attributeName + " - " + value );
                e.printStackTrace();
            }
        }

        // set extensibleObject may attributes
        ObjectClassDescription extensibleObjectOcd = this
            .getObjectClassDescription( SchemaConstants.EXTENSIBLE_OBJECT_OC );
        Collection<AttributeTypeDescription> userAtds = SchemaUtils.getUserAttributeDescriptions( this );
        Collection<String> atdNames = SchemaUtils.getNames( userAtds );
        List<String> atdNames2 = new ArrayList<String>( atdNames );
        extensibleObjectOcd.setMayAttributeTypes( atdNames2 );
    }
View Full Code Here

        else
        {
            // DUMMY
            List<String> names = new ArrayList<String>();
            names.add( nameOrOid );
            ObjectClassDescription ocd = new ObjectClassDescription();
            ocd.setNumericOid( nameOrOid );
            ocd.setNames( names );
            ocd.setExtensions( DUMMY_EXTENSIONS );
            return ocd;
        }
    }
View Full Code Here

        IAttribute ocAttribute = attributeMap.get( IAttribute.OBJECTCLASS_ATTRIBUTE_OID.toLowerCase() );
        String[] ocValues = ocAttribute.getStringValues();
        boolean structuralObjectClassAvailable = false;
        for ( String ocValue : ocValues )
        {
            ObjectClassDescription ocd = this.getBrowserConnection().getSchema().getObjectClassDescription( ocValue );
            if ( ocd.getKind() == ObjectClassTypeEnum.STRUCTURAL )
            {
                structuralObjectClassAvailable = true;
                break;
            }
        }
View Full Code Here

         */
        public boolean select( Viewer viewer, Object parentElement, Object element )
        {
            if ( element instanceof ObjectClassDescription )
            {
                ObjectClassDescription ocd = ( ObjectClassDescription ) element;
                Collection<String> lowerCaseIdentifiers = SchemaUtils.getLowerCaseIdentifiers( ocd );
                for ( String s : lowerCaseIdentifiers )
                {
                    if ( s.toLowerCase().startsWith( filterText.getText().toLowerCase() ) )
                    {
View Full Code Here

            {
                String[] ocValues = ocAttribute.getStringValues();
                for ( int i = 0; i < ocValues.length; i++ )
                {
                    String ocValue = ocValues[i];
                    ObjectClassDescription ocd = wizard.getSelectedConnection().getSchema().getObjectClassDescription(
                        ocValue );
                    availableObjectClasses.remove( ocd );
                    selectedObjectClasses.add( ocd );
                }
            }
View Full Code Here

        IStructuredSelection selection = ( IStructuredSelection ) iselection;
        Schema schema = wizard.getSelectedConnection().getSchema();
        Iterator<?> it = selection.iterator();
        while ( it.hasNext() )
        {
            ObjectClassDescription ocd = ( ObjectClassDescription ) it.next();
            if ( availableObjectClasses.contains( ocd ) && !selectedObjectClasses.contains( ocd ) )
            {
                availableObjectClasses.remove( ocd );
                selectedObjectClasses.add( ocd );
View Full Code Here

        IStructuredSelection selection = ( IStructuredSelection ) iselection;
        Schema schema = wizard.getSelectedConnection().getSchema();
        Iterator<?> it = selection.iterator();
        while ( it.hasNext() )
        {
            ObjectClassDescription ocd = ( ObjectClassDescription ) it.next();
            if ( !availableObjectClasses.contains( ocd ) && selectedObjectClasses.contains( ocd ) )
            {
                selectedObjectClasses.remove( ocd );
                availableObjectClasses.add( ocd );
View Full Code Here

            Set<String> remainingObjectClassesSet = new HashSet<String>( Arrays.asList( ocValues ) );
            remainingObjectClassesSet.removeAll( selectedObjectClasses );
            Set<AttributeTypeDescription> remainingAttributeSet = new HashSet<AttributeTypeDescription>();
            for ( String oc : remainingObjectClassesSet )
            {
                ObjectClassDescription ocd = schema.getObjectClassDescription( oc );
                if ( ocd != null )
                {
                    Collection<String> mustAttrs = SchemaUtils.getMustAttributeTypeDescriptionNamesTransitive( ocd,
                        schema );
                    for ( String mustAttr : mustAttrs )
View Full Code Here

    {
        if ( schema != null )
        {
            for ( String possibleObjectClass : possibleObjectClasses.keySet() )
            {
                ObjectClassDescription description = possibleObjectClasses.get( possibleObjectClass );
                if ( possibleObjectClass.toUpperCase().startsWith( objectClass.toUpperCase() ) )
                {
                    String replacementString = possibleObjectClass;
                    String displayString = possibleObjectClass;
                    if ( displayString.equals( description.getNumericOid() ) )
                    {
                        displayString += " (" + SchemaUtils.toString( description ) + ")";
                    }
                    else
                    {
                        displayString += " (" + description.getNumericOid() + ")";
                    }

                    ICompletionProposal proposal = new CompletionProposal( replacementString, offset, objectClass
                        .length(), replacementString.length(), getObjectClassImage(), displayString, null, SchemaUtils
                        .getLdifLine( schema.getObjectClassDescription( possibleObjectClass ) ) );
View Full Code Here

TOP

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

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.