Right, I don't know why exactly, but if you check

http://www.stolaf.edu/academics/chemapps/jmol/temp/signed/test.htm

I think (at least for me) the model loads when the applet is created. So 
the signed applet is working.

And you can run

load "=1blu"

from the console.

But if you try to issue a JavaScript command that loads a file, that 
fails. I think JavaScript, for good reasons, is considered outside the 
scope of the signed code, and therefore is prevented from accessing 
methods that would require a signature. See the discussion at: 
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4806873, namely:

"This is correct behavior. When unsigned javascript calls signed 
applet,  method call runs on untrusted security context of javascript, 
instead of trusted security context of applet."

Basically, unless you use "signed JavaScript" you cannot access methods 
in the applet that require a signature.

Strangely enough, though, the following code works:

<script type=text/javascript src=Jmol.js></script>
<script>
jmolInitialize(".","JmolAppletSigned.jar")
jmolHtml("<div id=theApplet>")
jmolApplet(400,"load http://www.rcsb.org/pdb/files/1blu.pdb";)
jmolBr()
jmolCommandInput()
jmolHtml("</div>")

jmolSetDocument(0)
code = '1crn'
function testload() {
 var xxxx = prompt("Enter a four-letter PDB code",code)
 if (!xxxx)return
 code = xxxx
 var s = jmolApplet(400,"load 
http://www.rcsb.org/pdb/files/"+code+".pdb";) + "<br>" + jmolCommandInput()
 document.getElementById("theApplet").innerHTML = s;
}
</script>

<a href=javascript:testload()>load a PDB file</a>

The key here is that the JavaScript actually builds a whole new applet, 
and then that applet is allowed to load the model desired. Go figure!

Bob


Angel Herraez wrote:

>Jeff wrote:
>
>  
>
>>However, I still get the same error 
>>message "java.security.AccessControlException: access denied
>>(java.net.SocketPermission www.rcsb.org:80 connect.resolve)" when I
>>click on the button.  So it looks like your suggestion of using
>>single quotes around the whole command and double quotes around the
>>pdb names does the same thing as my code which used double quotes
>>around the whole command and no quotes around the pdb names. 
>>Either way I get a java security error message.  Any other
>>suggestions?
>>    
>>
>
>Well, to me that's right, a Java security issue --sorry I missed that 
>comment of yours before--, not a code error. Maybe it would work 
>without the quotes, but the doc says quotes are mandatory, and to me 
>it has failed before because of that, so don't remove them.
>
>1. Are you using the signed applet?
>2. Which version?
>3. Does it work with a simpler command, e.g. just one file?
>4. Does it work with a file from your server, or any other than PDB?
>5. Try to use 
>            load files "=1crn" "=1blu" "=1hje" 
>       from the application console and see what happens
>
>Apart from that, it's a more technical problem for which I can't help 
>
>
>
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by DB2 Express
>Download DB2 Express C - the FREE version of DB2 express and take
>control of your XML. No limits. Just data. Click to get it now.
>http://sourceforge.net/powerbar/db2/
>_______________________________________________
>Jmol-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/jmol-users
>  
>


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to