From c5ca4d0db02eb2c304b559e9ac870e24d649c527 Mon Sep 17 00:00:00 2001 From: jprocter Date: Mon, 9 Nov 2009 16:54:40 +0000 Subject: [PATCH] user friendly GA and privacy statement --- help/html/privacy.html | 80 +++++++++++----- src/jalview/bin/Jalview.java | 215 ++++++++++++++++++++++++++---------------- 2 files changed, 189 insertions(+), 106 deletions(-) diff --git a/help/html/privacy.html b/help/html/privacy.html index 4e5525e..11728a5 100644 --- a/help/html/privacy.html +++ b/help/html/privacy.html @@ -1,25 +1,59 @@ - Jalview Privacy Statement -

Privacy for Jalview Users
- The Jalview Desktop application available from the www.jalview.org site does not contain code that is designed to collate any personal or private information without your consent. - - However, the application does contain routines which contact a variety of web services, and some of these are specifically designed to assess who is using Jalview. - - We collect usage statistics in the following ways: -

-

- Stopping Jalview from calling home - If you run Jalview in 'headless mode' via the command line, then the program shouldn't try to contact any of the web servers mentioned above (if it does, then its a bug!). You can also specify some command line options to disable the questionnaire and usage statistics check. Finally, the Connections Tab of the jalview preferences contains options for controlling the submission of usage statistics. - Other Web Clients in Jalview
- The Jalview desktop is intended to make it easier to interact with web-based bioinformatics resources, but we cannot vouch for the integrity of any of the services you might access via the program. Sorry! -

- + +Jalview Privacy Statement + + +

Privacy for Jalview Users
+

The Jalview Desktop application which is available from the +www.jalview.org site does not contain code designed collect personal or +private information without your consent. However, we do collect usage +statistics to work out who is using Jalview, so we can apply for funding +to support Jalview development, and make it better for our users.

+

Usage data is collected from the logs of various web services that the Jalview Desktop contacts through its normal operation. +These are described below:

+ +

+

Stopping Jalview from calling home
+If you run Jalview in 'headless mode' via the command line, then the +program shouldn't try to contact any of the web servers mentioned above +(if it does, then it's a bug!). You can also specify some command line options to disable +the questionnaire and usage statistics check. Finally, the Connections Tab of the +jalview preferences contains options for controlling the submission of +usage statistics. +

Other Web Clients in Jalview
+The Jalview desktop is intended to make it easier to interact with +web-based bioinformatics resources. However, we can't take any +responsibility for the integrity of any external services you might +access via the program. Sorry!

