resolves JAL-805
authorjprocter <Jim Procter>
Thu, 7 Apr 2011 13:05:39 +0000 (13:05 +0000)
committerjprocter <Jim Procter>
Thu, 7 Apr 2011 13:05:39 +0000 (13:05 +0000)
src/jalview/ws/EnfinEnvision2OneWay.java

index 6a9371b..b5b081d 100644 (file)
@@ -35,7 +35,9 @@ import java.awt.event.ItemEvent;
 import java.awt.event.ItemListener;
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
 import java.net.URL;
+import java.net.URLEncoder;
 import java.util.Hashtable;
 import java.util.Map;
 import java.util.Vector;
@@ -140,17 +142,28 @@ public class EnfinEnvision2OneWay extends DefaultHandler implements
       {
         groupURLdescr.addElement(description);
         groupURLdescr.addElement(description);
+        String urlstub=wfname;
+        if (wfname.indexOf(" ")>-1)
+        {
+               // make the name safe!
+               try {
+                               urlstub = URLEncoder.encode(wfname,"utf-8");
+                       } catch (UnsupportedEncodingException e) {
+                               // TODO Auto-generated catch block
+                               e.printStackTrace();
+                       }
+        }
         groupURLLinks
                 .addElement(wfname
                         + "|"
                         + "http://www.ebi.ac.uk/enfin-srv/envision2/pages/linkin.jsf?tool=Jalview&workflow="
-                        + wfname
+                        + urlstub
                         + "&datasetName=JalviewSeqs$DATASETID$&input=$SEQUENCEIDS$&inputType=0|,"); // #"+description+"#");
         groupURLLinks
                 .addElement(wfname
                         + "|"
                         + "http://www.ebi.ac.uk/enfin-srv/envision2/pages/linkin.jsf?tool=Jalview&workflow="
-                        + wfname
+                        + urlstub
                         + "&datasetName=JalviewSeqs$DATASETID$&input=$SEQUENCES=/([A-Za-z]+)+/=$&inputType=1|,"); // #"+description+"#");
       }
     }