Examples of LdifContentRecord


Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifContentRecord

            }

            // record --> Array of List of AttrValLine
            else if ( element instanceof LdifContentRecord )
            {
                LdifContentRecord record = ( LdifContentRecord ) element;
                return getUniqueAttrValLineArray( record.getAttrVals() );
            }
            else if ( element instanceof LdifChangeAddRecord )
            {
                LdifChangeAddRecord record = ( LdifChangeAddRecord ) element;
                return getUniqueAttrValLineArray( record.getAttrVals() );
            }
            else if ( element instanceof LdifChangeModifyRecord )
            {
                LdifChangeModifyRecord record = ( LdifChangeModifyRecord ) element;
                return record.getModSpecs();
            }
            else if ( element instanceof LdifChangeModDnRecord )
            {
                return new Object[0];
            }
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifContentRecord

            // clone entry and remove non-modifyable attributes
            try
            {
                EventRegistry.suspendEventFireingInCurrentThread();

                LdifContentRecord record = ModelConverter.entryToLdifContentRecord( templateEntries[0] );
                DummyEntry prototypeEntry = ModelConverter.ldifContentRecordToEntry( record, connection );
                IAttribute[] attributes = prototypeEntry.getAttributes();
                for ( int i = 0; i < attributes.length; i++ )
                {
                    if ( !SchemaUtils.isModifyable( attributes[i].getAttributeTypeDescription() ) )
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifContentRecord

            }

            // record --> Array of List of AttrValLine
            else if ( element instanceof LdifContentRecord )
            {
                LdifContentRecord record = ( LdifContentRecord ) element;
                return getUniqueAttrValLineArray( record.getAttrVals() );
            }
            else if ( element instanceof LdifChangeAddRecord )
            {
                LdifChangeAddRecord record = ( LdifChangeAddRecord ) element;
                return getUniqueAttrValLineArray( record.getAttrVals() );
            }
            else if ( element instanceof LdifChangeModifyRecord )
            {
                LdifChangeModifyRecord record = ( LdifChangeModifyRecord ) element;
                return record.getModSpecs();
            }
            else if ( element instanceof LdifChangeModDnRecord )
            {
                return new Object[0];
            }
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifContentRecord

        String dn = record.getDnLine().getValueAsString();

        if ( record instanceof LdifContentRecord )
        {
            LdifContentRecord attrValRecord = ( LdifContentRecord ) record;
            LdifAttrValLine[] attrVals = attrValRecord.getAttrVals();
            Attributes jndiAttributes = new BasicAttributes();
            for ( int ii = 0; ii < attrVals.length; ii++ )
            {
                String attributeName = attrVals[ii].getUnfoldedAttributeDescription();
                // String valueType = attrVals[ii].getValueType();
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifContentRecord

            try
            {
                SearchResult sr = ( SearchResult ) enumeration.next();

                DN dn = JNDIUtils.getDn( sr, parameter.getSearchBase().toString(), context );
                LdifContentRecord record = LdifContentRecord.create( dn.toString() );

                NamingEnumeration attributeEnumeration = sr.getAttributes().getAll();
                while ( attributeEnumeration.hasMore() )
                {
                    Attribute attribute = ( Attribute ) attributeEnumeration.next();
                    String attributeName = attribute.getID();
                    NamingEnumeration valueEnumeration = attribute.getAll();
                    while ( valueEnumeration.hasMore() )
                    {
                        Object o = valueEnumeration.next();
                        if ( o instanceof String )
                        {
                            record.addAttrVal( LdifAttrValLine.create( attributeName, ( String ) o ) );
                        }
                        if ( o instanceof byte[] )
                        {
                            record.addAttrVal( LdifAttrValLine.create( attributeName, ( byte[] ) o ) );
                        }
                    }
                }

                record.finish( LdifSepLine.create() );

                return record;

            }
            catch ( NamingException e )
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifContentRecord

            if ( enumeration.hasNext( null ) )
            {
                LdifContainer container = enumeration.next( null );
                if ( container instanceof LdifContentRecord )
                {
                    LdifContentRecord schemaRecord = ( LdifContentRecord ) container;
                    this.parseSchemaRecord( schemaRecord );
                }
            }
        }
        catch ( Exception e )
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifContentRecord

                        Schema.SCHEMA_ATTRIBUTE_MATCHINGRULEUSE, IAttribute.OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP,
                        IAttribute.OPERATIONAL_ATTRIBUTE_MODIFY_TIMESTAMP, } );
                LdifEnumeration le = this.connectionProvider.search( sp, monitor );
                if ( le.hasNext( monitor ) )
                {
                    LdifContentRecord schemaRecord = ( LdifContentRecord ) le.next( monitor );
                    this.schema = new Schema();
                    this.schema.loadFromRecord( schemaRecord );
                    EventRegistry.fireConnectionUpdated( new ConnectionUpdateEvent( this,
                        ConnectionUpdateEvent.EventDetail.SCHEMA_LOADED ), this );
                }
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifContentRecord

            {
                LdifContainer container = enumeration.next( monitor );

                if ( container instanceof LdifContentRecord )
                {
                    LdifContentRecord record = ( LdifContentRecord ) container;
                    LdifDnLine dnLine = record.getDnLine();
                    LdifAttrValLine[] attrValLines = record.getAttrVals();
                    LdifSepLine sepLine = record.getSepLine();

                    // sort and format
                    Arrays.sort( attrValLines, comparator );
                    LdifContentRecord newRecord = new LdifContentRecord( dnLine );
                    for ( int i = 0; i < attrValLines.length; i++ )
                    {
                        newRecord.addAttrVal( attrValLines[i] );
                    }
                    newRecord.finish( sepLine );
                    String s = newRecord.toFormattedString();

                    // String s = record.toFormattedString();
                    bufferedWriter.write( s );

                    count++;
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifContentRecord


    public static LdifContentRecord entryToLdifContentRecord( IEntry entry )
    {

        LdifContentRecord record = LdifContentRecord.create( entry.getDn().toString() );

        IAttribute[] attributes = entry.getAttributes();
        for ( int i = 0; i < attributes.length; i++ )
        {
            String name = attributes[i].getDescription();
            IValue[] values = attributes[i].getValues();
            for ( int ii = 0; ii < values.length; ii++ )
            {
                IValue value = values[ii];
                if ( value.getRawValue() instanceof LdifPart )
                {
                    LdifPart part = ( LdifPart ) value.getRawValue();
                    if ( part instanceof LdifCommentLine )
                    {
                        record.addComment( ( LdifCommentLine ) part );
                    }
                }
                else if ( value.isString() )
                {
                    record.addAttrVal( LdifAttrValLine.create( name, value.getStringValue() ) );
                }
                else
                {
                    record.addAttrVal( LdifAttrValLine.create( name, value.getBinaryValue() ) );
                }
            }
        }

        record.finish( LdifSepLine.create() );

        return record;
    }
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifContentRecord

                LdifContainer container = enumeration.next( monitor );

                if ( container instanceof LdifContentRecord )
                {

                    LdifContentRecord record = ( LdifContentRecord ) container;
                    bufferedWriter.write( recordToCsv( connection, record, attributes, attributeDelimiter, valueDelimiter,
                        quoteCharacter, lineSeparator, encoding, binaryEncoding, exportDn ) );

                    count++;
                    monitor.reportProgress( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__export_progress,
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.