Hi Pedro,

On 17.03.2014 10:59, Pedro Miguel Paiva Gaudencio wrote:
Hi Lars,

Yes, perfectly! I got it working. What I'm doing is not creating the recid prior to the upload and let it generate itself wih bibupload -i. The record is peacefully created, the thing I haven't thought was how to link the deposition with the record so it's edited afterwards...Is there a way to get the last recid generated? Perhaps adding the recid to the sip would solve it.
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.


I also tried reserving the recid in the sip prior to the bibupload, but then when the marcxml is uploaded the preview points to the wrong record (the previous one, of course), because bibupload ran with -i since the recid wasn't present in the xml.
create_recid() should normally stick recid in sip.metadata by default, so perhaps you are using reserved_recid() instead (which is zenodo specific)?

So, should I add the recid to the sip after the marcxml is uploaded or create an empty dummy record prior to the bibupload and then just update it in the bibupload?

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.

Cheers,
Lars



Cheers,
Pedro

------------------------------------------------------------------------
*From:* Lars Holm Nielsen
*Sent:* Monday, March 17, 2014 8:40 AM
*To:* Pedro Miguel Paiva Gaudencio
*Cc:* Javier Martin Montull; project-invenio-devel (Invenio developers mailing-list)
*Subject:* Re: [pu-branch] Deposit submission upload

Hi Pedro,

1) Generating recid prior to upload:
It all depends on the workflow and what you else you need to do. E.g. in Zenodo I need to know the recid prior to uploading, because I use the recid to generate a DOI which goes into the marcxml. Also, knowing the recid before bibupload runs, allows me to quickly generate a preview and record link to the soon to be uploaded record which I can display to the end-user right after they hit submit. In another workflow, it might be fine not to know the recid until after bibupload has been running.

2) JSONAlchemy: All the workflows should be moved to invenio-demosite, where you should have the recid (https://github.com/inveniosoftware/invenio-demosite/blob/pu/invenio_demosite/recordext/fields/atlantis.cfg#L698). It's WIP at the moment, and Esteban should soon have some changes coming in for JSONAlchemy. I.e. you should install invenio-demosite on top of Invenio as well, and we should move the workflows out of Invenio to invenio-demosite.

Does that answers your questions?

Cheers,
Lars
On 14.03.2014 17:42, Pedro Miguel Paiva Gaudencio wrote:
Hi Lars,

I got the deposit submission upload thingy working, just some things left (I think/hope): the marcxml is generated without the 001 (record id - bibupload runs in -r mode in upload_record_sip() and fails because the recid was previously created) and 980(collection information ["article", "book", "preprint", "report", etc] - which hides the record by default) fields.

I understood that the recid it's not supposed to be present in the new records' marcxml, but if I don't generate the recid (reserved_recid()and create_recid()) the workflow will fail when he gets to run_tasks().

I also understood (not quite sure if I'm right) that when we upload the new deposition, it will be generated a marcxml file from the json that the sip contained.

I checked the jsonalchemy.get_producer_rules() and it does not contain any rule for the 'recid', and so this is pobably why it's not being generated (from the json) along with the rest of the xml (on jsonalchemy.wrappers.legacy_export_as_marc()).

For the upload of new records to work peacefully we need to:

  * add the 001 (adding rules for 'recid' in the producer rules?) and
    980 fields to the marcxml?
  * add only the 980 field and always upload_record_sip() in -i mode?


Do we need the recid already reserved and created in the sips for the new records before the upload (since when a new record is inserted by bibupload a recid is created for that record)? If so, why?


This is my workflow (note that I'm only uploading new records and never editing existing submissions):

 1. prefill_draft(draft_id='default'),
 2. render_form(draft_id='default'),
 3. prepare_sip(),
 4. reserved_recid(),
 5. create_recid(),
 6. process_sip_metadata(process_recjson_new),
 7. finalize_record_sip(),
 8. upload_record_sip(),
 9. run_tasks(update=False)


Sorry about the extensive reading.

Thanks in advance,
Pedro


--
Lars Holm Nielsen
CERN, IT Department, Collaboration & Information Services
http://zenodo.org  | Tel: +41 22 76 79182 | Cel: +41 76 672 8927


--
Lars Holm Nielsen
CERN, IT Department, Collaboration & Information Services
http://zenodo.org | Tel: +41 22 76 79182 | Cel: +41 76 672 8927

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to