directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r696065 - in /directory/studio/trunk: connection-core/src/main/java/org/apache/directory/studio/connection/core/ ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/ ldapbrowser-core/src/main/java/org/apa...
Date Tue, 16 Sep 2008 21:16:24 GMT
Author: seelmann
Date: Tue Sep 16 14:16:23 2008
New Revision: 696065

URL: http://svn.apache.org/viewvc?rev=696065&view=rev
Log:
Added check if context entry already exists; Fixed wizard page rendering

Modified:
    directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/IJndiLogger.java
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryAttributesWizardPage.java
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java
    directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java

Modified: directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/IJndiLogger.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/IJndiLogger.java?rev=696065&r1=696064&r2=696065&view=diff
==============================================================================
--- directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/IJndiLogger.java
(original)
+++ directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/IJndiLogger.java
Tue Sep 16 14:16:23 2008
@@ -29,11 +29,10 @@
 import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
 import org.apache.directory.studio.connection.core.io.jndi.ReferralsInfo;
 import org.apache.directory.studio.connection.core.io.jndi.StudioSearchResult;
-import org.apache.directory.studio.connection.core.io.jndi.ReferralsInfo.UrlAndDn;
 
 
 /**
- * Callback interface to log modifications
+ * Callback interface to log modifications.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryAttributesWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryAttributesWizardPage.java?rev=696065&r1=696064&r2=696065&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryAttributesWizardPage.java
(original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryAttributesWizardPage.java
Tue Sep 16 14:16:23 2008
@@ -128,7 +128,7 @@
      * {@inheritDoc}
      *
      * This implementation initializes the must attributes of the
-     * protoype entry and initializes the entry widget when this
+     * prototype entry and initializes the entry widget when this
      * page becomes visible.
      */
     public void setVisible( boolean visible )
@@ -248,7 +248,7 @@
         configuration = new EntryEditorWidgetConfiguration();
 
         // create main widget
-        mainWidget = new EntryEditorWidget( this.configuration );
+        mainWidget = new EntryEditorWidget( configuration );
         mainWidget.createWidget( composite );
         mainWidget.getViewer().getTree().setFocus();
 

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java?rev=696065&r1=696064&r2=696065&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java
(original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java
Tue Sep 16 14:16:23 2008
@@ -339,7 +339,7 @@
      */
     public IWizardPage getNextPage()
     {
-        if ( !wizard.isNewContextEntry )
+        if ( !wizard.isNewContextEntry() )
         {
             dnBuilderWidget.validate();
 
@@ -380,6 +380,33 @@
                 return null;
             }
         }
+        else
+        {
+            try
+            {
+                final LdapDN dn = new LdapDN( contextEntryDnCombo.getText() );
+                
+                // check that new entry does not exists yet 
+                ReadEntryRunnable readEntryRunnable2 = new ReadEntryRunnable( wizard.getSelectedConnection(),
dn );
+                RunnableContextRunner.execute( readEntryRunnable2, getContainer(), false
);
+                IEntry entry = readEntryRunnable2.getReadEntry();
+                if ( entry != null )
+                {
+                    getShell().getDisplay().syncExec( new Runnable()
+                    {
+                        public void run()
+                        {
+                            MessageDialog.openError( getShell(), "Error", "Entry " + dn.toString()
+ " already exists" );
+                        }
+                    } );
+                    return null;
+                }
+            }
+            catch ( InvalidNameException e )
+            {
+                return null;
+            }
+        }
 
         return super.getNextPage();
     }
@@ -393,7 +420,8 @@
         if ( wizard.isNewContextEntry() )
         {
             // the combo
-            contextEntryDnCombo = BaseWidgetUtils.createCombo( parent, ArrayUtils.EMPTY_STRING_ARRAY,
0, 1 );
+            Composite composite = BaseWidgetUtils.createColumnContainer( parent, 1, 1 );
+            contextEntryDnCombo = BaseWidgetUtils.createCombo( composite, ArrayUtils.EMPTY_STRING_ARRAY,
0, 1 );
             contextEntryDnCombo.addModifyListener( new ModifyListener()
             {
                 public void modifyText( ModifyEvent e )
@@ -408,7 +436,7 @@
             contextEntryDnComboCPA.setFilterStyle( ContentProposalAdapter.FILTER_NONE );
             contextEntryDnComboCPA.setProposalAcceptanceStyle( ContentProposalAdapter.PROPOSAL_REPLACE
);
 
-            setControl( contextEntryDnCombo );
+            setControl( composite );
         }
         else
         {

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java?rev=696065&r1=696064&r2=696065&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java
(original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java
Tue Sep 16 14:16:23 2008
@@ -296,7 +296,7 @@
             {
                 SearchResult sr = enumeration.next();
                 LdapDN dn = JNDIUtils.getDn( sr );
-                LdifContentRecord record = LdifContentRecord.create( dn.toString() );
+                LdifContentRecord record = LdifContentRecord.create( dn.getUpName() );
 
                 NamingEnumeration<? extends Attribute> attributeEnumeration = sr.getAttributes().getAll();
                 while ( attributeEnumeration.hasMore() )



Mime
View raw message