Modification of vanilla JSP application

ChemAxon 60ee1f1328

03-08-2005 09:05:15

Hello,





I would like to make the following modifications to the jsp1_x application you guys provide:





1) For each cell in searchresults.jsp result set include either a radio button or a tick box, with a constant label "include in export".





2) Access the radio button / tick box checked attribute, per record when completeing an export so that only checked records are sent to the export file.





If you can point me to the approximate areas that I should attempt to modify in order to complete the above that would be great.


In the meantime I will be scouring through searchresults.jsp and exporter.jsp in hope of enlightenment!





Cheers,


DB.

ChemAxon 9c0afc9aaf

04-08-2005 11:43:20

Hi,





It's not a trivial change, but I'll try to give you some guidelines.





You can add checkboxes and labels to Marvin cells by modifying the layout.


The layout is string is generated in the "getCellParam" method in searchresults.jsp.





You can read more about the layout and checkboxes in th Marvin documentation:





http://www.chemaxon.com/marvin/doc/dev/viewman.html#advanced





There is also an example which demonstrates checkboxes and buttons:





http://www.chemaxon.com/marvin/doc/dev/example-view2.4.html





Since the JSP example allows paging, the server side must store the state


of all checkboxes in a session variable. (I suggest a boolean[] with the same size as the hit list)





As you can see from the documentation, you can assign actions to the checking and unchecking of textboxes. You can use this to notify the server when the sate of a checkbox has changed.


The easiest way to do this is to have searchreasult.jsp refresh itself and during this it can send itself the information about the change.


The current state of the checkboxes should be set at each display of the searchresults.jsp.





The export itself is less complicated.


We have the hits (int[]) and the selection (boolean[]) as session variables.


You should create an other int[] which only contains the selected cd_id values.


This should be eventually passed on to chemaxon.jchem.db.Exporter:





http://www.chemaxon.com/jchem/doc/api/chemaxon/jchem/db/Exporter.html#setIDList(int[])





The mechanism should be very similar to the one which exports the hits of a search.


In export.jsp:





exp.setIDList(idList);





I hope this helps.





Best regards,





Szilard

ChemAxon 60ee1f1328

04-08-2005 15:29:02

Szilard,





Fallen at the first hurdle I'm afraid!





It appears from the documentation you have referenced, the way to modify the layout is by using javascript calls or including a param tag neither of which appear to plug in nicely to the way that searchresults.jsp is written?





Is there a java way to modify the "value" variable in the getCellParam function? Maybe append the string which codes for a checkbox?


"C:0:1:1:1:c:n:"


Could I place a javascript call set after the first for loop to modify the layout parameter per cell?





Cheers,


Daniel.

ChemAxon 60ee1f1328

05-08-2005 09:46:08

Szilard,





I hear (on the grape vine) that you are developing some activeX components, I would not like to further speculate as to what these will or will not make possible (or even if you are developing them?), but if you could point me in the direction of any pre-product documentation you may have that would be great. My limited understanding of ActiveX is that it allows languages like VB to call Java API and display result...





Cheers,


Daniel.

ChemAxon 9c0afc9aaf

05-08-2005 09:46:54

Hi,





If a fixed layout is acceptable for you (you know the column names in advance), I suggest to substitute the getCellParam function with a string constant.





Best regards,





Szilard

ChemAxon 7c2d26e5cf

06-08-2005 01:17:58

Quote:
I hear (on the grape vine) that you are developing some activeX components, I would not like to further speculate as to what these will or will not make possible (or even if you are developing them?), but if you could point me in the direction of any pre-product documentation you may have that would be great. My limited understanding of ActiveX is that it allows languages like VB to call Java API and display result..
.





Dear Daniel,


There are two ways to access Java from VB or from another native code.


1. JNI:


Use JNI to write Java native methods then call them from native code. JNI is a part of Sun's JDK-s.


You can find several tutorials about JNI on the net. A good starting point can be the Sun's documentation:


http://java.sun.com/j2se/1.3/docs/guide/jni/


2. Java - ActiveX bridge:


With this tool, you can build ActiveX components from your Java Beans. The generated component can be used in any native IDE. If the beans is a graphical component, you can put the created component on a GUI form.


To be able to use Java - ActiveX bridge, you need a Visual Studio. There can be compatibility problems during conversion.


I know about only one guide about Axbridge:


http://java.sun.com/j2se/1.4.2/docs/guide/beans/axbridge/developerguide/


But you can find several topic in this issue on Sun's forum.


http://forum.java.sun.com/forum.jspa?forumID=40&start=0


I suggest you to see this forum because you can find answer for a lot of questions in this issue.


The Java - ActiveX bridge is also part of the JDK-s / SDK-s. But there are big difference between the 1.3 and 1.4.2 versions. In SDK 1.4.2, Sun has rewritten Java ActiveX bridge, thus the earlier versions are not compatibles with the new ones. Furthermore, in Java 1.4, this bridge is totally missing. The advantage of Java - ActiveX bridge is that you don't have to write extra interfaces (theoretically). Its disadvantage is the compatibility.





I suggest you to try both solutions to decide which is the better for you.





Tamas

ChemAxon 43e6884a7a

06-08-2005 08:18:21

Daniel,


Indeed, we have started to develop an ActiveX wrapper.What kind of ActiveX support would you like to see?





Ferenc


PS:


I suggest to open a new forum topic when you open a new topic. :-)

ChemAxon 60ee1f1328

06-08-2005 19:10:06

Thank you for this excellent information, which has certainly helped clarify this area for me. As always thank you for your fantastic support.





Best regards,


Daniel.

ChemAxon 60ee1f1328

08-08-2005 10:57:58

Hi Ferenc,





Initially, for us, I think being able to access the MarvinSketch / Marvin View API from VB will be primarily of interest and also the non-graphical APIs will also be useful. The ability to use the tools from Excel will also be of interest to us.





Cheers,


Daniel.

ChemAxon 7c2d26e5cf

08-08-2005 19:36:47

OK, we will notify you when the wrapper is ready and supports the above features.


Tamas

ChemAxon 60ee1f1328

09-08-2005 08:53:53

Thanks Tamas.





Is it possible to give an approximate idea as to the price likely to be assigned to these wrapper(s). This would be useful information to know in the next couple of weeks in order to help us to finalise an understanding of the options available to us and the total bill for each option.





Cheers,


Daniel.

ChemAxon 7c2d26e5cf

09-08-2005 11:35:32

Dear Daniel,


I am not competent in financial issues. Ferenc is in Boston on DDT. He comes back next week. He will answer for you question after he returns.





Cheers,


Tamas

ChemAxon 43e6884a7a

09-08-2005 11:46:15

The wrappers will probably come with no extra charge if you have either MarvinBeans or JChem Base license.