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

kenneth_suter
18.01.2007 776abd81a05b07b5e13ab16a614a966e522dbc1c
Made minor fix and improved messages for errors when the user lacks the proper file system access permissions to use the upgrade tool.  Also updated the text on the Welcome page to reflect removal of the build browsing capability.
5 files modified
71 ■■■■■ changed files
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Installation.java 25 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/resources/Resources.properties 21 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/BuildExtractor.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java 6 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/WelcomePanel.java 18 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Installation.java
@@ -230,17 +230,22 @@
      failureReason = "does not exist";
    } else {
      String[] children = rootDirectory.list();
      Set<String> childrenSet = new HashSet<String>(Arrays.asList(children));
      String[] dirsToCheck = new String[] {
              CONFIG_PATH_RELATIVE,
              DATABASES_PATH_RELATIVE,
              LIBRARIES_PATH_RELATIVE,
              // perhaps we should check more
      };
      for (String dir : dirsToCheck) {
        if (!childrenSet.contains(dir)) {
          failureReason = "does not contain directory '" + dir + "'";
      if (children != null) {
        Set<String> childrenSet = new HashSet<String>(Arrays.asList(children));
        String[] dirsToCheck = new String[] {
                CONFIG_PATH_RELATIVE,
                DATABASES_PATH_RELATIVE,
                LIBRARIES_PATH_RELATIVE,
                // perhaps we should check more
        };
        for (String dir : dirsToCheck) {
          if (!childrenSet.contains(dir)) {
            failureReason = "does not contain directory '" + dir + "'";
          }
        }
      } else {
        failureReason = "is empty or you lack permissions " +
                "to access this directory";
      }
    }
    if (failureReason != null) {
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/resources/Resources.properties
@@ -968,29 +968,20 @@
# have to modify it or not: if the server uses the locale of the browser to display
# a language there is no translation to be done but if we have specific URL for
# each language the URL must be localized.
upgrade-welcome-panel-offline-instructions=The OpenDS QuickUpgrade tool will upgrade \
  an existing build in place.<br><br>You will be prompted to choose among a list \
  of available builds to which you can upgrade or you can specify an install \
  package (.zip) file that you have already downloaded.  You can also use this tool to upgrade to a build \
  whose install package you have already downloaded manually.<br><br> \
  Additional information on this tool is available on the <a href="https://www.opends.org/wiki/"> \
  OpenDS documentation wiki</a>.<br><br>\
  <b><i>Note:</i></b> the upgrade tool will need to stop and start the OpenDS server
upgrade-welcome-panel-webstart-instructions=The OpenDS QuickUpgrade tool will upgrade \
  an existing build in place.<br><br>You will be prompted to choose among a list \
  of available builds to which you can upgrade or you can specify an install\
  package (.zip) file that you have already downloaded.  You can also use this tool to upgrade to a build \
  whose install package you have already downloaded manually.<br><br> \
  an existing build in place.<br><br>This instance of QuickUpgrade will upgrade the \
  server you specify below to the following OpenDS build: {0} (Build ID: {1}) .<br><br> \
  Additional information on this tool is available on the <a href="https://www.opends.org/wiki/"> \
  OpenDS documentation wiki</a>.<br><br>\
  <b><i>Note:</i></b> the upgrade tool will need to stop and start the OpenDS server
  <b>Note:</b> The upgrade tool will need to stop and start the OpenDS server
upgrade-location-label=Server to Upgrade:
upgrade-location-tooltip=File system location of the build that will be upgraded
upgrade-build-id-label=Build Version:
upgrade-build-id-tooltip=The ID of the build version installed in the above location
upgrade-build-id-unknown=Unknown
error-invalid-server-location=Invalid Directory Selected\nThe selected directory \
  {0} is not a valid OpenDS root installation directory.
error-invalid-server-location=Invalid Directory Selected: {0}\n\
  Either the selected directory is not a valid OpenDS root installation\n\
  directory or you do not have access permissions for this directory.
#
# Upgrader Choose Version Panel
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/BuildExtractor.java
@@ -114,6 +114,7 @@
      }
    } catch (Throwable t) {
      LOG.log(Level.INFO, "unexpected error extracting build", t);
      System.err.println("Failed to extract build: " + t.getLocalizedMessage());
      retCode = 1;
    }
    LOG.log(Level.INFO, "extractor exiting code=" + retCode);
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
@@ -1272,7 +1272,7 @@
      id = log.append(fromVersion, toVersion,
              HistoricalRecord.Status.STARTED, null);
    } catch (IOException e) {
      String msg = "IO Error logging operation: " + e.getLocalizedMessage();
      String msg = "I/O Error logging operation: " + e.getLocalizedMessage();
      throw ApplicationException.createFileSystemException(
              msg, e);
    }
@@ -1519,7 +1519,9 @@
                "Directory '" + getStageDirectory() +
                        "' does not contain a staged installation of OpenDS" +
                        " as was expected.  Verify that the new installation" +
                        " package (.zip) is an OpenDS installation file", null);
                        " package (.zip) is an OpenDS installation file and" +
                        " that you have write access permission for this " +
                        " directory.", null);
      }
    }
    return stagedInstallation;
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/WelcomePanel.java
@@ -33,11 +33,11 @@
import org.opends.quicksetup.UserData;
import org.opends.quicksetup.event.BrowseActionListener;
import org.opends.quicksetup.upgrader.Upgrader;
import org.opends.server.util.DynamicConstants;
import javax.swing.*;
import javax.swing.text.JTextComponent;
import java.awt.*;
import java.util.ArrayList;
/**
 * This panel is used to show a welcome message.  If this is the WebStart,
@@ -94,18 +94,10 @@
     * We can use org.opends.server.util.DynamicConstants without problems as it
     * has been added to quicksetup.jar during build time.
     */
    java.util.List<String> args = new ArrayList<String>();
    String msgKey;
    if (Utils.isWebStart()) {
      msgKey = "upgrade-welcome-panel-webstart-instructions";
      String cmd = Utils.isWindows() ? Installation.WINDOWS_UPGRADE_FILE_NAME :
              Installation.UNIX_UPGRADE_FILE_NAME;
      args.add(UIFactory.applyFontToHtml(cmd,
              UIFactory.INSTRUCTIONS_MONOSPACE_FONT));
    } else {
      msgKey = "upgrade-welcome-panel-offline-instructions";
    }
    return getMsg(msgKey, args.toArray(new String[0]));
    return getMsg("upgrade-welcome-panel-webstart-instructions",
            new String[] {
                    DynamicConstants.COMPACT_VERSION_STRING,
                    DynamicConstants.BUILD_ID});
  }
  /**