From 46f64d6b7b18945b4d609fabe9ac87b3f6cb8f30 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Thu, 16 Aug 2007 20:56:31 +0000
Subject: [PATCH] This commit gets the QuickSetup installer working again by specifying the server root during the directory configuration.  This is addressed by adding a hidden arg to ConfigureDS for the server root that the installer uses for the specification of the directory.

---
 opends/src/server/org/opends/server/tools/ConfigureDS.java |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/tools/ConfigureDS.java b/opends/src/server/org/opends/server/tools/ConfigureDS.java
index 7bee3b8..8da384a 100644
--- a/opends/src/server/org/opends/server/tools/ConfigureDS.java
+++ b/opends/src/server/org/opends/server/tools/ConfigureDS.java
@@ -32,6 +32,7 @@
 import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.Set;
+import java.io.File;
 
 import org.opends.server.api.ConfigHandler;
 import org.opends.server.config.BooleanConfigAttribute;
@@ -46,6 +47,8 @@
 import org.opends.server.protocols.ldap.LDAPResultCode;
 import org.opends.server.types.DirectoryException;
 import org.opends.server.types.DN;
+import org.opends.server.types.DirectoryEnvironmentConfig;
+import org.opends.server.types.InitializationException;
 import org.opends.server.util.SetupUtils;
 import org.opends.server.util.args.ArgumentException;
 import org.opends.server.util.args.ArgumentParser;
@@ -170,6 +173,7 @@
     StringArgument    trustManagerProviderDN;
     StringArgument    certNickName;
     StringArgument    keyManagerPath;
+    StringArgument    serverRoot;
 
     Message toolDescription = INFO_CONFIGDS_TOOL_DESCRIPTION.get();
     ArgumentParser argParser = new ArgumentParser(CLASS_NAME, toolDescription,
@@ -290,6 +294,14 @@
                                       INFO_DESCRIPTION_USAGE.get());
       argParser.addArgument(showUsage);
       argParser.setUsageArgument(showUsage);
+
+      serverRoot = new StringArgument("serverRoot",
+              ToolConstants.OPTION_SHORT_SERVER_ROOT,
+              ToolConstants.OPTION_LONG_SERVER_ROOT,
+              false, false, true, "{serverRootDir}", null, null,
+              null);
+      serverRoot.setHidden(true);
+      argParser.addArgument(serverRoot);
     }
     catch (ArgumentException ae)
     {
@@ -377,6 +389,15 @@
       return 1;
     }
 
+    if (serverRoot.isPresent()) {
+      DirectoryEnvironmentConfig env = DirectoryServer.getEnvironmentConfig();
+      String root = serverRoot.getValue();
+      try {
+        env.setServerRoot(new File(serverRoot.getValue()));
+      } catch (InitializationException e) {
+        ERR_INITIALIZE_SERVER_ROOT.get(root, e.getMessageObject());
+      }
+    }
 
     // Initialize the Directory Server configuration handler using the
     // information that was provided.

--
Gitblit v1.10.0