directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r821548 - in /directory/studio/trunk: ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/ ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/ ldapbrowser-ui/src/main/java/org/apache/director...
Date Sun, 04 Oct 2009 15:57:58 GMT
Author: seelmann
Date: Sun Oct  4 15:57:57 2009
New Revision: 821548

URL: http://svn.apache.org/viewvc?rev=821548&view=rev
Log:
DIRSTUDIO-519:
- added error handling when editing and saving LDIF entry editor
- added support for moddn when modifying the DN

Modified:
    directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorManager.java
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/LdifEntryEditorDocumentProvider.java
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages.properties
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_de.properties
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_fr.properties
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditor.java

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java?rev=821548&r1=821547&r2=821548&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
(original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
Sun Oct  4 15:57:57 2009
@@ -38,6 +38,7 @@
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.parsers.AttributeTypeDescription;
 import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.core.ConnectionParameter.EncryptionMethod;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
@@ -50,10 +51,15 @@
 import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
 import org.apache.directory.studio.ldifparser.LdifFormatParameters;
 import org.apache.directory.studio.ldifparser.LdifUtils;
+import org.apache.directory.studio.ldifparser.model.LdifFile;
+import org.apache.directory.studio.ldifparser.model.container.LdifChangeModDnRecord;
 import org.apache.directory.studio.ldifparser.model.container.LdifChangeModifyRecord;
 import org.apache.directory.studio.ldifparser.model.container.LdifModSpec;
 import org.apache.directory.studio.ldifparser.model.lines.LdifAttrValLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifDeloldrdnLine;
 import org.apache.directory.studio.ldifparser.model.lines.LdifModSpecSepLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifNewrdnLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifNewsuperiorLine;
 import org.apache.directory.studio.ldifparser.model.lines.LdifSepLine;
 import org.eclipse.core.runtime.Preferences;
 
@@ -380,12 +386,24 @@
      * @return the change modify record or null if there is no difference
      *         between the two entries
      */
-    public static LdifChangeModifyRecord computeDiff( IEntry t0, IEntry t1 )
+    public static LdifFile computeDiff( IEntry t0, IEntry t1 )
     {
-        Set<String> attributesToDelAdd = new HashSet<String>();
-        Set<String> attributesToReplace = new HashSet<String>();
+        LdifFile model = new LdifFile();
+
+        // check if entry needs to be renamed
+        if ( !t0.getDn().equals( t1.getDn() ) )
+        {
+            LdifChangeModDnRecord modDnRecord = LdifChangeModDnRecord.create( t0.getDn().getUpName()
);
+            modDnRecord.setNewrdn( LdifNewrdnLine.create( t1.getRdn().getUpName() ) );
+            modDnRecord.setNewsuperior( LdifNewsuperiorLine.create( DnUtils.getParent( t1.getDn()
).getUpName() ) );
+            modDnRecord.setDeloldrdn( LdifDeloldrdnLine.create1() );
+            modDnRecord.finish( LdifSepLine.create() );
+            model.addContainer( modDnRecord );
+        }
 
         // check attributes of old entry
+        Set<String> attributesToDelAdd = new HashSet<String>();
+        Set<String> attributesToReplace = new HashSet<String>();
         for ( IAttribute oldAttr : t0.getAttributes() )
         {
             String attributeDescription = oldAttr.getDescription();
@@ -424,8 +442,9 @@
             }
         }
 
-        LdifChangeModifyRecord record = LdifChangeModifyRecord.create( t0.getDn().getUpName()
);
+        LdifChangeModifyRecord record = LdifChangeModifyRecord.create( t1.getDn().getUpName()
);
 
+        // determine attributes to delete and/or add
         for ( String attributeDescription : attributesToDelAdd )
         {
             IAttribute oldAttribute = t0.getAttribute( attributeDescription );
@@ -505,6 +524,7 @@
             }
         }
 
+        // determine attributes to replace
         for ( String attributeDescription : attributesToReplace )
         {
             IAttribute oldAttribute = t0.getAttribute( attributeDescription );
@@ -551,10 +571,12 @@
         }
 
         record.finish( LdifSepLine.create() );
