From e01ad71d761c65c94cd8531763c914c07927ea60 Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Thu, 01 Sep 2011 10:12:08 +0000
Subject: [PATCH] Fix issue OPENDJ-207, to avoid triggering X11 server when using setup --cli mode.

---
 opends/src/quicksetup/org/opends/quicksetup/installer/offline/OfflineInstaller.java   |    6 +++---
 opends/src/quicksetup/org/opends/quicksetup/installer/webstart/WebStartInstaller.java |    6 +++---
 opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java                  |    7 +++++--
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java b/opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java
index 1d6df57..24881a2 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java
@@ -2240,13 +2240,16 @@
    * @param hmSummary the Map containing the messages.
    */
   protected void updateSummaryWithServerState(
-      Map<InstallProgressStep, Message> hmSummary)
+      Map<InstallProgressStep, Message> hmSummary, Boolean isCli)
   {
    Installation installation = getInstallation();
    String cmd = getPath(installation.getControlPanelCommandFile());
-   cmd = Utils.addWordBreaks(
+   if (! isCli)
+   {
+     cmd = Utils.addWordBreaks(
        UIFactory.applyFontToHtml(cmd, UIFactory.INSTRUCTIONS_MONOSPACE_FONT),
        60, 5);
+   }
    Message status;
    if (installation.getStatus().isServerRunning())
    {
diff --git a/opends/src/quicksetup/org/opends/quicksetup/installer/offline/OfflineInstaller.java b/opends/src/quicksetup/org/opends/quicksetup/installer/offline/OfflineInstaller.java
index b773a83..3c61cca 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/installer/offline/OfflineInstaller.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/installer/offline/OfflineInstaller.java
@@ -223,7 +223,7 @@
       }
 
       checkAbort();
-      updateSummaryWithServerState(hmSummary);
+      updateSummaryWithServerState(hmSummary, true);
       setCurrentProgressStep(InstallProgressStep.FINISHED_SUCCESSFULLY);
       notifyListeners(null);
 
@@ -254,7 +254,7 @@
           }
         }
         notifyListeners(getLineBreak());
-        updateSummaryWithServerState(hmSummary);
+        updateSummaryWithServerState(hmSummary, true);
         setCurrentProgressStep(InstallProgressStep.FINISHED_WITH_ERROR);
         Message html = getFormattedError(ex, true);
         notifyListeners(html);
@@ -285,7 +285,7 @@
         }
       }
       notifyListeners(getLineBreak());
-      updateSummaryWithServerState(hmSummary);
+      updateSummaryWithServerState(hmSummary, true);
       setCurrentProgressStep(InstallProgressStep.FINISHED_WITH_ERROR);
       ApplicationException ex = new ApplicationException(
           ReturnCode.BUG,
diff --git a/opends/src/quicksetup/org/opends/quicksetup/installer/webstart/WebStartInstaller.java b/opends/src/quicksetup/org/opends/quicksetup/installer/webstart/WebStartInstaller.java
index fa7244e..032b457 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/installer/webstart/WebStartInstaller.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/installer/webstart/WebStartInstaller.java
@@ -265,7 +265,7 @@
       }
 
       checkAbort();
-      updateSummaryWithServerState(hmSummary);
+      updateSummaryWithServerState(hmSummary, false);
       setCurrentProgressStep(InstallProgressStep.FINISHED_SUCCESSFULLY);
       notifyListeners(null);
 
@@ -296,7 +296,7 @@
           }
         }
         notifyListeners(getLineBreak());
-        updateSummaryWithServerState(hmSummary);
+        updateSummaryWithServerState(hmSummary, false);
         setCurrentProgressStep(InstallProgressStep.FINISHED_WITH_ERROR);
         Message html = getFormattedError(ex, true);
         notifyListeners(html);
@@ -317,7 +317,7 @@
         }
       }
       notifyListeners(getLineBreak());
-      updateSummaryWithServerState(hmSummary);
+      updateSummaryWithServerState(hmSummary, false);
       setCurrentProgressStep(InstallProgressStep.FINISHED_WITH_ERROR);
       ApplicationException ex = new ApplicationException(
           ReturnCode.BUG,

--
Gitblit v1.10.0