[Zope] incorporating jmol into Zope

gf gyromagnetic at gmail.com
Mon Apr 3 13:59:59 EDT 2006


Hi,
I am a Zope newbie and would really appreciate some help from
experienced Zope developers. I am trying to incorporate jmol (a
javascript molecule viewer: http://jmol.sourceforge.net/)  into some
web pages. I think that my confusion may have to do with the use of
'directory relative (../)' versus 'server relative (/)' versus
'absolute url (http://)' paths.

The instructions for jmol give an example as follows:

<html>
  <head>
    <title>Simple example</title>
    <script src="../jmol/Jmol.js"></script>
  </head>
  <body>
    <script>
      jmolInitialize("../jmol"); // REQUIRED
      jmolApplet(200, "load caffeine.xyz");
    </script>
  </body>
</html>

I have set up a folder in Zope for jmol's files (Jmol.js, JmolApplet.jar):
"root/javascript/jmol"

I have a Zope folder for the molecule files to be viewed:
"root/mycontent/images"

I have a dtml method for the actual view page:
root/mycontent/view_jmol

I would appreciate very much if someone could help translate the
example above using my Zope folder structure. I have tried many
variations, but they usually end up locking up the browser with a
'downloading applet' message.

Related to this is the following question: should I use use the actual
file names 'Jmol.js' , 'JmolApplet.jar' as their IDs, or should I use
'dotless' names and just set the correct file types?

Thanks for any help and advice you can give.

Best Regards,
gyro


>From the jmol website "General Recommendations":

- There is one directory on your web server that contains Jmol.js,
JmolApplet.jar, and any other jmol-specific files. For the purposes of
this discussion we will call this directory ../your-jmol-directory.

- Every web page within your site should refer to
../your-jmol-directory using a relative url.

- Directory relative paths which start with . or .. should always be
used. Server relative paths which start with / might be acceptable in
special circumstances. Absolute URLs which start with http:// are evil
and should never be used.

- Every page must contain the following HTML command in the head
section in order to include the Jmol.js library:

  <head>
    ...
    <script src="../your-jmol-directory/Jmol.js"></script>
    ...
  </head>
Every page must contain a call to jmolInitialize(codebaseDirectory) as
the first call into the Jmol.js library.


More information about the Zope mailing list