Examples of DummyEntry


Examples of org.apache.directory.ldapstudio.browser.core.internal.model.DummyEntry

            }
           
            availableObjectClasses.addAll( Arrays.asList( wizard.getSelectedConnection().getSchema()
                .getObjectClassDescriptions() ) );

            DummyEntry newEntry = wizard.getPrototypeEntry();
            IAttribute ocAttribute = newEntry.getAttribute( IAttribute.OBJECTCLASS_ATTRIBUTE );
            if ( ocAttribute != null )
            {
                String[] ocValues = ocAttribute.getStringValues();
                for ( int i = 0; i < ocValues.length; i++ )
                {
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.internal.model.DummyEntry

    /**
     * Saves the state of selected object classes to the entry.
     */
    private void saveState()
    {
        DummyEntry newEntry = wizard.getPrototypeEntry();

        try
        {
            EventRegistry.suspendEventFireingInCurrentThread();

            // set new objectClass values
            IAttribute ocAttribute = newEntry.getAttribute( IAttribute.OBJECTCLASS_ATTRIBUTE );
            if ( ocAttribute == null )
            {
                ocAttribute = new Attribute( newEntry, IAttribute.OBJECTCLASS_ATTRIBUTE );
                newEntry.addAttribute( ocAttribute );
            }
            IValue[] values = ocAttribute.getValues();
            for ( int i = 0; i < values.length; i++ )
            {
                ocAttribute.deleteValue( values[i] );
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.internal.model.DummyEntry

            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() ) )
                    {
                        prototypeEntry.deleteAttribute( attributes[i] );
                    }
                }
                wizard.setPrototypeEntry( prototypeEntry );
            }
            catch ( Exception e )
            {
                e.printStackTrace();
            }
            finally
            {
                EventRegistry.resumeEventFireingInCurrentThread();
            }
        }
        else
        {
            wizard.setPrototypeEntry( new DummyEntry( new DN(), wizard.getSelectedConnection() ) );
        }

        return super.getNextPage();
    }
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.internal.model.DummyEntry

        }

        if ( selectedConnection != null )
        {
            selectedConnection.suspend();
            prototypeEntry = new DummyEntry( new DN(), selectedConnection );
        }
    }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.internal.model.DummyEntry

            try
            {
                EventRegistry.suspendEventFireingInCurrentThread();

                LdifContentRecord record = ModelConverter.entryToLdifContentRecord( templateEntries[0] );
                DummyEntry prototypeEntry = ModelConverter.ldifContentRecordToEntry( record, new DummyConnection( connection.getSchema() ) );
                IAttribute[] attributes = prototypeEntry.getAttributes();
                for ( int i = 0; i < attributes.length; i++ )
                {
                    if ( !SchemaUtils.isModifyable( attributes[i].getAttributeTypeDescription() ) )
                    {
                        prototypeEntry.deleteAttribute( attributes[i] );
                    }
                }
                wizard.setPrototypeEntry( prototypeEntry );
            }
            catch ( Exception e )
            {
                e.printStackTrace();
            }
            finally
            {
                EventRegistry.resumeEventFireingInCurrentThread();
            }
        }
        else
        {
            wizard.setPrototypeEntry( new DummyEntry( new DN(), new DummyConnection( wizard.getSelectedConnection().getSchema() ) ) );
        }

        return super.getNextPage();
    }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry

                    LdifDnLine dnLine = record.getDnLine();
                    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++ )
                    {
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry

        // update shared working copy
        try
        {
            LdifContentRecord modifiedRecord = ( LdifContentRecord ) records[0];
            IBrowserConnection browserConnection = input.getSharedWorkingCopy( editor ).getBrowserConnection();
            DummyEntry modifiedEntry = ModelConverter.ldifContentRecordToEntry( modifiedRecord, browserConnection );
            ( ( DummyEntry ) input.getSharedWorkingCopy( editor ) ).setDn( modifiedEntry.getDn() );
            new CompoundModification().replaceAttributes( modifiedEntry, input.getSharedWorkingCopy( editor ), this );
        }
        catch ( InvalidNameException e )
        {
            throw new RuntimeException( e );
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry

                    dummyEntry = ModelConverter.ldifChangeAddRecordToEntry( ( LdifChangeAddRecord ) containers[0],
                        dummyConnection );
                }
                else if ( containers[0] instanceof LdifChangeModifyRecord )
                {
                    dummyEntry = new DummyEntry( new LdapDN(), dummyConnection );
                }

                AttributeWizard wizard = new AttributeWizard( Messages
                    .getString( "EditLdifAttributeAction.EditAttributeDescription" ), true, false, //$NON-NLS-1$
                    attributeDescription, dummyEntry );
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry

        if ( value != null )
        {
            try
            {
                // some value editors need the real DN (e.g. the password editor)
                DummyEntry dummyEntry = new DummyEntry( LdapDN.isValid( dn ) ? new LdapDN( dn ) : new LdapDN(),
                    connection );
                Attribute dummyAttribute = new Attribute( dummyEntry, description );
                Value dummyValue = new Value( dummyAttribute, value );
                rawValue = valueEditor.getRawValue( dummyValue );
            }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry

        // update shared working copy
        try
        {
            LdifContentRecord modifiedRecord = ( LdifContentRecord ) records[0];
            IBrowserConnection browserConnection = input.getSharedWorkingCopy( editor ).getBrowserConnection();
            DummyEntry modifiedEntry = ModelConverter.ldifContentRecordToEntry( modifiedRecord, browserConnection );
            ( ( DummyEntry ) input.getSharedWorkingCopy( editor ) ).setDn( modifiedEntry.getDn() );
            new CompoundModification().replaceAttributes( modifiedEntry, input.getSharedWorkingCopy( editor ), this );
        }
        catch ( InvalidNameException e )
        {
            throw new RuntimeException( e );
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.