On 17 Mar 2014, at 17:42, Pedro Miguel Paiva Gaudencio 
<pedro.gauden...@cern.ch> wrote:

> Hi there,
> 
> Add the recid to the sip.metadata (which create_recid() will do for you). If 
> you jsonalchemy is setup correctly, it should include 001 tag with the recid 
> in the generated marcxml available in sip.package, and upload_record_sip will 
> run bibupload -r. This you will usually just run after the user hits submit, 
> and thus there's not much difference from waiting until bibupload runs, 
> except making your life easier, by already having the link.
> 
> Yeah, probably my jsonalchemy is not doing something, because the recid is 
> not included in the generated marcxml.

Did you install the invenio-demosite?

> 
> No. First generate recid, stick in sip.metadata, then generate marcxml and 
> stick in sip.package, then bibupload -r. The sip can't and shouldn't be 
> edited after it's been given to bibupload.
> 
> Ok, that's done except for including the recid in the marcxml.
> 
> I tried Tibor's approach, but the thing is that bibupload delays the 
> records...I mean, the recid would be successfully assigned after the record 
> is created (in theory), but since bibupload/bibsched schedules their 
> insertion, they stand waiting on queue and when I query the last record 
> inserted it usually isn't the last submitted one.

Yes, I think you should only use Tibor’s approach if you don’t need the recid 
afterwards. Querying for the last recid is an unreliable way to obtain it.

You can test it like this:

from invenio.modules.records.api import Record
r = Record.create({‘recid': 1234}, 'json')
r.produce('json_for_marc’)

This should give you something like this:

[{'005': '20140318071429.0'}, {'001': 1234}]

Cheers,
Lars

> 
> Anyway, I think I'll take a look on the jsonalchemy stuff to check why the 
> recid isn't being included in the marcxml.
> 
> Cheers,
> Pedro

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to