+ \ No newline at end of file diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 919822a..3c12dda 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -48,24 +48,29 @@ import jalview.io.AppletFormatAdapter; */ public class Jalview { - static { - // grab all the rights we can the JVM - Policy.setPolicy( new Policy() { - public PermissionCollection - getPermissions(CodeSource codesource) { - Permissions perms = new Permissions(); - perms.add(new AllPermission()); - return(perms); - } - public void refresh(){ - } + static + { + // grab all the rights we can the JVM + Policy.setPolicy(new Policy() + { + public PermissionCollection getPermissions(CodeSource codesource) + { + Permissions perms = new Permissions(); + perms.add(new AllPermission()); + return (perms); + } + + public void refresh() + { + } }); } + /** * main class for Jalview application * * @param args - * open filename + * open filename */ public static void main(String[] args) { @@ -102,13 +107,15 @@ public class Jalview + "-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)" + // + + // "-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" + + "\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" + // + + // "-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"); System.exit(0); @@ -116,17 +123,19 @@ public class Jalview Cache.loadProperties(aparser.getValue("props")); // must do this before // anything else! String defs = aparser.getValue("setprop"); - while (defs!=null) + while (defs != null) { int p = defs.indexOf('='); - if ( p==-1 ) + if (p == -1) { - System.err.println("Ignoring invalid setprop argument : "+defs); - } else { - System.out.println("Executing setprop argument: "+defs); + System.err.println("Ignoring invalid setprop argument : " + defs); + } + else + { + System.out.println("Executing setprop argument: " + defs); // DISABLED FOR SECURITY REASONS // TODO: add a property to allow properties to be overriden by cli args - // Cache.setProperty(defs.substring(0,p), defs.substring(p+1)); + // Cache.setProperty(defs.substring(0,p), defs.substring(p+1)); } defs = aparser.getValue("setprop"); } @@ -163,7 +172,6 @@ public class Jalview // "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" // "com.sun.java.swing.plaf.motif.MotifLookAndFeel" - ); } catch (Exception ex) { @@ -173,7 +181,8 @@ public class Jalview desktop = new Desktop(); desktop.setVisible(true); desktop.discoverer.start(); - if (!aparser.contains("nousagestats")) { + if (!aparser.contains("nousagestats")) + { startUsageStats(desktop); } if (!aparser.contains("noquestionnaire")) @@ -208,10 +217,10 @@ public class Jalview String file = null, protocol = null, format = null, data = null; jalview.io.FileLoader fileLoader = new jalview.io.FileLoader(); Vector getFeatures = null; // vector of das source nicknames to fetch - // features from + // features from // loading is done. String groovyscript = null; // script to execute after all loading is - // completed one way or another + // completed one way or another // extract groovy argument and execute if necessary groovyscript = aparser.getValue("groovy"); file = aparser.getValue("open"); @@ -221,57 +230,86 @@ public class Jalview System.out.println("No files to open!"); System.exit(1); } - String vamsasImport=aparser.getValue("vdoc"),vamsasSession=aparser.getValue("vsess"); - if (vamsasImport!=null || vamsasSession!=null) + String vamsasImport = aparser.getValue("vdoc"), vamsasSession = aparser + .getValue("vsess"); + if (vamsasImport != null || vamsasSession != null) { - if (desktop==null || headless) + if (desktop == null || headless) { - System.out.println("Headless vamsas sessions not yet supported. Sorry."); + System.out + .println("Headless vamsas sessions not yet supported. Sorry."); System.exit(1); } // if we have a file, start a new session and import it. boolean inSession = false; - if (vamsasImport!=null) - { - try { - String viprotocol = Jalview.checkProtocol(vamsasImport); - if (viprotocol == jalview.io.FormatAdapter.FILE) { - inSession = desktop.vamsasImport(new File(vamsasImport)); - } else if (viprotocol == jalview.io.FormatAdapter.URL) { - inSession = desktop.vamsasImport(new URL(vamsasImport)); - } - - } catch (Exception e) + if (vamsasImport != null) + { + try + { + String viprotocol = Jalview.checkProtocol(vamsasImport); + if (viprotocol == jalview.io.FormatAdapter.FILE) { - System.err.println("Exeption when importing "+vamsasImport+" as a vamsas document."); - e.printStackTrace(); + inSession = desktop.vamsasImport(new File(vamsasImport)); } - if (!inSession) { - System.err.println("Failed to import "+vamsasImport+" as a vamsas document."); - } else { - System.out.println("Imported Successfully into new session "+desktop.getVamsasApplication().getCurrentSession()); + else if (viprotocol == jalview.io.FormatAdapter.URL) + { + inSession = desktop.vamsasImport(new URL(vamsasImport)); } + + } catch (Exception e) + { + System.err.println("Exeption when importing " + vamsasImport + + " as a vamsas document."); + e.printStackTrace(); + } + if (!inSession) + { + System.err.println("Failed to import " + vamsasImport + + " as a vamsas document."); + } + else + { + System.out.println("Imported Successfully into new session " + + desktop.getVamsasApplication().getCurrentSession()); + } } - if (vamsasSession!=null) { - if (vamsasImport!=null) { - // close the newly imported session and import the Jalview specific remnants into the new session later on. + if (vamsasSession != null) + { + if (vamsasImport != null) + { + // close the newly imported session and import the Jalview specific + // remnants into the new session later on. desktop.vamsasStop_actionPerformed(null); } // now join the new session - try { - if (desktop.joinVamsasSession(vamsasSession)) { - System.out.println("Successfully joined vamsas session "+vamsasSession); - } else { - System.err.println("WARNING: Failed to join vamsas session "+vamsasSession); + try + { + if (desktop.joinVamsasSession(vamsasSession)) + { + System.out.println("Successfully joined vamsas session " + + vamsasSession); + } + else + { + System.err.println("WARNING: Failed to join vamsas session " + + vamsasSession); } } catch (Exception e) { - System.err.println("ERROR: Failed to join vamsas session "+vamsasSession); + System.err.println("ERROR: Failed to join vamsas session " + + vamsasSession); e.printStackTrace(); } - if (vamsasImport!=null) { - // the Jalview specific remnants can now be imported into the new session at the user's leisure. - Cache.log.info("Skipping Push for import of data into existing vamsas session."); // TODO: enable this when debugged + if (vamsasImport != null) + { + // the Jalview specific remnants can now be imported into the new + // session at the user's leisure. + Cache.log + .info("Skipping Push for import of data into existing vamsas session."); // TODO: + // enable + // this + // when + // debugged // desktop.getVamsasApplication().push_update(); } } @@ -455,7 +493,7 @@ public class Jalview // We'll only open the default file if the desktop is visible. // And the user // //////////////////// - if (!headless && file == null && vamsasImport==null + if (!headless && file == null && vamsasImport == null && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true)) { file = jalview.bin.Cache.getDefault("STARTUP_FILE", @@ -513,20 +551,29 @@ public class Jalview /** * start a User Config prompt asking if we can log usage statistics. */ - jalview.gui.PromptUserConfig prompter = new jalview.gui.PromptUserConfig(desktop.desktop,"USAGESTATS", "Jalview Usage Statistics", "Jalview uses Google Analytics to report usage statistics.\nDo you want to enable this ?\n\n(if you press cancel, you will be asked again next time)", - new Runnable() { - public void run() - { - Cache.log.info("Initialising googletracker for usage stats."); - Cache.initGoogleTracker(); - Cache.log.debug("Tracking enabled."); - } - }, - new Runnable() { - public void run() { - Cache.log.info("Not enabling Google Tracking."); - } - }, null, true); + jalview.gui.PromptUserConfig prompter = new jalview.gui.PromptUserConfig( + desktop.desktop, + "USAGESTATS", + "Jalview Usage Statistics", + "Do you want to help make Jalview better by enabling " + +"the collection of usage statistics with Google Analytics ?" + +"\n\n(if you press cancel, you will be asked again next time)", + new Runnable() + { + public void run() + { + Cache.log + .info("Initialising googletracker for usage stats."); + Cache.initGoogleTracker(); + Cache.log.debug("Tracking enabled."); + } + }, new Runnable() + { + public void run() + { + Cache.log.info("Not enabling Google Tracking."); + } + }, null, true); SwingUtilities.invokeLater(prompter); } @@ -534,10 +581,10 @@ public class Jalview * Locate the given string as a file and pass it to the groovy interpreter. * * @param groovyscript - * the script to execute + * the script to execute * @param jalviewContext - * the Jalview Desktop object passed in to the groovy binding - * as the 'Jalview' object. + * the Jalview Desktop object passed in to the groovy binding as the + * 'Jalview' object. */ private static void executeGroovyScript(String groovyscript, Object jalviewContext) @@ -605,8 +652,8 @@ public class Jalview * groovy.lang.Binding; import groovy.util.GroovyScriptEngine; * * String[] roots = new String[] { "/my/groovy/script/path" }; - * GroovyScriptEngine gse = new GroovyScriptEngine(roots); Binding binding = - * new Binding(); binding.setVariable("input", "world"); + * GroovyScriptEngine gse = new GroovyScriptEngine(roots); Binding binding + * = new Binding(); binding.setVariable("input", "world"); * gse.run("hello.groovy", binding); */ ClassLoader cl = jalviewContext.getClass().getClassLoader(); @@ -658,7 +705,7 @@ public class Jalview { String nickname = null; String url = null; - boolean seq=false,feat=true; + boolean seq = false, feat = true; int pos = data.indexOf('='); // determine capabilities if (pos > 0) @@ -666,7 +713,9 @@ public class Jalview nickname = data.substring(0, pos); } url = data.substring(pos + 1); - if (url != null && (url.startsWith("http:") || url.startsWith("sequence:http:"))) + if (url != null + && (url.startsWith("http:") || url + .startsWith("sequence:http:"))) { if (nickname == null) { @@ -708,7 +757,7 @@ public class Jalview } return source; } - + /** * start a feature fetcher for every alignment frame * -- 1.7.10.2