Retrieving id when storing structure using jcman

User ce49e9ef9d

25-02-2011 08:04:36

We are integrating JChem and Marvin into the institution repository software DSpace. As part of our integration, we are adding MarvinSketch to a submission process; the user draws a structure in MarvinSketch, adds additional information in the form of metadata, then submits the record to DSpace's workflow.


So far, we have determined that we can store a structure created in MarvinSketch using jcman into JChem's structures table. What we now need is a method for retrieving the newly created structures record's id (I'm assuming this is from the cd_id field). Is this possible and how would we go about doing it? I notice that jcman does not return the newly created record's id.


Any help much appreciated.

ChemAxon 7c2d26e5cf

25-02-2011 16:58:53

I move this topic to JChem forum. JChem guys can answer the question.

ChemAxon 9c0afc9aaf

25-02-2011 17:11:00

Hi,


 


The same question has been raised here recently:


https://www.chemaxon.com/forum/viewpost33450.html#33450


Apparently the user found a workaround before we implement this funcionality:


If your table does not contain duplicates, trying to insert 2x the same structure with --nonduplicates the cd_id should be reported as duplicate.


Best regards,


Szilard


 

User ce49e9ef9d

25-02-2011 17:17:31

Great thanks. Yes we do not allow duplicates.


Would this be something that could be achieved using the JChem API. I see in the chemaxon.jchem.db.Importer class that there is a getImportedIDs method. For example, if we could retrieve the structure created in MarvinSketch and imported it using the Importer class, would getImportedIDs return our new record's cd_id?

ChemAxon 9c0afc9aaf

25-02-2011 17:27:33

 


If you can use JChem API, it is way better than command-line.


I suggest to 


- get the structure source from the MarvinSketch, e.g. in "mrv" format 


- insert the structure source using UpdateHandler. It has an option to return the cd_id :  call "execute(true)".


Please see this section of the developer's guide:


http://www.chemaxon.com/jchem/doc/dev/modify/index.html#modify_rows


Best,


Szilard