directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1212563 - in /directory/studio/trunk/plugins: ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/ ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/ ldapbrowser.cor...
Date Fri, 09 Dec 2011 18:26:32 GMT
Author: pamarcelot
Date: Fri Dec  9 18:26:31 2011
New Revision: 1212563

URL: http://svn.apache.org/viewvc?rev=1212563&view=rev
Log:
Fix for DIRSTUDIO-692 (User should be able to supress the version line in exported LDIF files).

Modified:
    directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/TextFormatsPreferencePage.java
    directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/messages.properties
    directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/messages_de.properties
    directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/messages_fr.properties
    directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java
    directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePreferencesInitializer.java
    directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifRunnable.java

Modified: directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/TextFormatsPreferencePage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/TextFormatsPreferencePage.java?rev=1212563&r1=1212562&r2=1212563&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/TextFormatsPreferencePage.java
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/TextFormatsPreferencePage.java
Fri Dec  9 18:26:31 2011
@@ -94,6 +94,8 @@ public class TextFormatsPreferencePage e
 
     private Button ldifSpaceAfterColonButton;
 
+    private Button includeVersionLineButton;
+
     private LineSeparatorInput ldifLineSeparator;
 
     private OptionsInput tableAttributeDelimiterWidget;
@@ -429,6 +431,11 @@ public class TextFormatsPreferencePage e
         ldifSpaceAfterColonButton.setSelection( coreStore
             .getBoolean( BrowserCoreConstants.PREFERENCE_LDIF_SPACE_AFTER_COLON ) );
 
+        includeVersionLineButton = BaseWidgetUtils.createCheckbox( ldifInnerComposite, Messages
+            .getString( "TextFormatsPreferencePage.IncludeVersionLine" ), 1 ); //$NON-NLS-1$
+        includeVersionLineButton.setSelection( coreStore
+            .getBoolean( BrowserCoreConstants.PREFERENCE_LDIF_INCLUDE_VERSION_LINE ) );
+
         ldifTab.setControl( ldifComposite );
     }
 
@@ -442,6 +449,8 @@ public class TextFormatsPreferencePage e
         coreStore.setValue( BrowserCoreConstants.PREFERENCE_LDIF_LINE_SEPARATOR, ldifLineSeparator.getRawValue()
);
         coreStore.setValue( BrowserCoreConstants.PREFERENCE_LDIF_SPACE_AFTER_COLON, ldifSpaceAfterColonButton
             .getSelection() );
