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

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


        {
            EventRegistry.suspendEventFiringInCurrentThread();
            for ( IValue value : values )
            {
                IAttribute attribute = value.getAttribute();
                IEntry entry = attribute.getEntry();

                attribute.deleteValue( value );
                if ( event == null )
                {
                    event = new ValueDeletedEvent( entry.getBrowserConnection(), entry, attribute, value );
                }

                if ( attribute.getValueSize() == 0 )
                {
                    attribute.getEntry().deleteAttribute( attribute );
View Full Code Here


     */
    private static IEntry createAndCacheEntry( IBrowserConnection browserConnection, LdapDN dn,
        StudioProgressMonitor monitor )
    {
        StudioProgressMonitor dummyMonitor = new StudioProgressMonitor( monitor );
        IEntry entry = null;

        // build tree to parent
        LinkedList<LdapDN> parentDnList = new LinkedList<LdapDN>();
        LdapDN parentDN = dn;
        while ( parentDN != null && browserConnection.getEntryFromCache( parentDN ) == null )
        {
            parentDnList.addFirst( parentDN );
            parentDN = DnUtils.getParent( parentDN );
        }

        for ( LdapDN aDN : parentDnList )
        {
            parentDN = DnUtils.getParent( aDN );
            if ( parentDN == null )
            {
                // only the root DSE has a null parent
                entry = browserConnection.getRootDSE();
            }
            else if ( !parentDN.isEmpty() && browserConnection.getEntryFromCache( parentDN ) != null )
            {
                // a normal entry has a parent but the parent isn't the rootDSE
                IEntry parentEntry = browserConnection.getEntryFromCache( parentDN );
                entry = new Entry( parentEntry, aDN.getRdn() );
                entry.setDirectoryEntry( true );
                parentEntry.addChild( entry );
                parentEntry.setChildrenInitialized( true );
                parentEntry.setHasMoreChildren( true );
                parentEntry.setHasChildrenHint( true );
                browserConnection.cacheEntry( entry );
            }
            else
            {
                // we have a base DN, check if the entry really exists in LDAP
View Full Code Here

        try
        {
            EventRegistry.suspendEventFiringInCurrentThread();
            IBrowserConnection browserConnection = entry.getBrowserConnection();
            LdifContentRecord record = ModelConverter.entryToLdifContentRecord( entry );
            IEntry clonedEntry = ModelConverter.ldifContentRecordToEntry( record, browserConnection );
            return clonedEntry;
        }
        catch ( InvalidNameException e )
        {
            throw new RuntimeException( e );
View Full Code Here

     *      the Entries
     */
    protected IEntry[] getEntries()
    {

        IEntry entry = null;

        if ( getSelectedEntries().length == 1 )
        {
            entry = getSelectedEntries()[0];
        }
View Full Code Here

     * {@inheritDoc}
     */
    public void run()
    {

        IEntry entry = null;
        if ( getInput() != null && getInput() instanceof IEntry )
        {
            entry = ( IEntry ) getInput();
        }
        else if ( getSelectedEntries().length > 0 )
        {
            entry = getSelectedEntries()[0];
        }
        else if ( getSelectedAttributes().length > 0 )
        {
            entry = getSelectedAttributes()[0].getEntry();
        }
        else if ( getSelectedValues().length > 0 )
        {
            entry = getSelectedValues()[0].getAttribute().getEntry();
        }

        if ( entry != null )
        {
            AttributeWizard wizard = new AttributeWizard(
                Messages.getString( "NewAttributeAction.NewAttribute" ), true, true, null, entry ); //$NON-NLS-1$
            WizardDialog dialog = new WizardDialog( getShell(), wizard );
            dialog.setBlockOnOpen( true );
            dialog.create();
            if ( dialog.open() == WizardDialog.OK )
            {
                String newAttributeDescription = wizard.getAttributeDescription();
                if ( newAttributeDescription != null && !"".equals( newAttributeDescription ) ) //$NON-NLS-1$
                {
                    IAttribute att = entry.getAttribute( newAttributeDescription );
                    if ( att == null )
                    {
                        att = new Attribute( entry, newAttributeDescription );
                        entry.addAttribute( att );
                    }

                    att.addEmptyValue();
                }
            }
View Full Code Here

        {
            return null;
        }
        else if ( attributeHierarchy.size() == 1 && attributeHierarchy.getAttribute().getValueSize() == 0 )
        {
            IEntry entry = attributeHierarchy.getAttribute().getEntry();
            IBrowserConnection connection = entry.getBrowserConnection();
            return new ACIItemValueWithContext( connection, entry, "" ); //$NON-NLS-1$
        }
        else if ( attributeHierarchy.size() == 1 && attributeHierarchy.getAttribute().getValueSize() == 1 )
        {
            IEntry entry = attributeHierarchy.getAttribute().getEntry();
            IBrowserConnection connection = entry.getBrowserConnection();
            String value = getDisplayValue( attributeHierarchy );
            return new ACIItemValueWithContext( connection, entry, value );
        }
        else
        {
View Full Code Here

    public Object getRawValue( IValue value )
    {
        Object o = super.getRawValue( value );
        if ( o != null && o instanceof String )
        {
            IEntry entry = value.getAttribute().getEntry();
            IBrowserConnection connection = entry.getBrowserConnection();
            String v = ( String ) o;
            return new ACIItemValueWithContext( connection, entry, v );
        }

        return null;
View Full Code Here

     * @param values
     *      the Values to paste
     */
    private void pasteValues( IValue[] values )
    {
        IEntry entry = null;
        if ( getSelectedAttributes().length > 0 )
        {
            entry = getSelectedAttributes()[0].getEntry();
        }
        else if ( getSelectedValues().length > 0 )
View Full Code Here

     */
    public void run()
    {
        if ( getSelectedEntries().length == 1 )
        {
            IEntry entry = getSelectedEntries()[0];
            FilterWidgetDialog dialog = new FilterWidgetDialog( getShell(), Messages
                .getString( "FilterChildrenAction.FilterChildren" ), //$NON-NLS-1$
                entry.getChildrenFilter(), entry.getBrowserConnection() );
            if ( dialog.open() == Dialog.OK )
            {
                String newFilter = dialog.getFilter();

                if ( newFilter == null || "".equals( newFilter.trim() ) ) //$NON-NLS-1$
                {
                    entry.setChildrenFilter( null );
                }
                else
                {
                    entry.setChildrenFilter( newFilter.trim() );
                }
                new StudioBrowserJob( new InitializeChildrenRunnable( true, entry ) ).execute();
            }
        }
    }
View Full Code Here

     */
    public void run()
    {
        if ( getSelectedEntries().length == 1 )
        {
            IEntry entry = getSelectedEntries()[0];
            entry.setChildrenFilter( null );
            new StudioBrowserJob( new InitializeChildrenRunnable( true, entry ) ).execute();
        }
    }
View Full Code Here

TOP

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

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.