directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r604889 - in /directory/sandbox/felixk: studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/ studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchRequest/ studio-dsml-parser/src/test...
Date Mon, 17 Dec 2007 15:03:41 GMT
Author: felixk
Date: Mon Dec 17 07:03:35 2007
New Revision: 604889

URL: http://svn.apache.org/viewvc?rev=604889&view=rev
Log:
Some update from trunk

Removed:
    directory/sandbox/felixk/studio-dsml-parser/src/test/resources/org/apache/directory/studio/dsmlv2/searchRequest/request_with_subentries_control.xml
Modified:
    directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java
    directory/sandbox/felixk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchRequest/SearchRequestTest.java
    directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/Control.java
    directory/sandbox/felixk/studio-ldif-parser/src/main/java/org/apache/directory/studio/ldifparser/model/lines/LdifControlLine.java
    directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PluginConstants.java
    directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PreferenceInitializer.java
    directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizard.java
    directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizardPage.java
    directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizard.java
    directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizardPage.java
    directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizard.java
    directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizardPage.java
    directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizard.java
    directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizardPage.java
    directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizard.java
    directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizardPage.java
    directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java
    directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizardPage.java
    directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java
    directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizardPage.java

Modified: directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java
(original)
+++ directory/sandbox/felixk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java
Mon Dec 17 07:03:35 2007
@@ -57,10 +57,14 @@
 import org.apache.directory.studio.ldifparser.model.container.LdifChangeDeleteRecord;
 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.LdifChangeRecord;
 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.LdifChangeTypeLine;
 import org.apache.directory.studio.ldifparser.model.lines.LdifCommentLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifControlLine;
 import org.apache.directory.studio.ldifparser.model.lines.LdifDeloldrdnLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifDnLine;
 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;
@@ -70,8 +74,6 @@
 /**
  * The ModificationLogger is used to log modifications in LDIF format into a file.
  *
- * TODO: log controls
- *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
@@ -221,8 +223,9 @@
     {
         try
         {
-            LdifChangeAddRecord record = LdifChangeAddRecord.create( dn );
-            //record.addControl( controlLine );
+            LdifChangeAddRecord record = new LdifChangeAddRecord( LdifDnLine.create( dn )
);
+            addControlLines( record, controls );
+            record.setChangeType( LdifChangeTypeLine.createAdd() );
             NamingEnumeration<? extends Attribute> attributeEnumeration = attributes.getAll();
             while ( attributeEnumeration.hasMore() )
             {
@@ -259,8 +262,9 @@
     public void logChangetypeDelete( Connection connection, final String dn, final Control[]
controls,
         NamingException ex )
     {
-        LdifChangeDeleteRecord record = LdifChangeDeleteRecord.create( dn );
-        //record.addControl( controlLine );
+        LdifChangeDeleteRecord record = new LdifChangeDeleteRecord( LdifDnLine.create( dn
) );
+        addControlLines( record, controls );
+        record.setChangeType( LdifChangeTypeLine.createDelete() );
         record.finish( LdifSepLine.create() );
 
         String formattedString = record.toFormattedString( LdifFormatParameters.DEFAULT );
@@ -276,8 +280,9 @@
     {
         try
         {
-            LdifChangeModifyRecord record = LdifChangeModifyRecord.create( dn );
-            //record.addControl( controlLine );
+            LdifChangeModifyRecord record = new LdifChangeModifyRecord( LdifDnLine.create(
dn ) );
+            addControlLines( record, controls );
+            record.setChangeType( LdifChangeTypeLine.createModify() );
             for ( ModificationItem item : modificationItems )
             {
                 Attribute attribute = item.getAttribute();
@@ -337,8 +342,9 @@
             Rdn newrdn = dn.getRdn();
             LdapDN newsuperior = DnUtils.getParent( dn );
 
-            LdifChangeModDnRecord record = LdifChangeModDnRecord.create( oldDn );
-            //record.addControl( controlLine );
+            LdifChangeModDnRecord record = new LdifChangeModDnRecord( LdifDnLine.create(
oldDn ) );
+            addControlLines( record, controls );
+            record.setChangeType( LdifChangeTypeLine.createModDn() );
             record.setNewrdn( LdifNewrdnLine.create( newrdn.getUpName() ) );
             record.setDeloldrdn( deleteOldRdn ? LdifDeloldrdnLine.create1() : LdifDeloldrdnLine.create0()
);
             record.setNewsuperior( LdifNewsuperiorLine.create( newsuperior.getUpName() )
);
@@ -349,6 +355,28 @@
         }
         catch ( InvalidNameException e )
         {
+        }
+    }
+
+
+    /**
+     * Adds control lines to the record
+     *
+     * @param record the recored
+     * @param controls the controls
+     */
+    private static void addControlLines( LdifChangeRecord record, Control[] controls )
+    {
+        if ( controls != null )
+        {
+            for ( Control control : controls )
+            {
+                String oid = control.getID();
+                boolean isCritical = control.isCritical();
+                byte[] controlValue = control.getEncodedValue();
+                LdifControlLine controlLine = LdifControlLine.create( oid, isCritical, controlValue
);
+                record.addControl( controlLine );
+            }
         }
     }
 