+        coreStore.setValue( BrowserCoreConstants.PREFERENCE_LDIF_INCLUDE_VERSION_LINE, includeVersionLineButton
+            .getSelection() );
         BrowserCorePlugin.getDefault().savePluginPreferences();
 
         coreStore.setValue( BrowserCoreConstants.PREFERENCE_FORMAT_CSV_ATTRIBUTEDELIMITER,
csvAttributeDelimiterWidget
@@ -486,6 +495,8 @@ public class TextFormatsPreferencePage e
             .setRawValue( coreStore.getDefaultString( BrowserCoreConstants.PREFERENCE_LDIF_LINE_SEPARATOR
) );
         ldifSpaceAfterColonButton.setSelection( coreStore
             .getDefaultBoolean( BrowserCoreConstants.PREFERENCE_LDIF_SPACE_AFTER_COLON )
);
+        includeVersionLineButton.setSelection( coreStore
+            .getDefaultBoolean( BrowserCoreConstants.PREFERENCE_LDIF_INCLUDE_VERSION_LINE
) );
 
         csvAttributeDelimiterWidget.setRawValue( coreStore
             .getDefaultString( BrowserCoreConstants.PREFERENCE_FORMAT_CSV_ATTRIBUTEDELIMITER
) );

Modified: directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/messages.properties?rev=1212563&r1=1212562&r2=1212563&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/messages.properties
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/messages.properties
Fri Dec  9 18:26:31 2011
@@ -86,6 +86,7 @@ TextFormatsPreferencePage.ExcelExport=Ex
 TextFormatsPreferencePage.ExcelExportLabel=Select Excel export file format options:
 TextFormatsPreferencePage.OdfExport=ODF Export
 TextFormatsPreferencePage.OdfExportLabel=Select ODF export file format options:
+TextFormatsPreferencePage.IncludeVersionLine=Include version line
 TextFormatsPreferencePage.LDIF=LDIF
 TextFormatsPreferencePage.LDIFLabel=Select LDIF format options:
 TextFormatsPreferencePage.LineLength1=Line length:

Modified: directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/messages_de.properties?rev=1212563&r1=1212562&r2=1212563&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/messages_de.properties
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/messages_de.properties
Fri Dec  9 18:26:31 2011
@@ -86,6 +86,7 @@ TextFormatsPreferencePage.ExcelExport=Ex
 TextFormatsPreferencePage.ExcelExportLabel=Excel Exportformat:
 TextFormatsPreferencePage.OdfExport=ODF Export
 TextFormatsPreferencePage.OdfExportLabel=ODF Exportformat:
+TextFormatsPreferencePage.IncludeVersionLine=TODO:Include version line
 TextFormatsPreferencePage.LDIF=LDIF
 TextFormatsPreferencePage.LDIFLabel=LDIF Format:
 TextFormatsPreferencePage.LineLength1=Zeilenl\u00E4nge:

Modified: directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/messages_fr.properties?rev=1212563&r1=1212562&r2=1212563&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/messages_fr.properties
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/messages_fr.properties
Fri Dec  9 18:26:31 2011
@@ -86,6 +86,7 @@ TextFormatsPreferencePage.ExcelExport=Ex
 TextFormatsPreferencePage.ExcelExportLabel=S\u00E9lectionner les options de format pour l'export
vers un fichier Excel:
 TextFormatsPreferencePage.OdfExport=Export ODF
 TextFormatsPreferencePage.OdfExportLabel=S\u00E9lectionner les options de format pour l'export
vers un fichier ODF:
+TextFormatsPreferencePage.IncludeVersionLine=Include la ligne de version
 TextFormatsPreferencePage.LDIF=LDIF
 TextFormatsPreferencePage.LDIFLabel=S\u00E9lectionner les options de format pour LDIF:
 TextFormatsPreferencePage.LineLength1=Longueur de ligne:

Modified: directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java?rev=1212563&r1=1212562&r2=1212563&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java
Fri Dec  9 18:26:31 2011
@@ -84,6 +84,8 @@ public final class BrowserCoreConstants
     public static final String PREFERENCE_LDIF_LINE_SEPARATOR = "ldifLineSeparator"; //$NON-NLS-1$
 
     public static final String PREFERENCE_LDIF_SPACE_AFTER_COLON = "ldifSpaceAfterColon";
//$NON-NLS-1$
+    
+    public static final String PREFERENCE_LDIF_INCLUDE_VERSION_LINE = "ldifIncludeVersionLine";
//$NON-NLS-1$
 
     public static final int BINARYENCODING_IGNORE = 0;
 

Modified: directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePreferencesInitializer.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePreferencesInitializer.java?rev=1212563&r1=1212562&r2=1212563&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePreferencesInitializer.java
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePreferencesInitializer.java
Fri Dec  9 18:26:31 2011
@@ -63,6 +63,7 @@ public class BrowserCorePreferencesIniti
         store.setDefault( BrowserCoreConstants.PREFERENCE_LDIF_LINE_WIDTH, 76 );
         store.setDefault( BrowserCoreConstants.PREFERENCE_LDIF_LINE_SEPARATOR, BrowserCoreConstants.LINE_SEPARATOR
);
         store.setDefault( BrowserCoreConstants.PREFERENCE_LDIF_SPACE_AFTER_COLON, true );
+        store.setDefault( BrowserCoreConstants.PREFERENCE_LDIF_INCLUDE_VERSION_LINE, true
);
 
         // default binary attributes
         BinaryAttribute[] defaultBinaryAttributes = new BinaryAttribute[]

Modified: directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifRunnable.java?rev=1212563&r1=1212562&r2=1212563&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifRunnable.java
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifRunnable.java
Fri Dec  9 18:26:31 2011
@@ -44,7 +44,9 @@ import org.apache.directory.studio.conne
 import org.apache.directory.studio.connection.core.StudioPagedResultsControl;
 import org.apache.directory.studio.connection.core.io.StudioNamingEnumeration;
 import org.apache.directory.studio.connection.core.jobs.StudioConnectionRunnableWithProgress;
+import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
+import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry;
@@ -174,12 +176,16 @@ public class ExportLdifRunnable implemen
             LdifFormatParameters ldifFormatParameters = Utils.getLdifFormatParameters();
 
             // add version spec
-            LdifVersionLine ldifVersionLine = LdifVersionLine.create();
-            String ldifVersionLineString = ldifVersionLine.toFormattedString( ldifFormatParameters
);
-            bufferedWriter.write( ldifVersionLineString );
-            LdifSepLine ldifSepLine = LdifSepLine.create();
-            String ldifSepLineString = ldifSepLine.toFormattedString( ldifFormatParameters
);
-            bufferedWriter.write( ldifSepLineString );
+            if ( BrowserCorePlugin.getDefault().getPluginPreferences()
+                .getBoolean( BrowserCoreConstants.PREFERENCE_LDIF_INCLUDE_VERSION_LINE )
)
+            {
+                LdifVersionLine ldifVersionLine = LdifVersionLine.create();
+                String ldifVersionLineString = ldifVersionLine.toFormattedString( ldifFormatParameters
);
+                bufferedWriter.write( ldifVersionLineString );
+                LdifSepLine ldifSepLine = LdifSepLine.create();
+                String ldifSepLineString = ldifSepLine.toFormattedString( ldifFormatParameters
);
+                bufferedWriter.write( ldifSepLineString );
+            }
 
             // add the records
             while ( !monitor.isCanceled() && !monitor.errorsReported() &&
enumeration.hasNext() )



Mime
View raw message