Marvin Applet and browser communication

User 512caa4d13

24-09-2008 13:55:18

Hello All,


I am new to Java and working on Marvin Applet. While surfing on net I gone through the following web site


http://chem.sis.nlm.nih.gov/chemidplus/


here the author used Marvin Applet which is giving the user a facility to draw the structure on the editor. But the interesting thing is that whatever is drawn on the editor is immediately reflected to a frame [possibly JFrame] on the browser.


From this I understood that the editor we got as an response to a request from the server is still communicating the rout of the request. I wanted to develop the same application but unfortunately haven't found any reference for such Applet - Browser communication. Please help me, if anyone can.

ChemAxon 7c2d26e5cf

24-09-2008 14:15:19

You can find the same example on the ChemAxon site: MarvinSketch Example - Pure visualization mode, detaching MarvinSketch from the web page


The Marvin Applets package also contains this basic example.


You need the detach parameter to do this. This example also explains its usage.


By the way, the applet on the ChemIDplus page is an ancient version. On ChemAxon site, the applet examples use the latest one.

User 512caa4d13

25-09-2008 05:02:55

Thank you very much, Mr. Tamas for your valuable information.





I am going through the example, but still I have a query, is it possible to open a mole file, that is stored in database and link is displayed on the browser to download [or similar name as "view"], whenever user clicks the link ?





The example I have referred previously, I thought that the author is establishing a continuous Applet - Servlet [or server] communication to send the drawn structure on the editor to the image area on browser, but I guess I am wrong as Marvin has provided the provision.





In my scenario the user can click any other structure file link or dragging the file to the applet editor to open it.





I doubt this might not be possible, for example if I opened a .doc file in MS word and if dragging any other file to the same window, actually the MS word allows me because the MS word software and the file are on the same computer. But here in web based application the applet editor is on client side and the file is on server side. Please help me..

ChemAxon 7c2d26e5cf

26-09-2008 18:19:34

I describe how I can imagine it.


Click on the link of the molfile. This event indicate a request to the server. The server posts the molfile to the browser. With some JavaScript code, you can set this molecule for the applet (perhaps Ajax can be useful here). If the molfile name is given in the source, this name will display on the title bar of the MarvinSketch window (if it is detached).





I can hardly imagine that the link dragging would work in the applet. But you can drag a molfile from your local filesystem into your running MarvinSketch applet.