Merge branch 'Release_2_8_1_Branch' into Release_2_8_1_Branch_i18n
authorJim Procter <jprocter@compbio.dundee.ac.uk>
Mon, 13 Jan 2014 14:13:29 +0000 (14:13 +0000)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Mon, 13 Jan 2014 14:13:29 +0000 (14:13 +0000)
15 files changed:
appletlib/JmolApplet-12.2.4.jar
build.xml
examples/appletParameters.html
examples/applets.html
examples/embedded.html
examples/embeddedWJmol.html
examples/formComplete.html
examples/javascriptLaunch.html
examples/linkedapplets_ng.html
lib/Jmol-12.2.4.jar
src/jalview/io/FileParse.java
src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java
test/jalview/io/FileIOTester.java
utils/InstallAnywhere/Jalview.iap_xml
utils/proguard.jar

index aeecb80..e17c4ac 100644 (file)
Binary files a/appletlib/JmolApplet-12.2.4.jar and b/appletlib/JmolApplet-12.2.4.jar differ
index 0e13756..12e16a8 100755 (executable)
--- a/build.xml
+++ b/build.xml
@@ -85,6 +85,8 @@
                <!-- Key Password -->
                <property name="jalview.key.pass" value="alignmentisfun" />
 
+                   
+                   
                <!-- Don't change anything below here unless you know what you are doing! -->
                <!-- Url path for WebStart in JNLP file -->
                <property name="WebStartLocation" value="http://www.jalview.org/webstart" />
                <property name="WebStartImage" value="JalviewLogo_big.png"/>
                <!-- J2SE version needed for webstart launch -->
                <property name="j2sev" value="1.6+"/>
+
+    <!-- Permissions for running Java applets and applications. Defaults are those suitable for deploying jalview webstart/jalviewLite at www.jalview.org -->
+    <property name="application.codebase" value="*.jalview.org"/>
+    <property name="applet.codebase" value="*.jalview.org"/>
+    <property name="applet.caller-codebase" value="${applet.codebase}"/>
+
                <!-- build directory configuration -->
                <property name="libDir" value="lib" />
                <property name="resourceDir" value="resources" />
 
        <target name="makefulldist" depends="makedist">
                <!-- the default keystore details might need to be edited here -->
-               <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
+               <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false" sigalg="SHA1withRSA">
 
                        <fileset dir="${packageDir}">
                                <include name="*.jar" />
                                <include name="*.jar"/>
                        </fileset>
                </delete>
-               <jar destfile="${packageDir}/${outputJar}">
+               <jar destfile="${packageDir}/${outputJar}" index="true">
                        <manifest>
                                <attribute name="Main-Class" value="jalview.bin.Jalview" />
+        <attribute name="Permissions" value="all-permissions" />
+        <!--<attribute name="Trusted-Lib" value="true" /> -->
+        <attribute name="Application-Name" value="Jalview Desktop"/>
+        <attribute name="Codebase" value="${application.codebase}"/>
                        </manifest>
                        <fileset dir="${outputDir}/">
                                <exclude name="cache*/**" />
                <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif" />
                <copy todir="${outputDir}/lang">
                        <fileset dir="${resourceDir}/lang"><include name="**.*"/></fileset></copy>
-               <jar destfile="in.jar">
+               <jar destfile="in.jar" index="true">
                        <manifest>
                                <attribute name="Main-Class" value="jalview.bin.JalviewLite" />
+                               <attribute name="Application-Name" value="JalviewLite Applet"/>
+                               <!--            <attribute name="Permissions" value="sandbox" /> -->
+                               <!--<attribute name="Trusted-Lib" value="true" /> -->
+                               <attribute name="Codebase" value="${applet.codebase}"/>
+                               <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}"/>
                        </manifest>
                        <fileset dir="${outputDir}">
                                <include name="com/**" />
                        <injar file="in.jar" />
                        <outjar file="${jalviewLiteJar}" />
                        <libraryjar refid="obfuscateDeps.path" />
