You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by fe...@apache.org on 2007/12/05 17:53:19 UTC
svn commit: r601411 [1/2] - in /directory/sandbox/felixk:
studio-aciitemeditor/META-INF/
studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/
studio-apacheds-configuration-feature/META-INF/ studio-apacheds-configur...
Author: felixk
Date: Wed Dec 5 08:53:15 2007
New Revision: 601411
URL: http://svn.apache.org/viewvc?rev=601411&view=rev
Log:
Some updates of manifest.mf and merges from trunk
Modified:
directory/sandbox/felixk/studio-aciitemeditor/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/SubtreeSpecificationDialog.java
directory/sandbox/felixk/studio-apacheds-configuration-feature/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-apacheds-configuration-help/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-apacheds-configuration/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-connection-core/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-connection-ui/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-jars/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-ldapbrowser-common/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RenameAction.java
directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/EntryExistsCopyStrategyDialogImpl.java
directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/FilterWidgetDialog.java
directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/MoveEntriesDialog.java
directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/RenameEntryDialog.java
directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/DnBuilderWidget.java
directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/FilterWidget.java
directory/sandbox/felixk/studio-ldapbrowser-core/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java
directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java
directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java
directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java
directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java
directory/sandbox/felixk/studio-ldapbrowser-feature/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-ldapbrowser-help/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-ldapbrowser-ui/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/MoveAction.java
directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewUniversalListener.java
directory/sandbox/felixk/studio-ldif-parser/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-ldifeditor-feature/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-ldifeditor-help/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-ldifeditor/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-plugin/pom.xml
directory/sandbox/felixk/studio-rcp-feature/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-rcp-help/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-rcp/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-schemaeditor-feature/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-schemaeditor-help/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-schemaeditor/META-INF/MANIFEST.MF
directory/sandbox/felixk/studio-valueeditors/META-INF/MANIFEST.MF
Modified: directory/sandbox/felixk/studio-aciitemeditor/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-aciitemeditor/META-INF/MANIFEST.MF?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-aciitemeditor/META-INF/MANIFEST.MF (original)
+++ directory/sandbox/felixk/studio-aciitemeditor/META-INF/MANIFEST.MF Wed Dec 5 08:53:15 2007
@@ -4,7 +4,7 @@
Bundle-SymbolicName: org.apache.directory.studio.aciitemeditor;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: org.apache.directory.studio.aciitemeditor.Activator
-Bundle-Vendor: The Apache Software Foundation
+Bundle-Vendor: Apache Software Foundation
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
Modified: directory/sandbox/felixk/studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/SubtreeSpecificationDialog.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/SubtreeSpecificationDialog.java?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/SubtreeSpecificationDialog.java (original)
+++ directory/sandbox/felixk/studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/SubtreeSpecificationDialog.java Wed Dec 5 08:53:15 2007
@@ -439,8 +439,9 @@
{
filter = subtreeSpecification.getRefinement().toString();
}
- filterWidget = new FilterWidget( connection, filter );
+ filterWidget = new FilterWidget( filter );
filterWidget.createWidget( composite );
+ filterWidget.setBrowserConnection( connection );
filterButton.setSelection( !refinementButton.getSelection() );
filterWidget.setEnabled( !refinementButton.getSelection() );
Modified: directory/sandbox/felixk/studio-apacheds-configuration-feature/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-apacheds-configuration-feature/META-INF/MANIFEST.MF?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-apacheds-configuration-feature/META-INF/MANIFEST.MF (original)
+++ directory/sandbox/felixk/studio-apacheds-configuration-feature/META-INF/MANIFEST.MF Wed Dec 5 08:53:15 2007
@@ -5,4 +5,4 @@
Bundle-Version: 1.0.0
Bundle-Localization: plugin
Eclipse-LazyStart: true
-Bundle-Vendor: The Apache Software Foundation
+Bundle-Vendor: Apache Software Foundation
Modified: directory/sandbox/felixk/studio-apacheds-configuration-help/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-apacheds-configuration-help/META-INF/MANIFEST.MF?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-apacheds-configuration-help/META-INF/MANIFEST.MF (original)
+++ directory/sandbox/felixk/studio-apacheds-configuration-help/META-INF/MANIFEST.MF Wed Dec 5 08:53:15 2007
@@ -5,4 +5,4 @@
Bundle-Version: 1.0.0
Bundle-Localization: plugin
Eclipse-LazyStart: true
-Bundle-Vendor: The Apache Software Foundation
+Bundle-Vendor: Apache Software Foundation
Modified: directory/sandbox/felixk/studio-apacheds-configuration/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-apacheds-configuration/META-INF/MANIFEST.MF?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-apacheds-configuration/META-INF/MANIFEST.MF (original)
+++ directory/sandbox/felixk/studio-apacheds-configuration/META-INF/MANIFEST.MF Wed Dec 5 08:53:15 2007
@@ -4,7 +4,7 @@
Bundle-SymbolicName: org.apache.directory.studio.apacheds.configuration;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: org.apache.directory.studio.apacheds.configuration.Activator
-Bundle-Vendor: The Apache Software Foundation
+Bundle-Vendor: Apache Software Foundation
Bundle-Localization: plugin
Eclipse-LazyStart: true
Require-Bundle: org.eclipse.core.runtime,
Modified: directory/sandbox/felixk/studio-connection-core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-connection-core/META-INF/MANIFEST.MF?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-connection-core/META-INF/MANIFEST.MF (original)
+++ directory/sandbox/felixk/studio-connection-core/META-INF/MANIFEST.MF Wed Dec 5 08:53:15 2007
@@ -4,7 +4,7 @@
Bundle-SymbolicName: org.apache.directory.studio.connection.core;singleton:=true
Bundle-Version: 1.0.1
Bundle-Activator: org.apache.directory.studio.connection.core.ConnectionCorePlugin
-Bundle-Vendor: The Apache Software Foundation
+Bundle-Vendor: Apache Software Foundation
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
org.apache.directory.studio.jars,
Modified: directory/sandbox/felixk/studio-connection-ui/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-connection-ui/META-INF/MANIFEST.MF?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-connection-ui/META-INF/MANIFEST.MF (original)
+++ directory/sandbox/felixk/studio-connection-ui/META-INF/MANIFEST.MF Wed Dec 5 08:53:15 2007
@@ -4,7 +4,7 @@
Bundle-SymbolicName: org.apache.directory.studio.connection.ui;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: org.apache.directory.studio.connection.ui.ConnectionUIPlugin
-Bundle-Vendor: The Apache Software Foundation
+Bundle-Vendor: Apache Software Foundation
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
Modified: directory/sandbox/felixk/studio-jars/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-jars/META-INF/MANIFEST.MF?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-jars/META-INF/MANIFEST.MF (original)
+++ directory/sandbox/felixk/studio-jars/META-INF/MANIFEST.MF Wed Dec 5 08:53:15 2007
@@ -1,10 +1,10 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Apache Directory Studio Jars
-Bundle-SymbolicName: org.apache.directory.studio.jars;singleton:=true
+Bundle-SymbolicName: org.apache.directory.studio.jars
Bundle-Version: 1.0.0
Bundle-Localization: plugin
-Bundle-Vendor: The Apache Software Foundation
+Bundle-Vendor: Apache Software Foundation
Export-Package: antlr,
antlr.ASdebug,
antlr.actions.cpp,
Modified: directory/sandbox/felixk/studio-ldapbrowser-common/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-common/META-INF/MANIFEST.MF?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-common/META-INF/MANIFEST.MF (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-common/META-INF/MANIFEST.MF Wed Dec 5 08:53:15 2007
@@ -4,7 +4,7 @@
Bundle-SymbolicName: org.apache.directory.studio.ldapbrowser.common;singleton:=true
Bundle-Version: 1.0.1
Bundle-Activator: org.apache.directory.studio.ldapbrowser.common.BrowserCommonActivator
-Bundle-Vendor: The Apache Software Foundation
+Bundle-Vendor: Apache Software Foundation
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
Modified: directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RenameAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RenameAction.java?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RenameAction.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RenameAction.java Wed Dec 5 08:53:15 2007
@@ -23,6 +23,7 @@
import org.apache.directory.shared.ldap.name.Rdn;
import org.apache.directory.studio.ldapbrowser.common.dialogs.RenameEntryDialog;
+import org.apache.directory.studio.ldapbrowser.common.dialogs.SimulateRenameDialogImpl;
import org.apache.directory.studio.ldapbrowser.core.jobs.RenameEntryJob;
import org.apache.directory.studio.ldapbrowser.core.model.IBookmark;
import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
@@ -193,10 +194,9 @@
if ( renameDialog.open() == Dialog.OK )
{
Rdn newRdn = renameDialog.getRdn();
- boolean deleteOldRdn = renameDialog.isDeleteOldRdn();
if ( newRdn != null && !newRdn.equals( entry.getRdn() ) )
{
- new RenameEntryJob( entry, newRdn, deleteOldRdn ).execute();
+ new RenameEntryJob( entry, newRdn, new SimulateRenameDialogImpl( getShell() ) ).execute();
}
}
}
Modified: directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/EntryExistsCopyStrategyDialogImpl.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/EntryExistsCopyStrategyDialogImpl.java?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/EntryExistsCopyStrategyDialogImpl.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/EntryExistsCopyStrategyDialogImpl.java Wed Dec 5 08:53:15 2007
@@ -146,7 +146,7 @@
*/
protected void createButtonsForButtonBar( Composite parent )
{
- createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false );
+ createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true );
//createButton( parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false );
}
@@ -212,15 +212,23 @@
private void validate()
{
- dnBuilderWidget.setEnabled( renameButton.getSelection() );
if ( renameButton.getSelection() )
{
+ dnBuilderWidget.setEnabled( true );
+// dnBuilderWidget.get
getButton( IDialogConstants.OK_ID ).setEnabled( dnBuilderWidget.getRdn() != null );
}
+ else
+ {
+ dnBuilderWidget.setEnabled( false );
+ }
// rememberCheckbox.setEnabled( overwriteButton.getSelection() || ignoreButton.getSelection() );
}
+ /**
+ * {@inheritDoc}
+ */
public int open()
{
final int[] result = new int[1];
@@ -235,27 +243,40 @@
}
+ /**
+ * {@inheritDoc}
+ */
public EntryExistsCopyStrategy getStrategy()
{
return strategy;
}
+ /**
+ * {@inheritDoc}
+ */
public Rdn getRdn()
{
return rdn;
}
+ /**
+ * {@inheritDoc}
+ */
public boolean isRememberSelection()
{
return isRememberStrategy;
}
+ /**
+ * {@inheritDoc}
+ */
public void setExistingEntry( IBrowserConnection browserConnection, LdapDN dn )
{
this.browserConnection = browserConnection;
this.dn = dn;
}
+
}
Modified: directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/FilterWidgetDialog.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/FilterWidgetDialog.java?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/FilterWidgetDialog.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/FilterWidgetDialog.java Wed Dec 5 08:53:15 2007
@@ -137,8 +137,9 @@
gd.widthHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH );
inner.setLayoutData( gd );
- filterWidget = new FilterWidget( connection, filter != null ? filter : "" );
+ filterWidget = new FilterWidget( filter != null ? filter : "" );
filterWidget.createWidget( inner );
+ filterWidget.setBrowserConnection( connection );
filterWidget.setFocus();
filterWidget.addWidgetModifyListener( new WidgetModifyListener()
{
Modified: directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/MoveEntriesDialog.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/MoveEntriesDialog.java?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/MoveEntriesDialog.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/MoveEntriesDialog.java Wed Dec 5 08:53:15 2007
@@ -56,18 +56,12 @@
/** The dn builder widget. */
private DnBuilderWidget dnBuilderWidget;
- /** The simulate move button. */
- private Button simulateMoveButton;
-
/** The ok button. */
private Button okButton;
/** The parent DN. */
private LdapDN parentDn;
- /** The simulate move flag. */
- private boolean simulateMove;
-
/**
* Creates a new instance of MoveEntriesDialog.
@@ -111,10 +105,7 @@
protected void okPressed()
{
parentDn = dnBuilderWidget.getParentDn();
- simulateMove = simulateMoveButton.getSelection();
-
dnBuilderWidget.saveDialogSettings();
-
super.okPressed();
}
@@ -147,11 +138,6 @@
dnBuilderWidget.createContents( composite );
dnBuilderWidget.setInput( entries[0].getBrowserConnection(), null, null, DnUtils.getParent( entries[0].getDn() ) );
- simulateMoveButton = BaseWidgetUtils.createCheckbox( composite,
- "Simulate subtree moving by searching/adding/deleting recursively", 1 );
- simulateMoveButton.setSelection( false );
- simulateMoveButton.setEnabled( false );
-
applyDialogFont( composite );
return composite;
}
@@ -177,17 +163,6 @@
public LdapDN getParentDn()
{
return parentDn;
- }
-
-
- /**
- * Gets the simulate move flag.
- *
- * @return the simulate move flag
- */
- public boolean isSimulateMove()
- {
- return simulateMove;
}
}
Modified: directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/RenameEntryDialog.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/RenameEntryDialog.java?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/RenameEntryDialog.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/RenameEntryDialog.java Wed Dec 5 08:53:15 2007
@@ -59,24 +59,12 @@
/** The dn builder widget. */
private DnBuilderWidget dnBuilderWidget;
- /** The delete old rdn button. */
- private Button deleteOldRdnButton;
-
- /** The simulate rename button. */
- private Button simulateRenameButton;
-
/** The ok button. */
private Button okButton;
/** The new rdn. */
private Rdn rdn;
- /** The delete old rdn flag. */
- private boolean deleteOldRdn;
-
- /** The simulate rename flag. */
- private boolean simulateRename;
-
/**
* Creates a new instance of RenameEntryDialog.
@@ -95,8 +83,6 @@
{
BrowserCommonActivator.getDefault().getDialogSettings().put( DELETE_OLD_RDN_DIALOGSETTING_KEY, true );
}
- this.deleteOldRdn = BrowserCommonActivator.getDefault().getDialogSettings().getBoolean(
- DELETE_OLD_RDN_DIALOGSETTING_KEY );
}
@@ -127,12 +113,6 @@
protected void okPressed()
{
rdn = dnBuilderWidget.getRdn();
- deleteOldRdn = deleteOldRdnButton.getSelection();
- simulateRename = simulateRenameButton.getSelection();
-
- BrowserCommonActivator.getDefault().getDialogSettings().put( DELETE_OLD_RDN_DIALOGSETTING_KEY, deleteOldRdn );
- dnBuilderWidget.saveDialogSettings();
-
super.okPressed();
}
@@ -165,14 +145,6 @@
dnBuilderWidget.setInput( entry.getBrowserConnection(), entry.getSubschema().getAllAttributeNames(), entry
.getRdn(), null );
- deleteOldRdnButton = BaseWidgetUtils.createCheckbox( composite, "Delete old RDN", 1 );
- deleteOldRdnButton.setSelection( deleteOldRdn );
-
- simulateRenameButton = BaseWidgetUtils.createCheckbox( composite,
- "Simulate subtree renaming by searching/adding/deleting recursively", 1 );
- simulateRenameButton.setSelection( false );
- simulateRenameButton.setEnabled( false );
-
applyDialogFont( composite );
return composite;
}
@@ -198,28 +170,6 @@
public Rdn getRdn()
{
return rdn;
- }
-
-
- /**
- * Checks if the old RDN should be deleted.
- *
- * @return true if the old RDN should be deleted.
- */
- public boolean isDeleteOldRdn()
- {
- return deleteOldRdn;
- }
-
-
- /**
- * Checks if the renaming should be simulated by searching/adding/deleting.
- *
- * @return true, if renaming shoudl be simulated
- */
- public boolean isSimulateRename()
- {
- return simulateRename;
}
}
Modified: directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/DnBuilderWidget.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/DnBuilderWidget.java?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/DnBuilderWidget.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/DnBuilderWidget.java Wed Dec 5 08:53:15 2007
@@ -631,6 +631,10 @@
rdnLine.rdnAddButton.setEnabled( b );
rdnLine.rdnDeleteButton.setEnabled( b && rdnLineList.size() > 1 );
}
+ if( b )
+ {
+ rdnLineList.get( 0 ).rdnValueText.setFocus();
+ }
}
if ( previewText != null )
{
Modified: directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/FilterWidget.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/FilterWidget.java?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/FilterWidget.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/FilterWidget.java Wed Dec 5 08:53:15 2007
@@ -87,12 +87,10 @@
/**
* Creates a new instance of FilterWidget.
*
- * @param browserConnection the connection
- * @param initalFilter the inital filter
+ * @param initalFilter the initial filter
*/
- public FilterWidget( IBrowserConnection browserConnection, String initalFilter )
+ public FilterWidget( String initalFilter )
{
- this.browserConnection = browserConnection;
this.initalFilter = initalFilter;
}
@@ -115,17 +113,22 @@
*/
public void createWidget( final Composite parent )
{
+ Composite composite = BaseWidgetUtils.createColumnContainer( parent, 1, 1 );
+ GridData gd = new GridData( GridData.FILL_HORIZONTAL );
+ gd.horizontalSpan = 1;
+ gd.widthHint = 200;
+ composite.setLayoutData( gd );
+
// filter combo with field decoration
final FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
FieldDecorationRegistry.DEC_CONTENT_PROPOSAL );
- filterComboField = new DecoratedField( parent, SWT.NONE, new IControlCreator()
+ filterComboField = new DecoratedField( composite, SWT.NONE, new IControlCreator()
{
public Control createControl( Composite parent, int style )
{
Combo combo = BaseWidgetUtils.createCombo( parent, new String[0], -1, 1 );
GridData gd = new GridData( GridData.FILL_HORIZONTAL );
gd.horizontalSpan = 1;
- gd.widthHint = 200;
combo.setLayoutData( gd );
combo.setVisibleItemCount( 20 );
return combo;
@@ -177,7 +180,6 @@
filterCombo.setItems( history );
// initial values
- setBrowserConnection( browserConnection );
filterCombo.setText( initalFilter == null ? "(objectClass=*)" : initalFilter );
}
Modified: directory/sandbox/felixk/studio-ldapbrowser-core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/META-INF/MANIFEST.MF?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/META-INF/MANIFEST.MF (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/META-INF/MANIFEST.MF Wed Dec 5 08:53:15 2007
@@ -1,10 +1,10 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Apache Directory Studio LDAP Browser Core
-Bundle-SymbolicName: org.apache.directory.studio.ldapbrowser.core;singleton:=true
+Bundle-SymbolicName: org.apache.directory.studio.ldapbrowser.core; singleton:=true
Bundle-Version: 1.0.1
Bundle-Activator: org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin
-Bundle-Vendor: The Apache Software Foundation
+Bundle-Vendor: Apache Software Foundation
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.search,
Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java Wed Dec 5 08:53:15 2007
@@ -149,14 +149,17 @@
if ( scope == SearchScope.OBJECT
|| !parent.getDn().getNormName().endsWith( entryToCopy.getDn().getNormName() ) )
{
- num = copyEntry( entryToCopy.getBrowserConnection(), entryToCopy.getDn(), parent.getDn(),
- copyScope, num, dummyMonitor, monitor );
+ dummyMonitor.reset();
+ num = copyEntry( entryToCopy, parent, null, copyScope, num, dialog, dummyMonitor, monitor );
}
else
{
monitor.reportError( BrowserCoreMessages.jobs__copy_entries_source_and_target_are_equal );
}
}
+
+ parent.setChildrenInitialized( false );
+ parent.setHasChildrenHint( true );
}
}
@@ -166,8 +169,6 @@
*/
protected void runNotification()
{
- parent.setChildrenInitialized( false );
- parent.setHasChildrenHint( true );
EventRegistry.fireEntryUpdated( new ChildrenInitializedEvent( parent ), this );
}
@@ -182,56 +183,104 @@
}
- private int copyEntry( IBrowserConnection browserConnection, LdapDN dnToCopy, LdapDN parentDn, int scope,
- int numberOfCopiedEntries, StudioProgressMonitor dummyMonitor, StudioProgressMonitor monitor )
+ /**
+ * Copy entry. If scope is SearchControls.SUBTREE_SCOPE the entry is copied
+ * recursively.
+ *
+ * @param browserConnection the browser connection
+ * @param dnToCopy the DN to copy
+ * @param parentDn the parent DN
+ * @param newRdn the new RDN, if null the RDN of dnToCopy is used
+ * @param scope the copy scope
+ * @param numberOfCopiedEntries the number of copied entries
+ * @param dialog the dialog to ask for the copy strategy, if null the user won't be
+ * asked instead the NameAlreadyBoundException it reported to the monitor
+ * @param dummyMonitor the dummy monitor, used for I/O that causes exceptions that
+ * should be handled
+ * @param monitor the real monitor
+ *
+ * @return the number of copied entries
+ */
+// static int copyEntry( IBrowserConnection browserConnection, LdapDN dnToCopy, LdapDN parentDn, Rdn newRdn,
+// int scope, int numberOfCopiedEntries, EntryExistsCopyStrategyDialog dialog, StudioProgressMonitor dummyMonitor,
+// StudioProgressMonitor monitor )
+ static int copyEntry( IEntry entryToCopy, IEntry parent, Rdn newRdn, int scope, int numberOfCopiedEntries,
+ EntryExistsCopyStrategyDialog dialog, StudioProgressMonitor dummyMonitor, StudioProgressMonitor monitor )
{
SearchControls searchControls = new SearchControls();
searchControls.setCountLimit( 1 );
searchControls.setReturningAttributes( new String[]
{ ISearch.ALL_USER_ATTRIBUTES, IAttribute.REFERRAL_ATTRIBUTE } );
searchControls.setSearchScope( SearchControls.OBJECT_SCOPE );
- NamingEnumeration<SearchResult> result = browserConnection.getConnection().getJNDIConnectionWrapper().search(
- dnToCopy.getUpName(), ISearch.FILTER_TRUE, searchControls, "never", JNDIConnectionWrapper.REFERRAL_IGNORE,
+ NamingEnumeration<SearchResult> result = entryToCopy.getBrowserConnection().getConnection().getJNDIConnectionWrapper().search(
+ entryToCopy.getDn().getUpName(), ISearch.FILTER_TRUE, searchControls, "never", JNDIConnectionWrapper.REFERRAL_IGNORE,
null, monitor, null );
- numberOfCopiedEntries = copyEntryRecursive( browserConnection, result, parentDn, scope, numberOfCopiedEntries,
- dummyMonitor, monitor );
+ numberOfCopiedEntries = copyEntryRecursive( entryToCopy.getBrowserConnection(), result, parent
+ .getBrowserConnection(), parent.getDn(), newRdn, scope, numberOfCopiedEntries, dialog, dummyMonitor,
+ monitor );
return numberOfCopiedEntries;
}
- private int copyEntryRecursive( IBrowserConnection browserConnection, NamingEnumeration<SearchResult> entries,
- LdapDN parentDn, int scope, int numberOfCopiedEntries, StudioProgressMonitor dummyMonitor,
+ /**
+ * Copy the entries. If scope is SearchControls.SUBTREE_SCOPE the entries are copied
+ * recursively.
+ *
+ * @param sourceBrowserConnection the source browser connection
+ * @param entries the source entries to copy
+ * @param targetBrowserConnection the target browser connection
+ * @param parentDn the target parent DN
+ * @param newRdn the new RDN, if null the original RDN of each entry is used
+ * @param scope the copy scope
+ * @param numberOfCopiedEntries the number of copied entries
+ * @param dialog the dialog to ask for the copy strategy, if null the user won't be
+ * asked instead the NameAlreadyBoundException it reported to the monitor
+ * @param dummyMonitor the dummy monitor, used for I/O that causes exceptions that
+ * should be handled
+ * @param monitor the real monitor
+ *
+ * @return the number of copied entries
+ */
+ static int copyEntryRecursive( IBrowserConnection sourceBrowserConnection, NamingEnumeration<SearchResult> entries,
+ IBrowserConnection targetBrowserConnection, LdapDN parentDn, Rdn forceNewRdn, int scope,
+ int numberOfCopiedEntries, EntryExistsCopyStrategyDialog dialog, StudioProgressMonitor dummyMonitor,
StudioProgressMonitor monitor )
{
try
{
while ( !monitor.isCanceled() && entries.hasMore() )
{
+ // get next entry to copy
SearchResult sr = entries.next();
-
- // compose new DN
LdapDN oldLdapDn = JNDIUtils.getDn( sr );
- String oldDn = oldLdapDn.getUpName();
Rdn oldRdn = oldLdapDn.getRdn();
- LdapDN newLdapDn = DnUtils.composeDn( oldRdn, parentDn );
- String newDn = newLdapDn.getUpName();
+
+ // reuse attributes of the entry to copy
+ Attributes newAttributes = sr.getAttributes();
- // copy attributes
- Attributes oldAttributes = sr.getAttributes();
- Attributes newAttributes = oldAttributes;
+ // compose new DN
+ Rdn newRdn = oldLdapDn.getRdn();
+ if( forceNewRdn != null )
+ {
+ newRdn = forceNewRdn;
+ }
+ LdapDN newLdapDn = DnUtils.composeDn( newRdn, parentDn );
+ // apply new RDN to the attributes
+ applyNewRdn( newAttributes, oldRdn, newRdn );
+
// create entry
- browserConnection.getConnection().getJNDIConnectionWrapper().createEntry( newDn, newAttributes, null,
+ targetBrowserConnection.getConnection().getJNDIConnectionWrapper().createEntry( newLdapDn.getUpName(), newAttributes, null,
dummyMonitor );
while ( dummyMonitor.errorsReported() )
{
- if ( dummyMonitor.getException() instanceof NameAlreadyBoundException )
+ if ( dialog != null && dummyMonitor.getException() instanceof NameAlreadyBoundException )
{
// open dialog
- dialog.setExistingEntry( browserConnection, newLdapDn );
+ dialog.setExistingEntry( targetBrowserConnection, newLdapDn );
dialog.open();
EntryExistsCopyStrategy strategy = dialog.getStrategy();
// boolean rememberSelection = dialog.isRememberSelection();
@@ -250,38 +299,15 @@
// break;
case RENAME_AND_CONTINUE:
Rdn renamedRdn = dialog.getRdn();
- for ( Iterator<AttributeTypeAndValue> it = oldRdn.iterator(); it.hasNext(); )
- {
- AttributeTypeAndValue atav = it.next();
- Attribute attribute = newAttributes.get( atav.getUpType() );
- if ( attribute != null )
- {
- attribute.remove( atav.getUpValue() );
- if ( attribute.size() == 0 )
- {
- newAttributes.remove( atav.getUpType() );
- }
- }
- }
- for ( Iterator<AttributeTypeAndValue> it = renamedRdn.iterator(); it.hasNext(); )
- {
- AttributeTypeAndValue atav = it.next();
- Attribute attribute = newAttributes.get( atav.getUpType() );
- if ( attribute == null )
- {
- attribute = new BasicAttribute( atav.getUpType() );
- newAttributes.put( attribute );
- }
- if ( !attribute.contains( atav.getUpValue() ) )
- {
- attribute.add( atav.getUpValue() );
- }
- }
-
+
+ // apply renamed RDN to the attributes
+ applyNewRdn( newAttributes, newRdn, renamedRdn );
+
+ // compose new DN
newLdapDn = DnUtils.composeDn( renamedRdn, parentDn );
- newDn = newLdapDn.getUpName();
- browserConnection.getConnection().getJNDIConnectionWrapper().createEntry( newDn,
+ // create entry
+ targetBrowserConnection.getConnection().getJNDIConnectionWrapper().createEntry( newLdapDn.getUpName(),
newAttributes, null, dummyMonitor );
break;
@@ -290,19 +316,23 @@
else
{
monitor.reportError( dummyMonitor.getException() );
- dummyMonitor.reset();
+ break;
}
}
else
{
monitor.reportError( dummyMonitor.getException() );
- dummyMonitor.reset();
+ break;
}
}
if ( !monitor.isCanceled() && !monitor.errorsReported() )
{
numberOfCopiedEntries++;
+
+ monitor.reportProgress( BrowserCoreMessages.bind( BrowserCoreMessages.model__copied_n_entries,
+ new String[]
+ { "" + numberOfCopiedEntries } ) ); //$NON-NLS-1$
// copy recursively
if ( scope == SearchControls.ONELEVEL_SCOPE || scope == SearchControls.SUBTREE_SCOPE )
@@ -312,8 +342,8 @@
searchControls.setReturningAttributes( new String[]
{ ISearch.ALL_USER_ATTRIBUTES, IAttribute.REFERRAL_ATTRIBUTE } );
searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
- NamingEnumeration<SearchResult> childEntries = browserConnection.getConnection()
- .getJNDIConnectionWrapper().search( oldDn, ISearch.FILTER_TRUE, searchControls, "never",
+ NamingEnumeration<SearchResult> childEntries = sourceBrowserConnection.getConnection()
+ .getJNDIConnectionWrapper().search( oldLdapDn.getUpName(), ISearch.FILTER_TRUE, searchControls, "never",
JNDIConnectionWrapper.REFERRAL_IGNORE, null, monitor, null );
if ( scope == SearchControls.ONELEVEL_SCOPE )
@@ -321,8 +351,9 @@
scope = SearchControls.OBJECT_SCOPE;
}
- numberOfCopiedEntries = copyEntryRecursive( browserConnection, childEntries, newLdapDn, scope,
- numberOfCopiedEntries, dummyMonitor, monitor );
+ numberOfCopiedEntries = copyEntryRecursive( sourceBrowserConnection, childEntries,
+ targetBrowserConnection, newLdapDn, null, scope, numberOfCopiedEntries, dialog,
+ dummyMonitor, monitor );
}
}
}
@@ -335,4 +366,37 @@
return numberOfCopiedEntries;
}
+ private static void applyNewRdn(Attributes attributes, Rdn oldRdn, Rdn newRdn)
+ {
+ // remove old RDN attributes and values
+ for ( Iterator<AttributeTypeAndValue> it = oldRdn.iterator(); it.hasNext(); )
+ {
+ AttributeTypeAndValue atav = it.next();
+ Attribute attribute = attributes.get( atav.getUpType() );
+ if ( attribute != null )
+ {
+ attribute.remove( atav.getUpValue() );
+ if ( attribute.size() == 0 )
+ {
+ attributes.remove( atav.getUpType() );
+ }
+ }
+ }
+
+ // add new RDN attributes and values
+ for ( Iterator<AttributeTypeAndValue> it = newRdn.iterator(); it.hasNext(); )
+ {
+ AttributeTypeAndValue atav = it.next();
+ Attribute attribute = attributes.get( atav.getUpType() );
+ if ( attribute == null )
+ {
+ attribute = new BasicAttribute( atav.getUpType() );
+ attributes.put( attribute );
+ }
+ if ( !attribute.contains( atav.getUpValue() ) )
+ {
+ attribute.add( atav.getUpValue() );
+ }
+ }
+ }
}
Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java Wed Dec 5 08:53:15 2007
@@ -62,21 +62,24 @@
* and start from 1. for each entry.
* </ol>
*
+ * TODO: delete subentries?
+ *
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
public class DeleteEntriesJob extends AbstractNotificationJob
{
+ /** The entries to delete. */
private IEntry[] entriesToDelete;
- private boolean useTreeDeleteContol;
- private boolean useManageDsaITControl;
- private boolean useSubentriesControl;
-
+
+ /** The deleted entries. */
private Set<IEntry> deletedEntriesSet;
+ /** The entries to update. */
private Set<IEntry> entriesToUpdateSet;
+ /** The searches to update. */
private Set<ISearch> searchesToUpdateSet;
@@ -84,17 +87,10 @@
* Creates a new instance of DeleteEntriesJob.
*
* @param entriesToDelete the entries to delete
- * @param useTreeDeleteContol true to use the Tree Delete Control
- * @param useManageDsaITControl true to use the Manage DSA IT Control
- * @param useSubentriesControl true to delete sub-entries
*/
- public DeleteEntriesJob( final IEntry[] entriesToDelete, boolean useTreeDeleteContol,
- boolean useManageDsaITControl, boolean useSubentriesControl )
+ public DeleteEntriesJob( final IEntry[] entriesToDelete )
{
this.entriesToDelete = entriesToDelete;
- this.useTreeDeleteContol = useTreeDeleteContol;
- this.useManageDsaITControl = useManageDsaITControl;
- this.useSubentriesControl = useSubentriesControl;
this.deletedEntriesSet = new HashSet<IEntry>();
this.entriesToUpdateSet = new HashSet<IEntry>();
@@ -105,17 +101,6 @@
}
- /**
- * Creates a new instance of DeleteEntriesJob.
- *
- * @param entriesToDelete the entries to delete
- */
- public DeleteEntriesJob( final IEntry[] entriesToDelete )
- {
- this( entriesToDelete, false, false, false );
- }
-
-
protected Connection[] getConnections()
{
Connection[] connections = new Connection[entriesToDelete.length];
@@ -154,8 +139,7 @@
// delete from directory
int errorStatusSize1 = monitor.getErrorStatus( "" ).getChildren().length; //$NON-NLS-1$
- num = optimisticDeleteEntryRecursive( browserConnection, entryToDelete.getDn().getUpName(), num,
- dummyMonitor, monitor );
+ num = optimisticDeleteEntryRecursive( browserConnection, entryToDelete.getDn(), num, dummyMonitor, monitor );
int errorStatusSize2 = monitor.getErrorStatus( "" ).getChildren().length; //$NON-NLS-1$
if ( !monitor.isCanceled() )
@@ -164,7 +148,7 @@
{
// delete
deletedEntriesSet.add( entryToDelete );
- entryToDelete.setChildrenInitialized( false );
+ //entryToDelete.setChildrenInitialized( false );
// delete from parent entry
entriesToUpdateSet.add( entryToDelete.getParententry() );
@@ -225,14 +209,15 @@
* @param numberOfDeletedEntries the number of delted entries
* @param dummyMonitor the dummy monitor
* @param monitor the progress monitor
- * @return the cululative number of deleted entries
+ *
+ * @return the cumulative number of deleted entries
*/
- private int optimisticDeleteEntryRecursive( IBrowserConnection browserConnection, String dn,
+ static int optimisticDeleteEntryRecursive( IBrowserConnection browserConnection, LdapDN dn,
int numberOfDeletedEntries, StudioProgressMonitor dummyMonitor, StudioProgressMonitor monitor )
{
// try to delete entry
dummyMonitor.reset();
- deleteEntry( browserConnection, dn, useTreeDeleteContol, useManageDsaITControl, dummyMonitor );
+ deleteEntry( browserConnection, dn, dummyMonitor );
if ( !dummyMonitor.errorsReported() )
{
@@ -244,8 +229,6 @@
else if ( dummyMonitor.getException() instanceof ContextNotEmptyException )
{
// perform one-level search and delete recursively
- // TODO: ManageDsaIT control
- // TODO: Subentries search
int numberInBatch;
dummyMonitor.reset();
do
@@ -257,7 +240,7 @@
searchControls.setReturningAttributes( new String[0] );
searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
NamingEnumeration<SearchResult> result = browserConnection.getConnection().getJNDIConnectionWrapper()
- .search( dn, ISearch.FILTER_TRUE, searchControls, "never", JNDIConnectionWrapper.REFERRAL_IGNORE,
+ .search( dn.getUpName(), ISearch.FILTER_TRUE, searchControls, "never", JNDIConnectionWrapper.REFERRAL_IGNORE,
null, dummyMonitor, null );
try
@@ -271,8 +254,7 @@
}
SearchResult sr = result.next();
- LdapDN ldapDn = JNDIUtils.getDn( sr );
- String childDn = ldapDn.getUpName();
+ LdapDN childDn = JNDIUtils.getDn( sr );
numberOfDeletedEntries = optimisticDeleteEntryRecursive( browserConnection, childDn,
numberOfDeletedEntries, dummyMonitor, monitor );
@@ -299,7 +281,7 @@
// try to delete the entry again
if ( !dummyMonitor.errorsReported() )
{
- deleteEntry( browserConnection, dn, useTreeDeleteContol, useManageDsaITControl, dummyMonitor );
+ deleteEntry( browserConnection, dn, dummyMonitor );
}
if ( !dummyMonitor.errorsReported() )
{
@@ -348,26 +330,19 @@
}
- static void deleteEntry( IBrowserConnection browserConnection, String dn, boolean useTreeDeleteControl,
- boolean useManageDsaITControl, StudioProgressMonitor monitor )
+ static void deleteEntry( IBrowserConnection browserConnection, LdapDN dn, StudioProgressMonitor monitor )
{
// controls
List<BasicControl> controls = new ArrayList<BasicControl>();
- if ( useTreeDeleteControl )
+ if ( browserConnection.getRootDSE().isControlSupported( Control.TREEDELETE_CONTROL.getOid() ) )
{
BasicControl treeDeleteControl = new BasicControl( Control.TREEDELETE_CONTROL.getOid(),
Control.TREEDELETE_CONTROL.isCritical(), Control.TREEDELETE_CONTROL.getControlValue() );
controls.add( treeDeleteControl );
}
- if ( useManageDsaITControl )
- {
- BasicControl manageDsaITControl = new BasicControl( Control.MANAGEDSAIT_CONTROL.getOid(),
- Control.MANAGEDSAIT_CONTROL.isCritical(), Control.MANAGEDSAIT_CONTROL.getControlValue() );
- controls.add( manageDsaITControl );
- }
// delete entry
- browserConnection.getConnection().getJNDIConnectionWrapper().deleteEntry( dn,
+ browserConnection.getConnection().getJNDIConnectionWrapper().deleteEntry( dn.getUpName(),
controls.toArray( new BasicControl[controls.size()] ), monitor );
}
Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java Wed Dec 5 08:53:15 2007
@@ -233,6 +233,7 @@
static void importLdif( IBrowserConnection browserConnection, LdifEnumeration enumeration, Writer logWriter,
boolean continueOnError, StudioProgressMonitor monitor )
{
+ StudioProgressMonitor dummyMonitor = new StudioProgressMonitor( monitor );
int importedCount = 0;
int errorCount = 0;
try
@@ -246,62 +247,80 @@
LdifRecord record = ( LdifRecord ) container;
try
{
- importLdifRecord( browserConnection, record, monitor );
- logModification( browserConnection, logWriter, record, monitor );
- importedCount++;
-
- // update cache and adjust attribute/children initialization flags
- LdapDN dn = new LdapDN( record.getDnLine().getValueAsString() );
- IEntry entry = browserConnection.getEntryFromCache( dn );
- LdapDN parentDn = DnUtils.getParent( dn );
- IEntry parentEntry = parentDn != null ? browserConnection.getEntryFromCache( parentDn ) : null;
-
- if ( record instanceof LdifChangeDeleteRecord )
+ dummyMonitor.reset();
+ importLdifRecord( browserConnection, record, dummyMonitor );
+ if ( dummyMonitor.errorsReported() )
{
- if ( entry != null )
- {
- entry.setAttributesInitialized( false );
- browserConnection.uncacheEntryRecursive( entry );
- }
- if ( parentEntry != null )
+ errorCount++;
+ logModificationError( browserConnection, logWriter, record, dummyMonitor.getException(),
+ monitor );
+
+ if ( !continueOnError )
{
- parentEntry.setChildrenInitialized( false );
+ monitor.reportError( dummyMonitor.getException() );
+ return;
}
}
- else if ( record instanceof LdifChangeModDnRecord )
+ else
{
- if ( entry != null )
- {
- entry.setAttributesInitialized( false );
- browserConnection.uncacheEntryRecursive( entry );
- }
- if ( parentEntry != null )
+ importedCount++;
+ logModification( browserConnection, logWriter, record, monitor );
+
+ // update cache and adjust attribute/children initialization flags
+ LdapDN dn = new LdapDN( record.getDnLine().getValueAsString() );
+ IEntry entry = browserConnection.getEntryFromCache( dn );
+ LdapDN parentDn = DnUtils.getParent( dn );
+ IEntry parentEntry = parentDn != null ? browserConnection.getEntryFromCache( parentDn )
+ : null;
+
+ if ( record instanceof LdifChangeDeleteRecord )
{
- parentEntry.setChildrenInitialized( false );
+ if ( entry != null )
+ {
+ entry.setAttributesInitialized( false );
+ browserConnection.uncacheEntryRecursive( entry );
+ }
+ if ( parentEntry != null )
+ {
+ parentEntry.setChildrenInitialized( false );
+ }
}
- LdifChangeModDnRecord modDnRecord = ( LdifChangeModDnRecord ) record;
- if ( modDnRecord.getNewsuperiorLine() != null )
+ else if ( record instanceof LdifChangeModDnRecord )
{
- LdapDN newSuperiorDn = new LdapDN( modDnRecord.getNewsuperiorLine().getValueAsString() );
- IEntry newSuperiorEntry = browserConnection.getEntryFromCache( newSuperiorDn );
- if ( newSuperiorEntry != null )
+ if ( entry != null )
{
- newSuperiorEntry.setChildrenInitialized( false );
+ entry.setAttributesInitialized( false );
+ browserConnection.uncacheEntryRecursive( entry );
+ }
+ if ( parentEntry != null )
+ {
+ parentEntry.setChildrenInitialized( false );
+ }
+ LdifChangeModDnRecord modDnRecord = ( LdifChangeModDnRecord ) record;
+ if ( modDnRecord.getNewsuperiorLine() != null )
+ {
+ LdapDN newSuperiorDn = new LdapDN( modDnRecord.getNewsuperiorLine()
+ .getValueAsString() );
+ IEntry newSuperiorEntry = browserConnection.getEntryFromCache( newSuperiorDn );
+ if ( newSuperiorEntry != null )
+ {
+ newSuperiorEntry.setChildrenInitialized( false );
+ }
}
}
- }
- else if ( record instanceof LdifChangeAddRecord || record instanceof LdifContentRecord )
- {
- if ( parentEntry != null )
+ else if ( record instanceof LdifChangeAddRecord || record instanceof LdifContentRecord )
{
- parentEntry.setChildrenInitialized( false );
+ if ( parentEntry != null )
+ {
+ parentEntry.setChildrenInitialized( false );
+ }
}
- }
- else
- {
- if ( entry != null )
+ else
{
- entry.setAttributesInitialized( false );
+ if ( entry != null )
+ {
+ entry.setAttributesInitialized( false );
+ }
}
}
}
@@ -513,7 +532,7 @@
* @param monitor the progress monitor
*/
private static void logModificationError( IBrowserConnection browserConnection, Writer logWriter,
- LdifRecord record, Exception exception, StudioProgressMonitor monitor )
+ LdifRecord record, Throwable exception, StudioProgressMonitor monitor )
{
try
{
Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java Wed Dec 5 08:53:15 2007
@@ -27,8 +27,8 @@
import java.util.List;
import java.util.Set;
-import javax.naming.ldap.Control;
-import javax.naming.ldap.ManageReferralControl;
+import javax.naming.ContextNotEmptyException;
+import javax.naming.directory.SearchControls;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.studio.connection.core.Connection;
@@ -46,6 +46,11 @@
/**
* Job to move entries.
+ *
+ * First it tries to move an entry using an moddn operation. If
+ * that operation fails with an LDAP error 66 (ContextNotEmptyException)
+ * the use is asked if s/he wants to simulate such a move by recursively
+ * searching/creating/deleting entries.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
@@ -65,7 +70,11 @@
/** The moved entries. */
private IEntry[] newEntries;
- private Set<ISearch> updatedSearches = new HashSet<ISearch>();
+ /** The searches to update. */
+ private Set<ISearch> searchesToUpdateSet = new HashSet<ISearch>();
+
+ /** The dialog to ask for simulated renaming */
+ private SimulateRenameDialog dialog;
/**
@@ -73,12 +82,15 @@
*
* @param entries the entries to move
* @param newParent the new parent
+ * @param dialog the dialog
*/
- public MoveEntriesJob( IEntry[] entries, IEntry newParent )
+ public MoveEntriesJob( IEntry[] entries, IEntry newParent, SimulateRenameDialog dialog )
{
this.browserConnection = newParent.getBrowserConnection();
this.oldEntries = entries;
this.newParent = newParent;
+ this.dialog = dialog;
+ this.newEntries = new IEntry[oldEntries.length];
setName( entries.length == 1 ? BrowserCoreMessages.jobs__move_entry_name_1
: BrowserCoreMessages.jobs__move_entry_name_n );
@@ -119,60 +131,100 @@
monitor.reportProgress( " " ); //$NON-NLS-1$
monitor.worked( 1 );
- newEntries = new IEntry[oldEntries.length];
- for ( int i = 0; i < oldEntries.length; i++ )
- {
- newEntries[i] = oldEntries[i];
- }
+ // use a dummy monitor to be able to handle exceptions
+ StudioProgressMonitor dummyMonitor = new StudioProgressMonitor( monitor );
+
+ int numAdd = 0;
+ int numDel = 0;
+ boolean isSimulatedRename = false;
+ LdapDN parentDn = newParent.getDn();
for ( int i = 0; i < oldEntries.length; i++ )
{
+ dummyMonitor.reset();
+
IEntry oldEntry = oldEntries[i];
- IEntry oldParent = oldEntry.getParententry();
- LdapDN newDn = DnUtils.composeDn( oldEntry.getRdn(), newParent.getDn() );
+ LdapDN oldDn = oldEntry.getDn();
+ LdapDN newDn = DnUtils.composeDn( oldDn.getRdn(), parentDn );
- // move in directory
- // TODO: use manual/simulated move, if move of subtree is not supported (JNDI)
- int errorStatusSize1 = monitor.getErrorStatus( "" ).getChildren().length; //$NON-NLS-1$
- moveEntry( browserConnection, oldEntry, newDn, monitor );
- //connection.move( oldEntry, newParent.getDn(), monitor );
- int errorStatusSize2 = monitor.getErrorStatus( "" ).getChildren().length; //$NON-NLS-1$
+ // try to move entry
+ moveEntry( browserConnection, oldDn, newDn, dummyMonitor );
- if ( errorStatusSize1 == errorStatusSize2 )
+ // do a simulated rename, if renaming of a non-leaf entry is not supported.
+ if ( dummyMonitor.errorsReported() )
{
- // move in parent
- oldParent.deleteChild( oldEntry );
- IEntry newEntry = ReadEntryJob.getEntry( browserConnection, newDn, monitor );
- newEntries[i] = newEntry;
- newParent.addChild( newEntry );
- newParent.setHasMoreChildren( false );
+ if ( dialog != null && dummyMonitor.getException() instanceof ContextNotEmptyException )
+ {
+ // open dialog
+ if ( numAdd == 0 )
+ {
+ dialog.setEntryInfo( browserConnection, oldDn, newDn );
+ dialog.open();
+ isSimulatedRename = dialog.isSimulateRename();
+ }
+
+ if ( isSimulatedRename )
+ {
+ // do simulated rename operation
+ dummyMonitor.reset();
+
+ numAdd = CopyEntriesJob.copyEntry( oldEntry, newParent, null, SearchControls.SUBTREE_SCOPE,
+ numAdd, null, dummyMonitor, monitor );
- newEntry.setHasChildrenHint( oldEntry.hasChildren() );
- if ( oldEntry.isChildrenInitialized() )
+ if ( !dummyMonitor.errorsReported() )
+ {
+ dummyMonitor.reset();
+ numDel = DeleteEntriesJob.optimisticDeleteEntryRecursive( browserConnection, oldDn, numDel,
+ dummyMonitor, monitor );
+ }
+ }
+ else
+ {
+ // no simulated rename operation
+ // report the exception to the real monitor
+ Throwable exception = dummyMonitor.getException();
+ monitor.reportError( exception );
+ }
+ }
+ else
{
- InitializeChildrenJob.initializeChildren( newEntry, monitor );
+ // we have another exception
+ // report it to the real monitor
+ Throwable exception = dummyMonitor.getException();
+ monitor.reportError( exception );
}
+ }
+
+ // update model
+ if ( !dummyMonitor.errorsReported() )
+ {
+ // uncache old entry
+ browserConnection.uncacheEntryRecursive( oldEntry );
+
+ // remove old entry from old parent
+ oldEntry.getParententry().deleteChild( oldEntry );
- // move in searches
+ // add new entry to new parent
+ boolean hasMoreChildren = newParent.hasMoreChildren() || !newParent.isChildrenInitialized();
+ IEntry newEntry = ReadEntryJob.getEntry( browserConnection, newDn, monitor );
+ newEntries[i] = newEntry;
+ newParent.addChild( newEntry );
+ newParent.setHasMoreChildren( hasMoreChildren );
+
+ // reset searches, if the moved entry is a result of a search
ISearch[] searches = browserConnection.getSearchManager().getSearches();
- for ( int j = 0; j < searches.length; j++ )
+ for ( ISearch search : searches )
{
- ISearch search = searches[j];
if ( search.getSearchResults() != null )
{
ISearchResult[] searchResults = search.getSearchResults();
- for ( int k = 0; k < searchResults.length; k++ )
+ for ( ISearchResult result : searchResults )
{
- ISearchResult result = searchResults[k];
if ( oldEntry.equals( result.getEntry() ) )
{
- ISearchResult[] newsrs = new ISearchResult[searchResults.length - 1];
- System.arraycopy( searchResults, 0, newsrs, 0, k );
- System.arraycopy( searchResults, k + 1, newsrs, k, searchResults.length - k - 1 );
- search.setSearchResults( newsrs );
- searchResults = newsrs;
- k--;
- updatedSearches.add( search );
+ search.setSearchResults( null );
+ searchesToUpdateSet.add( search );
+ break;
}
}
}
@@ -194,7 +246,7 @@
EventRegistry.fireEntryUpdated( new EntryMovedEvent( oldEntries[i], newEntries[i] ), this );
}
}
- for ( ISearch search : updatedSearches )
+ for ( ISearch search : searchesToUpdateSet )
{
EventRegistry.fireSearchUpdated( new SearchUpdateEvent( search,
SearchUpdateEvent.EventDetail.SEARCH_PERFORMED ), this );
@@ -216,26 +268,16 @@
* Moves an entry.
*
* @param browserConnection the browser connection
- * @param oldEntry the old entry
+ * @param oldDn the old DN
* @param newDn the new DN
* @param monitor the progress monitor
*/
- private void moveEntry( IBrowserConnection browserConnection, IEntry oldEntry, LdapDN newDn,
+ static void moveEntry( IBrowserConnection browserConnection, LdapDN oldDn, LdapDN newDn,
StudioProgressMonitor monitor )
{
- // dn
- String oldDnString = oldEntry.getDn().getUpName();
+ String oldDnString = oldDn.getUpName();
String newDnString = newDn.getUpName();
-
- // controls
- Control[] controls = null;
- if ( oldEntry.isReferral() )
- {
- controls = new Control[]
- { new ManageReferralControl() };
- }
-
- browserConnection.getConnection().getJNDIConnectionWrapper().rename( oldDnString, newDnString, false, controls,
+ browserConnection.getConnection().getJNDIConnectionWrapper().rename( oldDnString, newDnString, false, null,
monitor );
}
Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java Wed Dec 5 08:53:15 2007
@@ -26,8 +26,8 @@
import java.util.List;
import java.util.Set;
-import javax.naming.ldap.Control;
-import javax.naming.ldap.ManageReferralControl;
+import javax.naming.ContextNotEmptyException;
+import javax.naming.directory.SearchControls;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.name.Rdn;
@@ -47,6 +47,11 @@
/**
* Job to rename an entry.
*
+ * First it tries to rename an entry using an modrdn operation. If
+ * that operation fails with an LDAP error 66 (ContextNotEmptyException)
+ * the use is asked if s/he wants to simulate such a rename by recursively
+ * searching/creating/deleting entries.
+ *
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
@@ -59,33 +64,33 @@
/** The old entry. */
private IEntry oldEntry;
- /** The new rdn. */
+ /** The new RDN. */
private Rdn newRdn;
- /** The delete old rdn flag. */
- private boolean deleteOldRdn;
-
/** The new entry. */
private IEntry newEntry;
/** The updated searches. */
- private Set<ISearch> updatedSearchesSet = new HashSet<ISearch>();
+ private Set<ISearch> searchesToUpdateSet = new HashSet<ISearch>();
+
+ /** The dialog to ask for simulated renaming */
+ private SimulateRenameDialog dialog;
/**
* Creates a new instance of RenameEntryJob.
*
* @param entry the entry to rename
- * @param newRdn the new rdn
- * @param deleteOldRdn the delete old rdn flag
+ * @param newRdn the new RDN
+ * @param dialog the dialog
*/
- public RenameEntryJob( IEntry entry, Rdn newRdn, boolean deleteOldRdn )
+ public RenameEntryJob( IEntry entry, Rdn newRdn, SimulateRenameDialog dialog )
{
this.browserConnection = entry.getBrowserConnection();
this.oldEntry = entry;
- this.newEntry = entry;
+ this.newEntry = null;
this.newRdn = newRdn;
- this.deleteOldRdn = deleteOldRdn;
+ this.dialog = dialog;
setName( BrowserCoreMessages.jobs__rename_entry_name );
}
@@ -122,51 +127,85 @@
monitor.reportProgress( " " ); //$NON-NLS-1$
monitor.worked( 1 );
- IEntry parent = oldEntry.getParententry();
- LdapDN newDn = DnUtils.composeDn( newRdn, parent.getDn() );
+ LdapDN oldDn = oldEntry.getDn();
+ LdapDN parentDn = DnUtils.getParent( oldDn );
+ LdapDN newDn = DnUtils.composeDn( newRdn, parentDn );
+
+ // use a dummy monitor to be able to handle exceptions
+ StudioProgressMonitor dummyMonitor = new StudioProgressMonitor( monitor );
+
+ // try to rename entry
+ renameEntry( browserConnection, oldDn, newDn, dummyMonitor );
- // rename in directory
- // TODO: use manual/simulated rename, if rename of subtree is not
- // supported
- renameEntry( browserConnection, oldEntry, newDn, deleteOldRdn, monitor );
+ // do a simulated rename, if renaming of a non-leaf entry is not supported.
+ if ( dummyMonitor.errorsReported() )
+ {
+ if ( dialog != null && dummyMonitor.getException() instanceof ContextNotEmptyException )
+ {
+ // open dialog
+ dialog.setEntryInfo( browserConnection, oldDn, newDn );
+ dialog.open();
+ boolean isSimulatedRename = dialog.isSimulateRename();
+
+ if ( isSimulatedRename )
+ {
+ // do simulated rename operation
+ dummyMonitor.reset();
+ CopyEntriesJob.copyEntry( oldEntry, oldEntry.getParententry(), newRdn,
+ SearchControls.SUBTREE_SCOPE, 0, null, dummyMonitor, monitor );
+
+ if ( !dummyMonitor.errorsReported() )
+ {
+ dummyMonitor.reset();
+ DeleteEntriesJob.optimisticDeleteEntryRecursive( browserConnection, oldDn, 0, dummyMonitor,
+ monitor );
+ }
+ }
+ else
+ {
+ // no simulated rename operation
+ // report the exception to the real monitor
+ Throwable exception = dummyMonitor.getException();
+ monitor.reportError( exception );
+ }
+ }
+ else
+ {
+ // we have another exception
+ // report it to the real monitor
+ Throwable exception = dummyMonitor.getException();
+ monitor.reportError( exception );
+ }
+ }
+ // update model
if ( !monitor.errorsReported() )
{
// uncache old entry
browserConnection.uncacheEntryRecursive( oldEntry );
- // rename in parent
+ // remove old entry and add new entry to parent
+ IEntry parent = oldEntry.getParententry();
+ boolean hasMoreChildren = parent.hasMoreChildren();
parent.deleteChild( oldEntry );
newEntry = ReadEntryJob.getEntry( browserConnection, newDn, monitor );
parent.addChild( newEntry );
- parent.setHasMoreChildren( false );
-
- newEntry.setHasChildrenHint( oldEntry.hasChildren() );
- if ( oldEntry.isChildrenInitialized() )
- {
- InitializeChildrenJob.initializeChildren( newEntry, monitor );
- }
+ parent.setHasMoreChildren( hasMoreChildren );
- // rename in searches
+ // reset searches, if the renamed entry is a result of a search
ISearch[] searches = browserConnection.getSearchManager().getSearches();
- for ( int j = 0; j < searches.length; j++ )
+ for ( ISearch search : searches )
{
- ISearch search = searches[j];
if ( search.getSearchResults() != null )
{
ISearchResult[] searchResults = search.getSearchResults();
- for ( int k = 0; k < searchResults.length; k++ )
+ for ( ISearchResult result : searchResults )
{
- ISearchResult result = searchResults[k];
if ( oldEntry.equals( result.getEntry() ) )
{
- ISearchResult[] newsrs = new ISearchResult[searchResults.length - 1];
- System.arraycopy( searchResults, 0, newsrs, 0, k );
- System.arraycopy( searchResults, k + 1, newsrs, k, searchResults.length - k - 1 );
- search.setSearchResults( newsrs );
- searchResults = newsrs;
- k--;
- updatedSearchesSet.add( search );
+ search.setSearchResults( null );
+ searchesToUpdateSet.add( search );
+ break;
}
}
}
@@ -183,11 +222,12 @@
if ( oldEntry != null && newEntry != null )
{
EventRegistry.fireEntryUpdated( new EntryRenamedEvent( oldEntry, newEntry ), this );
- }
- for ( ISearch search : updatedSearchesSet )
- {
- EventRegistry.fireSearchUpdated( new SearchUpdateEvent( search,
- SearchUpdateEvent.EventDetail.SEARCH_PERFORMED ), this );
+
+ for ( ISearch search : searchesToUpdateSet )
+ {
+ EventRegistry.fireSearchUpdated( new SearchUpdateEvent( search,
+ SearchUpdateEvent.EventDetail.SEARCH_PERFORMED ), this );
+ }
}
}
@@ -205,27 +245,16 @@
* Renames the entry.
*
* @param browserConnection the browser connection
- * @param oldEntry the old entry
+ * @param oldDn the old DN
* @param newDn the new DN
- * @param deleteOldRdn the delete old RDN flag
* @param monitor the progress monitor
*/
- static void renameEntry( IBrowserConnection browserConnection, IEntry oldEntry, LdapDN newDn, boolean deleteOldRdn,
+ static void renameEntry( IBrowserConnection browserConnection, LdapDN oldDn, LdapDN newDn,
StudioProgressMonitor monitor )
{
- // dn
- String oldDnString = oldEntry.getDn().getUpName();
+ String oldDnString = oldDn.getUpName();
String newDnString = newDn.getUpName();
-
- // controls
- Control[] controls = null;
- if ( oldEntry.isReferral() )
- {
- controls = new Control[]
- { new ManageReferralControl() };
- }
-
- browserConnection.getConnection().getJNDIConnectionWrapper().rename( oldDnString, newDnString, deleteOldRdn, controls,
+ browserConnection.getConnection().getJNDIConnectionWrapper().rename( oldDnString, newDnString, true, null,
monitor );
}
Modified: directory/sandbox/felixk/studio-ldapbrowser-feature/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-feature/META-INF/MANIFEST.MF?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-feature/META-INF/MANIFEST.MF (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-feature/META-INF/MANIFEST.MF Wed Dec 5 08:53:15 2007
@@ -5,4 +5,4 @@
Bundle-Version: 1.0.1
Bundle-Localization: plugin
Eclipse-LazyStart: true
-Bundle-Vendor: The Apache Software Foundation
+Bundle-Vendor: Apache Software Foundation
Modified: directory/sandbox/felixk/studio-ldapbrowser-help/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-help/META-INF/MANIFEST.MF?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-help/META-INF/MANIFEST.MF (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-help/META-INF/MANIFEST.MF Wed Dec 5 08:53:15 2007
@@ -1,8 +1,8 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Apache Directory Studio LDAP Browser Help
-Bundle-SymbolicName: org.apache.directory.studio.ldapbrowser.help;singleton:=true
+Bundle-SymbolicName: org.apache.directory.studio.ldapbrowser.help; singleton:=true
Bundle-Version: 1.0.1
Bundle-Localization: plugin
Eclipse-LazyStart: true
-Bundle-Vendor: The Apache Software Foundation
+Bundle-Vendor: Apache Software Foundation
Modified: directory/sandbox/felixk/studio-ldapbrowser-ui/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/META-INF/MANIFEST.MF?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/META-INF/MANIFEST.MF (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/META-INF/MANIFEST.MF Wed Dec 5 08:53:15 2007
@@ -4,7 +4,7 @@
Bundle-SymbolicName: org.apache.directory.studio.ldapbrowser.ui;singleton:=true
Bundle-Version: 1.0.1
Bundle-Activator: org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin
-Bundle-Vendor: The Apache Software Foundation
+Bundle-Vendor: Apache Software Foundation
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.filesystem,
Modified: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/MoveAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/MoveAction.java?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/MoveAction.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/MoveAction.java Wed Dec 5 08:53:15 2007
@@ -26,7 +26,10 @@
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
import org.apache.directory.studio.ldapbrowser.common.dialogs.MoveEntriesDialog;
+import org.apache.directory.studio.ldapbrowser.common.dialogs.SimulateRenameDialogImpl;
+import org.apache.directory.studio.ldapbrowser.common.jobs.RunnableContextJobAdapter;
import org.apache.directory.studio.ldapbrowser.core.jobs.MoveEntriesJob;
+import org.apache.directory.studio.ldapbrowser.core.jobs.ReadEntryJob;
import org.apache.directory.studio.ldapbrowser.core.model.IBookmark;
import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
@@ -201,9 +204,15 @@
if ( newParentDn != null /* && !newRdn.equals(entry.getRdn()) */)
{
IEntry newParentEntry = entries[0].getBrowserConnection().getEntryFromCache( newParentDn );
+ if( newParentEntry == null )
+ {
+ ReadEntryJob job = new ReadEntryJob( entries[0].getBrowserConnection(), newParentDn );
+ RunnableContextJobAdapter.execute( job );
+ newParentEntry = job.getReadEntry();
+ }
if ( newParentEntry != null )
{
- new MoveEntriesJob( entries, newParentEntry ).execute();
+ new MoveEntriesJob( entries, newParentEntry, new SimulateRenameDialogImpl( getShell() ) ).execute();
}
}
}
Modified: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewUniversalListener.java?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewUniversalListener.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewUniversalListener.java Wed Dec 5 08:53:15 2007
@@ -500,7 +500,6 @@
{
EntryRenamedEvent ere = ( EntryRenamedEvent ) event;
viewer.refresh( ere.getNewEntry().getParententry(), true );
- viewer.refresh( ere.getNewEntry(), true );
viewer.setSelection( new StructuredSelection( ere.getNewEntry() ), true );
}
else if ( event instanceof EntryMovedEvent )
@@ -508,7 +507,6 @@
EntryMovedEvent eme = ( EntryMovedEvent ) event;
viewer.refresh( eme.getOldEntry().getParententry(), true );
viewer.refresh( eme.getNewEntry().getParententry(), true );
- viewer.refresh( eme.getNewEntry(), true );
viewer.setSelection( new StructuredSelection( eme.getNewEntry() ), true );
}
else if ( event instanceof EntryDeletedEvent )
@@ -516,7 +514,6 @@
EntryDeletedEvent ede = ( EntryDeletedEvent ) event;
if ( ede.getModifiedEntry().getParententry() != null )
{
- viewer.refresh( ede.getModifiedEntry(), true );
viewer.refresh( ede.getModifiedEntry().getParententry(), true );
viewer.setSelection( new StructuredSelection( ede.getModifiedEntry().getParententry() ), true );
}
Modified: directory/sandbox/felixk/studio-ldif-parser/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldif-parser/META-INF/MANIFEST.MF?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldif-parser/META-INF/MANIFEST.MF (original)
+++ directory/sandbox/felixk/studio-ldif-parser/META-INF/MANIFEST.MF Wed Dec 5 08:53:15 2007
@@ -1,10 +1,10 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Apache Directory Studio LDIF Parser
-Bundle-SymbolicName: org.apache.directory.studio.ldifparser;singleton:=true
-Bundle-Version: 1.0.1
+Bundle-SymbolicName: org.apache.directory.studio.ldifparser
+Bundle-Version: 1.0.0
Bundle-Localization: plugin
-Bundle-Vendor: The Apache Software Foundation
+Bundle-Vendor: Apache Software Foundation
Export-Package:
org.apache.directory.studio.ldifparser,
org.apache.directory.studio.ldifparser.model,
Modified: directory/sandbox/felixk/studio-ldifeditor-feature/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor-feature/META-INF/MANIFEST.MF?rev=601411&r1=601410&r2=601411&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor-feature/META-INF/MANIFEST.MF (original)
+++ directory/sandbox/felixk/studio-ldifeditor-feature/META-INF/MANIFEST.MF Wed Dec 5 08:53:15 2007
@@ -5,4 +5,4 @@
Bundle-Version: 1.0.1
Bundle-Localization: plugin
Eclipse-LazyStart: true
-Bundle-Vendor: The Apache Software Foundation
+Bundle-Vendor: Apache Software Foundation