function to return a smile or molfile : comparaison JME/marv

User 247a2c5018

02-04-2008 09:21:10

I would like to replace or compare JME with Marvin.


I see in this example how to implement Marvin :





http://www.chemaxon.com/marvin/examples/applets/example-sketch1.1.html





But I see nowhere where and how to use a function to return a smile or a molfile like JME :


http://www.molinspiration.com/jme/doc/jme_functions.html

ChemAxon 7c2d26e5cf

02-04-2008 10:07:58

Please see this example.


http://www.chemaxon.com/marvin/examples/applets/example-sketch3.4.html


It demonstrates how you can get/set molecule from/to the MarvinSketch applet.


You can use theJMSketch.getMol(String) method to retrieve the structure from the applet in the specified format.

User 247a2c5018

07-04-2008 14:29:21

I put in my code :





<td><applet CODEBASE="marvin/" ARCHIVE="jmarvin.jar" CODE="JMSketch" WIDTH=360 HEIGHT=315>


<strong>(YOU CANNOT SEE A JAVA APPLET HERE)</strong>


</applet></td>











The problem is the applet is not correctly represented :


The names "Field, Edit" are too big


The toolbars are too big.


How to resize to have a nice applet?





In addition, I lose the Atoms in the toolbars : H, C, N. Why?

User 247a2c5018

08-04-2008 11:34:41

No idea?





I solve my problem with :


<td><applet codebase="marvin/" ARCHIVE="jmarvin.jar" CODE="JMSketch" WIDTH=370 HEIGHT=350>


</applet></td>





The applet is better represented.


But I have no atoms in the toolbars whereas I select in View, Toolbars, atoms.

ChemAxon 909aee4527

08-04-2008 12:36:51

This can easily be solved with GUI customization: http://www.chemaxon.com/marvin/help/sketch/gui/customization_server_side.html





Simply creating the following configuration file and setting as an applet parameter gives you the result shown by the image.


Code:
<?xml version="1.0" encoding="UTF-8"?>


<customization active="default">


  <scheme id="default" largeIcons="false">


  </scheme>


</customization>



With this method you can further personalize the GUI according to your needs.





The size of File, Edit ect menu names depends on the window system settings, it equals with other menu font sizes.





Missing atom icons: do they appear when you launch the desktop application?

User 247a2c5018

08-04-2008 12:40:25

>>Missing atom icons: do they appear when you launch the desktop application?





No they don't.

ChemAxon 909aee4527

08-04-2008 12:42:53

Ok, please try View > Configurations > Reset current configuration.


Do they appear this way?

User 247a2c5018

08-04-2008 12:46:57

no

ChemAxon 909aee4527

08-04-2008 13:06:02

I hope you don't mind the questions, we haven't seen this problem yet.


- Please make sure View > Configurations > Marvin is active


- Are they listed on the View > Customize > Toolbars panel selecting the Atoms toolbar?


- Do you have any error message when the desktop application is started from console?

User 247a2c5018

08-04-2008 13:35:02

I have error for java (see error.txt)

ChemAxon 909aee4527

08-04-2008 14:50:51

Thank you, this helps a lot!


However we still cannot reproduce it.


Can you send us the contents of the Help > About MarvinSketch window?


Please give some details about the environment you're using (CPU information). Can you reproduce it on other machines?

User 247a2c5018

08-04-2008 14:59:06

see the file attached

User 247a2c5018

08-04-2008 15:05:53

>>Can you reproduce it on other machines?





Yes I do

User 247a2c5018

08-04-2008 15:12:00

I have other problems :





I create my applet :





<td><applet codebase="marvin/" ARCHIVE="jmarvin.jar" name="MSketch" CODE="JMSketch" WIDTH=370 HEIGHT=350>


<?php if ($requ_structure!='') { ?>


<param name="MSketch" value="<?php echo $requ_structure;?>">


<?php }?>


<?php echo $lbl[80][$lang];?>


<param("menuconfig", "marvin/configuration.xml");


</applet></td>








Ok After I create a javascript function to remove the selected options :





function efface()


{


document.MSketch.reset();


document.formulaire.requ_mode_recherche_structure[0].checked=true;


document.formulaire.requ_stereo_chimie[0].checked=true;


document.formulaire.requ_masse_moleculaire_inf.value='';


document.formulaire.requ_masse_moleculaire_sup.value='';


document.formulaire.requ_stru_logP_value_inf.value='';


document.formulaire.requ_stru_logP_value_sup.value='';


document.formulaire.requ_stru_logS_value_inf.value='';


document.formulaire.requ_stru_logS_value_sup.value='';


document.formulaire.requ_quantite.value='';


document.formulaire.requ_conditionnement[0].checked=true;


document.formulaire.requ_stru_id.value='';


document.formulaire.requ_subs_national_id.value='';


document.formulaire.requ_slot_lotnational_id.value='';


document.formulaire.requ_score.value='';


}





But this function doesn't run when i add : document.MSketch.reset();





Why?

ChemAxon 7c2d26e5cf

08-04-2008 16:26:03

First of all, JMSketch.reset() method does not exist in the JMSketch API.





By returning back to the NullPointerException: Are you sure that all required resources are available for running applet?


Please check that chemaxon/elements.zip is available in the directory of your Marvin Applets package. Marvin retrieves elements from this file.


Finally, please check that Marvin Applets examples on ChemAxon site works fine to you.


If not, there may be a configuration problem in your browser.

User 247a2c5018