Modified: directory/sandbox/felixk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchRequest/SearchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchRequest/SearchRequestTest.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchRequest/SearchRequestTest.java
(original)
+++ directory/sandbox/felixk/studio-dsml-parser/src/test/java/org/apache/directory/studio/dsmlv2/searchRequest/SearchRequestTest.java
Mon Dec 17 07:03:35 2007
@@ -2322,40 +2322,6 @@
 
 
     /**
-     * Test parsing of a request with a SubEntries Control
-     */
-    public void testRequestWithSubEntriesControl()
-    {
-        Dsmlv2Parser parser = null;
-        try
-        {
-            parser = new Dsmlv2Parser();
-
-            parser
-                .setInputFile( SearchRequestTest.class.getResource( "request_with_subentries_control.xml"
).getFile() );
-
-            parser.parse();
-        }
-        catch ( Exception e )
-        {
-            fail( e.getMessage() );
-        }
-
-        SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest();
-
-        assertEquals( 1, searchRequest.getControls().size() );
-
-        Control control = searchRequest.getCurrentControl();
-
-        assertTrue( control.getCriticality() );
-
-        assertEquals( "1.3.6.1.4.1.4203.1.10.1", control.getControlType() );
-
-        assertEquals( "Some text", StringTools.utf8ToString( ( byte[] ) control.getControlValue()
) );
-    }
-
-
-    /**
      * Test parsing of a request with a needed requestID attribute
      * 
      * DIRSTUDIO-1

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/Control.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/Control.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/Control.java
(original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/Control.java
Mon Dec 17 07:03:35 2007
@@ -157,7 +157,7 @@
             return "";
         }
 
-        LdifControlLine line = LdifControlLine.create( getOid(), isCritical() ? " true" :
" false", getControlValue() );
+        LdifControlLine line = LdifControlLine.create( getOid(), isCritical(), getControlValue()
);
         String s = line.toRawString();
         s = s.substring( line.getRawControlSpec().length(), s.length() );
         s = s.substring( line.getRawControlType().length(), s.length() );

Modified: directory/sandbox/felixk/studio-ldif-parser/src/main/java/org/apache/directory/studio/ldifparser/model/lines/LdifControlLine.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldif-parser/src/main/java/org/apache/directory/studio/ldifparser/model/lines/LdifControlLine.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldif-parser/src/main/java/org/apache/directory/studio/ldifparser/model/lines/LdifControlLine.java
(original)
+++ directory/sandbox/felixk/studio-ldif-parser/src/main/java/org/apache/directory/studio/ldifparser/model/lines/LdifControlLine.java
Mon Dec 17 07:03:35 2007
@@ -232,7 +232,7 @@
         {
             LdifControlLine controlLine = new LdifControlLine( 0, "control", ":", oid, criticality,
                 controlValue != null ? ":" : null, controlValue != null ? controlValue :
null,
-                    LdifParserConstants.LINE_SEPARATOR );
+                LdifParserConstants.LINE_SEPARATOR );
             return controlLine;
         }
     }
@@ -244,6 +244,18 @@
             && controlValue.length > 0 ? "::" : null, controlValue != null &&
controlValue.length > 0 ? LdifUtils
             .base64encode( controlValue ) : null, LdifParserConstants.LINE_SEPARATOR );
         return controlLine;
+    }
+
+
+    public static LdifControlLine create( String oid, boolean isCritical, String controlValue
)
+    {
+        return create( oid, isCritical ? " true" : " false", controlValue );
+    }
+
+
+    public static LdifControlLine create( String oid, boolean isCritical, byte[] controlValue
)
+    {
+        return create( oid, isCritical ? " true" : " false", controlValue );
     }
 
 }

Modified: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PluginConstants.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PluginConstants.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PluginConstants.java
(original)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PluginConstants.java
Mon Dec 17 07:03:35 2007
@@ -348,8 +348,28 @@
     public static final String PREFS_SEARCH_VIEW_SCHEMA_LABEL_DISPLAY = SearchViewPreferencePage.ID
         + ".schemaLabel.display"; //$NON-NLS-1$
 
+    // Contexts
     /** The Context for the SchemaView */
     public static final String CONTEXT_SCHEMA_VIEW = Activator.PLUGIN_ID + ".contexts.schemaView";