+                       <dontwarn/>
                        <keep access="public" type="class" name="jalview.bin.JalviewLite">
                                <field access="public" />
                                <method access="public" />
                                <constructor access="public" />
                        </keep>
+                       <keep access="public" type="class" name="jalview.appletgui.AlignFrame">
+                               <field access="public" />
+                               <method access="public" />
+                               <constructor access="public" />
+                       </keep>
                        <!--      -libraryjars "${obfuscateDeps}"
       -injars      in.jar
       -outjars     jalviewApplet.jar
                      <include name="**/*"/>
                        </fileset>
          </copy>
-                       
+           <jar update="true" index="true" jarfile="${packageDir}/examples/${jalviewLiteJar}"/>
+           <jar update="true" index="true" jarfile="${packageDir}/examples/${jmolJar}">
+               <manifest>
+               <attribute name="Application-Name" value="Jmol (bundled with JalviewLite)"/>
+               <!--          <attribute name="Permissions" value="sandbox" /> -->
+               <!--<attribute name="Trusted-Lib" value="true" /> -->
+               <attribute name="Codebase" value="${applet.codebase}"/>
+               <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}"/>
+                 </manifest>
+               </jar>
+    <signjar sigalg="SHA1WithRSA" storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
+      <fileset dir="${packageDir}/examples">
+        <include name="*.jar" />
+      </fileset>
+    </signjar>
        </target>
        <target name="sourcedoc" description="Create jalview source documentation pages" depends="init">
         <javadoc destdir="${javadocDir}">
