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

jvergara
08.08.2010 672ab71e6a868a65f91df446da587481c8de64ea
Fix for issue 4466 (provide installer log location in the progress screen)
The user is notified of the existence of the log file at the beginning of the 'Details' area in the progress dialog.
If an error occurs, the log file is also referenced: the user is asked to provide the log file if (s)he intends to report the error.
6 files modified
72 ■■■■■ changed files
opends/src/messages/messages/quicksetup.properties 2 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/Application.java 15 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/installer/offline/OfflineInstaller.java 12 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/installer/webstart/WebStartInstaller.java 11 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/upgrader/Reverter.java 10 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java 22 ●●●● patch | view | raw | blame | history
opends/src/messages/messages/quicksetup.properties
@@ -516,6 +516,8 @@
INFO_GENERAL_LOADING=Loading...
INFO_GENERAL_NONE=None
INFO_GENERAL_SEE_FOR_DETAILS=See %s for a detailed log of this operation.
INFO_GENERAL_PROVIDE_LOG_IN_ERROR=If you want to report this error, provide \
 the contents of file %s
INFO_GENERAL_SEE_FOR_HISTORY=See %s for a detailed installation history.
INFO_GENERAL_SERVER_STARTED=started
INFO_GENERAL_SERVER_STOPPED=stopped
opends/src/quicksetup/org/opends/quicksetup/Application.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 */
package org.opends.quicksetup;
@@ -688,6 +688,19 @@
  }
  /**
   * Conditionally notifies listeners of the log file if it
   * has been initialized.
   */
  protected void notifyListenersOfLogAfterError() {
    File logFile = QuickSetupLog.getLogFile();
    if (logFile != null) {
      notifyListeners(getFormattedProgress(
          INFO_GENERAL_PROVIDE_LOG_IN_ERROR.get(logFile.getPath())));
      notifyListeners(getLineBreak());
    }
  }
  /**
   * Writes an initial record in the installation's historical
   * log describing moving from one version to another.
   * @param fromVersion from with install will be migrated
opends/src/quicksetup/org/opends/quicksetup/installer/offline/OfflineInstaller.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 */
package org.opends.quicksetup.installer.offline;
@@ -99,6 +99,10 @@
      checkAbort();
      setCurrentProgressStep(InstallProgressStep.CONFIGURING_SERVER);
      notifyListenersOfLog();
      notifyListeners(getLineBreak());
      configureServer();
      checkAbort();
@@ -219,8 +223,6 @@
      checkAbort();
      updateSummaryWithServerState(hmSummary);
      notifyListeners(getLineBreak());
      notifyListenersOfLog();
      setCurrentProgressStep(InstallProgressStep.FINISHED_SUCCESSFULLY);
      notifyListeners(null);
@@ -257,7 +259,7 @@
        notifyListeners(html);
        LOG.log(Level.SEVERE, "Error installing.", ex);
        notifyListeners(getLineBreak());
        notifyListenersOfLog();
        notifyListenersOfLogAfterError();
      }
      runError = ex;
    }
@@ -291,7 +293,7 @@
      notifyListeners(msg);
      LOG.log(Level.SEVERE, "Error installing.", t);
      notifyListeners(getLineBreak());
      notifyListenersOfLog();
      notifyListenersOfLogAfterError();
      runError = ex;
    }
    finally
opends/src/quicksetup/org/opends/quicksetup/installer/webstart/WebStartInstaller.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 */
package org.opends.quicksetup.installer.webstart;
@@ -113,6 +113,9 @@
      setCurrentProgressStep(InstallProgressStep.DOWNLOADING);
      notifyListenersOfLog();
      notifyListeners(getLineBreak());
      checkAbort();
      InputStream in =
@@ -262,8 +265,6 @@
      checkAbort();
      updateSummaryWithServerState(hmSummary);
      notifyListeners(getLineBreak());
      notifyListenersOfLog();
      setCurrentProgressStep(InstallProgressStep.FINISHED_SUCCESSFULLY);
      notifyListeners(null);
@@ -300,7 +301,7 @@
        notifyListeners(html);
        LOG.log(Level.SEVERE, "Error installing.", ex);
        notifyListeners(getLineBreak());
        notifyListenersOfLog();
        notifyListenersOfLogAfterError();
      }
    }
    catch (Throwable t)