//$NON-NLS-1$
     /** The Context for the SchemaView */
     public static final String CONTEXT_PROJECTS_VIEW = Activator.PLUGIN_ID + ".contexts.projectsView";
//$NON-NLS-1$
+
+    // File Dialogs
+    /** The File Dialog path for 'Export Schema Projects' */
+    public static final String FILE_DIALOG_EXPORT_PROJECTS = Activator.PLUGIN_ID + ".fileDialog.exportProjects";
+    /** The File Dialog path for 'Export Schemas to OpenLDAP files' */
+    public static final String FILE_DIALOG_EXPORT_SCHEMAS_OPENLDAP = Activator.PLUGIN_ID
+        + ".fileDialog.exportSchemasOpenLDAP";
+    /** The File Dialog path for 'Export Schemas to XML files' */
+    public static final String FILE_DIALOG_EXPORT_SCHEMAS_XML = Activator.PLUGIN_ID + ".fileDialog.exportSchemasXML";
+    /** The File Dialog path for 'Export Schemas for Apache DS' */
+    public static final String FILE_DIALOG_EXPORT_SCHEMAS_APACHE_DS = Activator.PLUGIN_ID
+        + ".fileDialog.exportSchemasApacheDS";
+    /** The File Dialog path for 'Import Schema Projects' */
+    public static final String FILE_DIALOG_IMPORT_PROJECTS = Activator.PLUGIN_ID + ".fileDialog.importProjects";
+    /** The File Dialog path for 'Import Schemas from OpenLDAP files' */
+    public static final String FILE_DIALOG_IMPORT_SCHEMAS_OPENLDAP = Activator.PLUGIN_ID
+        + ".fileDialog.importSchemasOpenLDAP";
+    /** The File Dialog path for 'Import Schemas from XML files' */
+    public static final String FILE_DIALOG_IMPORT_SCHEMAS_XML = Activator.PLUGIN_ID + ".fileDialog.importSchemasXML";
 }

Modified: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PreferenceInitializer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PreferenceInitializer.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PreferenceInitializer.java
(original)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PreferenceInitializer.java
Mon Dec 17 07:03:35 2007
@@ -92,5 +92,14 @@
             PluginConstants.PREFS_SEARCH_VIEW_SORTING_BY_FIRSTNAME );
         store.setDefault( PluginConstants.PREFS_SEARCH_VIEW_SORTING_ORDER,
             PluginConstants.PREFS_SEARCH_VIEW_SORTING_ORDER_ASCENDING );
+
+        // File Dialogs
+        store.setDefault( PluginConstants.FILE_DIALOG_EXPORT_PROJECTS, System.getProperty(
"user.home" ) ); //$NON-NLS-1$
+        store.setDefault( PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_OPENLDAP, System.getProperty(
"user.home" ) ); //$NON-NLS-1$
+        store.setDefault( PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_XML, System.getProperty(
"user.home" ) ); //$NON-NLS-1$
+        store.setDefault( PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_APACHE_DS, System.getProperty(
"user.home" ) ); //$NON-NLS-1$
+        store.setDefault( PluginConstants.FILE_DIALOG_IMPORT_PROJECTS, System.getProperty(
"user.home" ) ); //$NON-NLS-1$
+        store.setDefault( PluginConstants.FILE_DIALOG_IMPORT_SCHEMAS_OPENLDAP, System.getProperty(
"user.home" ) ); //$NON-NLS-1$
+        store.setDefault( PluginConstants.FILE_DIALOG_IMPORT_SCHEMAS_XML, System.getProperty(
"user.home" ) ); //$NON-NLS-1$
     }
 }