09-04-2008 07:41:57

>>First of all, JMSketch.reset() method does not exist in the JMSketch API.





which method to reset?





>>Please check that chemaxon/elements.zip is available in the directory of your Marvin Applets package. Marvin retrieves elements from this file.





chemaxon/elements.zip is available








>>Finally, please check that Marvin Applets examples on ChemAxon site works fine to you.





Yes it works

ChemAxon 7c2d26e5cf

09-04-2008 13:33:16

In your JavaScript code, you refer to the reset() method of a JMSketch instance (your MarvinSketch applet is titled with "MSketch" by giving the "name" attribute in the "applet" tag). If you take a look at to the JMSketch API, you can see that this method is not defined there.


Code:
function efface()


{


document.MSketch.reset();

User 247a2c5018

09-04-2008 15:55:58

I try to put package on an other linux server.


I have no more these problems?


I don't know why I can't have the elements toolbars with my first server.


which files are necessary to see elements? (I have the file elements.zip)








which method must I use to run a reset of the applet?

ChemAxon 7c2d26e5cf

09-04-2008 17:00:35

What you mean on reset of the applet?

User 247a2c5018

10-04-2008 08:11:11

>>What you mean on reset of the applet?





a function like "clear desk"

ChemAxon 909aee4527

10-04-2008 08:33:04

Hello,


please try the following using your first server:


1. start the browser without open tabs and make Java Consol visible


2. set the trace level to maximum by pressing 5, and clear the classloader cache by pressing x


3. open the page with the marvin applet


Please send us the full stack trace appearing on the consol.

User 247a2c5018

10-04-2008 08:48:26

see the log of the java console

User 247a2c5018

10-04-2008 09:00:37

I have these errors in log apache when i start Marvin applet :





[Thu Apr 10 10:57:50 2008] [error] [client 192.168.70.56] File does not exist: /www-data-dev/abonne/marvin/META-INF


[Thu Apr 10 10:57:50 2008] [error] [client 192.168.70.56] File does not exist: /www-data-dev/abonne/marvin/META-INF


[Thu Apr 10 10:57:50 2008] [error] [client 192.168.70.56] File does not exist: /www-data-dev/abonne/marvin/META-INF


[Thu Apr 10 10:57:50 2008] [error] [client 192.168.70.56] File does not exist: /www-data-dev/abonne/marvin/META-INF


[Thu Apr 10 10:57:50 2008] [error] [client 192.168.70.56] File does not exist: /www-data-dev/abonne/marvin/META-INF


[Thu Apr 10 10:57:50 2008] [error] [client 192.168.70.56] File does not exist: /www-data-dev/abonne/marvin/META-INF


[Thu Apr 10 10:57:52 2008] [error] [client 192.168.70.56] File does not exist: /www-data-dev/abonne/marvin/plugins/plugins.properties


[Thu Apr 10 10:57:52 2008] [error] [client 192.168.70.56] File does not exist: /www-data-dev/abonne/marvin/chemaxon/marvin/sketch


[Thu Apr 10 10:57:52 2008] [error] [client 192.168.70.56] File does not exist: /www-data-dev/abonne/marvin/META-INF


[Thu Apr 10 10:57:52 2008] [error] [client 192.168.70.56] File does not exist: /www-data-dev/abonne/marvin/META-INF

User 247a2c5018

10-04-2008 14:09:29

Ok I find


It comes from my htacess :





RewriteEngine on


RewriteRule ^.*\.zip sdfile.php [QSA,L]











I remove RewriteEngine on and after I have the elements toolbars.


But For my apllication, i need to put the RewriteEngine.


How to solve the problem?

User 247a2c5018

11-04-2008 13:21:54

No idea about these apache error ?





File does not exist: /www-data-dev/abonne/marvin/META-INF


File does not exist: /www-data-dev/abonne/marvin/plugins/plugins.properties





and about the problem of zip file?

ChemAxon 7c2d26e5cf

14-04-2008 10:34:09

Can you send the list of your the marvin/plugins directory?


META-INF should not be there. I am not familiar with apache but it should not load directory with this name.


META-INF is a folder inside a jar file that contains meta data about the jar that is required for the Java classloader.


Probably your tool extracted the jar's content. You should switch it off. If you edit the content of a signed (trusted) jar, its certification will be damaged. It means that the jar is no more trusted after that.


In default, "plugins.properties" does not exists in the marvin/plugins directory.


You need this file, if you would like to customize calculator plugins list in MarvinSketch or in MarvinView (e.g.: add your own plugin to the list). If you create a "plugins.properties" file in this directory, Marvin will prefer settings in this file instead of factory settings.

User 247a2c5018

14-04-2008 12:30:49

>>Can you send the list of your the marvin/plugins directory?





calc.properties.sample.txt


extensions.jar


plugins.properties.sample.txt








I have also this error:





File does not exist: /www-data-dev/abonne/marvin/chemaxon/marvin/sketch

ChemAxon 7c2d26e5cf

15-04-2008 15:42:03

Fine. Your "marvin/plugins" directory is correct. There are proper files.


"chemaxon/marvin/sketch" is a directory in Marvin, not a file. I don't know why your apache try to download it.


Is the applet working fine in your browser? Does this apache warning causes any problem by the usage of the applet?





Returning to your previous question (about reset):


There is no explicit reset method in JMSketch API. To clear the sketch canvas, set an empty molecule for the applet:


Code:
document.MSketch.setMol("");