@@ -324,7 +325,7 @@
      notifyListeners(msg);
      LOG.log(Level.SEVERE, "Error installing.", t);
      notifyListeners(getLineBreak());
      notifyListenersOfLog();
      notifyListenersOfLogAfterError();
    }
    System.setErr(origErr);
    System.setOut(origOut);
opends/src/quicksetup/org/opends/quicksetup/upgrader/Reverter.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2007-2009 Sun Microsystems, Inc.
 *      Copyright 2007-2010 Sun Microsystems, Inc.
 */
package org.opends.quicksetup.upgrader;
@@ -827,11 +827,9 @@
      notifyListeners(getFormattedDoneWithLineBreak());
      LOG.log(Level.INFO, "History recorded");
      notifyListeners(
              new MessageBuilder(
                INFO_GENERAL_SEE_FOR_HISTORY.get(
                     Utils.getPath(getInstallation().getHistoryLogFile())))
              .append(getLineBreak()).toMessage());
      notifyListeners(getFormattedProgress(INFO_GENERAL_SEE_FOR_HISTORY.get(
          Utils.getPath(getInstallation().getHistoryLogFile()))));
      notifyListeners(formatter.getLineBreak());
      try {
        Stage stage = getStage();
opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2007-2009 Sun Microsystems, Inc.
 *      Copyright 2007-2010 Sun Microsystems, Inc.
 */
package org.opends.quicksetup.upgrader;
@@ -35,7 +35,6 @@
import org.opends.admin.ads.ADSContext;
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import org.opends.quicksetup.ReturnCode;
import org.opends.quicksetup.WizardStep;
@@ -772,11 +771,15 @@
    // for some reason
    runError = null;
    notifyListenersOfLog();
    notifyListeners(getLineBreak());
    try {
      if (Utils.isWebStart()) {
        ZipExtractor extractor;
        setCurrentProgressStep(UpgradeProgressStep.DOWNLOADING);
        try {
          LOG.log(Level.INFO, "Waiting for Java Web Start jar download");
          waitForLoader(UpgradeProgressStep.EXTRACTING.getProgress());
@@ -1392,12 +1395,9 @@
                note);
        notifyListeners(getFormattedDoneWithLineBreak());
        LOG.log(Level.INFO, "history recorded");
        notifyListeners(
                new MessageBuilder().append(
                  INFO_GENERAL_SEE_FOR_HISTORY.get(
                    Utils.getPath(getInstallation().getHistoryLogFile())))
                .append(formatter.getLineBreak())
                .toMessage());
        notifyListeners(getFormattedProgress(INFO_GENERAL_SEE_FOR_HISTORY.get(
            Utils.getPath(getInstallation().getHistoryLogFile()))));
        notifyListeners(formatter.getLineBreak());
        try {
          Stage stage = getStage();
@@ -1441,7 +1441,6 @@
      if (abort) {
        LOG.log(Level.INFO, "upgrade canceled by user");
        if (!Utils.isCli()) {
          notifyListenersOfLog();
          this.currentProgressStep = UpgradeProgressStep.FINISHED_CANCELED;
          notifyListeners(null);
        } else {
@@ -1451,7 +1450,7 @@
      } else if (runError != null) {
        LOG.log(Level.INFO, "upgrade completed with errors", runError);
        if (!Utils.isCli()) {
          notifyListenersOfLog();
          notifyListenersOfLogAfterError();
          this.currentProgressStep = UpgradeProgressStep.FINISHED_WITH_ERRORS;
        } else {
          setCurrentProgressStep(UpgradeProgressStep.FINISHED_WITH_ERRORS);
@@ -1465,7 +1464,7 @@
        // as errors.  Warning markup is used surrounding the main message
        // at the end of progress.
        if (!Utils.isCli()) {
          notifyListenersOfLog();
          notifyListenersOfLogAfterError();
          this.currentProgressStep = UpgradeProgressStep.FINISHED_WITH_WARNINGS;
          notifyListeners(getFormattedError(warningText, true));
        } else {
@@ -1478,7 +1477,6 @@
      } else {
        LOG.log(Level.INFO, "upgrade completed successfully");
        if (!Utils.isCli()) {
          notifyListenersOfLog();
          this.currentProgressStep = UpgradeProgressStep.FINISHED;
          notifyListeners(null);
        } else {