j brandon keith wrote:
> Hi, I'm new to Jmol. I'm trying to run it via Java Web start. Even
> doing a simple jnlp like that below *doesn't work*. I click on the
> link and the Java logo comes up but then *nothing happens*. What
> basic thing am I doing wrong.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <jnlp spec="1.0+"
> codebase="http://trueblue.caltech.edu/java">
> <information>
> <title>Jmol</title>
> <vendor>DANSE</vendor>
> <homepage href="http://danse.us" />
> <description>Jmol</description>
> </information>
> <offline-allowed/>
> <security>
> <all-permissions/>
> </security>
> <resources>
> <j2se version="1.5+" />
> <jar href="Jmol.jar" />
> </resources>
> <component-desc main-class="org.openscience.jmol.app.Jmol" />
> </jnlp>
>
> I'm using Java 6. It works fine from the command line: java -jar Jmol.jar
>
> Also, I'd like to launch Jmol via Java web start (jws) and have it
> automatically load a cif file. However, I believe jws cannot accept
> parameters. So I write a class that calls jmol and loads "sample.cif"
> from a dynamically generated code base:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <jnlp spec="1.0+"
> codebase="http://trueblue.caltech.edu/java">
> <information>
> <title>Sample Viewer</title>
> <vendor>DANSE</vendor>
> <homepage href="http://danse.us" />
> <description>Sample Viewer</description>
> </information>
> <offline-allowed/>
> <security>
> <all-permissions/>
> </security>
> <resources>
> <j2se version="1.5+" java-vm-args="-Xmx512m -splash:splash.png"/>
> <jar href="sampleViewer.jar"/>
> <jar href="Jmol.jar" />
> </resources>
> <component-desc main-class="sampleViewer.Main" />
> </jnlp>
>
> But that doesn't work either (probably related to previous error).
> But is this the best way to do this or is there a javascript way that
> is better?
>
I have no experience with configuring Java web start applications. But
from a brief look at the start process of existing web start
applications I would suggest the following:
1) If it is sufficient to have fixed arguments just integrate something
like this into your 'jnlp' file:
<application-desc main-class="org.openscience.jmol.app.Jmol">
<argument>-s default.script</argument>
<argument>sample.cif</argument>
</application-desc>
2) If there are dynamic arguments then you could write a little CGI
script (PHP, Perl, etc.) that returns a customized 'jnlp' file.
Regards,
Rolf
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers