From 1d6d65acb2c39a39cb02454ddd3c31045b8dca04 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Tue, 25 Aug 2009 14:07:59 +0000
Subject: [PATCH] Put back the code that allows to append data when importing data.

---
 opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/ImportLDIFPanel.java |    9 +--------
 opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/NewBaseDNPanel.java  |   42 ++----------------------------------------
 2 files changed, 3 insertions(+), 48 deletions(-)

diff --git a/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/ImportLDIFPanel.java b/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/ImportLDIFPanel.java
index 15d4b6d..bb17888 100644
--- a/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/ImportLDIFPanel.java
+++ b/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/ImportLDIFPanel.java
@@ -288,12 +288,6 @@
     gbc.gridy ++;
     add(replaceEntries, gbc);
 
-//  TODO: change this once the append is supported by the import again.
-    lImportType.setVisible(false);
-    overwrite.setVisible(false);
-    append.setVisible(false);
-    replaceEntries.setVisible(false);
-
     gbc.gridx = 0;
     gbc.gridy ++;
     gbc.insets.left = 0;
@@ -715,8 +709,7 @@
       }
       if (append.isSelected())
       {
-        // TODO: change this once the append is supported again by the import.
-        //args.add("--append");
+        args.add("--append");
         if (replaceEntries.isSelected())
         {
           args.add("--replaceExisting");
diff --git a/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/NewBaseDNPanel.java b/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/NewBaseDNPanel.java
index c14dbd5..d3a3c29 100644
--- a/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/NewBaseDNPanel.java
+++ b/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/NewBaseDNPanel.java
@@ -111,7 +111,7 @@
 import org.opends.server.util.cli.CommandBuilder;
 
 /**
- * The clss that appears when the user clicks on 'New Base DN'.
+ * The class that appears when the user clicks on 'New Base DN'.
  *
  */
 public class NewBaseDNPanel extends StatusGenericPanel
@@ -625,11 +625,6 @@
       }
       if (errors.isEmpty())
       {
-        // TODO: delete this check
-        if (!continueToOverwriteBackend())
-        {
-          return;
-        }
         launchOperation(newTask,
             INFO_CTRL_PANEL_CREATING_BASE_DN_SUMMARY.get(dn),
             INFO_CTRL_PANEL_CREATING_BASE_DN_COMPLETE.get(),
@@ -650,38 +645,6 @@
     }
   }
 
-  /**
-   * TODO: once the append is supported in the import-ldif, delete this method.
-   * @return <CODE>true</CODE> if the user accepted to overwrite the backend
-   * contents and <CODE>false</CODE> otherwise.
-   */
-  private boolean continueToOverwriteBackend()
-  {
-    boolean userConfirmed = true;
-    if (!isNewBackend() && isServerRunning())
-    {
-      String backendName = getBackendName();
-      for (BackendDescriptor bck :
-        getInfo().getServerDescriptor().getBackends())
-      {
-        if (bck.getBackendID().equalsIgnoreCase(backendName))
-        {
-          if (bck.getEntries() > 0)
-          {
-            // Ask confirmation: append is not supported and we are going to
-            // overwrite the contents of the backend.
-            userConfirmed = displayConfirmationDialog(
-                INFO_CTRL_PANEL_CONFIRMATION_REQUIRED_SUMMARY.get(),
-                INFO_CTRL_PANEL_CONFIRMATION_IMPORT_LDIF_DETAILS.get(
-                    backendName));
-          }
-          break;
-        }
-      }
-    }
-    return userConfirmed;
-  }
-
   private String getBackendName()
   {
     Object backendName = backends.getSelectedItem();
@@ -866,8 +829,7 @@
           }
           args.add("--backendID");
           args.add(getBackendName());
-          // TODO: uncomment this line once import supports append again
-          // args.add("--append");
+          args.add("--append");
         }
         else
         {

--
Gitblit v1.10.0