Examples of MatchingRuleDescription


Examples of org.apache.directory.shared.ldap.schema.parsers.MatchingRuleDescription

    /**
     * {@inheritDoc}
     */
    public void setInput( Object input )
    {
        MatchingRuleDescription mrd = null;
        if ( input instanceof MatchingRuleDescription )
        {
            mrd = ( MatchingRuleDescription ) input;
        }

        // create main content
        createMainContent( mrd );

        // set flag
        isObsoleteText.setEnabled( mrd != null && mrd.isObsolete() );

        // set syntax content
        String lsdOid = null;
        LdapSyntaxDescription lsd = null;
        if ( mrd != null )
        {
            Schema schema = getSchema();
            lsdOid = mrd.getSyntax();
            if ( lsdOid != null && schema.hasLdapSyntaxDescription( lsdOid ) )
            {
                lsd = schema.getLdapSyntaxDescription( lsdOid );
            }
        }
View Full Code Here

Examples of org.apache.directory.shared.ldap.schema.parsers.MatchingRuleDescription

        int pos = 0;
       
        for ( Value<?> value:attr )
        {
            MatchingRuleDescription desc = null;

            try
            {
                desc = matchingRuleParser.parseMatchingRuleDescription( value.getString() );
            }
            catch ( ParseException e )
            {
                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException(
                    "The following does not conform to the matchingRuleDescription syntax: " + value.getString(),
                    ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                iave.setRootCause( e );
                throw iave;
            }
           
            if ( ! dao.hasSyntax( desc.getSyntax() )  )
            {
                throw new LdapOperationNotSupportedException(
                    "Cannot create a matchingRule that depends on non-existant syntax: " + desc.getSyntax(),
                    ResultCodeEnum.UNWILLING_TO_PERFORM );
            }
           
            MatchingRuleImpl mr = new MatchingRuleImpl( desc.getNumericOid(), desc.getSyntax(), globalRegistries );
            setSchemaObjectProperties( desc, mr );
           
            matchingRules[pos++] = mr;
        }
       
View Full Code Here

Examples of org.apache.directory.shared.ldap.schema.parsers.MatchingRuleDescription

        // check first to see if it is present in the subschemaSubentry
        // -------------------------------------------------------------------
       
        Attributes attrs = getSubschemaSubentryAttributes();
        Attribute attrTypes = attrs.get( "matchingRules" );
        MatchingRuleDescription matchingRuleDescription = null;
        for ( int ii = 0; ii < attrTypes.size(); ii++ )
        {
            String desc = ( String ) attrTypes.get( ii );
            if ( desc.indexOf( oid ) != -1 )
            {
                matchingRuleDescription = matchingRuleDescriptionSchemaParser.parseMatchingRuleDescription( desc );
                break;
            }
        }
    
        if ( isPresent )
        {
            assertNotNull( matchingRuleDescription );
            assertEquals( oid, matchingRuleDescription.getNumericOid() );
        }
        else
        {
            assertNull( matchingRuleDescription );
        }
View Full Code Here

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

                }
                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();
View Full Code Here

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

            return DEFAULT_SCHEMA.getMatchingRuleDescription( nameOrOid );
        }
        else
        {
            // DUMMY
            MatchingRuleDescription mrd = new MatchingRuleDescription();
            mrd.setNumericOid( nameOrOid );
            mrd.setExtensions( DUMMY_EXTENSIONS );
            return mrd;
        }
    }
