<!-- 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}">
<td width="80" ><strong>value=""></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>
<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"
<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">
<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">
-->
<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">
<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">
</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">
,
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");
<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">
archive="jalviewApplet.jar" width="0" height="0">
<param name="debug" value="true"/>
<param name="showbutton" value="false"/>
+<param name="permissions" value="sandbox"/>
</applet>
,
linkUrl_2 : "http://us.expasy.org/cgi-bin/niceprot.pl?$SEQUENCE_ID$",
+ permissions : 'sandbox',
APPLICATION_URL : "http://www.jalview.org/services/launchApp"
};
,
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');
}
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
{
//
// 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) {
{
// 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:"))
// 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++;
}
}
}
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);
+ }
}
<?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"/>
<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">
<int>2</int>
</property>
<property name="onlyInstallBundledVMIfOneNotFoundInSystem">
- <boolean>false</boolean>
+ <boolean>true</boolean>
</property>
<property name="uninstallJRE">
<boolean>true</boolean>
<boolean>false</boolean>
</property>
<property name="withoutVmSearchOption">
- <short>10</short>
+ <short>13</short>
</property>
<property name="withVMSearchOption">
<short>21</short>
<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>
</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>
</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>
<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>
<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>
<boolean>false</boolean>
</property>
<property name="totalSize">
- <long>13096</long>
+ <long>1</long>
</property>
<property name="macBinary">
<boolean>false</boolean>
</visualChildren>
<installChildren>
<object refID="fe7d6493a66a"/>
- <object refID="ee9b98899f7a"/>
</installChildren>
</object>
</installationObjects>