JAL-1570 patch to enable adding a webservice which fails validation
authorCharles Ofoegbu <tcnofoegbu@dundee.ac.uk>
Mon, 17 Nov 2014 11:04:24 +0000 (11:04 +0000)
committerCharles Ofoegbu <tcnofoegbu@dundee.ac.uk>
Mon, 17 Nov 2014 11:04:24 +0000 (11:04 +0000)
src/jalview/gui/WsPreferences.java

index 876d157..de89241 100644 (file)
@@ -484,6 +484,7 @@ public class WsPreferences extends GWsPreferences
                       Desktop.desktop,
                       MessageManager.getString("info.validate_jabaws_server"),
                       MessageManager.getString("label.test_server"), JOptionPane.YES_NO_OPTION);
+
       if (validate == JOptionPane.OK_OPTION)
       {
         if (jalview.ws.jws2.Jws2Discoverer.testServiceUrl(foo))
@@ -492,10 +493,29 @@ public class WsPreferences extends GWsPreferences
         }
         else
         {
-          JOptionPane
-                  .showInternalMessageDialog(
+          int opt = JOptionPane
+                  .showInternalOptionDialog(
                           Desktop.desktop,
-                          MessageManager.getString("warn.server_didnt_pass_validation"));
+                          "The Server  '"
+                                  + foo.toString()
+                                  + "' failed validation, do you want to proceed and add it anyway? ",
+                          "Server Validation Failed",
+                          JOptionPane.YES_NO_OPTION,
+                          JOptionPane.INFORMATION_MESSAGE, null, null, null);
+          if (opt == JOptionPane.YES_OPTION)
+          {
+            return foo.toString();
+          }
+          else
+          {
+            JOptionPane
+                    .showInternalMessageDialog(
+                            Desktop.desktop,
+                            MessageManager
+                                    .getString("warn.server_didnt_pass_validation"));
+          }
+
+
         }
       }
       else