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

Examples of org.apache.directory.studio.ldapbrowser.core.model.DN


        // build subtree specification tree
        StringBuffer sb = new StringBuffer();
        sb.append( "{" ); //$NON-NLS-1$

        // Adding base
        DN base = entryWidget.getDn();
        if ( base != null && !SubtreeValueEditor.EMPTY.equals( base.toString() ) )
        {
            sb.append( " base \"" + base.toString() + "\"," ); //$NON-NLS-1$ //$NON-NLS-2$
        }

        // Adding Minimum
        int minimum = minimumSpinner.getSelection();
        if ( minimum != 0 )
View Full Code Here


    /**
     * Opens the editor and adds the new Exclusion value to the list.
     */
    private void addValueExclusionsTable()
    {
        DN chopBase = null;
        try
        {
            chopBase = new DN( subtreeSpecification.getBase().toNormName() );
        }
        catch ( NameException e )
        {
        }
        if ( subentryDN != null && subentryDN.getParentDn() != null )
        {
            DN suffix = subentryDN != null ? subentryDN.getParentDn() : null;
            chopBase = new DN( chopBase, suffix );
        }

        ExclusionDialog dialog = new ExclusionDialog( getShell(), connection, chopBase, "" ); //$NON-NLS-1$
        if ( dialog.open() == TextDialog.OK && !SubtreeValueEditor.EMPTY.equals( dialog.getType() ) && !SubtreeValueEditor.EMPTY.equals( dialog.getDN() ) )
        {
View Full Code Here

    private void editValueExclusionsTable()
    {
        String oldValue = getSelectedValueExclusionsTable();
        if ( oldValue != null )
        {
            DN chopBase = null;
            try
            {
                chopBase = new DN( subtreeSpecification.getBase().toNormName() );
            }
            catch ( NameException e )
            {
            }
            if ( subentryDN != null && subentryDN.getParentDn() != null )
            {
                DN suffix = subentryDN != null ? subentryDN.getParentDn() : null;
                chopBase = new DN( chopBase, suffix );
            }

            ExclusionDialog dialog = new ExclusionDialog( getShell(), connection, chopBase, oldValue );
            if ( dialog.open() == TextDialog.OK && !SubtreeValueEditor.EMPTY.equals( dialog.getType() )
                && !SubtreeValueEditor.EMPTY.equals( dialog.getDN() ) )
View Full Code Here

    {
        LdifPart[] parts = ldifRecord.getParts();

        EventRegistry.suspendEventFireingInCurrentThread();

        DummyEntry entry = new DummyEntry( new DN( ldifRecord.getDnLine().getValueAsString() ), connection );

        for ( int i = 0; i < parts.length; i++ )
        {
            if ( parts[i] instanceof LdifAttrValLine )
            {
View Full Code Here

            { this.oldEntry.getDn().toString() } ), 3 );
        monitor.reportProgress( " " ); //$NON-NLS-1$
        monitor.worked( 1 );

        IEntry parent = oldEntry.getParententry();
        DN newDn = new DN( newRdn, parent.getDn() );

        // rename in directory
        // TODO: use manual/simulated rename, if rename of subtree is not
        // supported
        browserConnection.rename( oldEntry, newDn, deleteOldRdn, monitor );
View Full Code Here

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

                AttributeWizard wizard = new AttributeWizard( "Edit Attribute Description", true, false,
                    attributeDescription, dummyEntry );
                WizardDialog dialog = new WizardDialog( Display.getDefault().getActiveShell(), wizard );
View Full Code Here

        Object rawValue = null;
        if ( value != null )
        {
            try
            {
                DummyEntry dummyEntry = new DummyEntry( new DN( dn ), connection );
                Attribute dummyAttribute = new Attribute( dummyEntry, description );
                Value dummyValue = new Value( dummyAttribute, value );

                rawValue = valueEditor.getRawValue( dummyValue );
            }
View Full Code Here

        if ( showParent )
        {
            try
            {
                // calculate DN
                parentDn = new DN( parentEntryWidget.getDn() );
            }
            catch ( Exception e )
            {
                parentE = e;
                parentDn = null;
            }
        }

        String s = "";
        if ( rdnE != null )
        {
            s += rdnE.getMessage() != null ? rdnE.getMessage() : "Error in RDN ";
        }
        if ( parentE != null )
        {
            s += ", " + parentE.getMessage() != null ? parentE.getMessage() : "Error in Parent DN ";
        }

        if ( previewText != null )
        {
            if ( s.length() > 0 )
            {
                previewText.setText( s );
            }
            else
            {
                DN dn;
                if ( showParent && showRDN )
                {
                    dn = new DN( rdn, parentDn );
                }
                else if ( showParent )
                {
                    dn = new DN( parentDn );
                }
                else if ( showRDN )
                {
                    dn = new DN( rdn );
                }
                else
                {
                    dn = new DN();
                }
                previewText.setText( dn.toString() );
            }
        }

        notifyListeners();
    }
View Full Code Here

        {
            public void modifyText( ModifyEvent e )
            {
                try
                {
                    dn = new DN( dnCombo.getText() );
                }
                catch ( NameException e1 )
                {
                    dn = null;
                }

                internalSetEnabled();
                notifyListeners();
            }
        } );

        // Up button
        upButton = new Button( textAndUpComposite, SWT.PUSH );
        upButton.setToolTipText( "Parent" );
        upButton.setImage( BrowserCommonActivator.getDefault().getImage( BrowserCommonConstants.IMG_PARENT ) );
        upButton.setEnabled( false );
        upButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                if ( dn != null && dn.getParentDn() != null )
                {
                    dn = dn.getParentDn();
                    dnChanged();
                    internalSetEnabled();
                    notifyListeners();
                }
            }
        } );

        // Browse button
        entryBrowseButton = BaseWidgetUtils.createButton( parent, "Br&owse...", 1 );
        entryBrowseButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                if ( browserConnection != null )
                {
                    // get root entry
                    IEntry rootEntry = browserConnection.getRootDSE();
                    if( suffix != null && suffix.getRdns().length > 0 )
                    {
                        rootEntry = browserConnection.getEntryFromCache( suffix );
                        if ( rootEntry == null )
                        {
                            ReadEntryJob job = new ReadEntryJob( browserConnection, suffix );
                            RunnableContextJobAdapter.execute( job );
                            rootEntry = job.getReadEntry();
                        }
                    }

                    // calculate initial DN
                    DN initialDN = dn;
                    if( suffix != null && suffix.getRdns().length > 0 )
                    {
                        if( initialDN != null && initialDN.getRdns().length > 0 )
                        {
                            initialDN = new DN( initialDN, suffix );
                        }
                    }

                    // get initial entry
                    IEntry entry = rootEntry;
                    if ( initialDN != null && initialDN.getRdns().length > 0 )
                    {
                        entry = browserConnection.getEntryFromCache( initialDN );
                        if ( entry == null )
                        {
                            ReadEntryJob job = new ReadEntryJob( browserConnection, initialDN );
View Full Code Here

        }

        if ( search.getBrowserConnection() != null )
        {
            IBrowserConnection browserConnection = search.getBrowserConnection();
            DN searchBase = search.getSearchBase();

            if ( browserConnectionWidget != null )
            {
                browserConnectionWidget.setBrowserConnection( browserConnection );
            }
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.ldapbrowser.core.model.DN

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.