+        if ( record.isValid() && record.getModSpecs().length > 0 )
+        {
+            model.addContainer( record );
+        }
 
-        // check for changes: if there are no changes the record does not include
-        // any modifications and so it is not valid.
-        return record.isValid() && record.getModSpecs().length > 0 ? record :
null;
+        return model.getRecords().length > 0 ? model : null;
     }
 
 }

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorManager.java?rev=821548&r1=821547&r2=821548&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorManager.java
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorManager.java
Sun Oct  4 15:57:57 2009
@@ -35,6 +35,7 @@
 import org.apache.directory.studio.connection.ui.RunnableContextRunner;
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonActivator;
 import org.apache.directory.studio.ldapbrowser.core.events.EntryModificationEvent;
+import org.apache.directory.studio.ldapbrowser.core.events.EntryRenamedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EntryUpdateListener;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.jobs.ExecuteLdifRunnable;
@@ -47,7 +48,9 @@
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
 import org.apache.directory.studio.ldifparser.LdifFormatParameters;
-import org.apache.directory.studio.ldifparser.model.container.LdifChangeModifyRecord;
+import org.apache.directory.studio.ldifparser.model.LdifFile;
+import org.apache.directory.studio.ldifparser.model.container.LdifChangeModDnRecord;
+import org.apache.directory.studio.ldifparser.model.container.LdifRecord;
 import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.core.runtime.IExtension;
 import org.eclipse.core.runtime.IExtensionPoint;
@@ -424,20 +427,26 @@
 
     private void updateOscSharedReferenceCopy( IEntry entry )
     {
-        IEntry referenceEntry = oscSharedReferenceCopies.remove( entry );
-        EntryEditorUtils.ensureAttributesInitialized( entry );
-        EventRegistry.suspendEventFiringInCurrentThread();
-        new CompoundModification().replaceAttributes( entry, referenceEntry, this );
-        EventRegistry.resumeEventFiringInCurrentThread();
-        oscSharedReferenceCopies.put( entry, referenceEntry );
+        IEntry referenceCopy = oscSharedReferenceCopies.remove( entry );
+        if ( referenceCopy != null )
+        {
+            EntryEditorUtils.ensureAttributesInitialized( entry );
+            EventRegistry.suspendEventFiringInCurrentThread();
+            new CompoundModification().replaceAttributes( entry, referenceCopy, this );
+            EventRegistry.resumeEventFiringInCurrentThread();
+            oscSharedReferenceCopies.put( entry, referenceCopy );
+        }
     }
 
 
     private void updateOscSharedWorkingCopy( IEntry entry )
     {
-        EntryEditorUtils.ensureAttributesInitialized( entry );
         IEntry workingCopy = oscSharedWorkingCopies.get( entry );
-        new CompoundModification().replaceAttributes( entry, workingCopy, this );
+        if ( workingCopy != null )
+        {
+            EntryEditorUtils.ensureAttributesInitialized( entry );
+            new CompoundModification().replaceAttributes( entry, workingCopy, this );
+        }
     }
 
 
@@ -552,7 +561,7 @@
             IEntry workingCopy = oscSharedWorkingCopies.get( originalEntry );
             if ( referenceCopy != null && workingCopy != null )
             {
-                LdifChangeModifyRecord diff = Utils.computeDiff( referenceCopy, workingCopy
);
+                LdifFile diff = Utils.computeDiff( referenceCopy, workingCopy );
                 return diff != null;
             }
             return false;
