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

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


    {
        Object value = getValue();
        if ( value != null && value instanceof DnValueEditorRawValueWrapper )
        {
            DnValueEditorRawValueWrapper wrapper = ( DnValueEditorRawValueWrapper ) value;
            DN dn;
            try
            {
                dn = wrapper.dn != null ? new DN( wrapper.dn ) : null;
            }
            catch ( NameException e )
            {
                dn = null;
            }
View Full Code Here


        }

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

            if ( connectionWidget != null )
            {
                connectionWidget.setConnection( connection );
            }
View Full Code Here

                        if ( readIn.available() > 1 && connection != null )
                        {
                            int size = readIn.readInt();
                            byte[] dn = new byte[size];
                            readIn.read( dn );
                            entry = connection.getEntryFromCache( new DN( new String( dn ) ) );
                        }
                        else
                        {
                            return null;
                        }
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

            }
        }
        else if ( getSelectedSearchResults().length > 0 )
        {
            DN dn = getSelectedSearchResults()[0].getDn();

            if ( mode == MODE_UTF8 )
            {
                text.append( LdifUtils.utf8decode( dn.toString().getBytes() ) );
            }
            else if ( mode == MODE_BASE64 )
            {
                text.append( LdifUtils.base64encode( dn.toString().getBytes() ) );
            }
            else if ( mode == MODE_HEX )
            {
                text.append( LdifUtils.hexEncode( dn.toString().getBytes() ) );
            }
            else if ( mode == MODE_LDIF )
            {
                text.append( ModelConverter.dnToLdifDnLine( dn ).toFormattedString() );
            }
View Full Code Here

        BaseWidgetUtils.createLabel( composite, Messages.getString( "ExclusionValueEditor.label.rdn" ), 1 ); //$NON-NLS-1$
        entryWidget = new EntryWidget( connection, null, base );
        entryWidget.createWidget( composite );
        try
        {
            DN dn = new DN( initalDN );
            entryWidget.setInput( connection, dn, base );
        }
        catch ( NameException e )
        {
        }
View Full Code Here

            String type = memento.getString( "TYPE" );
            if ( "IEntry".equals( type ) )
            {
                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById(
                    memento.getString( "CONNECTION" ) );
                DN dn = new DN( memento.getString( "DN" ) );
                IEntry entry = connection.getEntryFromCache( dn );
                super.setInput( new EntryEditorInput( entry ) );
            }
            else if ( "ISearchResult".equals( type ) )
            {
                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById(
                    memento.getString( "CONNECTION" ) );
                ISearch search = connection.getSearchManager().getSearch( memento.getString( "SEARCH" ) );
                ISearchResult[] searchResults = search.getSearchResults();
                DN dn = new DN( memento.getString( "DN" ) );
                for ( int i = 0; i < searchResults.length; i++ )
                {
                    if ( dn.equals( searchResults[i].getDn() ) )
                    {
                        super.setInput( new EntryEditorInput( searchResults[i] ) );
                        break;
                    }
                }
View Full Code Here

    {
        ConnectionAndDn connectionAndDn = getConnectionAndDn();
        if ( connectionAndDn != null )
        {
            IBrowserConnection connection = connectionAndDn.connection;
            DN dn = connectionAndDn.dn;

            IEntry entry = connection.getEntryFromCache( dn );
            if ( entry == null )
            {
                ReadEntryJob job = new ReadEntryJob( connection, dn );
View Full Code Here

        Composite composite = BaseWidgetUtils.createColumnContainer( outer, 3, 1 );

        BaseWidgetUtils.createLabel( composite, Messages.getString( "SubtreeValueEditor.label.base" ), 1 ); //$NON-NLS-1$

        DN base = null;
        DN suffix = null;
        try
        {
            base = new DN( subtreeSpecification.getBase().toNormName() );
            suffix = subentryDN != null ? subentryDN.getParentDn() : null;
        }
        catch ( NameException e )
        {
        }
View Full Code Here

     */
    private void validate()
    {
        boolean valid = true;

        DN base = entryWidget.getDn();
        valid &= base != null;

        String ss = buildSubreeSpecification();

        try
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.