You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by ja...@apache.org on 2014/01/21 15:00:14 UTC

git commit: Made marmotta-splash and marmotta-installer work together more robust.

Updated Branches:
  refs/heads/develop 21e0e9dd3 -> f3f6356f5


Made marmotta-splash and marmotta-installer work together more robust.


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/f3f6356f
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/f3f6356f
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/f3f6356f

Branch: refs/heads/develop
Commit: f3f6356f56893e358f419c8ffb28b557e678863c
Parents: 21e0e9d
Author: Jakob Frank <ja...@apache.org>
Authored: Mon Jan 13 12:34:14 2014 +0100
Committer: Jakob Frank <ja...@apache.org>
Committed: Tue Jan 21 14:59:36 2014 +0100

----------------------------------------------------------------------
 launchers/marmotta-installer/pom.xml            | 24 +++-----------------
 .../src/main/resources/installer/standalone.xml |  3 +--
 launchers/marmotta-splash/pom.xml               |  1 +
 .../splash/common/ui/SelectionDialog.java       |  5 +---
 .../splash/startup/StartupListener.java         | 16 ++++++++-----
 .../splash/systray/SystrayListener.java         |  2 --
 6 files changed, 16 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/f3f6356f/launchers/marmotta-installer/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-installer/pom.xml b/launchers/marmotta-installer/pom.xml
index 2478fdd..e723e63 100644
--- a/launchers/marmotta-installer/pom.xml
+++ b/launchers/marmotta-installer/pom.xml
@@ -203,28 +203,10 @@
                                     <goal>copy-dependencies</goal>
                                 </goals>
                                 <configuration>
-                                    <excludeTransitive>true</excludeTransitive>
+                                    <excludeTransitive>false</excludeTransitive>
                                     <excludeArtifactIds>izpack-standalone-compiler,marmotta-webapp</excludeArtifactIds>
-                                    <includeArtifactIds>marmotta-splash</includeArtifactIds>
-                                    <outputDirectory>${stagingDir}/lib</outputDirectory>
-                                </configuration>
-                            </execution>
-                            <execution>
-                                <id>copy</id>
-                                <phase>compile</phase>
-                                <goals>
-                                    <goal>copy</goal>
-                                </goals>
-                                <configuration>
-                                    <artifactItems>
-                                        <artifactItem>
-                                            <groupId>org.apache.commons</groupId>
-                                            <artifactId>commons-lang3</artifactId>
-                                            <overWrite>false</overWrite>
-                                            <outputDirectory>${stagingDir}/lib</outputDirectory>
-                                            <destFileName>apache-commons-lang3.jar</destFileName>
-                                        </artifactItem>
-                                    </artifactItems>
+                                    <outputDirectory>${stagingDir}/lib/extra</outputDirectory>
+                                    <includeScope>runtime</includeScope>
                                 </configuration>
                             </execution>
                             <execution>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f3f6356f/launchers/marmotta-installer/src/main/resources/installer/standalone.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-installer/src/main/resources/installer/standalone.xml b/launchers/marmotta-installer/src/main/resources/installer/standalone.xml
index d6d68be..023ac98 100644
--- a/launchers/marmotta-installer/src/main/resources/installer/standalone.xml
+++ b/launchers/marmotta-installer/src/main/resources/installer/standalone.xml
@@ -88,8 +88,7 @@
             <file src="images/splashscreen.png" targetdir="\$INSTALL_PATH/apache-tomcat-${TOMCAT_VERSION}/icons" />
             <file src="tomcat/index.jsp" targetdir="\$INSTALL_PATH/apache-tomcat-${TOMCAT_VERSION}/webapps/ROOT" override="true" />
             <file src="log/catalina.out" targetdir="\$INSTALL_PATH/apache-tomcat-${TOMCAT_VERSION}/logs" />
-            <file src="lib/marmotta-splash-${MARMOTTA_VERSION}.jar" targetdir="\$INSTALL_PATH/apache-tomcat-${TOMCAT_VERSION}/lib" />
-            <file src="lib/apache-commons-lang3.jar" targetdir="\$INSTALL_PATH/apache-tomcat-${TOMCAT_VERSION}/lib" />
+            <fileset dir="lib/extra/" targetdir="\$INSTALL_PATH/apache-tomcat-${TOMCAT_VERSION}/lib/" override="false" />
             <!-- macos specific -->
             <file src="macos/Start Apache Marmotta.app" targetdir="\$INSTALL_PATH" os="mac" />
             <file src="images/icon_start.icns" targetdir="\$INSTALL_PATH/Start Apache Marmotta.app/Contents/Resources" os="mac" />

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f3f6356f/launchers/marmotta-splash/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-splash/pom.xml b/launchers/marmotta-splash/pom.xml
index b13ea48..736b096 100644
--- a/launchers/marmotta-splash/pom.xml
+++ b/launchers/marmotta-splash/pom.xml
@@ -37,6 +37,7 @@
             <groupId>org.apache.tomcat</groupId>
             <artifactId>tomcat-catalina</artifactId>
             <version>7.0.39</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.geronimo.ext.tomcat</groupId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f3f6356f/launchers/marmotta-splash/src/main/java/org/apache/marmotta/splash/common/ui/SelectionDialog.java