Modified: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizard.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizard.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizard.java
(original)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizard.java
Mon Dec 17 07:03:35 2007
@@ -77,8 +77,11 @@
      */
     public boolean performFinish()
     {
-        final Project[] selectedProjects = page.getSelectedProjects();
+        // Saving the dialog settings
+        page.saveDialogSettings();
 
+        // Getting the projects to be exported and where to export them
+        final Project[] selectedProjects = page.getSelectedProjects();
         final String exportDirectory = page.getExportDirectory();
         try
         {

Modified: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizardPage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizardPage.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizardPage.java
(original)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizardPage.java
Mon Dec 17 07:03:35 2007
@@ -254,6 +254,15 @@
         DirectoryDialog dialog = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
);
         dialog.setText( "Choose Folder" );
         dialog.setMessage( "Select the folder in which export the files." );
+        if ( "".equals( exportDirectoryText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_EXPORT_PROJECTS ) );
+        }
+        else
+        {
+            dialog.setFilterPath( exportDirectoryText.getText() );
+        }
 
         String selectedDirectory = dialog.open();
         if ( selectedDirectory != null )
@@ -361,5 +370,15 @@
     public String getExportDirectory()
     {
         return exportDirectoryText.getText();
+    }
+
+
+    /**
+     * Saves the dialog settings.
+     */
+    public void saveDialogSettings()
+    {
+        Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_EXPORT_PROJECTS,
+            exportDirectoryText.getText() );
     }
 }

Modified: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizard.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizard.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizard.java
(original)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizard.java
Mon Dec 17 07:03:35 2007
@@ -74,8 +74,11 @@
      */
     public boolean performFinish()
     {
-        final Schema[] selectedSchemas = page.getSelectedSchemas();
+        // Saving the dialog settings
+        page.saveDialogSettings();
 
+        // Getting the schemas to be exported and where to export them
+        final Schema[] selectedSchemas = page.getSelectedSchemas();
         final String exportDirectory = page.getExportDirectory();
         try
         {

Modified: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizardPage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizardPage.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizardPage.java
(original)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizardPage.java
Mon Dec 17 07:03:35 2007
@@ -254,6 +254,15 @@
         DirectoryDialog dialog = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
);
         dialog.setText( "Choose Folder" );
         dialog.setMessage( "Select the folder in which export the files." );
+        if ( "".equals( exportDirectoryText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_OPENLDAP ) );
+        }
+        else
+        {
+            dialog.setFilterPath( exportDirectoryText.getText() );
+        }
 
         String selectedDirectory = dialog.open();
         if ( selectedDirectory != null )
@@ -361,5 +370,15 @@
     public String getExportDirectory()
     {
         return exportDirectoryText.getText();
+    }
+
+
+    /**
+     * Saves the dialog settings.
+     */
+    public void saveDialogSettings()
+    {
+        Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_OPENLDAP,
+            exportDirectoryText.getText() );
     }
 }

Modified: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizard.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizard.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizard.java
(original)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizard.java
Mon Dec 17 07:03:35 2007
@@ -74,8 +74,11 @@
      */
     public boolean performFinish()
     {
-        final Schema[] selectedSchemas = page.getSelectedSchemas();
+        // Saving the dialog settings
+        page.saveDialogSettings();
 
+        // Getting the schemas to be exported and where to export them
+        final Schema[] selectedSchemas = page.getSelectedSchemas();
         int exportType = page.getExportType();
         if ( exportType == ExportSchemasAsXmlWizardPage.EXPORT_MULTIPLE_FILES )
         {

Modified: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizardPage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizardPage.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizardPage.java
(original)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizardPage.java
Mon Dec 17 07:03:35 2007
@@ -353,6 +353,15 @@
         DirectoryDialog dialog = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
);
         dialog.setText( "Choose Folder" );
         dialog.setMessage( "Select the folder in which export the files." );
+        if ( "".equals( exportMultipleFilesText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_XML ) );
+        }
+        else
+        {
+            dialog.setFilterPath( exportMultipleFilesText.getText() );
+        }
 
         String selectedDirectory = dialog.open();
         if ( selectedDirectory != null )
