<embed src="chemical_file" width="200" height="200" ... optional_parameters="...">A pre-requisite with plugins is that they require the user to first install the appropriate software. If the user does not wish to install this specific software, or has no permission on their computer to do so, then the HTML page containing the invocation of the plug-in will fail to display any chemical content, i.e. this mode of display is not "fail safe". The HTML can be made more robust by inserting a number of JavaScript tests to predetermine whether the appropriate plugin was installed, but because of the complexity of this test, few authors made use of this (somewhat non standard) feature.
Examples of plug-in applications are shown in entries 1-4 (Table 1).4
In 1996, a further technology termed Java was introduced which provides an alternative approach. This no longer requires the user to pre-install any software; rather the requisite code (termed an applet) is downloaded from the server, and executed on the users machine in a "just-in-time" manner. This approach has a number of pros and cons compared to the plugin method.
<applet code="chemical.class" archive="chemical.jar" width="200" height="200"> <param name=model value="caffeine.xyz">The introduction of Java-based applets has the consequence that the author of the web page must consider preparing two or more different versions; one for each plug-in, and one for each Java applet (Table 1). It is possible to create this effect dynamically using JavaScript embedded in the HTML document, or using server-side includes, but this again increases the complexity of the authoring. A good example of such a multi-mode approach are the "Molecules-of-the-Month" pages,6 a project started in December 1995, and where three or four different presentational modes are normally prepared for each molecule discussed.
Some examples of the use of Java applets are shown in entries 5-9 (Table 1).
Table 1. Different Methods for Invoking Chemical Data in a Web Browser | |||
---|---|---|---|
Entry ID | Program System | HTML Markup (tag) | Type of data |
1 | Chime11/Chem3D2 | <embed> | 2D/3D Coordinates |
2 | VRML3 | <embed> | 3D Coordinates and Animation |
3 | Quicktime | <embed> | 3D Orbital Surface |
4 | SVG | <embed> | 2D Vector diagrams |
5 | ChemSymphony10 | <applet> | 3D Coordinates |
6 | Chemapplet | <applet> | 3D Coordinates/Orbital |
7 | JMol | <applet> | 3D Coordinates/Animation |
8 | jSPEC5 | <applet> | JCAMP IR, UV, MS spectral data |
9 | Java Molecular Editor9 | <applet> | 2D Structure data |
10 | Java=>Chemical_plug=>VRML=>Image=>Text | <object> | 3D Coordinates/Animation |
11 | Chemical_plug=>Java=>VRML=>Image=>Text | <object> | 3D Coordinates/Animation |
12 | Chime11/Chem3D2 | <iframe> | 3D Coordinates |
13 | Browser | <img> | General |
14 | Browser | <script> | General |
15 | Browser | <a> | XML (eXtensible Markup) |
<object id="jmol" classid="java:org.openscience.miniJmol.JmolApplet.class" codetype="application/java" archive="JmolApplet.jar" standby="Loading JMol" width="320" height="240" title="Display using Java"> <param name="model" value="6a-rhf-vib.xyz" /> <param name="format" value="XYZ" /> <param name="bcolour" value="#FFFFFF" /> <param name="animate" value="1" /> <object id="chemical" data="6a-rhf-vib.xyz" type="chemical/x-xyz" width= "320" height="240" title="Display using chemical Plugin" standby="Loading plugin"> <param name="frank" value="no" /> <param name="display3d" value="spacefill" /> <param name="bgcolor" value="white" /> <object id="vrml" data="vib.wrl" type="model/vrml" width="320" height= "240" title="Display using VRML Plugin" standby="Loading VRML"> <object id="image" type="image/jpeg" data="vib.jpg" width="418" height="325" title="Display using image only"> <a id="RSC" href= "http://www.rsc.org/suppdata/perkin2/1998/2695/index.html" name= "RSC" title="Link to RSC Journals Supplemental data pages" target= "search_main"> Trapezoidal distortions in 2+2 Cycloaddition reactions</a> </object> </object> </object> </object>In the above definition, the first attempt to display a set of coordinates in XYZ format is made by invoking the JMol applet. If for some reason, Java is disabled on the browser, an attempt to display an object using the defined MIME type chemical/x-xyz is made. Internally, the browser will attempt to resolve this MIME type to any plugin that may have been installed. Optional parameters for the plugin can also be defined (the ones shown above are relevant for the Chime plugin). If a specific viewer of chemical coordinates is not available, then a more generic Virtual reality viewer can be invoked. If this option also fails, then a simple image file will be loaded. If the user has disabled image viewing on the browser, then the final text field will be displayed.
The <iframe> specification is much simpler, and is not designed to provide alternative methods of presenting information. We include a short test of this mode (entry 12, Table 1) for completeness. We also note three other tags which can potentially invoke chemical content. The <img> tag (entry 13) is used to display bitmap-based diagrams which are not generally re-usable in a chemical context. It is possible however to embed text and more specifically chemical objects within the image byte code of image types such as GIF or PNG, and these can in principle be parsed, indexed and searched for. This could be used to provide more semantically rich content within the <img> tag. Another tag which can carry chemical information is the <script> tag, although it would be difficult to specifically identify chemical content within this syntax. Finally, we note the <a> tag, which of course is normally invoked only to link one document to another, and not to carry specific chemical information per se. We do note however that such links can be made to XML-based documents, which can be semantically very rich. We note one example in the table (entry 15) which is used to invoke a CML-based XML repository. This is fully described in a separate article.7
Amaya, which serves as a test bed for the W3C standards process, does not support either Java or plugins, and hence is not a suitable browser for chemical applications. In theory, this browser should display the image file by default, but in fact fails to do so. Internet Explorer version 5 from Microsoft probably represents the most development investment in any browser, but this software does not appear to support the <object> element correctly, attempting to display all four embedded objects simultaneously, and not sequentially as intended. Netscape at the 4.7 revision appears to support only a single nesting of the <object> element, and reverting to text display if the first declaration is unavailable. Early (alpha) versions of Version 6 appear to display standard behaviour towards the <object> element, although there seem some problems with plug-in display.
Overall, the track record of implementing HTML standards within Web browsers has been very variable. Almost two years after the HTML 4.0 standard was published, only one browser (iCab) fully and one (Netscape) almost implement the <object> and <iframe> elements. It is apparent that some time must yet pass before a properly structured implementation of chemical datatypes can be achieved within browser windows. The alternative option, of associating these types with external applications continues to be available on all browsers, as it has done since 1993.
Table 2. Browser tests for <object> Cascading | |||||||||
---|---|---|---|---|---|---|---|---|---|
Test (Entry 10, Table 1) | Object ID displayed in Browser | ||||||||
Internet Explorer 5 | Netscape 4.7 | Netscape 6.0 | Amaya 2.4 Windows |
Opera 3.62 Windows |
iCab 2.0 MacOS |
||||
Windows | MacOS | Windows | MacOS | Windows | MacOS | ||||
Java enabled | attempts all objects, displays image | Displays innermost object (image)a | java | java errorb | Java | Java | attempts imagec | texta | java |
Java disabled | attempts all objects, displays image | Displays innermost object (image) | text | text | Chemical_plug (e) | Chemical_plug (e) | attempts imaged | text | chemical_plug |
chemical_plug disabled | attempts all objects, displays image | Displays innermost object (image) | text | text | (e) | (e) | attempts imaged | text | vrml_plug |
All Plugins disabled | attempts all objects, displays image | Displays innermost object (image) | text | text | image | image | attempts image | text | image |
Images disabled | - | text | text | text | text | text | - | text | - |