Geoff,
If I understand you correctly, you have a PHP filter for Moodle such that if
this filter is installed on a Moodle server one can create a link on a Moodle
page to a structure file (pdb, xyz, mol, etc.) and clicking on that link opens
a page displaying that structure using JSmol. Is that something you would be
willing to share because I could use something like that.
Incidentally, when I tried your test page in Safari (everything up to date) it
gave an unrecognized file format error for 1crn.pdb.gz. Also when I tried the
link to dan.pse it loaded the page but not the structure then the page became
unresponsive. When I tried the link for 1m19.pdb.gz it also gave an
unrecognized file format error.
***********************************************
Jeff Hansen
Department of Chemistry and Biochemistry
DePauw University
602 S. College Ave.
Greencastle, IN 46135
[email protected]
***********************************************
On Jul 25, 2013, at 10:34 AM, Geoffrey Rowland <[email protected]> wrote:
> OK I may be missing something (a little knowledge is dangerous) but I'll try
> to explain things as I understand them. Apologies if I'm stating the blinking
> obvious at any point.
>
> I have a PHP 'filter' for Moodle (and similar plugin for Mahara) which
> effectively replaces a link to a data structure file, uploaded to Moodle,
> with the code to display this link with JSmol. Currently, this is set up for
> a subset of datatypes that JSmol?Jmol recognises (cif, cml, mcif, mol, pdb,
> sdf, xyz) though is easily extended. I am now trying to add the binary
> formats pdb.gz and pse.
>
> The uploaded file links are of the form
> http://site-address/moodle/pluginfile.php?/22/mod_label/intro/1crn.pdb.gz and
> access to the files depends on the context, user, view permissions etc of
> Moodle (controlled via Moodle's pluginfile.php etc). This 'just works', in
> most cases, as the filter code (in moodle/filter/jmol/filter.php) follows a
> pretty standard filter template and includes/requires all the necessary
> Moodle files and context variables to allow the relvant file access.
>
> This all works nicely with text data files (mol, pdb etc) with all browsers
> (IE 8 defaults to Jmol rather than JSmol). Also, works for Firefox, Opera and
> Safari with the binary files (.pse. and .pdb.gz). However, this fails with
> the binary files with Chrome and IE9/10. As I understand it, this is because
> jsmol.php is called to handle binary-to-base64 conversion (required for
> Chrome and IE) but since it is not 'aware' of the Moodle 'context', jsmol.php
> is blocked from accessing the file. If I bypass/turn off the Moodle file
> access permissions in 'hacky' insecure ways, then the binary files are
> displayed with Chrome and IE.
>
> One (the best?) way to fix this would be to pass all the necessary context
> variables to jsmol.php such that it can access the file link.Not yet made any
> progress with this and this will need a different customisation for each CMS
> system (Moodle, Mahara etc).
>
> As an alternative, I was trying to set up the binary-to-base64 conversion
> 'on-the-fly' within the filter.php code (i.e. without calling jsmol.php),
> then load into JSmol. Hence my enquiry about the best way to do this (e.g.
> using PHP file_get contents(), base64-encode() and JSmol load or load data or
> whatever?). I have gleaned some understanding from scrutinising the jsmol.php
> code, but not yet got this to work.
>
> One other workaround is to switch to Jmol (which does not require jsmol.php)
> rather than JSmol for the problematic browser-file combinations. This does
> work (though not set up on the test server, below) but somewhat defeats the
> object of using JSmol. Perhaps if all else fails...
>
> Any suggestions most welcome!
>
> You can see the problem on a test Moodle installation here:
>
> http://blueliaslearning.com/moodle/
>
> Choose the JSmol Filter Test link and select the [Login as guest] button.
>
> All should be fine with Firefox, Safari or Opera, but not with IE 9/10 or
> Chrome viewing the .pdb.gz or .pse files.
>
> Many thanks
>
> Geoff
>
> >Blocked by what? when? What has it to do with your Course Management
> >System? It's just an AJAX call to you server.
>
> >> Hi Bob
> >>
> >> Appreciate that turning binary into BASE64 is exactly what jsmol.php does
> >> and that in most cases it works very nicely.
> >> However, 'out-of-the-box' it is being blocked by the file APIs of the
> >> particular PHP-based CMSs.
> >> Was looking for a simple generic way to get around this.
> >>
> >> Geoff
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk_______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users