duplicate structure in web interface

User f52820d97e

11-05-2006 16:37:39

Hi,


I am using a modified version of the interrogation interface (examples/jsp1_x) for a chemolibrary under MySQL with extra columns like a product reference.


I would like to be able to insert a molecule with the same structure but a different reference string (the difference is in the salt, which I include in one table but not in another), but the interface won't let me, whereas jcman does!


Is it possible?


Thank you,


Nicolas

ChemAxon 9c0afc9aaf

11-05-2006 16:47:30

Hi,





This is really just an example, anyone can modify the JSP source to their individual needs.





I'm not sure which version you have, but something like this should be commented out from update.jsp to disable this checking:











Code:



// Checking if the structure already exists in the


    // structure table


    JChemSearch searcher = new JChemSearch();


    searcher.setConnectionHandler(ch);


    searcher.setQueryStructure(molfile);


    searcher.setSearchType(JChemSearch.PERFECT);


    searcher.setStructureTable(structureTableName);


    searcher.setWaitingForResult(true);


    searcher.run();


    int foundItemsCount = searcher.getResultCount();


    if(isInsertion) {


   if(foundItemsCount>0)


       throw new Exception("Structure already exists (cd_id="+


          searcher.getResult(0)+")");


    } else {


   for(int i=0; i<foundItemsCount; i++)


       if(searcher.getResult(i)!=id.intValue())


      throw new Exception(


         "Structure already exists at cd_id="+


         searcher.getResult(i));


    }








Best regards,





Szilard

User f52820d97e

11-05-2006 17:07:05

great, it works, thank you! I am not jsp fluent yet... and did not think of checking the source...