Examples of LdifRecord


Examples of netscape.ldap.util.LDIFRecord

                    final InputStream inputStream = new FileInputStream(
                        this.ldapFiles[i]);
                    final DataInputStream dataInputStream = new DataInputStream(
                        inputStream);
                    final LDIF ldif = new LDIF(dataInputStream);
                    LDIFRecord record = ldif.nextRecord();
                    while (record != null)
                    {
                        this.processRecord(connection, record);
                        record = ldif.nextRecord();
                    }
View Full Code Here

Examples of netscape.ldap.util.LDIFRecord

                try {
                    this.getLog().info("Processing " + this.ldapFiles[i]);
                    final InputStream inputStream = new FileInputStream(this.ldapFiles[i]);
                    final DataInputStream dataInputStream = new DataInputStream(inputStream);
                    final LDIF ldif = new LDIF(dataInputStream);
                    LDIFRecord record = ldif.nextRecord();
                    while (record != null) {
                        this.processRecord(connection, record);
                        record = ldif.nextRecord();
                    }
                } catch (LDAPException e) {
View Full Code Here

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

        public String getText( Object element )
        {
            // Record
            if ( element instanceof LdifRecord )
            {
                LdifRecord ldifRecord = ( LdifRecord ) element;
                return ldifRecord.getDnLine().getValueAsString();
            }

            // List of AttrValLine
            else if ( element instanceof List && ( ( List ) element ).get( 0 ) instanceof LdifAttrValLine )
            {
View Full Code Here

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

                {
                    Object element = ( ( IStructuredSelection ) event.getSelection() ).getFirstElement();

                    if ( element instanceof LdifRecord )
                    {
                        LdifRecord ldifRecord = ( LdifRecord ) element;
                        ldifEditor.selectAndReveal( ldifRecord.getDnLine().getOffset(), ldifRecord.getDnLine()
                            .getLength() );
                    }
                    else if ( element instanceof List )
                    {
                        List list = ( List ) element;
View Full Code Here

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

        public String getText( Object element )
        {
            // Record
            if ( element instanceof LdifRecord )
            {
                LdifRecord ldifRecord = ( LdifRecord ) element;
                return ldifRecord.getDnLine().getValueAsString();
            }

            // List of AttrValLine
            else if ( element instanceof List && ( ( List ) element ).get( 0 ) instanceof LdifAttrValLine )
            {
View Full Code Here

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

            }

            editor.deactivateGlobalActionHandlers();
            if ( dialog.open() == LdifEntryEditorDialog.OK )
            {
                LdifRecord record = dialog.getLdifRecord();

                IDocument document = editor.getDocumentProvider().getDocument( editor.getEditorInput() );
                String old = document.get();
                StringBuffer sb = new StringBuffer();
                sb.append( old.substring( 0, container.getOffset() ) );
                sb.append( record.toFormattedString() );
                sb.append( old.substring( container.getOffset() + container.getLength(), old.length() ) );
                document.set( sb.toString() );
            }
            editor.activateGlobalActionHandlers();
        }
View Full Code Here

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

        }

        // changetype: xxx
        if ( container instanceof LdifRecord )
        {
            LdifRecord record = ( LdifRecord ) container;
            LdifPart[] parts = record.getParts();
            if ( parts.length > 1 && ( !( parts[1] instanceof LdifChangeTypeLine ) || !parts[1].isValid() ) )
            {
                if ( CT_ADD.startsWith( prefix ) )
                    proposalList.add( new CompletionProposal( CT_ADD, offset - prefix.length(), prefix.length(), CT_ADD
                        .length(), LdifEditorActivator.getDefault().getImage( LdifEditorConstants.IMG_LDIF_ADD ), CT_ADD
                        .substring( 0, CT_ADD.length() - BrowserCoreConstants.LINE_SEPARATOR.length() ), null, null ) );
                if ( CT_MODIFY.startsWith( prefix ) )
                    proposalList.add( new CompletionProposal( CT_MODIFY, offset - prefix.length(), prefix.length(),
                        CT_MODIFY.length(),
                        LdifEditorActivator.getDefault().getImage( LdifEditorConstants.IMG_LDIF_MODIFY ), CT_MODIFY
                            .substring( 0, CT_MODIFY.length() - BrowserCoreConstants.LINE_SEPARATOR.length() ), null,
                        null ) );
                if ( CT_DELETE.startsWith( prefix ) )
                    proposalList.add( new CompletionProposal( CT_DELETE, offset - prefix.length(), prefix.length(),
                        CT_DELETE.length(),
                        LdifEditorActivator.getDefault().getImage( LdifEditorConstants.IMG_LDIF_DELETE ), CT_DELETE
                            .substring( 0, CT_DELETE.length() - BrowserCoreConstants.LINE_SEPARATOR.length() ), null,
                        null ) );
                if ( CT_MODDN.startsWith( prefix ) )
                    proposalList.add( new CompletionProposal( CT_MODDN, offset - prefix.length(), prefix.length(),
                        CT_MODDN.length(), LdifEditorActivator.getDefault().getImage( LdifEditorConstants.IMG_LDIF_RENAME ),
                        CT_MODDN.substring( 0, CT_MODDN.length() - BrowserCoreConstants.LINE_SEPARATOR.length() ),
                        null, null ) );
            }

        }

        // changetype: modify
        if ( container instanceof LdifChangeModDnRecord )
        {
            LdifChangeModDnRecord record = ( LdifChangeModDnRecord ) container;
            if ( ( record.getNewrdnLine() == null || !record.getNewrdnLine().isValid() )
                && MD_NEWRDN.startsWith( prefix ) )
            {
                proposalList.add( new CompletionProposal( MD_NEWRDN, offset - prefix.length(), prefix.length(),
                    MD_NEWRDN.length(), null, null, null, null ) );
            }
            if ( ( record.getDeloldrdnLine() == null || !record.getDeloldrdnLine().isValid() )
                && MD_DELETEOLDRDN_TRUE.startsWith( prefix ) )
            {
                proposalList.add( new CompletionProposal( MD_DELETEOLDRDN_TRUE, offset - prefix.length(), prefix
                    .length(), MD_DELETEOLDRDN_TRUE.length(), null, null, null, null ) );
            }
            if ( ( record.getNewsuperiorLine() == null || !record.getNewsuperiorLine().isValid() )
                && MD_NEWSUPERIOR.startsWith( prefix ) )
            {
                proposalList.add( new CompletionProposal( MD_NEWSUPERIOR, offset - prefix.length(), prefix.length(),
                    MD_NEWSUPERIOR.length(), null, null, null, null ) );
            }
View Full Code Here

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

                LdifContainer container = enumeration.next( monitor );

                if ( container instanceof LdifRecord )
                {

                    LdifRecord record = ( LdifRecord ) container;
                    try
                    {
                        this.applyModificationAndLog( record, monitor );

                        // update cache and adjust attribute/children initialization flags
                        DN dn = new DN( record.getDnLine().getValueAsString() );
                        IEntry entry = connection.getEntryFromCache( dn );
                        DN parentDn = dn.getParentDn();
                        IEntry parentEntry = parentDn != null ? connection.getEntryFromCache( dn.getParentDn() ) : null;

                        if ( record instanceof LdifChangeDeleteRecord )
View Full Code Here

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

        }

        // changetype: xxx
        if ( container instanceof LdifRecord )
        {
            LdifRecord record = ( LdifRecord ) container;
            LdifPart[] parts = record.getParts();
            if ( parts.length > 1 && ( !( parts[1] instanceof LdifChangeTypeLine ) || !parts[1].isValid() ) )
            {
                if ( CT_ADD.startsWith( prefix ) )
                    proposalList.add( new CompletionProposal( CT_ADD, offset - prefix.length(), prefix.length(), CT_ADD
                        .length(), BrowserUIPlugin.getDefault().getImage( BrowserUIConstants.IMG_LDIF_ADD ), CT_ADD
                        .substring( 0, CT_ADD.length() - BrowserCoreConstants.LINE_SEPARATOR.length() ), null, null ) );
                if ( CT_MODIFY.startsWith( prefix ) )
                    proposalList.add( new CompletionProposal( CT_MODIFY, offset - prefix.length(), prefix.length(),
                        CT_MODIFY.length(),
                        BrowserUIPlugin.getDefault().getImage( BrowserUIConstants.IMG_LDIF_MODIFY ), CT_MODIFY
                            .substring( 0, CT_MODIFY.length() - BrowserCoreConstants.LINE_SEPARATOR.length() ), null,
                        null ) );
                if ( CT_DELETE.startsWith( prefix ) )
                    proposalList.add( new CompletionProposal( CT_DELETE, offset - prefix.length(), prefix.length(),
                        CT_DELETE.length(),
                        BrowserUIPlugin.getDefault().getImage( BrowserUIConstants.IMG_LDIF_DELETE ), CT_DELETE
                            .substring( 0, CT_DELETE.length() - BrowserCoreConstants.LINE_SEPARATOR.length() ), null,
                        null ) );
                if ( CT_MODDN.startsWith( prefix ) )
                    proposalList.add( new CompletionProposal( CT_MODDN, offset - prefix.length(), prefix.length(),
                        CT_MODDN.length(), BrowserUIPlugin.getDefault().getImage( BrowserUIConstants.IMG_LDIF_RENAME ),
                        CT_MODDN.substring( 0, CT_MODDN.length() - BrowserCoreConstants.LINE_SEPARATOR.length() ),
                        null, null ) );
            }

        }

        // changetype: modify
        if ( container instanceof LdifChangeModDnRecord )
        {
            LdifChangeModDnRecord record = ( LdifChangeModDnRecord ) container;
            if ( ( record.getNewrdnLine() == null || !record.getNewrdnLine().isValid() )
                && MD_NEWRDN.startsWith( prefix ) )
            {
                proposalList.add( new CompletionProposal( MD_NEWRDN, offset - prefix.length(), prefix.length(),
                    MD_NEWRDN.length(), null, null, null, null ) );
            }
            if ( ( record.getDeloldrdnLine() == null || !record.getDeloldrdnLine().isValid() )
                && MD_DELETEOLDRDN_TRUE.startsWith( prefix ) )
            {
                proposalList.add( new CompletionProposal( MD_DELETEOLDRDN_TRUE, offset - prefix.length(), prefix
                    .length(), MD_DELETEOLDRDN_TRUE.length(), null, null, null, null ) );
            }
            if ( ( record.getNewsuperiorLine() == null || !record.getNewsuperiorLine().isValid() )
                && MD_NEWSUPERIOR.startsWith( prefix ) )
            {
                proposalList.add( new CompletionProposal( MD_NEWSUPERIOR, offset - prefix.length(), prefix.length(),
                    MD_NEWSUPERIOR.length(), null, null, null, null ) );
            }
View Full Code Here

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

                    {
                        Object element = ( ( IStructuredSelection ) event.getSelection() ).getFirstElement();

                        if ( element instanceof LdifRecord )
                        {
                            LdifRecord ldifRecord = ( LdifRecord ) element;
                            ldifEditor.selectAndReveal( ldifRecord.getDnLine().getOffset(), ldifRecord.getDnLine()
                                .getLength() );
                        }
                        else if ( element instanceof List )
                        {
                            List list = ( List ) element;
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.