From: gmungoc
Date: Wed, 19 Nov 2014 12:55:39 +0000 (+0000)
Subject: JAL-1342 new command-line parameter -jabaws
X-Git-Tag: Release_2_8_2b1^2~20
X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9d139ca8d1af8f0f2d78193d418ae9e9168a3e8a;p=jalview.git
JAL-1342 new command-line parameter -jabaws
---
diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java
index 24ed1b4..3b0a23e 100755
--- a/src/jalview/bin/Cache.java
+++ b/src/jalview/bin/Cache.java
@@ -150,6 +150,7 @@ import org.apache.log4j.SimpleLayout;
* FOLLOW_SELECTIONS (true) Controls whether a new alignment view should
* respond to selections made in other alignments containing the same sequences.
*
+ * JWS2HOSTURLS comma-separated list of URLs to try for JABAWS services
* SHOW_WSDISCOVERY_ERRORS (true) Controls if the web service URL discovery
* warning dialog box is displayed.
* ANNOTATIONCOLOUR_MIN (orange) Shade used for minimum value of annotation
diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java
index 184c267..f80f341 100755
--- a/src/jalview/bin/Jalview.java
+++ b/src/jalview/bin/Jalview.java
@@ -24,6 +24,7 @@ import jalview.gui.AlignFrame;
import jalview.gui.Desktop;
import jalview.util.MessageManager;
import jalview.util.Platform;
+import jalview.ws.jws2.Jws2Discoverer;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@@ -34,6 +35,7 @@ import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.lang.reflect.Constructor;
+import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.net.URLDecoder;
@@ -106,40 +108,7 @@ public class Jalview
if (aparser.contains("help") || aparser.contains("h"))
{
- System.out
- .println("Usage: jalview -open [FILE] [OUTPUT_FORMAT] [OUTPUT_FILE]\n\n"
- + "-nodisplay\tRun Jalview without User Interface.\n"
- + "-props FILE\tUse the given Jalview properties file instead of users default.\n"
- + "-colour COLOURSCHEME\tThe colourscheme to be applied to the alignment\n"
- + "-annotations FILE\tAdd precalculated annotations to the alignment.\n"
- + "-tree FILE\tLoad the given newick format tree file onto the alignment\n"
- + "-features FILE\tUse the given file to mark features on the alignment.\n"
- + "-fasta FILE\tCreate alignment file FILE in Fasta format.\n"
- + "-clustal FILE\tCreate alignment file FILE in Clustal format.\n"
- + "-pfam FILE\tCreate alignment file FILE in PFAM format.\n"
- + "-msf FILE\tCreate alignment file FILE in MSF format.\n"
- + "-pileup FILE\tCreate alignment file FILE in Pileup format\n"
- + "-pir FILE\tCreate alignment file FILE in PIR format.\n"
- + "-blc FILE\tCreate alignment file FILE in BLC format.\n"
- + "-jalview FILE\tCreate alignment file FILE in Jalview format.\n"
- + "-png FILE\tCreate PNG image FILE from alignment.\n"
- + "-imgMap FILE\tCreate HTML file FILE with image map of PNG image.\n"
- + "-eps FILE\tCreate EPS file FILE from alignment.\n"
- + "-questionnaire URL\tQueries the given URL for information about any Jalview user questionnaires.\n"
- + "-noquestionnaire\tTurn off questionnaire check.\n"
- + "-nousagestats\tTurn off google analytics tracking for this session.\n"
- + "-sortbytree OR -nosortbytree\tEnable or disable sorting of the given alignment by the given tree\n"
- // +
- // "-setprop PROPERTY=VALUE\tSet the given Jalview property, after all other properties files have been read\n\t (quote the 'PROPERTY=VALUE' pair to ensure spaces are passed in correctly)"
- + "-dasserver nickname=URL\tAdd and enable a das server with given nickname\n\t\t\t(alphanumeric or underscores only) for retrieval of features for all alignments.\n"
- + "\t\t\tSources that also support the sequence command may be specified by prepending the URL with sequence:\n"
- + "\t\t\t e.g. sequence:http://localdas.somewhere.org/das/source)\n"
- + "-fetchfrom nickname\tQuery nickname for features for the alignments and display them.\n"
- // +
- // "-vdoc vamsas-document\tImport vamsas document into new session or join existing session with same URN\n"
- // + "-vses vamsas-session\tJoin session with given URN\n"
- + "-groovy FILE\tExecute groovy script in FILE, after all other arguments have been processed (if FILE is the text 'STDIN' then the file will be read from STDIN)\n"
- + "\n~Read documentation in Application or visit http://www.jalview.org for description of Features and Annotations file~\n\n");
+ showUsage();
System.exit(0);
}
if (aparser.contains("nodisplay") || aparser.contains("nogui")
@@ -150,6 +119,20 @@ public class Jalview
}
Cache.loadProperties(aparser.getValue("props")); // must do this before
// anything else!
+
+ final String jabawsUrl = aparser.getValue("jabaws");
+ if (jabawsUrl != null)
+ {
+ try
+ {
+ Jws2Discoverer.getDiscoverer().setPreferredUrl(jabawsUrl);
+ } catch (MalformedURLException e)
+ {
+ System.err.println("Invalid jabaws parameter: " + jabawsUrl
+ + " ignored");
+ }
+ }
+
String defs = aparser.getValue("setprop");
while (defs != null)
{
@@ -619,6 +602,45 @@ public class Jalview
}
}
+ private static void showUsage()
+ {
+ System.out
+ .println("Usage: jalview -open [FILE] [OUTPUT_FORMAT] [OUTPUT_FILE]\n\n"
+ + "-nodisplay\tRun Jalview without User Interface.\n"
+ + "-props FILE\tUse the given Jalview properties file instead of users default.\n"
+ + "-colour COLOURSCHEME\tThe colourscheme to be applied to the alignment\n"
+ + "-annotations FILE\tAdd precalculated annotations to the alignment.\n"
+ + "-tree FILE\tLoad the given newick format tree file onto the alignment\n"
+ + "-features FILE\tUse the given file to mark features on the alignment.\n"
+ + "-fasta FILE\tCreate alignment file FILE in Fasta format.\n"
+ + "-clustal FILE\tCreate alignment file FILE in Clustal format.\n"
+ + "-pfam FILE\tCreate alignment file FILE in PFAM format.\n"
+ + "-msf FILE\tCreate alignment file FILE in MSF format.\n"
+ + "-pileup FILE\tCreate alignment file FILE in Pileup format\n"
+ + "-pir FILE\tCreate alignment file FILE in PIR format.\n"
+ + "-blc FILE\tCreate alignment file FILE in BLC format.\n"
+ + "-jalview FILE\tCreate alignment file FILE in Jalview format.\n"
+ + "-png FILE\tCreate PNG image FILE from alignment.\n"
+ + "-imgMap FILE\tCreate HTML file FILE with image map of PNG image.\n"
+ + "-eps FILE\tCreate EPS file FILE from alignment.\n"
+ + "-questionnaire URL\tQueries the given URL for information about any Jalview user questionnaires.\n"
+ + "-noquestionnaire\tTurn off questionnaire check.\n"
+ + "-nousagestats\tTurn off google analytics tracking for this session.\n"
+ + "-sortbytree OR -nosortbytree\tEnable or disable sorting of the given alignment by the given tree\n"
+ // +
+ // "-setprop PROPERTY=VALUE\tSet the given Jalview property, after all other properties files have been read\n\t (quote the 'PROPERTY=VALUE' pair to ensure spaces are passed in correctly)"
+ + "-jabaws URL\tSpecify URL for Jabaws services (e.g. for a local installation).\n"
+ + "-dasserver nickname=URL\tAdd and enable a das server with given nickname\n\t\t\t(alphanumeric or underscores only) for retrieval of features for all alignments.\n"
+ + "\t\t\tSources that also support the sequence command may be specified by prepending the URL with sequence:\n"
+ + "\t\t\t e.g. sequence:http://localdas.somewhere.org/das/source)\n"
+ + "-fetchfrom nickname\tQuery nickname for features for the alignments and display them.\n"
+ // +
+ // "-vdoc vamsas-document\tImport vamsas document into new session or join existing session with same URN\n"
+ // + "-vses vamsas-session\tJoin session with given URN\n"
+ + "-groovy FILE\tExecute groovy script in FILE, after all other arguments have been processed (if FILE is the text 'STDIN' then the file will be read from STDIN)\n"
+ + "\n~Read documentation in Application or visit http://www.jalview.org for description of Features and Annotations file~\n\n");
+ }
+
private static void startUsageStats(final Desktop desktop)
{
/**
diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java
index 23ba893..7a1202c 100644
--- a/src/jalview/gui/Desktop.java
+++ b/src/jalview/gui/Desktop.java
@@ -2602,7 +2602,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
+ ermsg
+ ""
+ "It may be that you have invalid JABA URLs
in your web service preferences,"
- + " or mis-configured HTTP proxy settings.
"
+ + "
or as a command-line argument, or mis-configured HTTP proxy settings.
"
+ "Check the Connections and Web services tab
of the"
+ " Tools->Preferences dialog box to change them.