mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
04.32.2008 e9b9dbd7edb77833789858b1844d7c26de0a8279
Fix for issue 3556 (Control panel : backup proposes  the same ID previouly used)

The proposed ID is renewed each time the window is reopened.
2 files modified
40 ■■■■ changed files
opends/src/guitools/org/opends/guitools/controlpanel/ui/BackupListPanel.java 2 ●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/controlpanel/ui/BackupPanel.java 38 ●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/controlpanel/ui/BackupListPanel.java
@@ -137,7 +137,7 @@
   * Whether the backup parent directory has been initialized with a value or
   * not.
   */
  protected boolean backupDirectoryInitialized;
  private boolean backupDirectoryInitialized;
  private static final Logger LOG =
    Logger.getLogger(RestorePanel.class.getName());
opends/src/guitools/org/opends/guitools/controlpanel/ui/BackupPanel.java
@@ -96,6 +96,8 @@
  private ChangeListener changeListener;
  private boolean backupIDInitialized = false;
  private static final Logger LOG =
    Logger.getLogger(BackupPanel.class.getName());
@@ -297,13 +299,6 @@
       */
      public void run()
      {
        if (!backupDirectoryInitialized)
        {
          SimpleDateFormat dateFormat = new SimpleDateFormat(
              ServerConstants.DATE_FORMAT_COMPACT_LOCAL_TIME);
          final String id = dateFormat.format(new Date());
          backupID.setText(id);
        }
        allBackends.setVisible(backends.getModel().getSize() > 0);
      }
    });
@@ -320,6 +315,7 @@
    setPrimaryValid(lBackend);
    setPrimaryValid(lPath);
    setPrimaryValid(lAvailableBackups);
    backupIDInitialized = false;
    final LinkedHashSet<Message> errors = new LinkedHashSet<Message>();
@@ -547,6 +543,34 @@
  }
  /**
   * {@inheritDoc}
   */
  public void toBeDisplayed(boolean visible)
  {
    super.toBeDisplayed(visible);
    if (visible && !backupIDInitialized)
    {
      initializeBackupID();
    }
    if (!visible)
    {
      backupIDInitialized = false;
    }
  }
  /**
   * Initialize the backup ID field with a value.
   *
   */
  private void initializeBackupID()
  {
    SimpleDateFormat dateFormat = new SimpleDateFormat(
        ServerConstants.DATE_FORMAT_COMPACT_LOCAL_TIME);
    final String id = dateFormat.format(new Date());
    backupID.setText(id);
  }
  /**
   * Class that launches the backup.
   *
   */