View Full Code Here

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

        {
            for ( String possibleMatchingRule : possibleMatchingRules.keySet() )
            {
                if ( possibleMatchingRule.toUpperCase().startsWith( matchingRule.toUpperCase() ) )
                {
                    MatchingRuleDescription description = schema.getMatchingRuleDescription( possibleMatchingRule );
                    String replacementString = possibleMatchingRule;
                    if ( equalsColonToken == null )
                    {
                        replacementString += ":";
                    }
                    if ( equalsToken == null )
                    {
                        replacementString += "=";
                    }
                    String displayString = possibleMatchingRule;
                    if ( displayString.equals( description.getNumericOid() ) )
                    {
                        displayString += " (" + SchemaUtils.toString( description ) + ")";
                    }
                    else
                    {
                        displayString += " (" + description.getNumericOid() + ")";
                    }
                    String info = SchemaUtils.getLdifLine( description );
                    ICompletionProposal proposal = new CompletionProposal( replacementString, offset, matchingRule
                        .length(), replacementString.length(), getMatchingRuleImage(), displayString, null, info );
                    proposalList.add( proposal );
View Full Code Here

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

        lengthText.setText( getNonNullString( lsdLength > 0 ? Integer.toString( lsdLength ) : null ) );
        syntaxSection.layout();

        // set matching rules content
        String emrOid = null;
        MatchingRuleDescription emr = null;
        if ( atd != null )
        {
            emrOid = SchemaUtils.getEqualityMatchingRuleNameOrNumericOidTransitive( atd, getSchema() );
            if ( emrOid != null && getSchema().hasMatchingRuleDescription( emrOid ) )
            {
                emr = getSchema().getMatchingRuleDescription( emrOid );
            }
        }
        equalityLink.setText( getNonNullString( emr != null ? SchemaUtils.toString( emr ) : emrOid ) );
        equalityLink.setHref( emr );
        equalityLink.setUnderlined( emr != null );
        equalityLink.setEnabled( emr != null );

        String smrOid = null;
        MatchingRuleDescription smr = null;
        if ( atd != null )
        {
            smrOid = SchemaUtils.getSubstringMatchingRuleNameOrNumericOidTransitive( atd, getSchema() );
            if ( smrOid != null && getSchema().hasMatchingRuleDescription( smrOid ) )
            {
                smr = getSchema().getMatchingRuleDescription( smrOid );
            }
        }
        substringLink.setText( getNonNullString( smr != null ? SchemaUtils.toString( smr ) : smrOid ) );
        substringLink.setHref( smr );
        substringLink.setUnderlined( smr != null );
        substringLink.setEnabled( smr != null );

        String omrOid = null;
        MatchingRuleDescription omr = null;
        if ( atd != null )
        {
            omrOid = SchemaUtils.getOrderingMatchingRuleNameOrNumericOidTransitive( atd, getSchema() );
            if ( omrOid != null && getSchema().hasMatchingRuleDescription( omrOid ) )
            {
View Full Code Here

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

                otherMatchSection.setText( "Other Matching Rules (" + otherMrdNames.size() + ")" );
                for ( String mrdName : otherMrdNames )
                {
                    if ( getSchema().hasMatchingRuleDescription( mrdName ) )
                    {
                        MatchingRuleDescription mrd = getSchema().getMatchingRuleDescription( mrdName );
                        Hyperlink otherMatchLink = toolkit.createHyperlink( otherMatchClient, SchemaUtils
                            .toString( mrd ), SWT.WRAP );
                        otherMatchLink.setHref( mrd );
                        otherMatchLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
                        otherMatchLink.setUnderlined( true );
View Full Code Here

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

                    && fc.getMatchingRuleToken().getOffset() <= hoverRegion.getOffset()
                    && hoverRegion.getOffset() <= fc.getMatchingRuleToken().getOffset()
                        + fc.getMatchingRuleToken().getLength() )
                {
                    String matchingRule = fc.getMatchingRuleToken().getValue();
                    MatchingRuleDescription matchingRuleDescription = schema.getMatchingRuleDescription( matchingRule );
                    String info = SchemaUtils.getLdifLine( matchingRuleDescription );
                    return info;
                }
            }
        }
View Full Code Here

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

        {
            for ( String possibleMatchingRule : possibleMatchingRules.keySet() )
            {
                if ( possibleMatchingRule.toUpperCase().startsWith( matchingRule.toUpperCase() ) )
                {
                    MatchingRuleDescription description = schema.getMatchingRuleDescription( possibleMatchingRule );
                    String replacementString = possibleMatchingRule;
                    if ( equalsColonToken == null )
                    {
                        replacementString += ":";
                    }
                    if ( equalsToken == null )
                    {
                        replacementString += "=";
                    }
                    String displayString = possibleMatchingRule;
                    if ( displayString.equals( description.getNumericOid() ) )
                    {
                        displayString += " (" + SchemaUtils.toString( description ) + ")";
                    }
                    else
                    {
                        displayString += " (" + description.getNumericOid() + ")";
                    }
                    String info = SchemaUtils.getLdifLine( description );
                    ICompletionProposal proposal = new CompletionProposal( replacementString, offset, matchingRule
                        .length(), replacementString.length(), getMatchingRuleImage(), displayString, null, info );
                    proposalList.add( proposal );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.