How to add name to structure converter via web call

User 8139ea8dbd

02-11-2012 05:16:50

We would like to be able to paste int company compound ID and have it pull out structure. http://www.chemaxon.com/marvin/help/developer/naming.html suggests we do this on the client side.
Can we have Marvin call a URL, providing the name, and returning the structure?  First, we prefer the ID to structure look up is done on the serverside.  Second, due to authorization requirement, we will need a way to check if the user is authorized to do the ID to structure conversion.  A URL call potentially can forward the user cookie to the server.

ChemAxon 5433b8e56b

05-11-2012 11:23:14

Hi,


why do you need to have such functionality inside the applet? Is not it enough to place a text input field beside the applet, and when it is changing, a javascript can react, call the service, send all the information that is needed for authentication, and for the conversion, and get a Molecule back that can be loaded by the javascript into the applet.


I think it is a convenient and fast way for you to implement this. On the service side it is enough to create the string representation for the molecule, and send that back. As I understand the IDs we are talking about are company specific, so you can have the ID-to-Structure conversion on your own.


What do you think? Can this be a working solution for you?


Regards,
Istvan

User 8139ea8dbd

05-11-2012 14:59:43

Yes, we can do that for web applications developed by our own, but how do we implement corporate ID to structure conversion for the Marvin editor in Jchem for Excel (or Jchem foe SharePoint I assume is the same), where there in no control to trigger JavaScript. Thanks.

ChemAxon e7b9408ca1

12-11-2012 16:29:49

Dear Yingyao,


It seems to me that what you need is to be able to plug in your own corporate ID converter, which can then run arbitrary code, including calling your own webservice. There is currently such a system, documented at http://www.chemaxon.com/marvin/help/developer/beans/api/chemaxon/naming/NameConverters.html


Some possible issues:



  1. can you deal with security in this framework?

  2. this specific API requires you to explicitly add your converter class by calling a method. This means it can only be used when using the API, or writing a wrapper that would do that before starting marvin. This is obviously not practical, so we could look into using a runtime discovery mechanism instead.

  3. Depending on how you use marvin (applet vs jchem4xl or sharepoint) you might be running the java or the .net version. So we need to sort out the details of how to make that work in all cases. I'm also checking internally with the different teams to see how we can support that.


Another option would be to use a webservice directly (you just provide a URL). That would probably be simpler to get to work. On the other hand, you would not have a ability to do client-side handling, for instance a quick check of the format of the input (e.g. number of characters, prefix, ...) which would allow to avoid a round-trip for non-corporate IDs.


What are your thoughts about theses different solutions?


Best regards,


Daniel

User 8139ea8dbd

12-11-2012 16:51:21

For sure, I would think a URL call, posting the ID and returning a structure would be the easiest and the most flexible case.  So I would vote for the second option.  We only need to write one service and used it in anywhere Marvin Sketch is used, all we need is to configure client to add the URL.


If the ID is wrong, the service simply returns an empty string (or an error message that client understands how to display).  As long as the URL call carries the cookies, we can do server-side authentication.

ChemAxon e7b9408ca1

13-11-2012 11:57:17

OK, so let's go for the webservice route!


For the applet, we can add an applet parameter, so the URL can be defined in one place and used by all the clients. We will also investigate forwardning all cookies from the domain to allow you to check authentification.


For the desktop, there would be a preference option to set a URL, which will be saved with the other preferences on the machine.


Does this fit your needs?


Do you have specific requirements as to what the complete request URL should look like? I was thinking of just appending the input name/ID at the end of the URL for simpliicity's sake, since the URL could look like ".../service?ID=" or just ".../service/", depending on how you implement it on your side.

User 8139ea8dbd

13-11-2012 13:58:43

Sounds perfect! No preference for the URL, I would propose the final URL Marvin uses to be:


ConfiguredURLString+ID string


User can set ConfiguredURLString to be "service/" or "service?ID=", up to them.

ChemAxon e7b9408ca1

16-11-2012 09:11:42

Agreed on the URL.


How important and urgent is this feature? I'm optimistic we could get the applet case working quite soon, though we need some further work to work on forwarding the cookies for authentification, and it will be useful to test that on your side, as that can be sensitive to security settings, browser and browser version, ...


On the desktop, do you need authentification as well, and if yes, how would you want that to work? Also, adding the GUI for the preferences on the desktop might take a little longer, I'm discussing that with the GUI relevant team. Another option is to configure it using a plain text file, which can be a bit more challenging for end users (although it could be actually the easiest if by chance you do automated deployment).

User 8139ea8dbd

16-11-2012 17:00:41

Not urgent, we don't have this feature for years, so we can definitely wait for another one or two releases.


At GNF, we don't use Stand-alone Marvin (except Marvin.net in JChem for Excel), so I don't have many suggestions for that.  J4X probably can use Option dialog.  Ideally, it should be a configuration that coporate IT team can pre-set for their installation package, so that each user does not have to configure themselves afterwards.


Thanks!

ChemAxon e7b9408ca1

10-12-2012 11:29:07

Initial support for calling the webservice will be in 5.12. It can currently be set up as an applet parameter, and in stand-alone marvin.


For jc4xl, I still need to get confirmation if setting the URL in marvin.net will then activate the feature in all cases. I also mentioned the idea of a pre-set installation package for the future.


For the applet, I believe the cookies will be carried so that you can use them for authentification, but this will be best to test that in your setup.


5.12 will probably be released in january, and there will be a public beta before that, if you want to do initial tests.

User 8139ea8dbd

10-12-2012 16:18:10

Great, will certainly be happy to test when it is ready.