@@ -373,7 +382,15 @@
             { "*.xml", "*" } );
         dialog.setFilterNames( new String[]
             { "XML Files", "All Files" } );
-        dialog.setFilterPath( exportSingleFileText.getText() );
+        if ( "".equals( exportSingleFileText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_XML ) );
+        }
+        else
+        {
+            dialog.setFilterPath( exportSingleFileText.getText() );
+        }
 
         String selectedFile = dialog.open();
         if ( selectedFile != null )
@@ -538,5 +555,23 @@
     public String getExportFile()
     {
         return exportSingleFileText.getText();
+    }
+
+
+    /**
+     * Saves the dialog settings.
+     */
+    public void saveDialogSettings()
+    {
+        if ( exportMultipleFilesRadio.getSelection() )
+        {
+            Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_XML,
+                exportMultipleFilesText.getText() );
+        }
+        else
+        {
+            Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_XML,
+                new File( exportSingleFileText.getText() ).getParent() );
+        }
     }
 }

Modified: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizard.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizard.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizard.java
(original)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizard.java
Mon Dec 17 07:03:35 2007
@@ -86,8 +86,11 @@
      */
     public boolean performFinish()
     {
-        final Schema[] selectedSchemas = page.getSelectedSchemas();
+        // Saving the dialog settings
+        page.saveDialogSettings();
 
+        // Getting the schemas to be exported and where to export them
+        final Schema[] selectedSchemas = page.getSelectedSchemas();
         int exportType = page.getExportType();
         if ( exportType == ExportSchemasAsXmlWizardPage.EXPORT_MULTIPLE_FILES )
         {

Modified: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizardPage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizardPage.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizardPage.java
(original)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizardPage.java
Mon Dec 17 07:03:35 2007
@@ -353,6 +353,15 @@
         DirectoryDialog dialog = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
);
         dialog.setText( "Choose Folder" );
         dialog.setMessage( "Select the folder in which export the files." );
+        if ( "".equals( exportMultipleFilesText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_APACHE_DS ) );
+        }
+        else
+        {
+            dialog.setFilterPath( exportMultipleFilesText.getText() );
+        }
 
         String selectedDirectory = dialog.open();
         if ( selectedDirectory != null )
@@ -373,7 +382,15 @@
             { "*.ldif", "*" } );
         dialog.setFilterNames( new String[]
             { "LDIF Files", "All Files" } );
-        dialog.setFilterPath( exportSingleFileText.getText() );
+        if ( "".equals( exportSingleFileText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_APACHE_DS ) );
+        }
+        else
+        {
+            dialog.setFilterPath( exportSingleFileText.getText() );
+        }
 
         String selectedFile = dialog.open();
         if ( selectedFile != null )
@@ -538,5 +555,23 @@
     public String getExportFile()
     {
         return exportSingleFileText.getText();
+    }
+
+
+    /**
+     * Saves the dialog settings.
+     */
+    public void saveDialogSettings()
+    {
+        if ( exportMultipleFilesRadio.getSelection() )
+        {
+            Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_APACHE_DS,
+                exportMultipleFilesText.getText() );
+        }
+        else
+        {
+            Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_APACHE_DS,
+                new File( exportSingleFileText.getText() ).getParent() );
+        }
     }
 }

