On Fri, Aug 24, 2012 at 3:26 AM, Mikko Rantalainen
<[email protected]> wrote:
> Is it possible to configure JmolApplet to fetch the required files
> through the UA (web browser) instead of directly trying to connect the
> server?
>
I believe so. If you can get it through AJAX, you are all set. Just
use Jmol-JSO.
You should create a new _Applet prototype function on your page:
Jmol._Applet.prototype._getSecureFile = function(query, script){
this._script("zap;set echo middle center;echo Retrieving
data...");
// script is necessary only if you need to do the post-load
processing
var self = this;
Jmol._contactServer("?query=" + encodeURIComponent(query),
function(data){self._loadModel(data, ";" + script)},
function(){alert("error...")}
);
}
and call that from your page link.
Then be sure to set Info.serverURL to your server, not mine!
Info.serverURL needs to point to a PHP document on your server to
process your request for the "query" -- just deliver the file contents
as is. In this way, the actual data files need never be exposed. Only
your PHP file needs exposure.
Bob
--
Robert M. Hanson
Larson-Anderson Professor of Chemistry
Chair, Chemistry Department
St. Olaf College
Northfield, MN
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
------------------------------------------------------------------------------
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/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users