index 3b10c14..4779046 100644 (file)
@@ -174,6 +174,11 @@ var _gaq = _gaq || [];_gaq.push(["_setAccount", "UA-9060947-1"]);_gaq.push(["_tr
             <td width="80" ><strong>value=&quot;&quot;&gt;</strong></td>
             <td width="100%"><strong>Description</strong></td>
           </tr>
+          <tr>
+          <td>permissions</td>
+          <td>sandbox</td>
+          <td><strong>This parameter is necessary, and must have the value <em>sandbox</em> to allow the JalviewLite applet to run.</strong></td>
+          </tr>
           <tr> 
             <td>file</td>
             <td>fileName</td>
index c53cc7a..255f104 100755 (executable)
@@ -178,6 +178,7 @@ var _gaq = _gaq || [];_gaq.push(["_setAccount", "UA-9060947-1"]);_gaq.push(["_tr
       <td width="10%" valign="center"><applet
         code="jalview.bin.JalviewLite" width="140" height="35"
         archive="jalviewApplet.jar">
+<param name="permissions" value="sandbox">
        <param name="file" value="uniref50.fa">
         <param name="treeFile" value="ferredoxin.nw">
          <param name="userDefinedColour"
@@ -203,6 +204,7 @@ var _gaq = _gaq || [];_gaq.push(["_setAccount", "UA-9060947-1"]);_gaq.push(["_tr
       <td width="10%" valign="center"><applet
         code="jalview.bin.JalviewLite" width="140" height="35"
         archive="jalviewApplet.jar">
+<param name="permissions" value="sandbox">
        <param name="file" value="uniref50.fa">
         <param name="features" value="exampleFeatures.txt">
          <param name="showFeatureSettings" value="true">
@@ -226,6 +228,7 @@ var _gaq = _gaq || [];_gaq.push(["_setAccount", "UA-9060947-1"]);_gaq.push(["_tr
       <td width="10%" valign="center"><applet
         code="jalview.bin.JalviewLite" width="140" height="35"
         archive="jalviewApplet.jar,JmolApplet-12.2.4.jar">
+<param name="permissions" value="sandbox">
        <param name="file" value="uniref50.fa">
         <!-- <param name="debug" value="true">
                         -->
@@ -252,6 +255,7 @@ var _gaq = _gaq || [];_gaq.push(["_setAccount", "UA-9060947-1"]);_gaq.push(["_tr
       <td width="10%" valign="middle"><applet
         code="jalview.bin.JalviewLite" width="140" height="35"
         archive="jalviewApplet.jar">
+<param name="permissions" value="sandbox">
        <param name="file" value="jpred_msa.fasta">
         <param name="jnetfile" value="jpred_msa.seq.concise">
          <param name="defaultColour" value="Clustal">
@@ -284,6 +288,7 @@ var _gaq = _gaq || [];_gaq.push(["_setAccount", "UA-9060947-1"]);_gaq.push(["_tr
       <td width="10%" valign="center"><applet
         code="jalview.bin.JalviewLite" width="140" height="35"
         archive="jalviewApplet.jar">
+<param name="permissions" value="sandbox">
        <param name="file" value="RF00031_folded.stk">
         <param name="defaultColour" value="Purine/Pyrimidine">
          <param name="showAnnotation" value="true">
index 2384737..eda8a27 100644 (file)
@@ -169,7 +169,8 @@ var _gaq = _gaq || [];_gaq.push(["_setAccount", "UA-9060947-1"]);_gaq.push(["_tr
 </ul>
 <applet code="jalview.bin.JalviewLite"
                        width="756" height="560" archive="jalviewApplet.jar">
-                       <param name="file" value="plantfdx.fa">
+                       <param name="permissions" value="sandbox">
+      <param name="file" value="plantfdx.fa">
                        <param name="annotations" value="plantfdx.annotations">
                        <param name="features" value="plantfdx.features">
                        <param name="embedded" value="true">
index 5a65953..24f7406 100644 (file)
@@ -108,7 +108,8 @@ function genHref()
   ,
   linkUrl_2 : "http://us.expasy.org/cgi-bin/niceprot.pl?$SEQUENCE_ID$",
   APPLICATION_URL : "http://www.jalview.org/services/launchApp",
-  PDBfile : "1gaq.txt FER1_MAIZE"
+  PDBfile : "1gaq.txt FER1_MAIZE",
+  permissions : "sandbox"
  };
  jmolSetCallback("hoverCallback","_jmolhover");
   jmolSetCallback("pickCallback","_jmolpick");
index 91b0670..2f3f2f0 100644 (file)
@@ -163,6 +163,7 @@ var _gaq = _gaq || [];_gaq.push(["_setAccount", "UA-9060947-1"]);_gaq.push(["_tr
                <a name="api">View the full <a href="jalviewLiteJs.html">JalviewLite API documentation</a>.</a>
                <applet code="jalview.bin.JalviewLite" width="0" height="0"
                        archive="jalviewApplet.jar" name="Jalview">
+                       <param name="permissions" value="sandbox">
                        <param name="file" value="plantfdx.fa">
                        <param name="features" value="plantfdx.features">
                        <param name="wrap" value="true">
index f555265..d565ed2 100644 (file)
@@ -242,6 +242,7 @@ function startJalview(aligURL,title,alwvar) {
 archive="jalviewApplet.jar" width="0" height="0">
 <param name="debug" value="true"/>
 <param name="showbutton" value="false"/>
+<param name="permissions" value="sandbox"/>
 </applet>
 
 
index 86f4bc0..ef43184 100644 (file)
@@ -208,6 +208,7 @@ document.onclick = mclose;
  
     ,
     linkUrl_2 : "http://us.expasy.org/cgi-bin/niceprot.pl?$SEQUENCE_ID$",
+    permissions : 'sandbox',
     APPLICATION_URL : "http://www.jalview.org/services/launchApp"
   };
  
@@ -242,6 +243,7 @@ document.onclick = mclose;
  
     ,
     linkUrl_2 : "http://us.expasy.org/cgi-bin/niceprot.pl?$SEQUENCE_ID$",
+    permissions : 'sandbox',
     APPLICATION_URL : "http://www.jalview.org/services/launchApp"
   };
   deployJava.runApplet(attributes, parameters, '1.6');
index 39019b4..f1254cd 100644 (file)
Binary files a/lib/Jmol-12.2.4.jar and b/lib/Jmol-12.2.4.jar differ
index f9440fa..bb52ec2 100755 (executable)
@@ -142,12 +142,35 @@ public class FileParse
     }
     if (!error)
     {
+      if (fileStr.toLowerCase().endsWith(".gz"))
+      {
+        try
+        {
+          dataIn = tryAsGzipSource(new FileInputStream(fileStr));
+          dataName = fileStr;
+          return error;
+        } catch (Exception x)
+        {
+          warningMessage = "Failed  to resolve as a GZ stream ("
+                  + x.getMessage() + ")";
+          x.printStackTrace();
+        }
+        ;
+      }
+      
       dataIn = new BufferedReader(new FileReader(fileStr));
       dataName = fileStr;
     }
     return error;
   }
-
+  private BufferedReader tryAsGzipSource(InputStream inputStream) throws Exception
+  {
+    BufferedReader inData = new BufferedReader(new InputStreamReader(new GZIPInputStream(inputStream)));
+    inData.mark(2048);
+    inData.read();
+    inData.reset();
+    return inData;
+  }
   private boolean checkURLSource(String fileStr) throws IOException,
           MalformedURLException
   {
@@ -156,14 +179,10 @@ public class FileParse
     //
     // GZIPInputStream code borrowed from Aquaria (soon to be open sourced) via Kenny Sabir
     Exception e=null;
-    if (fileStr.endsWith(".gz")) {
+    if (fileStr.toLowerCase().endsWith(".gz")) {
       try {
           InputStream inputStream = url.openStream();
-          dataIn = new BufferedReader(new InputStreamReader(new GZIPInputStream(inputStream)));
-          dataIn.mark(2048);
-          dataIn.read();
-          dataIn.reset();
-          
+          dataIn = tryAsGzipSource(inputStream);
           dataName = fileStr;
           return false;
       } catch (Exception ex) {
index 9d044bc..761bcc8 100644 (file)
@@ -178,13 +178,21 @@ public class DasSourceRegistry implements DasSourceRegistryI,
     {
       // get local sources from properties and initialise the local source list
       String local = jalview.bin.Cache.getProperty("DAS_LOCAL_SOURCE");
+
       if (local != null)
       {
+        int n = 1;
         StringTokenizer st = new StringTokenizer(local, "\t");
         while (st.hasMoreTokens())
         {
           String token = st.nextToken();
           int bar = token.indexOf("|");
+          if (bar == -1)
+          {
+            System.err
+                    .println("Warning: DAS user local source appears to have no nickname (expected a '|' followed by nickname)\nOffending definition: '"
+                            + token + "'");
+          }
           String url = token.substring(bar + 1);
           boolean features = true, sequence = false;
           if (url.startsWith("sequence:"))
@@ -193,8 +201,25 @@ public class DasSourceRegistry implements DasSourceRegistryI,
             // this source also serves sequences as well as features
             sequence = true;
           }
-          createLocalSource(url, token.substring(0, bar), sequence,
-                  features);
+          try
+          {
+            if (bar > -1)
+            {
+              createLocalSource(url, token.substring(0, bar), sequence,
+                      features);
+            }
+            else
+            {
+              createLocalSource(url, "User Source" + n, sequence, features);
+            }
+          } catch (Exception q)
+          {
+            System.err
+                    .println("Unexpected exception when creating local source from '"
+                            + token + "'");
+            q.printStackTrace();
+          }
+          n++;
         }
       }
     }
index 62ce958..a2aa5da 100644 (file)
@@ -34,16 +34,42 @@ public class FileIOTester
   public static void tearDownAfterClass() throws Exception
   {
   }
-final static File ALIGN_FILE = new File("test/jalview/io/test_gz_fasta.gz");
+  final static File ALIGN_FILE = new File("test/jalview/io/test_gz_fasta.gz");
+  final static File NOTGZALIGN_FILE = new File("test/jalview/io/test_gz_fasta_notgz.gz");
 
+  private void assertValidFasta(String src, FileParse fp)
+  {
+    assertTrue("Couldn't resolve "+src+" as a valid file",fp.isValid());
+    String type = new IdentifyFile().Identify(fp);
+    assertTrue("Gzipped data from '"+src+"' identified as '"+type+"'",type.equalsIgnoreCase("FASTA"));
+  }
   @Test
   public void testGzipIo() throws IOException
   {     
     String uri;
     FileParse fp = new FileParse(uri=ALIGN_FILE.getAbsoluteFile().toURI().toString(),AppletFormatAdapter.URL);
-    assertTrue("Couldn't resolve "+uri+" as a valid file",fp.isValid());
-    String type = new IdentifyFile().Identify(fp);
-    assertTrue("Gzipped data from '"+uri+"' identified as '"+type+"'",type.equalsIgnoreCase("FASTA"));
+    assertValidFasta(uri, fp);
   }
 
+  @Test
+  public void testGziplocalFileIO() throws IOException
+  {
+    String filepath;
+    FileParse fp = new FileParse(filepath=ALIGN_FILE.getAbsoluteFile().toString(), AppletFormatAdapter.FILE);
+    assertValidFasta(filepath, fp);
+  }
+  @Test
+  public void testNonGzipURLIO() throws IOException
+  {
+    String uri;
+    FileParse fp = new FileParse(uri=NOTGZALIGN_FILE.getAbsoluteFile().toURI().toString(),AppletFormatAdapter.URL);
+    assertValidFasta(uri, fp);
+  }
+  @Test
+  public void testNonGziplocalFileIO() throws IOException
+  {
+    String filepath;
+    FileParse fp = new FileParse(filepath=NOTGZALIGN_FILE.getAbsoluteFile().toString(), AppletFormatAdapter.FILE);
+    assertValidFasta(filepath, fp);
+  }
 }
index 4fbaf37..e34e520 100755 (executable)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- This script was automatically generated using InstallAnywhere 2013 Professional, Build 4538
      STATUS: Fully Functional LICENSED Edition
-     DATE:   Mon Oct 21 14:27:40 BST 2013 -->
-<InstallAnywhere_Deployment_Project increments="5104">
+     DATE:   Fri Nov 01 13:57:32 GMT 2013 -->
+<InstallAnywhere_Deployment_Project increments="5103">
        <!-- ** DO NOT EDIT ** Essential authorization and configuration data ** DO NOT EDIT ** -->
        <essentialScriptInfo>
                <versionID major="15" minor="0" revision="0"/>
@@ -10,7 +10,7 @@
                <scriptID>12,42,11,85,78,76,73,67,69,78,83,69,68</scriptID>
                <buildID>3,13,71,76,105,110,117,120,44,32,50,46,54,46,51,50,45,50,55,57,46,50,50,46,49,46,101,108,54,46,120,56,54,95,54,52,44,32,97,109,100,54,52,59,32,74,97,118,97,32,49,46,55,46,48,95,50,53,44,32,79,114,97,99,108,101,32,67,111,114,112,111,114,97,116,105,111,110,44,32,104,116,116,112,58,47,47,106,97,118,97,46,111,114,97,99,108,101,46,99,111,109,47,59,32,101,110,44,32,85,110,107,110,111,119,110,59,32,73,83,79,45,56,56,53,57,45,49</buildID>
                <!-- The authorizationID may change between project saves and builds.  This does not effect the integrity of the project, nor do changes in this value represent changes in the actual InstallAnywhere project. -->
-               <authorizationID>1,0,0,64,-35,60,16,-128,80,127,118,101,93,105,116,96,121,48,48,49,56,52,67,98,113,112,112,37,82,101,96,63,55,-11,2,11,7,83,27,1,1,0,0</authorizationID>
+               <authorizationID>1,0,0,64,29,-4,96,96,80,127,118,101,93,105,116,96,121,48,48,49,56,52,67,98,113,112,112,37,82,101,96,63,55,-11,2,0,1,84,19,2,1,0,0</authorizationID>
        </essentialScriptInfo>
        <installationObjects uniqueObjects="217">
                <object class="com.zerog.ia.installer.Installer" objectID="fe7d63eda660">
@@ -2654,7 +2654,7 @@ Press "Done" to quit the installer.]]></string>
                                <int>2</int>
                        </property>
                        <property name="onlyInstallBundledVMIfOneNotFoundInSystem">
-                               <boolean>false</boolean>
+                               <boolean>true</boolean>
                        </property>
                        <property name="uninstallJRE">
                                <boolean>true</boolean>
@@ -2741,7 +2741,7 @@ Press "Done" to quit the installer.]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="withoutVmSearchOption">
-                                                                                               <short>10</short>
+                                                                                               <short>13</short>
                                                                                        </property>
                                                                                        <property name="withVMSearchOption">
                                                                                                <short>21</short>
@@ -4037,7 +4037,7 @@ Press "Done" to quit the installer.]]></string>
                                                                <boolean>true</boolean>
                                                        </property>
                                                        <property name="credentialInformation">
-                                                               <object class="com.flexera.ia.vapp.datastructures.VMWareCredentialInformationImpl" objectID="eeb45609a007">
+                                                               <object class="com.flexera.ia.vapp.datastructures.VMWareCredentialInformationImpl" objectID="27759feba050">
                                                                        <property name="hostName">
                                                                                <string><![CDATA[]]></string>
                                                                        </property>
@@ -4159,7 +4159,7 @@ Press "Done" to quit the installer.]]></string>
                                        </method>
                                        <method name="put">
                                                <string><![CDATA[com.zerog.ia.installer.options.valid.vm.list]]></string>
-                                               <string><![CDATA[1.7+]]></string>
+                                               <string><![CDATA[1.6,1.7,1.8+]]></string>
                                        </method>
                                        <method name="put">
                                                <string><![CDATA[com.zerog.ia.project.build.last.date]]></string>
@@ -4231,7 +4231,7 @@ Press "Done" to quit the installer.]]></string>
                                        </method>
                                        <method name="put">
                                                <string><![CDATA[com.zerog.ia.project.save.last.date]]></string>
-                                               <string><![CDATA[21 October 2013 14:27:40 o'clock BST]]></string>
+                                               <string><![CDATA[01 November 2013 13:57:31 o'clock GMT]]></string>
                                        </method>
                                        <method name="put">
                                                <string><![CDATA[com.zerog.ia.build.options.optimization.platform.cdrom]]></string>
@@ -4485,7 +4485,7 @@ Press "Done" to quit the installer.]]></string>
                                                <string><![CDATA[Jalview]]></string>
                                        </property>
                                        <property name="installerName">
-                                               <string><![CDATA[install]]></string>
+                                               <string><![CDATA[install-jalview]]></string>
                                        </property>
                                        <property name="productName">
                                                <string><![CDATA[Jalview]]></string>
@@ -4539,7 +4539,7 @@ Press "Done" to quit the installer.]]></string>
                                                <string><![CDATA[jalview-discuss@jalview.org]]></string>
                                        </property>
                                        <property name="copyright">
-                                               <string><![CDATA[2012]]></string>
+                                               <string><![CDATA[2013]]></string>
                                        </property>
                                        <property name="license">
                                                <string><![CDATA[Commercial]]></string>
@@ -6822,7 +6822,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="totalSize">
-                                                                                               <long>13096</long>
+                                                                                               <long>1</long>
                                                                                        </property>
                                                                                        <property name="macBinary">
                                                                                                <boolean>false</boolean>
@@ -7340,7 +7340,6 @@ and any path to a file to read from that file]]></string>
                        </visualChildren>
                        <installChildren>
                                <object refID="fe7d6493a66a"/>
-                               <object refID="ee9b98899f7a"/>
                        </installChildren>
                </object>
        </installationObjects>
index 2c249de..dfb7f29 100755 (executable)
Binary files a/utils/proguard.jar and b/utils/proguard.jar differ