Modified: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizard.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizard.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizard.java
(original)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizard.java
Mon Dec 17 07:03:35 2007
@@ -73,8 +73,11 @@
      */
     public boolean performFinish()
     {
-        final File[] selectedProjectFiles = page.getSelectedProjectFiles();
+        // Saving the dialog settings
+        page.saveDialogSettings();
 
+        // Getting the projects to be imported
+        final File[] selectedProjectFiles = page.getSelectedProjectFiles();
         try
         {
             getContainer().run( true, false, new IRunnableWithProgress()

Modified: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizardPage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizardPage.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizardPage.java
(original)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizardPage.java
Mon Dec 17 07:03:35 2007
@@ -219,6 +219,15 @@
         DirectoryDialog dialog = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
);
         dialog.setText( "Choose Folder" );
         dialog.setMessage( "Select the folder from which import the files." );
+        if ( "".equals( fromDirectoryText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_IMPORT_PROJECTS ) );
+        }
+        else
+        {
+            dialog.setFilterPath( fromDirectoryText.getText() );
+        }
 
         String selectedDirectory = dialog.open();
         if ( selectedDirectory != null )
@@ -331,4 +340,13 @@
         return schemaFiles.toArray( new File[0] );
     }
 
+
+    /**
+     * Saves the dialog settings.
+     */
+    public void saveDialogSettings()
+    {
+        Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_IMPORT_PROJECTS,
+            fromDirectoryText.getText() );
+    }
 }

Modified: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java
(original)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java
Mon Dec 17 07:03:35 2007
@@ -77,8 +77,11 @@
      */
     public boolean performFinish()
     {
-        final File[] selectedSchemasFiles = page.getSelectedSchemaFiles();
+        // Saving the dialog settings
+        page.saveDialogSettings();
 
+        // Getting the schemas to be imported
+        final File[] selectedSchemasFiles = page.getSelectedSchemaFiles();
         schemaChecker.disableModificationsListening();
 
         try

Modified: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizardPage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizardPage.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizardPage.java
(original)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizardPage.java
Mon Dec 17 07:03:35 2007
@@ -219,6 +219,15 @@
         DirectoryDialog dialog = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
);
         dialog.setText( "Choose Folder" );
         dialog.setMessage( "Select the folder from which import the files." );
+        if ( "".equals( fromDirectoryText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_IMPORT_SCHEMAS_OPENLDAP ) );
+        }
+        else
+        {
+            dialog.setFilterPath( fromDirectoryText.getText() );
+        }
 
         String selectedDirectory = dialog.open();
         if ( selectedDirectory != null )
@@ -260,7 +269,7 @@
      */
     private void dialogChanged()
     {
-        // Export Directory
+        // Import Directory
         String directory = fromDirectoryText.getText();
         if ( ( directory == null ) || ( directory.equals( "" ) ) )
         {
@@ -331,4 +340,13 @@
         return schemaFiles.toArray( new File[0] );
     }
 
+
+    /**
+     * Saves the dialog settings.
+     */
+    public void saveDialogSettings()
+    {
+        Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_IMPORT_SCHEMAS_OPENLDAP,
+            fromDirectoryText.getText() );
+    }
 }

Modified: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java
(original)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java
Mon Dec 17 07:03:35 2007
@@ -78,10 +78,12 @@
      */
     public boolean performFinish()
     {
-        final String[] selectedSchemasFiles = page.getSelectedSchemaFiles();
+        // Saving the dialog settings
+        page.saveDialogSettings();
 
+        // Getting the schemas to be imported
+        final String[] selectedSchemasFiles = page.getSelectedSchemaFiles();
         schemaChecker.disableModificationsListening();
-
         try
         {
             getContainer().run( true, false, new IRunnableWithProgress()

Modified: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizardPage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizardPage.java?rev=604889&r1=604888&r2=604889&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizardPage.java
(original)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizardPage.java
Mon Dec 17 07:03:35 2007
@@ -219,6 +219,15 @@
         DirectoryDialog dialog = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
);
         dialog.setText( "Choose Folder" );
         dialog.setMessage( "Select the folder from which import the files." );
+        if ( "".equals( fromDirectoryText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_IMPORT_SCHEMAS_XML ) );
+        }
+        else
+        {
+            dialog.setFilterPath( fromDirectoryText.getText() );
+        }
 
         String selectedDirectory = dialog.open();
         if ( selectedDirectory != null )
@@ -331,4 +340,13 @@
         return schemaFiles.toArray( new String[0] );
     }
 
+
+    /**
+     * Saves the dialog settings.
+     */
+    public void saveDialogSettings()
+    {
+        Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_IMPORT_SCHEMAS_XML,
+            fromDirectoryText.getText() );
+    }
 }



Mime
View raw message