@@ -568,7 +577,7 @@
             IEntry workingCopy = oscSharedWorkingCopies.get( originalEntry );
             if ( referenceCopy != null && workingCopy != null )
             {
-                LdifChangeModifyRecord diff = Utils.computeDiff( referenceCopy, workingCopy
);
+                LdifFile diff = Utils.computeDiff( referenceCopy, workingCopy );
                 if ( diff != null )
                 {
                     // save by executing the LDIF
@@ -579,6 +588,17 @@
                     {
                         updateOscSharedReferenceCopy( originalEntry );
                         updateOscSharedWorkingCopy( originalEntry );
+
+                        // check if the entry was renamed, fire an appropriate event in that
case
+                        for ( LdifRecord record : diff.getRecords() )
+                        {
+                            if ( record instanceof LdifChangeModDnRecord )
+                            {
+                                IEntry newEntry = originalEntry.getBrowserConnection().getEntryFromCache(
+                                    workingCopy.getDn() );
+                                EventRegistry.fireEntryUpdated( new EntryRenamedEvent( originalEntry,
newEntry ), this );
+                            }
+                        }
                     }
                     return status;
                 }
@@ -606,13 +626,10 @@
     private void askUpdateSharedWorkingCopy( IWorkbenchPartReference partRef, IEntry originalEntry,
         IEntry oscSharedWorkingCopy, Object source )
     {
-        MessageDialog dialog = new MessageDialog(
-            partRef.getPart( false ).getSite().getShell(),
-            Messages.getString("EntryEditorManager.EntryChanged"), //$NON-NLS-1$
-            null,
-            Messages.getString("EntryEditorManager.EntryChangedDescription"), //$NON-NLS-1$
-            MessageDialog.QUESTION, new String[]
-                { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0 );
+        MessageDialog dialog = new MessageDialog( partRef.getPart( false ).getSite().getShell(),
Messages
+            .getString( "EntryEditorManager.EntryChanged" ), null, Messages //$NON-NLS-1$
+            .getString( "EntryEditorManager.EntryChangedDescription" ), MessageDialog.QUESTION,
new String[] //$NON-NLS-1$
+            { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0 );
         int result = dialog.open();
         if ( result == 0 )
         {
@@ -627,11 +644,6 @@
                 oscEditor.workingCopyModified( source );
             }
         }
-//        else
-//        {
-//            // only update the reference copy
-//            updateOscSharedReferenceCopy( originalEntry );
-//        }
     }
 
 
@@ -714,11 +726,12 @@
                     // check if the same entry is used in an OSC editor and is dirty ->
should save first?
                     if ( oscSharedReferenceCopy != null && oscSharedWorkingCopy !=
null )
                     {
-                        LdifChangeModifyRecord diff = Utils.computeDiff( oscSharedReferenceCopy,
oscSharedWorkingCopy );
+                        LdifFile diff = Utils.computeDiff( oscSharedReferenceCopy, oscSharedWorkingCopy
);
                         if ( diff != null )
                         {
                             MessageDialog dialog = new MessageDialog( partRef.getPart( false
).getSite().getShell(),
-                                Messages.getString("EntryEditorManager.SaveChanges"), null,
Messages.getString("EntryEditorManager.SaveChangesDescription"), //$NON-NLS-1$ //$NON-NLS-2$
+                                Messages.getString( "EntryEditorManager.SaveChanges" ), null,//$NON-NLS-1$

+                                Messages.getString( "EntryEditorManager.SaveChangesDescription"
), //$NON-NLS-1$ 
                                 MessageDialog.QUESTION, new String[]
                                     { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL
}, 0 );
                             int result = dialog.open();
@@ -734,12 +747,11 @@
                     // check if original entry was updated
                     if ( oscSharedReferenceCopy != null && oscSharedWorkingCopy !=
null )
                     {
-                        LdifChangeModifyRecord refDiff = Utils.computeDiff( originalEntry,
oscSharedReferenceCopy );
+                        LdifFile refDiff = Utils.computeDiff( originalEntry, oscSharedReferenceCopy
);
                         if ( refDiff != null )
                         {
                             // check if we could just update the working copy
-                            LdifChangeModifyRecord workDiff = Utils.computeDiff( oscSharedReferenceCopy,
-                                oscSharedWorkingCopy );
+                            LdifFile workDiff = Utils.computeDiff( oscSharedReferenceCopy,
oscSharedWorkingCopy );
                             if ( workDiff != null )
                             {
                                 askUpdateSharedWorkingCopy( partRef, originalEntry, oscSharedWorkingCopy,
null );
@@ -808,12 +820,11 @@
                 IEntry oscSharedWorkingCopy = oscSharedWorkingCopies.get( originalEntry );
                 if ( oscSharedReferenceCopy != null && oscSharedWorkingCopy != null
)
                 {
-                    LdifChangeModifyRecord refDiff = Utils.computeDiff( originalEntry, oscSharedReferenceCopy
);
+                    LdifFile refDiff = Utils.computeDiff( originalEntry, oscSharedReferenceCopy
);
                     if ( refDiff != null )
                     {
                         // diff between original entry and reference copy
-                        LdifChangeModifyRecord workDiff = Utils.computeDiff( oscSharedReferenceCopy,
-                            oscSharedWorkingCopy );
+                        LdifFile workDiff = Utils.computeDiff( oscSharedReferenceCopy, oscSharedWorkingCopy
);
                         if ( workDiff == null )
                         {
                             // no changes on working copy, update
@@ -850,7 +861,7 @@
                 IEntry autoSaveSharedWorkingCopy = autoSaveSharedWorkingCopies.get( originalEntry
);
                 if ( autoSaveSharedReferenceCopy != null && autoSaveSharedWorkingCopy
!= null )
                 {
-                    LdifChangeModifyRecord diff = Utils.computeDiff( originalEntry, autoSaveSharedReferenceCopy
);
+                    LdifFile diff = Utils.computeDiff( originalEntry, autoSaveSharedReferenceCopy
);
                     if ( diff != null )
                     {
                         updateAutoSaveSharedReferenceCopy( originalEntry );
@@ -899,8 +910,7 @@
                 // auto-save working copy has been modified: save and inform all auto-save
editors
                 IEntry autoSaveSharedReferenceCopy = autoSaveSharedReferenceCopies.get( originalEntry
);
                 IEntry autoSaveSharedWorkingCopy = autoSaveSharedWorkingCopies.get( originalEntry
);
-                LdifChangeModifyRecord diff = Utils
-                    .computeDiff( autoSaveSharedReferenceCopy, autoSaveSharedWorkingCopy
);
+                LdifFile diff = Utils.computeDiff( autoSaveSharedReferenceCopy, autoSaveSharedWorkingCopy
);
                 if ( diff != null )
                 {
                     ExecuteLdifRunnable runnable = new ExecuteLdifRunnable( browserConnection,
diff

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/LdifEntryEditorDocumentProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/LdifEntryEditorDocumentProvider.java?rev=821548&r1=821547&r2=821548&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/LdifEntryEditorDocumentProvider.java
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/LdifEntryEditorDocumentProvider.java
Sun Oct  4 15:57:57 2009
@@ -25,6 +25,7 @@
 
 import javax.naming.InvalidNameException;
 
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.entryeditors.EntryEditorInput;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
@@ -35,7 +36,9 @@
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
 import org.apache.directory.studio.ldifeditor.editor.LdifDocumentProvider;
+import org.apache.directory.studio.ldifparser.model.container.LdifContainer;
 import org.apache.directory.studio.ldifparser.model.container.LdifContentRecord;
+import org.apache.directory.studio.ldifparser.model.container.LdifInvalidContainer;
 import org.apache.directory.studio.ldifparser.model.container.LdifRecord;
 import org.apache.directory.studio.ldifparser.model.lines.LdifAttrValLine;
 import org.eclipse.core.runtime.CoreException;
@@ -45,6 +48,7 @@
 import org.eclipse.jface.text.Document;
 import org.eclipse.jface.text.DocumentEvent;
 import org.eclipse.jface.text.IDocument;
+import org.eclipse.osgi.util.NLS;
 
 
 /**
@@ -73,6 +77,32 @@
     protected void doSaveDocument( IProgressMonitor monitor, Object element, IDocument document,
boolean overwrite )
         throws CoreException
     {
+        LdifRecord[] records = getLdifModel().getRecords();
+        if ( records.length != 1 || !( records[0] instanceof LdifContentRecord ) )
+        {
+            throw new CoreException( new Status( IStatus.ERROR, BrowserUIConstants.PLUGIN_ID,
Messages
+                .getString( "LdifEntryEditorDocumentProvider.InvalidRecordType" ) ) ); //$NON-NLS-1$
+        }
+        if ( !LdapDN.isValid( records[0].getDnLine().getRawDn() ) )
+        {
+            throw new CoreException( new Status( IStatus.ERROR, BrowserUIConstants.PLUGIN_ID,
Messages
+                .getString( "LdifEntryEditorDocumentProvider.InvalidDN" ) ) ); //$NON-NLS-1$
+        }
+        if ( !records[0].isValid() )
+        {
+            throw new CoreException( new Status( IStatus.ERROR, BrowserUIConstants.PLUGIN_ID,
NLS.bind( Messages
+                .getString( "LdifEntryEditorDocumentProvider.InvalidLdif" ), records[0].getInvalidString()
) ) ); //$NON-NLS-1$
+        }
+        for ( LdifContainer ldifContainer : getLdifModel().getContainers() )
+        {
+            if ( ldifContainer instanceof LdifInvalidContainer )
+            {
+                LdifInvalidContainer cont = ( LdifInvalidContainer ) ldifContainer;
+                throw new CoreException( new Status( IStatus.ERROR, BrowserUIConstants.PLUGIN_ID,
NLS.bind( Messages
+                    .getString( "LdifEntryEditorDocumentProvider.InvalidLdif" ), cont.getInvalidString()
) ) ); //$NON-NLS-1$
+            }
+        }
+
         EntryEditorInput input = getEntryEditorInput( element );
         IStatus status = input.saveSharedWorkingCopy( false, editor );
         if ( status != null && !status.isOK() )
@@ -87,22 +117,26 @@
     {
         super.documentChanged( event );
 
-        if ( input == null )
+        // the document change was caused by the model update
+        // no need to update the model again, don't fire more events
+        if ( inSetContent )
         {
             return;
         }
+
+        // only continue if the LDIF model is valid
         LdifRecord[] records = getLdifModel().getRecords();
-        if ( records.length != 1 || !( records[0] instanceof LdifContentRecord ) || !records[0].isValid()
)
+        if ( records.length != 1 || !( records[0] instanceof LdifContentRecord ) || !records[0].isValid()
+            || !LdapDN.isValid( records[0].getDnLine().getRawDn() ) )
         {
-            // can't continue
             return;
         }
-
-        // the document change was caused by the model update
-        // no need to update the model again, don't fire more events
-        if ( inSetContent )
+        for ( LdifContainer ldifContainer : getLdifModel().getContainers() )
         {
-            return;
+            if ( ldifContainer instanceof LdifInvalidContainer )
+            {
+                return;
+            }
         }
 
         // update shared working copy
@@ -111,11 +145,12 @@
             LdifContentRecord modifiedRecord = ( LdifContentRecord ) records[0];
             IBrowserConnection browserConnection = input.getSharedWorkingCopy( editor ).getBrowserConnection();
             DummyEntry modifiedEntry = ModelConverter.ldifContentRecordToEntry( modifiedRecord,
browserConnection );
+            ( ( DummyEntry ) input.getSharedWorkingCopy( editor ) ).setDn( modifiedEntry.getDn()
);
             new CompoundModification().replaceAttributes( modifiedEntry, input.getSharedWorkingCopy(
editor ), this );
         }
         catch ( InvalidNameException e )
         {
-            throw new RuntimeException( "Failed to set input", e );
+            throw new RuntimeException( e );
         }
     }
 
@@ -230,7 +265,7 @@
         else
         {
             throw new CoreException( new Status( IStatus.ERROR, BrowserUIConstants.PLUGIN_ID,
-                "Expected MultiTabLdifEntryEditorInput, was " + element ) );
+                "Expected EntryEditorInput, was " + element ) ); //$NON-NLS-1$
         }
     }
 

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages.properties?rev=821548&r1=821547&r2=821548&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages.properties
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages.properties
Sun Oct  4 15:57:57 2009
@@ -19,6 +19,9 @@
 EntryEditorActionGroup.OpenSchemaBrowser=Open Schema Browser
 EntryEditorActionGroup.ShowIn=Show In
 EntryEditorInput.EntryEditor=Entry Editor
+LdifEntryEditorDocumentProvider.InvalidDN=Invalid distinguished name.
+LdifEntryEditorDocumentProvider.InvalidLdif=Invalid LDIF: {0}
+LdifEntryEditorDocumentProvider.InvalidRecordType=Exactly one LDIF content record expected.
 OpenEntryEditorAction.EditEntry=Edit Entry...
 OpenEntryEditorPreferencePageAction.Preferences=Preferences...
 OpenEntryEditorPreferencePageAction.PreferencesToolTip=Preferences...

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_de.properties?rev=821548&r1=821547&r2=821548&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_de.properties
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_de.properties
Sun Oct  4 15:57:57 2009
@@ -19,6 +19,9 @@
 EntryEditorActionGroup.OpenSchemaBrowser=\u00D6ffne Schema Browser
 EntryEditorActionGroup.ShowIn=Anzeigen in
 EntryEditorInput.EntryEditor=Eintrag Editor
+LdifEntryEditorDocumentProvider.InvalidDN=Ung\u00fcltiger Distinguished Name.
+LdifEntryEditorDocumentProvider.InvalidLdif=Ung\u00fcltiges LDIF: {0}
+LdifEntryEditorDocumentProvider.InvalidRecordType=Genau ein LDIF Inhaltsdatensatz erwartet.
 OpenEntryEditorAction.EditEntry=Eintrag editieren...
 OpenEntryEditorPreferencePageAction.Preferences=Benutzervorgaben...
 OpenEntryEditorPreferencePageAction.PreferencesToolTip=Benutzervorgaben...

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_fr.properties?rev=821548&r1=821547&r2=821548&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_fr.properties
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_fr.properties
Sun Oct  4 15:57:57 2009
@@ -19,6 +19,9 @@
 EntryEditorActionGroup.OpenSchemaBrowser=Ouvrir le navigateur de sch\u00E9ma
 EntryEditorActionGroup.ShowIn=Afficher dans
 EntryEditorInput.EntryEditor=Editeur d'entr\u00E9e
+LdifEntryEditorDocumentProvider.InvalidDN=TODO: Invalid distinguished name.
+LdifEntryEditorDocumentProvider.InvalidLdif=TODO: Invalid LDIF: {0}
+LdifEntryEditorDocumentProvider.InvalidRecordType=TODO: Exactly one LDIF content record expected.
 OpenEntryEditorAction.EditEntry=Editer l'entr\u00E9e...
 OpenEntryEditorPreferencePageAction.Preferences=Pr\u00E9f\u00E9rences...
 OpenEntryEditorPreferencePageAction.PreferencesToolTip=Pr\u00E9f\u00E9rences...

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditor.java?rev=821548&r1=821547&r2=821548&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditor.java
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditor.java
Sun Oct  4 15:57:57 2009
@@ -38,7 +38,7 @@
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
 import org.apache.directory.studio.ldapbrowser.ui.views.browser.BrowserView;
 import org.apache.directory.studio.ldifparser.LdifFormatParameters;
-import org.apache.directory.studio.ldifparser.model.container.LdifChangeModifyRecord;
+import org.apache.directory.studio.ldifparser.model.LdifFile;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.util.IPropertyChangeListener;
@@ -107,7 +107,7 @@
                     {
                         IEntry originalEntry = modifiedEntry.getBrowserConnection().getEntryFromCache(
                             modifiedEntry.getDn() );
-                        LdifChangeModifyRecord diff = Utils.computeDiff( originalEntry, modifiedEntry
);
+                        LdifFile diff = Utils.computeDiff( originalEntry, modifiedEntry );
                         if ( diff != null )
                         {
                             // save



Mime
View raw message