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

Examples of org.apache.directory.studio.ldapbrowser.core.utils.AttributeComparator


                    LdifAttrValLine[] attrValLines = record.getAttrVals();
                    LdifSepLine sepLine = record.getSepLine();

                    // sort and format
                    DummyEntry entry = ModelConverter.ldifContentRecordToEntry( record, browserConnection );
                    AttributeComparator comparator = new AttributeComparator( entry );
                    Arrays.sort( attrValLines, comparator );
                    LdifContentRecord newRecord = new LdifContentRecord( dnLine );
                    for ( int i = 0; i < attrValLines.length; i++ )
                    {
                        newRecord.addAttrVal( attrValLines[i] );
View Full Code Here


    private void setDocumentInput( IDocument document, IEntry entry )
    {
        LdifContentRecord record = ModelConverter.entryToLdifContentRecord( entry );

        // sort attribute-value lines
        AttributeComparator comparator = new AttributeComparator( entry );
        LdifAttrValLine[] attrValLines = record.getAttrVals();
        Arrays.sort( attrValLines, comparator );
        LdifContentRecord newRecord = new LdifContentRecord( record.getDnLine() );
        for ( LdifAttrValLine attrValLine : attrValLines )
        {
View Full Code Here

            IAttribute[] attributes = ( IAttribute[] ) attributeMap.values().toArray(
                new IAttribute[attributeMap.size()] );

            if ( attributes.length > 0 )
            {
                AttributeComparator comparator = new AttributeComparator( entries[0] );
                Arrays.sort( attributes, comparator );
            }

            returningAttributes = new String[attributes.length];
            for ( int i = 0; i < attributes.length; i++ )
            {
                returningAttributes[i] = attributes[i].getDescription();
            }
        }

        // header
        if ( this.mode != MODE_TABLE
            || BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
                BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_DN ) )
        {
            text.append( quoteCharacter );
            text.append( "DN" ); //$NON-NLS-1$
            text.append( quoteCharacter );
            text.append( attributeDelimiter );
        }
        for ( int a = 0; returningAttributes != null && a < returningAttributes.length; a++ )
        {
            text.append( quoteCharacter );
            text.append( returningAttributes[a] );
            text.append( quoteCharacter );
            if ( a + 1 < returningAttributes.length )
            {
                text.append( attributeDelimiter );
            }
        }
        text.append( lineSeparator );

        for ( int e = 0; entries != null && e < entries.length; e++ )
        {

            if ( this.mode != MODE_TABLE
                || BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
                    BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_DN ) )
            {
                text.append( quoteCharacter );
                text.append( entries[e].getDn().getUpName() );
                text.append( quoteCharacter );
                text.append( attributeDelimiter );

            }
            for ( int a = 0; returningAttributes != null && a < returningAttributes.length; a++ )
            {

                AttributeComparator comparator = new AttributeComparator( entries[e] );
                AttributeHierarchy ah = entries[e].getAttributeWithSubtypes( returningAttributes[a] );
                if ( ah != null )
                {

                    StringBuffer valueSB = new StringBuffer();
View Full Code Here

                        }
                    }
                }
                IValue[] values = ( IValue[] ) valueList.toArray( new IValue[valueList.size()] );

                AttributeComparator comparator = new AttributeComparator( entries[e] );
                Arrays.sort( values, comparator );

                for ( int i = 0; i < values.length; i++ )
                {
                    serializeValue( values[i], text );
View Full Code Here

    private void setDocumentInput( IDocument document, IEntry entry )
    {
        LdifContentRecord record = ModelConverter.entryToLdifContentRecord( entry );

        // sort attribute-value lines
        AttributeComparator comparator = new AttributeComparator( entry );
        LdifAttrValLine[] attrValLines = record.getAttrVals();
        Arrays.sort( attrValLines, comparator );
        LdifContentRecord newRecord = new LdifContentRecord( record.getDnLine() );
        for ( LdifAttrValLine attrValLine : attrValLines )
        {
View Full Code Here

    private static void export( IBrowserConnection browserConnection, SearchParameter searchParameter, BufferedWriter bufferedWriter,
        int count, StudioProgressMonitor monitor ) throws IOException, ConnectionException
    {
        try
        {
            AttributeComparator comparator = new AttributeComparator( browserConnection );
            JndiLdifEnumeration enumeration = search( browserConnection, searchParameter, monitor );
           
            while ( !monitor.isCanceled() && enumeration.hasNext() )
            {
                LdifContainer container = enumeration.next();
View Full Code Here

    private static void export( IBrowserConnection browserConnection, SearchParameter searchParameter, BufferedWriter bufferedWriter,
        int count, StudioProgressMonitor monitor ) throws IOException, ConnectionException
    {
        try
        {
            AttributeComparator comparator = new AttributeComparator( browserConnection );
            JndiLdifEnumeration enumeration = search( browserConnection, searchParameter, monitor );
           
            while ( !monitor.isCanceled() && enumeration.hasNext() )
            {
                LdifContainer container = enumeration.next();
View Full Code Here

            IAttribute[] attributes = ( IAttribute[] ) attributeMap.values().toArray(
                new IAttribute[attributeMap.size()] );

            if ( attributes.length > 0 )
            {
                AttributeComparator comparator = new AttributeComparator( entries[0] );
                Arrays.sort( attributes, comparator );
            }

            returningAttributes = new String[attributes.length];
            for ( int i = 0; i < attributes.length; i++ )
            {
                returningAttributes[i] = attributes[i].getDescription();
            }
        }

        // header
        if ( this.mode != MODE_TABLE
            || BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
                BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_DN ) )
        {
            text.append( quoteCharacter );
            text.append( "Dn" ); //$NON-NLS-1$
            text.append( quoteCharacter );
            text.append( attributeDelimiter );
        }
        for ( int a = 0; returningAttributes != null && a < returningAttributes.length; a++ )
        {
            text.append( quoteCharacter );
            text.append( returningAttributes[a] );
            text.append( quoteCharacter );
            if ( a + 1 < returningAttributes.length )
            {
                text.append( attributeDelimiter );
            }
        }
        text.append( lineSeparator );

        for ( int e = 0; entries != null && e < entries.length; e++ )
        {

            if ( this.mode != MODE_TABLE
                || BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
                    BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_DN ) )
            {
                text.append( quoteCharacter );
                text.append( entries[e].getDn().getName() );
                text.append( quoteCharacter );
                text.append( attributeDelimiter );

            }
            for ( int a = 0; returningAttributes != null && a < returningAttributes.length; a++ )
            {

                AttributeComparator comparator = new AttributeComparator( entries[e] );
                AttributeHierarchy ah = entries[e].getAttributeWithSubtypes( returningAttributes[a] );
                if ( ah != null )
                {

                    StringBuffer valueSB = new StringBuffer();
View Full Code Here

                        }
                    }
                }
                IValue[] values = ( IValue[] ) valueList.toArray( new IValue[valueList.size()] );

                AttributeComparator comparator = new AttributeComparator( entries[e] );
                Arrays.sort( values, comparator );

                for ( int i = 0; i < values.length; i++ )
                {
                    serializeValue( values[i], text );
View Full Code Here

                    LdifAttrValLine[] attrValLines = record.getAttrVals();
                    LdifSepLine sepLine = record.getSepLine();

                    // sort and format
                    DummyEntry entry = ModelConverter.ldifContentRecordToEntry( record, browserConnection );
                    AttributeComparator comparator = new AttributeComparator( entry );
                    Arrays.sort( attrValLines, comparator );
                    LdifContentRecord newRecord = new LdifContentRecord( dnLine );
                    for ( int i = 0; i < attrValLines.length; i++ )
                    {
                        newRecord.addAttrVal( attrValLines[i] );
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.ldapbrowser.core.utils.AttributeComparator

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.