|
From: Miguel <mi...@jm...> - 2004-12-23 00:39:06
|
Todd wrote: > We store our structure files (mol files and CIF files) in database > CLOBs and we're trying to use jmol to display them in a web page. (jmol= > version 10.00, Windows 2000, FireFox 1.0). I'd like to use > jmolAppletInline instead of writting a temporary file and then calling > jmolApplet, if possible. Understood. > Using the online examples, I was able to > figure out how to write a CLOB (in mol file format) to a javascript > variable (myWholeMol) and then use: > jmolAppletInline(400,myWholeMol,=22=22,=22mol=22); The parameter =22mol=22 that you have is not necessary. ** 2 minutes later ** I took a look at the Jmol.js documentation at http://www.jmol.org/jslibrary .... and I see that this may have been confusing. The 4th parameter 'nameSuffix' applies to the name of the applet itself, not to the file name. The command above named your applet 'jmolAppletmol'= ... as in <applet name=3D'jmolAppletmol' id=3D'jmolAppletmol' ...> Jmol does not look at any extensions to determine file type. It determine= s file type by looking at the contents. > in my web page and the mol file structure displays in the jmol window. > If I try the same method with a CIF file, writting it to javascript > variable myWholeCIF and use: > jmolAppletInline(400,myWholeCIF,=22=22,=22cif=22); /* again, =22cif=22 is not necessary, but doesn't hurt anything */ > nothing shows up in the jmol window. > I then wrote the CIF information > to a temporary file (temp.cif) and used jmolApplet instead and it the > atoms load just fine. Very strange. That sounds like my bug. > Am I using the jmolAppletInline correctly? If you successfully loaded a 'mol' file then you did the right thing. > The fourth argument of jmolAppletInline is an optional suffix. As explained above, this is a suffix for the applet, not for the molecula= r model data. > Is =22cif=22 correct in this case? Nope ... but it should not have hurt anything either. > Also do I need anything for the third argument? The third argument is a script file, so you can do change the appearance of the rendering ... optional. A few suggestions: * Open the java console before loading your web page. It will print out interesting stuff. Look for 'ModelResolver' and see if it is successfully= identifying the file as 'cif' * Newlines are important in cif files. Of course, they are important in .mol files too. So you probably have that taken care of. * zip up a .cif file and your test .html page and send them to me offlin= e. * just before calling jmolAppletInline() make a call to jmolDebugAlert()= Miguel |