From: Mike M. <mi...@as...> - 2012-08-31 12:54:10
|
Hi all, I have tried unsuccessfully to remove myself from the forum. Can you please try to do so manually as I have tried everything I can to do it myself, Thanks, Mike Miller, -----Original Message----- From: Robert Hanson <ha...@st...> To: jmo...@li... Date: Thu, 30 Aug 2012 08:16:38 -0500 Subject: Re: [Jmol-users] How to use JmolApplet to display molecules protected by authenticated session? You won't be able to load binary data into Jmol using any script command. Sorry. This won't work with .jmol files. So basically you have the problem that Java itself can't load the file as a script, and the file is binary. Right? I can probably do something about that. As long as the binary data is mappable to Java byte[] I'll get back to you with a test tonight or tomorrow. I think it should be possible, but it's going to be rather tricky. Bob On Thu, Aug 30, 2012 at 5:38 AM, Mikko Rantalainen <mik...@pe... [mailto:mik...@pe...]> wrote: 2012-08-28 22:04 Europe/Helsinki: Robert Hanson: > Main problem I see there is that you are not waiting for the applet to > initialize. You need to do that call from within an appletReadyCallback > function.OK. I fixed that. I tried both Jmol.js and Jmol-JSO libraries and I'm pretty sure my current problem is only related to data to be passed to applet's method loadInlineString(). I've prepared a demo at http://peda.net/veraja/demo/mikko/testit/jmol [http://peda.net/veraja/demo/mikko/testit/jmol] What already works: demo-load-sdf.html: load SDF file via Jmol applet demo-load-jmol.html: load JMZ/JMOL file via Jmol applet demo-ajax-load-sdf.html: load SDF file via ajax in paraller with Jmol applet loading What does not work: demo-ajax-load-jmol.html: load JMZ/JMOL file via ajax in paraller with Jmol applet loading The files demo-ajax-load-sdf.html and demo-ajax-load-jmol.html are identical except for the file to load (ioversol.sdf vs ioversol.jmol). I believe that the problem is around line 96 of file "demo-ajax-load-jmol.html" where I have the binary data in javascript variable "data" and I'm trying to call Jmol.js function "jmolLoadInline(data)". I guess I would need to do some kind of conversion to get the binary data to correctly end up to the applet. (If I have understood correctly, Java strings are technically a bit different compared to JavaScript strings. I guess this causes problems with the binary contents in variable "data" which contains binary zeros among other stuff.) In short: I have a binary file contents (ZIP-archive / JMZ / .jmol) in a variable called "data". How can I get jmolLoadInline() to work with the full data? The example files have been prepared to work in a local filesystem (tested Firefox 14, Google Chrome 22 denies XHR access to files in local filesystem so that cannot be used). -- Mikko ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ [http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/] _______________________________________________ Jmol-users mailing list Jmo...@li... [mailto:Jmo...@li...] https://lists.sourceforge.net/lists/listinfo/jmol-users [https://lists.sourceforge.net/lists/listinfo/jmol-users] -- Robert M. Hanson Larson-Anderson Professor of Chemistry Chair, Chemistry Department St. Olaf College Northfield, MN http://www.stolaf.edu/people/hansonr [http://www.stolaf.edu/people/hansonr] If nature does not answer first what we want, it is better to take what answer we get. -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900 |