----------------------------------------------------------------------
diff --git a/launchers/marmotta-splash/src/main/java/org/apache/marmotta/splash/common/ui/SelectionDialog.java b/launchers/marmotta-splash/src/main/java/org/apache/marmotta/splash/common/ui/SelectionDialog.java
index 8f287c9..0e98ea2 100644
--- a/launchers/marmotta-splash/src/main/java/org/apache/marmotta/splash/common/ui/SelectionDialog.java
+++ b/launchers/marmotta-splash/src/main/java/org/apache/marmotta/splash/common/ui/SelectionDialog.java
@@ -143,7 +143,7 @@ public class SelectionDialog {
             defaultBtn = close;
         }
         
-        
+
         dialog.pack();
         dialog.setLocationRelativeTo(null);
         defaultBtn.requestFocusInWindow();
@@ -151,9 +151,6 @@ public class SelectionDialog {
         dialog.setVisible(true);
         dialog.dispose();
 
-        
-        
-        
         return result.get();
     }
     

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f3f6356f/launchers/marmotta-splash/src/main/java/org/apache/marmotta/splash/startup/StartupListener.java
----------------------------------------------------------------------
diff --git a/launchers/marmotta-splash/src/main/java/org/apache/marmotta/splash/startup/StartupListener.java b/launchers/marmotta-splash/src/main/java/org/apache/marmotta/splash/startup/StartupListener.java
index 458f7bb..0168185 100644
--- a/launchers/marmotta-splash/src/main/java/org/apache/marmotta/splash/startup/StartupListener.java
+++ b/launchers/marmotta-splash/src/main/java/org/apache/marmotta/splash/startup/StartupListener.java
@@ -108,8 +108,9 @@ public class StartupListener implements LifecycleListener {
                         List<String> hostNames = new ArrayList<String>(addressList.keySet());
                         Collections.sort(hostNames);
 
-                        String loopback = "localhost";
-                        for(String hostName : hostNames) {
+                        int loopback = -1;
+                        for (int i = 0; i < hostNames.size(); i++) {
+                            String hostName = hostNames.get(i);
                             List<InetAddress> addresses = addressList.get(hostName);
                             String label = hostName + " \n(";
                             for(Iterator<InetAddress> it = addresses.iterator(); it.hasNext(); ) {
@@ -124,7 +125,7 @@ public class StartupListener implements LifecycleListener {
 
                             if(addresses.get(0).isLoopbackAddress()) {
                                 text = "Local IP-Address. Recommended for Laptop use or Demonstration purposes";
-                                loopback = hostName;
+                                loopback = loopback<0?i:loopback;
                             } else {
                                 text = "Public IP-Address. Recommended for Workstation or Server use";
                             }
@@ -134,11 +135,14 @@ public class StartupListener implements LifecycleListener {
 
                         int choice = SelectionDialog.select("Select Server Address",
                                 "Select host address to use for configuring the\nApache Marmotta Platform.",
-                                WordUtils.wrap("For demonstration purposes or laptop installations it is recommended to select \""+loopback+"\" below. For server and workstation installations, please select a public IP address.", 60), 
-                                choices, 0);
+                                WordUtils.wrap("For demonstration purposes or laptop installations it is recommended to select \""+(loopback<0?"localhost":hostNames.get(loopback))+"\" below. For server and workstation installations, please select a public IP address.", 60), 
+                                choices, loopback);
 
                         
-                        if (choice < 0) return;
+                        if (choice < 0) {
+                            log.error("No Server Address selected, server will shut down.");
+                            throw new IllegalArgumentException("No Server Addess was selected");
+                        }
 
                         serverName = hostNames.get(choice);
                         serverPort = getServerPort();

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f3f6356f/launchers/marmotta-splash/src/main/java/org/apache/marmotta/splash/systray/SystrayListener.java
----------------------------------------------------------------------
diff --git a/launchers/marmotta-splash/src/main/java/org/apache/marmotta/splash/systray/SystrayListener.java b/launchers/marmotta-splash/src/main/java/org/apache/marmotta/splash/systray/SystrayListener.java
index 17e5ca7..fb45627 100644
--- a/launchers/marmotta-splash/src/main/java/org/apache/marmotta/splash/systray/SystrayListener.java
+++ b/launchers/marmotta-splash/src/main/java/org/apache/marmotta/splash/systray/SystrayListener.java
@@ -84,8 +84,6 @@ public class SystrayListener implements LifecycleListener {
         if(event.getType().equals(Lifecycle.AFTER_START_EVENT) && SystemTray.isSupported()) {
             initContextLinks();
             initSysTray();
-        } else if (event.getType().equals(Lifecycle.BEFORE_STOP_EVENT) && SystemTray.isSupported()) {
-            SystemTray.getSystemTray().remove(icon);
         }
     }