From 9137379e14442d2790e946b67618d6424b6d93b0 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Thu, 07 Jun 2007 17:31:48 +0000
Subject: [PATCH] This commit:
---
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Status.java | 2
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/QuickSetupLog.java | 1
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/QuickSetupStepPanel.java | 5
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java | 2
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Configuration.java | 8
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Constants.java | 41 ++--
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/PlainTextProgressMessageFormatter.java | 14 -
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/RemoteBuildManager.java | 4
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/UserData.java | 4
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeLauncher.java | 4
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/HtmlProgressMessageFormatter.java | 66 ++++---
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/ChooseVersionPanel.java | 23 +-
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/resources/Resources.properties | 55 +++++
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java | 45 ++--
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/GuiUserInteraction.java | 21 +
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/BuildListDownloadErrorPanel.java | 47 +----
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Launcher.java | 6
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/SplashScreen.java | 3
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java | 10
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CliApplicationHelper.java | 4
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/SecurityOptions.java | 2
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/BuildExtractor.java | 11
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/WebProxyDialog.java | 34 ++-
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Build.java | 6
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgraderCliHelper.java | 13
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/FileManager.java | 2
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/HistoricalRecord.java | 28 +-
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java | 7
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/QuickSetupCli.java | 8
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/uninstaller/UninstallCliHelper.java | 6
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Installation.java | 41 ++-
31 files changed, 295 insertions(+), 228 deletions(-)
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CliApplicationHelper.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CliApplicationHelper.java
index 8f93f44..0890ab6 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CliApplicationHelper.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CliApplicationHelper.java
@@ -218,7 +218,7 @@
if (errors.size() > 0)
{
String msg = Utils.getStringFromCollection(errors,
- QuickSetupCli.LINE_SEPARATOR+QuickSetupCli.LINE_SEPARATOR);
+ Constants.LINE_SEPARATOR+Constants.LINE_SEPARATOR);
throw new UserDataException(null, msg);
}
}
@@ -307,7 +307,7 @@
* @param args String[] args
* @return String message
*/
- protected static String getMsg(String key, String[] args)
+ protected static String getMsg(String key, String... args)
{
return org.opends.server.util.StaticUtils.wrapText(
getI18n().getMsg(key, args), Utils.getCommandLineMaxLineWidth());
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Configuration.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Configuration.java
index 7442f3d..ceca3d5 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Configuration.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Configuration.java
@@ -118,8 +118,7 @@
int index1 = getContents().indexOf(attrWithPoints, index);
if (index1 != -1) {
int index2 =
- getContents().indexOf(
- System.getProperty("line.separator"), index1);
+ getContents().indexOf(Constants.LINE_SEPARATOR, index1);
if (index2 != -1) {
String sPort =
getContents().substring(attrWithPoints.length() +
@@ -184,7 +183,7 @@
String line;
// We do not care about encoding: we are just interested in the ports
while ((line = in.readLine()) != null) {
- buf.append(line).append(System.getProperty("line.separator"));
+ buf.append(line).append(Constants.LINE_SEPARATOR);
}
reader.close();
contents = buf.toString().toLowerCase();
@@ -197,8 +196,7 @@
attrName += ":";
int index1 = getContents().indexOf(attrName);
while (index1 != -1) {
- int index2 = getContents().indexOf(
- System.getProperty("line.separator"), index1);
+ int index2 = getContents().indexOf(Constants.LINE_SEPARATOR, index1);
String value;
if (index2 > (index1 + attrName.length())) {
value = getContents().substring(attrName.length() + index1,
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/DefaultDataOptions.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Constants.java
similarity index 60%
rename from opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/DefaultDataOptions.java
rename to opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Constants.java
index cfd094c..0b31cf4 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/DefaultDataOptions.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Constants.java
@@ -22,35 +22,30 @@
* CDDL HEADER END
*
*
- * Portions Copyright 2006-2007 Sun Microsystems, Inc.
+ * Portions Copyright 2007 Sun Microsystems, Inc.
*/
package org.opends.quicksetup;
/**
- * This class is just used to specify which are the default values that will be
- * proposed to the user in the Data Options panel of the Installation wizard.
- *
+ * Defines common constants.
*/
-class DefaultDataOptions extends DataOptions
-{
- /**
- * Default constructor.
- *
- */
- public DefaultDataOptions()
- {
- super(Type.CREATE_BASE_ENTRY, "dc=example,dc=com");
- }
+public class Constants {
- /**
- * Get the number of entries that will be automatically generated.
- *
- * @return the number of entries that will be automatically generated.
- */
- public int getNumberEntries()
- {
- return 2000;
- }
+ /** Platform appropriate line separator. */
+ static public final String LINE_SEPARATOR =
+ System.getProperty("line.separator");
+
+ /** HTML line break tag. */
+ public static final String HTML_LINE_BREAK = "<br>";
+
+ /** HTML bold open tag. */
+ public static final String HTML_BOLD_OPEN = "<b>";
+
+ /** HTML bold close tag. */
+ public static final String HTML_BOLD_CLOSE = "</b>";
+
+ /** Default dynamic name of directory manager. */
+ public static final String DIRECTORY_MANAGER_DN = "cn=Directory Manager";
}
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java
index d2c6ad2..220c7f5 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java
@@ -356,8 +356,7 @@
if (index1 != -1)
{
int index2 =
- getConfigFileContents().indexOf(
- System.getProperty("line.separator"), index1);
+ getConfigFileContents().indexOf(Constants.LINE_SEPARATOR, index1);
if (index2 != -1)
{
String sPort =
@@ -436,7 +435,7 @@
// We do not care about encoding: we are just interested in the ports
while ((line = in.readLine()) != null)
{
- buf.append(line + System.getProperty("line.separator"));
+ buf.append(line).append(Constants.LINE_SEPARATOR);
}
reader.close();
} catch (IOException ioe)
@@ -473,7 +472,7 @@
while (index1 != -1)
{
int index2 = getConfigFileContents().indexOf(
- System.getProperty("line.separator"), index1);
+ Constants.LINE_SEPARATOR, index1);
String value;
if (index2 > (index1 + attrName.length()))
{
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Installation.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Installation.java
index eab83f5..c49c92d 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Installation.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Installation.java
@@ -36,6 +36,7 @@
import java.util.concurrent.ExecutionException;
import org.opends.quicksetup.util.Utils;
+import org.opends.quicksetup.i18n.ResourceProvider;
/**
* This class represents the physical state of an OpenDS installation.
@@ -216,18 +217,21 @@
* an actual OpenDS installation.
* @param rootDirectory File directory candidate
* @throws IllegalArgumentException if root directory does not appear to
- * be an OpenDS installation root.
+ * be an OpenDS installation root. The thrown exception contains
+ * a localized message indicating the reason why
+ * <code>rootDirectory</code> is not a valid OpenDS install root.
*/
static public void validateRootDirectory(File rootDirectory)
throws IllegalArgumentException {
- // TODO: i18n
String failureReason = null;
if (rootDirectory == null) {
- failureReason = "root directory is null";
+ failureReason = getMsg("error-install-root-dir-null");
} else if (!rootDirectory.exists()) {
- failureReason = "is not a directory";
+ failureReason = getMsg("error-install-root-dir-no-exist",
+ Utils.getPath(rootDirectory));
} else if (!rootDirectory.isDirectory()) {
- failureReason = "does not exist";
+ failureReason = getMsg("error-install-root-dir-not-dir",
+ Utils.getPath(rootDirectory));
} else {
String[] children = rootDirectory.list();
if (children != null) {
@@ -240,19 +244,17 @@
};
for (String dir : dirsToCheck) {
if (!childrenSet.contains(dir)) {
- failureReason = "does not contain directory '" + dir + "'";
+ failureReason = getMsg("error-install-root-dir-no-dir",
+ Utils.getPath(rootDirectory), dir);
}
}
} else {
- failureReason = "is empty or you lack permissions " +
- "to access this directory";
+ failureReason = getMsg("error-install-root-dir-empty",
+ Utils.getPath(rootDirectory));
}
}
if (failureReason != null) {
- throw new IllegalArgumentException("Install root '" +
- (rootDirectory != null ? Utils.getPath(rootDirectory) : "null") +
- "' is not an OpenDS installation root: " +
- " " + failureReason);
+ throw new IllegalArgumentException(failureReason);
}
}
@@ -477,10 +479,9 @@
}
}
if (rev == null) {
- // TODO: i18n
throw new ApplicationException(
ApplicationException.Type.FILE_SYSTEM_ERROR,
- "Could not determine SVN rev", null);
+ getMsg("error-determining-svn-rev"), null);
}
return rev;
}
@@ -590,7 +591,6 @@
backupDirectory.delete();
}
if (!backupDirectory.mkdirs()) {
- // TODO: i18n
throw new IOException("failed to create history backup directory");
}
return backupDirectory;
@@ -750,7 +750,7 @@
public BuildInformation getBuildInformation(boolean useCachedVersion)
throws ApplicationException
{
- if (buildInformation == null || useCachedVersion == false) {
+ if (buildInformation == null || !useCachedVersion) {
FutureTask<BuildInformation> ft = new FutureTask<BuildInformation>(
new Callable<BuildInformation>() {
public BuildInformation call() throws ApplicationException {
@@ -775,4 +775,13 @@
public String toString() {
return Utils.getPath(rootDirectory);
}
+
+ static private String getMsg(String key) {
+ return ResourceProvider.getInstance().getMsg(key);
+ }
+
+ static private String getMsg(String key, String... args) {
+ return ResourceProvider.getInstance().getMsg(key, args);
+ }
+
}
\ No newline at end of file
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Launcher.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Launcher.java
index 777eecc..1ced51f 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Launcher.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Launcher.java
@@ -200,9 +200,8 @@
while (t != null)
{
StackTraceElement[] stack = t.getStackTrace();
- for (int i = 0; i < stack.length; i++)
- {
- buf.append(stack[i].toString()+"\n");
+ for (StackTraceElement aStack : stack) {
+ buf.append(aStack.toString()).append("\n");
}
t = t.getCause();
@@ -273,7 +272,6 @@
private void printVersion()
{
System.out.print(PRINTABLE_VERSION_STRING);
- return;
}
/**
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/QuickSetupCli.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/QuickSetupCli.java
index 21c5a49..87c0345 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/QuickSetupCli.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/QuickSetupCli.java
@@ -74,9 +74,6 @@
*/
static public int UNKNOWN = 100;
- /** Platform dependent filesystem separator. */
- public static String LINE_SEPARATOR = System.getProperty("line.separator");
-
/** Arguments passed in the command line. */
protected String[] args;
@@ -137,6 +134,7 @@
}
catch (Exception ex)
{
+ // do nothing;
}
}
@@ -180,8 +178,8 @@
}
catch (UserDataException uude)
{
- System.err.println(LINE_SEPARATOR+uude.getLocalizedMessage()+
- LINE_SEPARATOR);
+ System.err.println(Constants.LINE_SEPARATOR+uude.getLocalizedMessage()+
+ Constants.LINE_SEPARATOR);
returnValue = USER_DATA_ERROR;
}
return returnValue;
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/QuickSetupLog.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/QuickSetupLog.java
index 0378aef..43e6ed2 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/QuickSetupLog.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/QuickSetupLog.java
@@ -78,6 +78,7 @@
}
static private String getInitialLogRecord() {
+ // Note; currently the logs are not internationalized.
StringBuffer sb = new StringBuffer()
.append("QuickSetup application launched " +
DateFormat.getDateTimeInstance(DateFormat.LONG,
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/SecurityOptions.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/SecurityOptions.java
index 0826303..178a5a1 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/SecurityOptions.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/SecurityOptions.java
@@ -244,7 +244,7 @@
/**
* Sets the key store password.
- * @param keystorePassword the new key store password.
+ * @param keyStorePassword the new key store password.
*/
private void setKeyStorePassword(String keyStorePassword)
{
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/SplashScreen.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/SplashScreen.java
index c28db89..35b8260 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/SplashScreen.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/SplashScreen.java
@@ -249,6 +249,7 @@
});
} catch (Exception ex)
{
+ // do nothing;
}
}
@@ -270,6 +271,7 @@
});
} catch (Exception ex)
{
+ // do nothing;
}
}
@@ -294,6 +296,7 @@
Thread.sleep(sleepTime);
} catch (Exception ex)
{
+ // do nothing;
}
}
}
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Status.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Status.java
index 64e0e3d..34cf37f 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Status.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Status.java
@@ -66,8 +66,6 @@
* @return boolean where true means the configuration has been modified
*/
public boolean configurationHasBeenModified() {
- // TODO: a better way might be to diff config.ldif with configuration
- // base in config/upgrade/config.ldif.<svn rev>
boolean mod = false;
try {
mod = installation.getCurrentConfiguration().hasBeenModified();
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/UserData.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/UserData.java
index 71efd86..38051d7 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/UserData.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/UserData.java
@@ -93,11 +93,11 @@
setServerPort(defaultPort);
}
- setDirectoryManagerDn("cn=Directory Manager");
+ setDirectoryManagerDn(Constants.DIRECTORY_MANAGER_DN);
setNewSuffixOptions(defaultNewSuffixOptions);
AuthenticationData data = new AuthenticationData();
- data.setDn("cn=Directory Manager");
+ data.setDn(Constants.DIRECTORY_MANAGER_DN);
data.setPort(389);
DataReplicationOptions repl = new DataReplicationOptions(
DataReplicationOptions.Type.STANDALONE, data);
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/resources/Resources.properties b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/resources/Resources.properties
index 48ba1b3..7091a63 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/resources/Resources.properties
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/resources/Resources.properties
@@ -223,6 +223,7 @@
continue-button-label=Continue
continue-button-install-tooltip=Continue with Setup
ok-button-label=OK
+retry-button-label=Retry
#
# Confirmation dialogs
@@ -258,7 +259,7 @@
confirm-uninstall-server-running-title=Server is Running
confirm-cancel-title=Confirmation Required
confirm-cancel-prompt=Cancel the running operation?
-
+network-error-title=Network Error
#
# Error dialog title
@@ -796,6 +797,9 @@
open-ldif-file-dialog-title=Choose an LDIF File
open-zip-file-dialog-title=Choose an OpenDS Installation Package (.zip)
open-generic-file-dialog-title=Choose a File
+show-details-button-label=Show Details
+hide-details-button-label=Hide Details
+details-label=Details:
#
# Progress Summary Labels
@@ -1003,6 +1007,8 @@
error-server-status=Error determining the server's status.
error-server-health-check-failure=Server health check failed.
error-upgraded-server-starts-with-errors=The upgraded server starts with errors: {0}
+error-restoring-file=The following could not be restored after the failed \
+ upgrade attempt. You should restore this file/directory manually: {0} to {1}
# General errors
error-failed-moving-file=Failed to move file {0} to {1}.
@@ -1015,6 +1021,21 @@
error-apply-ldif-modify=Error processing modification operation of {0}: {1}
error-apply-ldif-add=Error processing add operation of {0}: {1}
error-apply-ldif-delete=Error processing delete operation of {0}: {1}
+error-invalid-port-value=Invalid port value {0}. A port number must be an integer \
+ between 1 and 65535.
+error-initializing-log=Error initializing log.
+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.
+error-option-required=Option {0} is required.
+error-parsing-options=Error parsing options.
+error-install-root-dir-null=The root directory is null.
+error-install-root-dir-not-dir=File {0} is not an OpenDS installation root.
+error-install-root-dir-no-exist=Directory {0} does not exist.
+error-install-root-dir-no-dir=Directory {0} does not contain directory {1}.
+error-install-root-dir-empty=Directory {0} is either empty or you lack permissions\
+ to access its contents.
+
#
# Install Status: messages displayed in the offline quick setup
@@ -1078,9 +1099,6 @@
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: {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
@@ -1106,6 +1124,9 @@
is down or experiencing difficulty.</li></ul><br>You can still continue with \
upgrade but will need to download a build separately and then point to it in \
the wizard.
+upgrade-choose-version-unable-to-access-build-info=Unable to access remote build information.
+upgrade-choose-version-loading-build-info=Loading remote build information...
+upgrade-choose-version-reading-build-info=Reading remote build information...
upgrade-review-panel-title=Review
upgrade-review-panel-instructions=Review your settings and click Finish if they \
@@ -1124,7 +1145,33 @@
build-manager-downloading-build=Downloading Build...
build-manager-downloading-build-done=Finished Downloading Build
+# Build extractor
+build-extractor-error=Failed to extract build: {0}
+build-extractor-error-file-no-exist=File {0} does not exist.
+
+# Web Proxy dialog strings
+web-proxy-dlg-title=Web Proxy Configuration
+web-proxy-dlg-user-label=User:
+web-proxy-dlg-password-label=Password:
+web-proxy-dlg-host-label=Host:
+web-proxy-dlg-port-label=Port:
+web-proxy-dlg-auth-label=Authentication:
+web-proxy-dlg-auth-req-label=Required by proxy
+
+# Upgrade log
+upgrade-log-field-op=Operation:
+upgrade-log-field-time=Time:
+upgrade-log-field-from=From:
+upgrade-log-field-to=To:
+upgrade-log-field-status=Status:
+upgrade-log-field-note=Note:
+upgrade-log-status-started=Started
+upgrade-log-status-success=Success
+upgrade-log-status-failure=Failure
+
general-loading=Loading...
general-see-for-details=See {0} for a detailed log of this operation.
general-build-id=Build ID
general-unset=Unset
+general-none=None
+general-unspecified=Unspecified
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/GuiUserInteraction.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/GuiUserInteraction.java
index 1872ebe..23aeaad 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/GuiUserInteraction.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/GuiUserInteraction.java
@@ -28,6 +28,8 @@
package org.opends.quicksetup.ui;
import org.opends.quicksetup.UserInteraction;
+import org.opends.quicksetup.Constants;
+import org.opends.quicksetup.i18n.ResourceProvider;
import org.opends.quicksetup.util.Utils;
import javax.swing.*;
@@ -102,9 +104,10 @@
// characters per line functionality of the extends options
// pane does not affect message that are components so we
// have to format this ourselves.
- StringBuilder sb = new StringBuilder("<b>");
+ StringBuilder sb = new StringBuilder(Constants.HTML_BOLD_OPEN);
sb.append(Utils.breakHtmlString(summary, MAX_CHARS_PER_LINE));
- sb.append("</b><br>");
+ sb.append(Constants.HTML_BOLD_CLOSE);
+ sb.append(Constants.HTML_LINE_BREAK);
sb.append(Utils.breakHtmlString(details, MAX_CHARS_PER_LINE));
JEditorPane ep = UIFactory.makeHtmlPane(
sb.toString(),
@@ -187,7 +190,9 @@
detailsButtonsPanel.setLayout(
new BoxLayout(detailsButtonsPanel,
BoxLayout.LINE_AXIS));
- final JButton btnDetails = new JButton("Show Details");
+ final String showDetailsLabel = getMsg("show-details-button-label");
+ final String hideDetailsLabel = getMsg("hide-details-button-label");
+ final JButton btnDetails = new JButton(showDetailsLabel);
btnDetails.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Dimension current = dialog.getSize();
@@ -195,12 +200,12 @@
// detailsComponent.setVisible(true);
dialog.setSize(current.width,
current.height + getExpansionHeight());
- btnDetails.setText("Hide Details");
+ btnDetails.setText(hideDetailsLabel);
} else {
// detailsComponent.setVisible(false);
dialog.setSize(current.width,
current.height - getExpansionHeight());
- btnDetails.setText("Show Details");
+ btnDetails.setText(showDetailsLabel);
}
detailsShowing = !detailsShowing;
}
@@ -248,7 +253,7 @@
gbc.insets = new Insets(15, 0, 0, 0);
gbc.fill = GridBagConstraints.HORIZONTAL;
detailsPanel.add(UIFactory.makeJLabel(null,
- "Details:",
+ getMsg("details-label"),
UIFactory.TextStyle.PRIMARY_FIELD_VALID), gbc);
gbc.insets.top = UIFactory.TOP_INSET_PRIMARY_FIELD;
@@ -276,6 +281,10 @@
}
+ private static String getMsg(String key) {
+ return ResourceProvider.getInstance().getMsg(key);
+ }
+
// public static void main(String[] args) {
// new GuiUserInteraction(null).confirm(
// "Summary",
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/QuickSetupStepPanel.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/QuickSetupStepPanel.java
index 0bd74e3..90d4260 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/QuickSetupStepPanel.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/QuickSetupStepPanel.java
@@ -46,6 +46,7 @@
import org.opends.quicksetup.ProgressDescriptor;
import org.opends.quicksetup.SecurityOptions;
import org.opends.quicksetup.UserData;
+import org.opends.quicksetup.Constants;
import org.opends.quicksetup.util.HtmlProgressMessageFormatter;
import org.opends.quicksetup.util.ProgressMessageFormatter;
import org.opends.quicksetup.util.URLWorker;
@@ -413,7 +414,7 @@
{
if (html)
{
- buf.append("<br>");
+ buf.append(Constants.HTML_LINE_BREAK);
}
else
{
@@ -425,7 +426,7 @@
}
if (html)
{
- buf.append("<br>");
+ buf.append(Constants.HTML_LINE_BREAK);
}
else
{
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/WebProxyDialog.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/WebProxyDialog.java
index 33a4731..e9636e4 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/WebProxyDialog.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/WebProxyDialog.java
@@ -28,6 +28,7 @@
package org.opends.quicksetup.ui;
import org.opends.quicksetup.util.Utils;
+import org.opends.quicksetup.i18n.ResourceProvider;
import javax.swing.*;
import java.awt.*;
@@ -105,7 +106,7 @@
}
private void init(String host, Integer port, String user, char[] pw) {
- setTitle("Proxy Configuration");
+ setTitle(getMsg("web-proxy-dlg-title"));
optionPane = createContentPane(host, port, user, pw);
optionPane.addPropertyChangeListener(this);
setContentPane(optionPane);
@@ -268,17 +269,19 @@
p.setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
- final JLabel lblUser = UIFactory.makeJLabel(null, "User:",
+ final JLabel lblUser = UIFactory.makeJLabel(null,
+ getMsg("web-proxy-dlg-user-label"),
UIFactory.TextStyle.SECONDARY_FIELD_VALID);
- final JLabel lblPassword = UIFactory.makeJLabel(null, "Password:",
+ final JLabel lblPassword = UIFactory.makeJLabel(null,
+ getMsg("web-proxy-dlg-password-label"),
UIFactory.TextStyle.SECONDARY_FIELD_VALID);
gbc.gridx = 0;
gbc.gridy = 0;
gbc.anchor = GridBagConstraints.FIRST_LINE_START;
gbc.fill = GridBagConstraints.NONE;
- p.add(new JLabel("Proxy Host:"), gbc);
+ p.add(new JLabel(getMsg("web-proxy-dlg-host-label")), gbc);
gbc.gridx = 1;
gbc.gridy = 0;
@@ -290,7 +293,7 @@
gbc.gridy = 1;
gbc.weightx = 0;
gbc.fill = GridBagConstraints.NONE;
- p.add(new JLabel("Proxy Port:"), gbc);
+ p.add(new JLabel(getMsg("web-proxy-dlg-port-label")), gbc);
gbc.gridx = 1;
gbc.gridy = 1;
@@ -302,14 +305,15 @@
gbc.weightx = 0;
gbc.fill = GridBagConstraints.NONE;
gbc.insets.top = 7; // I don't understand why this is necesary
- p.add(new JLabel("Auhentication:"), gbc);
+ p.add(new JLabel(getMsg("web-proxy-dlg-auth-label")), gbc);
gbc.gridx = 1;
gbc.gridy = 2;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets.top = 0;
p.add(chkRequiresAuth =
- UIFactory.makeJCheckBox("Required by proxy","",
+ UIFactory.makeJCheckBox(getMsg("web-proxy-dlg-auth-req-label"),
+ "",
UIFactory.TextStyle.SECONDARY_FIELD_VALID
), gbc);
chkRequiresAuth.addActionListener(new ActionListener() {
@@ -368,11 +372,13 @@
String errorMsg = null;
String portString = tfPort.getText();
- //TODO better port number verification
try {
- Integer.parseInt(portString);
+ Integer port = Integer.parseInt(portString);
+ if (!(port >= 1 && port <= 65535)) {
+ errorMsg = getMsg("invalid-port-value-range", portString);
+ }
} catch (NumberFormatException e) {
- errorMsg = "Illegal port value " + portString;
+ errorMsg = getMsg("invalid-port-value-range", portString);
}
if (errorMsg != null) {
@@ -381,6 +387,14 @@
return (errorMsg == null);
}
+ private String getMsg(String key) {
+ return ResourceProvider.getInstance().getMsg(key);
+ }
+
+ private String getMsg(String key, String... args) {
+ return ResourceProvider.getInstance().getMsg(key, args);
+ }
+
// /**
// * For testing.
// * @param args cl args
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/uninstaller/UninstallCliHelper.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/uninstaller/UninstallCliHelper.java
index 98dabf5..04b295e 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/uninstaller/UninstallCliHelper.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/uninstaller/UninstallCliHelper.java
@@ -213,13 +213,13 @@
if (i == 6)
{
String[] arg = {Utils.getStringFromCollection(outsideDbs,
- QuickSetupCli.LINE_SEPARATOR)};
+ Constants.LINE_SEPARATOR)};
msg = getMsg(keys[i], arg);
}
else if (i == 7)
{
String[] arg = {Utils.getStringFromCollection(outsideLogs,
- QuickSetupCli.LINE_SEPARATOR)};
+ Constants.LINE_SEPARATOR)};
msg = getMsg(keys[i], arg);
}
else
@@ -293,7 +293,7 @@
!userData.getRemoveLogs())
{
somethingSelected = false;
- System.out.println(QuickSetupCli.LINE_SEPARATOR+
+ System.out.println(Constants.LINE_SEPARATOR+
getMsg("cli-uninstall-nothing-to-be-uninstalled"));
}
else
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Build.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Build.java
index 13493a2..bf8bb0d 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Build.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Build.java
@@ -43,17 +43,17 @@
/**
* Daily build descriptor.
*/
- DAILY("Daily Build"),
+ DAILY("Daily Build"), // DO NOT i18n
/**
* Weekly build descriptor.
*/
- WEEKLY("Weekly Build"),
+ WEEKLY("Weekly Build"), // DO NOT i18n
/**
* Release build descriptor.
*/
- RELEASE("Release Build");
+ RELEASE("Release Build"); // DO NOT i18n
/**
* Creates a Category from its 'key' String value.
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/BuildExtractor.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/BuildExtractor.java
index f15592a..5a949ae 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/BuildExtractor.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/BuildExtractor.java
@@ -28,6 +28,7 @@
package org.opends.quicksetup.upgrader;
import org.opends.quicksetup.*;
+import org.opends.quicksetup.i18n.ResourceProvider;
import org.opends.quicksetup.event.ProgressUpdateListener;
import org.opends.quicksetup.event.ProgressUpdateEvent;
import org.opends.quicksetup.util.Utils;
@@ -70,7 +71,8 @@
UpgradeLauncher.LOG_FILE_PREFIX + "ext-",
UpgradeLauncher.LOG_FILE_SUFFIX));
} catch (Throwable t) {
- System.err.println("Unable to initialize log");
+ System.err.println(
+ ResourceProvider.getInstance().getMsg("error-initializing-log"));
t.printStackTrace();
}
new BuildExtractor(args).run();
@@ -106,15 +108,16 @@
File buildFile = getBuildFile(args);
if (buildFile != null) {
if (!buildFile.exists()) {
- // TODO: i18n
throw new FileNotFoundException(
- buildFile.getName() + " does not exist");
+ getMsg("build-extractor-error-file-no-exist",
+ Utils.getPath(buildFile)));
}
expandZipFile(buildFile);
}
} catch (Throwable t) {
LOG.log(Level.INFO, "unexpected error extracting build", t);
- System.err.println("Failed to extract build: " + t.getLocalizedMessage());
+ String reason = t.getLocalizedMessage();
+ System.err.println(getMsg("build-extractor-error", reason));
retCode = 1;
}
LOG.log(Level.INFO, "extractor exiting code=" + retCode);
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/HistoricalRecord.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/HistoricalRecord.java
index f36aeab..7d974a1 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/HistoricalRecord.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/HistoricalRecord.java
@@ -46,17 +46,23 @@
static private final Logger LOG =
Logger.getLogger(HistoricalRecord.class.getName());
- static private String OPERATION = "operation:";
+ //--------------------------------------------------//
+ // Since these are internationalized, logs that are //
+ // moved from one locale to another may not be //
+ // readable programmatically. //
+ //--------------------------------------------------//
- static private String TIME = "time:";
+ static private String OPERATION = getMsg("upgrade-log-field-op");
- static private String FROM = "from:";
+ static private String TIME = getMsg("upgrade-log-field-time");
- static private String TO = "to:";
+ static private String FROM = getMsg("upgrade-log-field-from");
- static private String STATUS = "status:";
+ static private String TO = getMsg("upgrade-log-field-to");
- static private String NOTE = "note:";
+ static private String STATUS = getMsg("upgrade-log-field-status");
+
+ static private String NOTE = getMsg("upgrade-log-field-note");
static private String SEPARATOR = " ";
@@ -67,11 +73,11 @@
*/
enum Status {
- STARTED("started"),
+ STARTED(getMsg("upgrade-log-status-started")),
- SUCCESS("success"),
+ SUCCESS(getMsg("upgrade-log-status-success")),
- FAILURE("failure");
+ FAILURE(getMsg("upgrade-log-status-failure"));
private String representation;
@@ -136,7 +142,7 @@
token = st.nextToken();
String toString = token.substring(TO.length());
- to = BuildInformation.fromBuildString(fromString);
+ to = BuildInformation.fromBuildString(toString);
token = st.nextToken();
String outcomeString = token.substring(STATUS.length());
@@ -294,7 +300,7 @@
return sb.toString();
}
- private String getMsg(String key) {
+ static private String getMsg(String key) {
return ResourceProvider.getInstance().getMsg(key);
}
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/RemoteBuildManager.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/RemoteBuildManager.java
index b3d7dfa..693c10f 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/RemoteBuildManager.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/RemoteBuildManager.java
@@ -120,7 +120,7 @@
}
String proxyAuthString = createProxyAuthString();
if (proxyAuthString != null) {
- conn.setRequestProperty("Proxy-Authorization", "Basic " +
+ conn.setRequestProperty("Proxy-Authorization", "Basic " + // DO NOT i18n
proxyAuthString);
}
InputStream in;
@@ -170,7 +170,7 @@
}
String proxyAuthString = createProxyAuthString();
if (proxyAuthString != null) {
- conn.setRequestProperty("Proxy-Authorization", "Basic " +
+ conn.setRequestProperty("Proxy-Authorization", "Basic " + // DO NOT i18n
proxyAuthString);
}
InputStream is = null;
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeLauncher.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeLauncher.java
index d808e0f..cacaba6 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeLauncher.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeLauncher.java
@@ -31,6 +31,7 @@
import org.opends.quicksetup.CliApplication;
import org.opends.quicksetup.Installation;
import org.opends.quicksetup.QuickSetupLog;
+import org.opends.quicksetup.i18n.ResourceProvider;
import org.opends.quicksetup.util.Utils;
import java.util.logging.Logger;
@@ -63,7 +64,8 @@
QuickSetupLog.initLogFileHandler(
File.createTempFile(LOG_FILE_PREFIX, LOG_FILE_SUFFIX));
} catch (Throwable t) {
- System.err.println("Unable to initialize log");
+ System.err.println(
+ ResourceProvider.getInstance().getMsg("error-initializing-log"));
t.printStackTrace();
}
new UpgradeLauncher(args).launch();
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
index a630a25..3a3d004 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
@@ -41,6 +41,8 @@
import org.opends.quicksetup.BuildInformation;
import org.opends.quicksetup.CurrentInstallStatus;
import org.opends.quicksetup.UserInteraction;
+import org.opends.quicksetup.Constants;
+import org.opends.quicksetup.i18n.ResourceProvider;
import org.opends.quicksetup.webstart.WebStartDownloader;
import org.opends.quicksetup.util.Utils;
import org.opends.quicksetup.util.ZipExtractor;
@@ -321,7 +323,9 @@
UpgradeLauncher.LOG_FILE_PREFIX,
UpgradeLauncher.LOG_FILE_SUFFIX));
} catch (IOException e) {
- System.err.println("Failed to initialize log");
+ System.err.println(
+ ResourceProvider.getInstance().getMsg("error-initializing-log"));
+ e.printStackTrace();
}
// Get started on downloading the web start jars
@@ -449,7 +453,7 @@
* {@inheritDoc}
*/
public String getSummary(ProgressStep step) {
- String txt = null;
+ String txt;
if (step == UpgradeProgressStep.FINISHED) {
txt = getFinalSuccessMessage();
} else if (step == UpgradeProgressStep.FINISHED_CANCELED) {
@@ -697,8 +701,7 @@
* {@inheritDoc}
*/
public boolean canFinish(WizardStep step) {
- boolean cf = UpgradeWizardStep.REVIEW.equals(step);
- return cf;
+ return UpgradeWizardStep.REVIEW.equals(step);
}
/**
@@ -719,7 +722,7 @@
try {
if (Utils.isWebStart()) {
- ZipExtractor extractor = null;
+ ZipExtractor extractor;
try {
LOG.log(Level.INFO, "Waiting for Java Web Start jar download");
waitForLoader(15); // TODO: ratio
@@ -769,7 +772,7 @@
checkAbort();
- boolean schemaCustomizationPresent = false;
+ boolean schemaCustomizationPresent;
try {
LOG.log(Level.INFO, "checking for schema customizations");
setCurrentProgressStep(
@@ -787,7 +790,7 @@
checkAbort();
- boolean configCustimizationPresent = false;
+ boolean configCustimizationPresent;
try {
LOG.log(Level.INFO, "checking for config customizations");
setCurrentProgressStep(
@@ -976,13 +979,13 @@
if (errors != null && errors.size() > 0) {
notifyListeners(formatter.getFormattedError() +
formatter.getLineBreak());
- String sep = System.getProperty("line.separator");
String formattedDetails =
- Utils.listToString(errors, sep, /*bullet=*/"\u2022 ", "");
+ Utils.listToString(errors,
+ Constants.LINE_SEPARATOR, /*bullet=*/"\u2022 ", "");
runWarning = new ApplicationException(
ApplicationException.Type.APPLICATION,
getMsg("error-upgraded-server-starts-with-errors",
- sep + formattedDetails), null);
+ Constants.LINE_SEPARATOR + formattedDetails), null);
String cancel = getMsg("upgrade-verification-failure-cancel");
UserInteraction ui = userInteraction();
if (ui == null || cancel.equals(ui.confirm(
@@ -1106,8 +1109,7 @@
} catch (ApplicationException e) {
notifyListeners(formatter.getFormattedError() +
formatter.getLineBreak());
- System.err.print("Error cleaning up after upgrade: " +
- e.getLocalizedMessage());
+ LOG.log(Level.INFO, "Error cleaning up after upgrade.", e);
}
// Decide final status based on presense of error
@@ -1223,9 +1225,9 @@
fm.move(f, root, null);
} catch (Throwable t) {
restoreError = true;
- notifyListeners("The following could not be restored after the" +
- "failed upgrade attempt. You should restore this " +
- "file/directory manually: '" + f + "' to '" + root + "'");
+ notifyListeners(getMsg("error-restoring-file",
+ Utils.getPath(f),
+ Utils.getPath(root)));
}
}
if (!restoreError) {
@@ -1491,6 +1493,8 @@
* an upgrade from the current version to the next version
* is possible. Upgrading may not be possible due to 'flag
* day' types of changes to the codebase.
+ * @throws org.opends.quicksetup.ApplicationException if upgradability
+ * cannot be insured.
*/
private void insureUpgradability() throws ApplicationException {
BuildInformation currentVersion;
@@ -1499,7 +1503,8 @@
try {
currentVersion = getInstallation().getBuildInformation();
} catch (ApplicationException e) {
- LOG.log(Level.INFO, "error", e);
+ LOG.log(Level.INFO, "error getting build information for " +
+ "current installation", e);
throw ApplicationException.createFileSystemException(
getMsg("error-determining-current-build"), e);
}
@@ -1507,7 +1512,8 @@
try {
newVersion = getStagedInstallation().getBuildInformation();
} catch (Exception e) {
- LOG.log(Level.INFO, "error", e);
+ LOG.log(Level.INFO, "error getting build information for " +
+ "staged installation", e);
throw ApplicationException.createFileSystemException(
getMsg("error-determining-upgrade-build"), e); }
@@ -1579,7 +1585,7 @@
private String getFinalSuccessMessage() {
String txt;
String installPath = Utils.getPath(getInstallation().getRootDirectory());
- String newVersion = null;
+ String newVersion;
try {
BuildInformation bi = getInstallation().getBuildInformation();
if (bi != null) {
@@ -1686,7 +1692,8 @@
try {
stagedVersion = getStagedInstallation().getBuildInformation();
} catch (Exception e) {
- LOG.log(Level.INFO, "error", e);
+ LOG.log(Level.INFO, "error getting build info for staged installation",
+ e);
}
}
return stagedVersion;
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgraderCliHelper.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgraderCliHelper.java
index e651e0e..cef2c78 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgraderCliHelper.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgraderCliHelper.java
@@ -75,20 +75,21 @@
localInstallPackFileNameArg.getValue();
File installPackFile = new File(localInstallPackFileName);
if (!installPackFile.exists()) {
- throw new UserDataException(null, "File '" +
- localInstallPackFileName +
- "' does not exist");
+ throw new UserDataException(null,
+ getMsg("build-extractor-error-file-no-exist",
+ localInstallPackFileName));
} else {
uud.setInstallPackage(installPackFile);
}
} else {
- // TODO i18N
+ // TODO: ask the user for this information if non noninteractive
throw new UserDataException(null,
- "Option -f is required.");
+ getMsg("error-option-required",
+ "-" + FILE_OPTION_SHORT + "/--" + FILE_OPTION_LONG));
}
} catch (ArgumentException e) {
- throw new UserDataException(null, "Error parsing arguments");
+ throw new UserDataException(null, getMsg("error-parsing-options"));
}
return uud;
}
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/BuildListDownloadErrorPanel.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/BuildListDownloadErrorPanel.java
index fad5430..96786fb 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/BuildListDownloadErrorPanel.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/BuildListDownloadErrorPanel.java
@@ -40,7 +40,6 @@
import java.net.*;
import java.util.logging.Level;
import java.util.logging.Logger;
-import java.lang.reflect.InvocationTargetException;
/**
* This panel represents the big error message the pops up when the
@@ -72,14 +71,14 @@
private void layoutPanel() {
setLayout(new GridBagLayout());
- String proxyString = "None";
+ String proxyString = getMsg("general-none");
Proxy proxy = rbm.getProxy();
if (proxy != null) {
SocketAddress addr = proxy.address();
proxyString = addr.toString();
}
- String baseContext = "Unspecified";
+ String baseContext = getMsg("general-unspecified");
URL url = rbm.getBaseContext();
if (url != null) {
baseContext = url.toString();
@@ -87,10 +86,9 @@
String html =
getMsg("upgrade-choose-version-build-list-error",
- new String[]{
- baseContext,
- reason.getLocalizedMessage(),
- proxyString});
+ baseContext,
+ reason.getLocalizedMessage(),
+ proxyString);
/* This helps with debugger the HTML rendering
StringBuffer content = new StringBuffer();
@@ -125,33 +123,12 @@
add(UIFactory.makeHtmlPane(html, ek, UIFactory.INSTRUCTIONS_FONT));
}
- /**
- * Returns a localized message for a key value. In the properties file we
- * have something of type:
- * key=value
- * <p/>
- * For instance if we pass as key "mykey" and as arguments {"value1"} and
- * in the properties file we have:
- * mykey=value with argument {0}.
- * <p/>
- * This method will return "value with argument value1".
- *
- * @param key the key in the properties file.
- * @param args the arguments to be passed to generate the resulting value.
- * @return the value associated to the key in the properties file.
- * @see org.opends.quicksetup.i18n.ResourceProvider#getMsg(String,String[])
- */
- public String getMsg(String key, String[] args) {
- return getI18n().getMsg(key, args);
+ private String getMsg(String key) {
+ return ResourceProvider.getInstance().getMsg(key);
}
- /**
- * Returns a ResourceProvider instance.
- *
- * @return a ResourceProvider instance.
- */
- public ResourceProvider getI18n() {
- return ResourceProvider.getInstance();
+ private String getMsg(String key, String... args) {
+ return ResourceProvider.getInstance().getMsg(key, args);
}
/**
@@ -199,12 +176,8 @@
} else {
try {
SwingUtilities.invokeAndWait(proxySpecifier);
- } catch (InterruptedException e) {
- LOG.log(Level.INFO, "error", e);
- } catch (InvocationTargetException e) {
- LOG.log(Level.INFO, "error", e);
} catch (Throwable t) {
- LOG.log(Level.INFO, "error", t);
+ LOG.log(Level.INFO, "error waiting for event thread", t);
}
}
}
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/ChooseVersionPanel.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/ChooseVersionPanel.java
index 4a5c210..a698a29 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/ChooseVersionPanel.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/ChooseVersionPanel.java
@@ -59,7 +59,6 @@
private JLabel lblCurrentVersion = null;
private JRadioButton rbRemote = null;
private JRadioButton rbLocal = null;
- private ButtonGroup grpRemoteLocal = null;
private JComboBox cboBuild = null;
private JLabel lblFile = null;
private JTextField tfFile = null;
@@ -110,7 +109,7 @@
try {
loadBuildList();
} catch (IOException e) {
- LOG.log(Level.INFO, "error", e);
+ LOG.log(Level.INFO, "Error loading build list", e);
}
}
};
@@ -130,7 +129,7 @@
public Object getFieldValue(FieldName fieldName) {
Object value = null;
if (FieldName.UPGRADE_DOWNLOAD.equals(fieldName)) {
- value = new Boolean(rbRemote.isSelected());
+ value = rbRemote.isSelected();
} else if (FieldName.UPGRADE_BUILD_TO_DOWNLOAD.equals(fieldName)) {
value = cboBuild.getSelectedItem();
} else if (FieldName.UPGRADE_FILE.equals(fieldName)) {
@@ -172,7 +171,7 @@
getMsg("upgrade-choose-version-local-tooltip"),
UIFactory.TextStyle.SECONDARY_FIELD_VALID);
- grpRemoteLocal = new ButtonGroup();
+ ButtonGroup grpRemoteLocal = new ButtonGroup();
grpRemoteLocal.add(rbRemote);
grpRemoteLocal.add(rbLocal);
grpRemoteLocal.setSelected(rbRemote.getModel(), true);
@@ -314,7 +313,8 @@
try {
bld = new RemoteBuildListComboBoxModelCreator(rbm);
} catch (IOException e) {
- LOG.log(Level.INFO, "error", e);
+ LOG.log(Level.INFO, "error creating remote build list combo " +
+ "box model creator", e);
}
}
return bld;
@@ -343,7 +343,7 @@
* Creates a default instance.
*/
public BuildListErrorComboBoxRenderer() {
- super("Unable to access remote build information",
+ super(getMsg("upgrade-choose-version-unable-to-access-build-info"),
UIFactory.getImageIcon(UIFactory.IconType.WARNING),
SwingConstants.LEFT);
UIFactory.setTextStyle(this, UIFactory.TextStyle.SECONDARY_STATUS);
@@ -382,7 +382,7 @@
* Creates a default instance.
*/
public BuildListLoadingComboBoxRenderer() {
- super("Loading remote build information...",
+ super(getMsg("upgrade-choose-version-loading-build-info"),
UIFactory.getImageIcon(UIFactory.IconType.WAIT_TINY),
SwingConstants.LEFT);
UIFactory.setTextStyle(this, UIFactory.TextStyle.SECONDARY_STATUS);
@@ -449,11 +449,14 @@
cbm = new DefaultComboBoxModel(buildList.toArray());
} else {
try {
- String[] options = { "Retry", "Close" };
+ String[] options = {
+ getMsg("retry-button-label"),
+ getMsg("close-button-label")
+ };
int i = JOptionPane.showOptionDialog(getMainWindow(),
new BuildListDownloadErrorPanel(rbm,
throwable),
- "Network Error",
+ getMsg("network-error-title"),
JOptionPane.YES_NO_OPTION,
JOptionPane.ERROR_MESSAGE,
null,
@@ -501,7 +504,7 @@
private InputStream getInputStream() throws IOException {
if (this.in == null) {
this.in = rbm.getDailyBuildsInputStream(getMainWindow(),
- "Reading build information");
+ getMsg("upgrade-choose-version-reading-build-info"));
}
return this.in;
}
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/FileManager.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/FileManager.java
index f03d076..5a8aaba 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/FileManager.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/FileManager.java
@@ -308,6 +308,7 @@
* Create a new copy operation.
* @param objectFile to copy
* @param destDir to copy to
+ * @param overwrite if true copy should overwrite any existing file
*/
public CopyOperation(File objectFile, File destDir, boolean overwrite) {
super(objectFile);
@@ -507,6 +508,7 @@
/**
* Creates a delete operation.
* @param objectFile to delete
+ * @param newParent Filr where <code>objectFile</code> will be copied.
*/
public MoveOperation(File objectFile, File newParent) {
super(objectFile);
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/HtmlProgressMessageFormatter.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/HtmlProgressMessageFormatter.java
index e5bc404..71d0778 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/HtmlProgressMessageFormatter.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/HtmlProgressMessageFormatter.java
@@ -30,9 +30,12 @@
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.opends.quicksetup.i18n.ResourceProvider;
import org.opends.quicksetup.ui.UIFactory;
+import org.opends.quicksetup.Constants;
/**
* This is an implementation of the ProgressMessageFormatter class that
@@ -41,15 +44,13 @@
*/
public class HtmlProgressMessageFormatter implements ProgressMessageFormatter
{
+ static private final Logger LOG =
+ Logger.getLogger(HtmlProgressMessageFormatter.class.getName());
+
private String doneHtml;
private String errorHtml;
/**
- * The line break in HTML.
- */
- private static String LINE_BREAK = "<br>";
-
- /**
* The constant used to separate parameters in an URL.
*/
private String PARAM_SEPARATOR = "&&&&";
@@ -163,8 +164,7 @@
UIFactory.getIconHtml(UIFactory.IconType.INFORMATION_LARGE) + SPACE
+ SPACE + UIFactory.applyFontToHtml(text, UIFactory.PROGRESS_FONT);
- String result = UIFactory.applySuccessfulBackgroundToHtml(html);
- return result;
+ return UIFactory.applySuccessfulBackgroundToHtml(html);
}
/**
@@ -284,7 +284,8 @@
Throwable root = ex.getCause();
while (root != null)
{
- stackBuf.append(getHtml(getMsg("exception-root-cause")) + LINE_BREAK);
+ stackBuf.append(getHtml(getMsg("exception-root-cause")))
+ .append(Constants.HTML_LINE_BREAK);
stackBuf.append(getHtmlStack(root));
root = root.getCause();
}
@@ -297,11 +298,10 @@
if (msg != null)
{
buf.append(UIFactory.applyFontToHtml(getHtml(ex.getMessage()),
- UIFactory.PROGRESS_ERROR_FONT)
- + LINE_BREAK);
+ UIFactory.PROGRESS_ERROR_FONT)).append(Constants.HTML_LINE_BREAK);
} else
{
- buf.append(ex.toString() + LINE_BREAK);
+ buf.append(ex.toString()).append(Constants.HTML_LINE_BREAK);
}
buf.append(getErrorWithStackHtml(openDiv, hideText, showText, stackText,
closeDiv, false));
@@ -329,7 +329,7 @@
*/
public String getLineBreak()
{
- return LINE_BREAK;
+ return Constants.HTML_LINE_BREAK;
}
/**
@@ -367,8 +367,8 @@
int index = lastText.indexOf(urlText);
if (index == -1)
{
- System.out.println("lastText: " + lastText);
- System.out.println("does not contain: " + urlText);
+ LOG.log(Level.FINE, "lastText: " + lastText +
+ "does not contain: " + urlText);
} else
{
lastText =
@@ -397,7 +397,7 @@
{
if (i != 0)
{
- buffer.append("<br>");
+ buffer.append(Constants.HTML_LINE_BREAK);
}
buffer.append(escape(lines[i]));
}
@@ -481,10 +481,19 @@
{
StringBuilder buf = new StringBuilder();
StackTraceElement[] stack = ex.getStackTrace();
- for (int i = 0; i < stack.length; i++)
- {
- buf.append(SPACE + SPACE + SPACE + SPACE + SPACE + SPACE + SPACE +
- SPACE + SPACE + SPACE + getHtml(stack[i].toString()) + LINE_BREAK);
+ for (StackTraceElement aStack : stack) {
+ buf.append(SPACE)
+ .append(SPACE)
+ .append(SPACE)
+ .append(SPACE)
+ .append(SPACE)
+ .append(SPACE)
+ .append(SPACE)
+ .append(SPACE)
+ .append(SPACE)
+ .append(SPACE)
+ .append(getHtml(aStack.toString()))
+ .append(Constants.HTML_LINE_BREAK);
}
return buf.toString();
}
@@ -535,11 +544,12 @@
try
{
String text = hide ? hideText : showText;
- buf.append(openDiv + "<a href=\"http://").append(
- URLEncoder.encode(params, "UTF-8") + "\">" + text + "</a>");
+ buf.append(openDiv).append("<a href=\"http://")
+ .append(URLEncoder.encode(params, "UTF-8"))
+ .append("\">").append(text).append("</a>");
if (hide)
{
- buf.append(LINE_BREAK + stackText);
+ buf.append(Constants.HTML_LINE_BREAK).append(stackText);
}
buf.append(closeDiv);
@@ -568,11 +578,11 @@
String showText, String stackText, String closeDiv, boolean hide)
{
StringBuilder buf = new StringBuilder();
- buf.append(openDiv + PARAM_SEPARATOR);
- buf.append(hideText + PARAM_SEPARATOR);
- buf.append(showText + PARAM_SEPARATOR);
- buf.append(stackText + PARAM_SEPARATOR);
- buf.append(closeDiv + PARAM_SEPARATOR);
+ buf.append(openDiv).append(PARAM_SEPARATOR);
+ buf.append(hideText).append(PARAM_SEPARATOR);
+ buf.append(showText).append(PARAM_SEPARATOR);
+ buf.append(stackText).append(PARAM_SEPARATOR);
+ buf.append(closeDiv).append(PARAM_SEPARATOR);
buf.append(hide);
return buf.toString();
}
@@ -607,7 +617,7 @@
String showText = params[i++];
String stackText = params[i++];
String closeDiv = params[i++];
- boolean isHide = new Boolean(params[i]);
+ boolean isHide = Boolean.valueOf(params[i]);
if (isHide)
{
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java
index 61a40d3..7bfe1c9 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java
@@ -175,8 +175,8 @@
// Attempting to use DirectoryServer with a configuration file
// for a different version of the server can cause problems for
// the server at startup.
- BuildInformation installBi = null;
- BuildInformation currentBi = null;
+ BuildInformation installBi;
+ BuildInformation currentBi;
try {
installBi = installation.getBuildInformation();
currentBi = BuildInformation.getCurrent();
@@ -511,12 +511,6 @@
}
}
- static private void unregisterListenersForOutput() {
- DebugLogger.removeDebugLogPublisher(DN.NULL_DN);
- ErrorLogger.removeErrorLogPublisher(DN.NULL_DN);
- AccessLogger.removeAccessLogPublisher(DN.NULL_DN);
- }
-
static private String getMsg(String key, String... args) {
return ResourceProvider.getInstance().getMsg(key, args);
}
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/PlainTextProgressMessageFormatter.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/PlainTextProgressMessageFormatter.java
index cbf7e85..ca8098a 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/PlainTextProgressMessageFormatter.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/PlainTextProgressMessageFormatter.java
@@ -28,6 +28,7 @@
package org.opends.quicksetup.util;
import org.opends.quicksetup.i18n.ResourceProvider;
+import org.opends.quicksetup.Constants;
/**
* This is an implementation of the ProgressMessageFormatter class that
@@ -41,11 +42,6 @@
private String errorText;
/**
- * The line break in plain text.
- */
- private static String LINE_BREAK = System.getProperty("line.separator");
-
- /**
* The space in plain text.
*/
private static String SPACE = " ";
@@ -87,7 +83,7 @@
String result;
if (applyMargin)
{
- result = LINE_BREAK+text;
+ result = Constants.LINE_SEPARATOR+text;
} else
{
result = text;
@@ -108,7 +104,7 @@
String result;
if (applyMargin)
{
- result = LINE_BREAK+text;
+ result = Constants.LINE_SEPARATOR+text;
} else
{
result = text;
@@ -226,7 +222,7 @@
String result;
if (applyMargin)
{
- result = LINE_BREAK+msg;
+ result = Constants.LINE_SEPARATOR+msg;
} else
{
result = msg;
@@ -240,7 +236,7 @@
*/
public String getLineBreak()
{
- return LINE_BREAK;
+ return Constants.LINE_SEPARATOR;
}
/**
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
index ba4c09d..ab56bdf 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -1410,7 +1410,7 @@
p = d.indexOf(' ', maxll);
if (p > 0 && p < len) {
return d.substring(0, p) +
- "<br>" +
+ Constants.HTML_LINE_BREAK +
breakHtmlString(d.substring(p + 1), maxll);
} else {
return d;
--
Gitblit v1.10.0