ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1515705 - in /ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin: AddArtifactWindow.java VaadinServlet.java
Date Tue, 20 Aug 2013 05:14:05 GMT
Author: marrs
Date: Tue Aug 20 05:14:05 2013
New Revision: 1515705

URL: http://svn.apache.org/r1515705
Log:
ACE-410 Changed the add artifacts process to only show a single summary message. Also adjusted
the session timeout a bit.

Modified:
    ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/AddArtifactWindow.java
    ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinServlet.java

Modified: ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/AddArtifactWindow.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/AddArtifactWindow.java?rev=1515705&r1=1515704&r2=1515705&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/AddArtifactWindow.java
(original)
+++ ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/AddArtifactWindow.java
Tue Aug 20 05:14:05 2013
@@ -504,24 +504,30 @@ abstract class AddArtifactWindow extends
      */
     final List<ArtifactObject> importRemoteBundles(List<File> uploadedArtifacts)
{
         List<ArtifactObject> added = new ArrayList<ArtifactObject>();
-
+        
+        StringBuffer errors = new StringBuffer();
+        int failedImports = 0;
         for (File artifact : uploadedArtifacts) {
             try {
                 added.add(importRemoteBundle(artifact.toURI().toURL()));
             }
             catch (Exception exception) {
-                showErrorNotification("Import artifact failed", "<br/>Artifact '"
-                    + artifact.getName()
-                    + "' could not be imported into the repository.<br />"
-                    + "Reason: " + exception.getMessage());
-
+            	failedImports++;
+            	errors.append("<br />" + exception.getMessage());
                 logError("Import of " + artifact.getAbsolutePath() + " failed.", exception);
             }
             finally {
                 artifact.delete();
             }
         }
-
+        if (failedImports > 0) {
+        	if (failedImports == uploadedArtifacts.size()) {
+        		showErrorNotification("All " + failedImports + " artifacts failed", (failedImports
> 30 ? "See the server log for a full list of failures." : errors.toString()));
+        	}
+        	else {
+        		showWarningNotification("" + failedImports + "/" + uploadedArtifacts.size() + "
artifacts failed", (failedImports > 30 ? "See the server log for a full list of failures."
: errors.toString()));
+        	}
+        }
         return added;
     }
 
@@ -534,6 +540,11 @@ abstract class AddArtifactWindow extends
     final void showErrorNotification(final String aTitle, final String aMessage) {
         getParent().showNotification(aTitle, aMessage, Notification.TYPE_ERROR_MESSAGE);
     }
+    
+    /** Shows a warning messsage on screen. */
+    final void showWarningNotification(final String aTitle, final String aMessage) {
+        getParent().showNotification(aTitle, aMessage, Notification.TYPE_WARNING_MESSAGE);
+    }
 
     /**
      * Logs a given message at the error level.

Modified: ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinServlet.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinServlet.java?rev=1515705&r1=1515704&r2=1515705&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinServlet.java
(original)
+++ ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinServlet.java
Tue Aug 20 05:14:05 2013
@@ -35,8 +35,7 @@ import com.vaadin.terminal.gwt.server.Ab
 import com.vaadin.terminal.gwt.server.WebApplicationContext;
 
 public class VaadinServlet extends AbstractApplicationServlet implements ManagedService {
-
-    private static final int SESSION_TIMEOUT = 30; // in seconds (so 120 = 2 minutes)
+    private static final int SESSION_TIMEOUT = 300; // in seconds (so 120 = 2 minutes)
     private static final long serialVersionUID = 1L;
     public static final String PID = "org.apache.ace.webui.vaadin";
 



Mime
View raw message