Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   automatically obtain entry ID from search, posted by Chris Körner on Tue Mar 23 23:05:20 2021 
    icon2.gif   Re: automatically obtain entry ID from search, posted by Stefan Ritt on Wed Mar 24 10:01:34 2021 
       icon2.gif   Re: automatically obtain entry ID from search, posted by Sebastian Schenk on Wed Mar 24 18:02:07 2021 
Message ID: 69329     Entry time: Wed Mar 24 18:02:07 2021     In reply to: 69323
Icon: Reply  Author: Sebastian Schenk  Author Email: sebastian.schenk@physik.uni-halle.de 
Category: Question  OS: Linux  ELOG Version: 3.14 
Subject: Re: automatically obtain entry ID from search 

Hi Chris,

Additional the the HTTP request sugested by Stefan you could also use the search functionality of the elog python module.
For the HTTP request you may also need a way to provide credentials or transmit cookies, if the elog needs authentification.

I think your request to alter the samples logbook will be called with "execute new" or similar at submit time of the entry to the measurement logbook.
Then both methods will have the issue that elogd is still processing the submit and can't answer new requests until the old is finished.
Have a look at https://elog.psi.ch/elogs/Forum/69328 for possible workarounds.

Best wishes,
Sebastian

Stefan Ritt wrote:

You would have to do that on the scrip level. Use "curl" to search a logbook. Like following URL would search for all entries in this forum where you are the authoer, then return the entries in CSV format:

https://elog.psi.ch/elogs/Forum/?mode=CSV1&Author=k%F6rner

Then you can parese this CSV file and extract the entry ID, which you can pass to the elog client to submit a new entry to the other logbook.

Stefan

Chris Körner wrote:

Hi,

in our application I want to have, let's say in the simplest case, two logbooks. One as a database of samples we fabricated and one as a logbook for measurements. When a measurement on a sample is done and an entry is submitted to the 2nd logbook, I want to automatically edit or reply to the corresponding entry in the 1st logbook. For example I want to append a line in the free text field to have a full log of what happened to a sample there. We reference our samples with a unique auto-generated ID in both logbooks. Is is somehow possible to search the 1st logbook for that ID or any other attribute and obtain the elog entry ID since the elog client will need that ID for editing an entry?

 

 

ELOG V3.1.5-3fb85fa6