Package org.apache.directory.ldapstudio.browser.core.model.ldif.container

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


            LdifChangeModifyRecord cmr = new LdifChangeModifyRecord( LdifDnLine.create( valuesToCreate[i]
                .getAttribute().getEntry().getDn().toString() ) );
            ModelConverter.addControls( cmr, valuesToCreate[i].getAttribute().getEntry() );
            cmr.setChangeType( LdifChangeTypeLine.createModify() );

            LdifModSpec modSpec = LdifModSpec.createAdd( valuesToCreate[i].getAttribute().getDescription() );
            if ( valuesToCreate[i].isString() )
            {
                modSpec.addAttrVal( LdifAttrValLine.create( valuesToCreate[i].getAttribute().getDescription(),
                    valuesToCreate[i].getStringValue() ) );
            }
            else
            {
                modSpec.addAttrVal( LdifAttrValLine.create( valuesToCreate[i].getAttribute().getDescription(),
                    valuesToCreate[i].getBinaryValue() ) );
            }
            modSpec.finish( LdifModSpecSepLine.create() );
            cmr.addModSpec( modSpec );
            cmr.finish( LdifSepLine.create() );

            try
            {
View Full Code Here


            ModelConverter.addControls( cmr, oldValue.getAttribute().getEntry() );
            cmr.setChangeType( LdifChangeTypeLine.createModify() );

            if ( oldValue.getAttribute().getValueSize() == 1 )
            {
                LdifModSpec modSpec = LdifModSpec.createReplace( oldValue.getAttribute().getDescription() );
                if ( newValue.isString() )
                {
                    modSpec.addAttrVal( LdifAttrValLine.create( oldValue.getAttribute().getDescription(), newValue
                        .getStringValue() ) );
                }
                else
                {
                    modSpec.addAttrVal( LdifAttrValLine.create( oldValue.getAttribute().getDescription(), newValue
                        .getBinaryValue() ) );
                }
                modSpec.finish( LdifModSpecSepLine.create() );
                cmr.addModSpec( modSpec );
                cmr.finish( LdifSepLine.create() );
            }
            else
            {
                LdifModSpec modSpec1 = LdifModSpec.createAdd( oldValue.getAttribute().getDescription() );
                if ( newValue.isString() )
                {
                    modSpec1.addAttrVal( LdifAttrValLine.create( oldValue.getAttribute().getDescription(), newValue
                        .getStringValue() ) );
                }
                else
                {
                    modSpec1.addAttrVal( LdifAttrValLine.create( oldValue.getAttribute().getDescription(), newValue
                        .getBinaryValue() ) );
                }
                modSpec1.finish( LdifModSpecSepLine.create() );
                cmr.addModSpec( modSpec1 );

                LdifModSpec modSpec2 = LdifModSpec.createDelete( oldValue.getAttribute().getDescription() );
                if ( oldValue.isString() )
                {
                    modSpec2.addAttrVal( LdifAttrValLine.create( oldValue.getAttribute().getDescription(), oldValue
                        .getStringValue() ) );
                }
                else
                {
                    modSpec2.addAttrVal( LdifAttrValLine.create( oldValue.getAttribute().getDescription(), oldValue
                        .getBinaryValue() ) );
                }
                modSpec2.finish( LdifModSpecSepLine.create() );
                cmr.addModSpec( modSpec2 );
                cmr.finish( LdifSepLine.create() );
            }

            this.applyModificationAndLog( cmr, monitor );
View Full Code Here

                LdifChangeModifyRecord cmr = new LdifChangeModifyRecord( LdifDnLine.create( valuesToDelete[i]
                    .getAttribute().getEntry().getDn().toString() ) );
                ModelConverter.addControls( cmr, valuesToDelete[i].getAttribute().getEntry() );
                cmr.setChangeType( LdifChangeTypeLine.createModify() );

                LdifModSpec modSpec = LdifModSpec.createDelete( valuesToDelete[i].getAttribute().getDescription() );
                if ( valuesToDelete[i].isString() )
                {
                    modSpec.addAttrVal( LdifAttrValLine.create( valuesToDelete[i].getAttribute().getDescription(),
                        valuesToDelete[i].getStringValue() ) );
                }
                else
                {
                    modSpec.addAttrVal( LdifAttrValLine.create( valuesToDelete[i].getAttribute().getDescription(),
                        valuesToDelete[i].getBinaryValue() ) );
                }
                modSpec.finish( LdifModSpecSepLine.create() );
                cmr.addModSpec( modSpec );
                cmr.finish( LdifSepLine.create() );

                this.applyModificationAndLog( cmr, monitor );
            }
View Full Code Here

                LdifChangeModifyRecord cmr = new LdifChangeModifyRecord( LdifDnLine.create( attriubtesToDelete[i]
                    .getEntry().getDn().toString() ) );
                ModelConverter.addControls( cmr, attriubtesToDelete[i].getEntry() );
                cmr.setChangeType( LdifChangeTypeLine.createModify() );

                LdifModSpec modSpec = LdifModSpec.createDelete( attriubtesToDelete[i].getDescription() );
                modSpec.finish( LdifModSpecSepLine.create() );
                cmr.addModSpec( modSpec );
                cmr.finish( LdifSepLine.create() );

                this.applyModificationAndLog( cmr, monitor );
            }
View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifModSpec

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.