def _add_records_to_set(ids, set_name): # use invenio-record functions to add set information to the record # get record via invenio-record.api.Record.... get_record for recid, oaiid in ids: if oaiid: rec = Record.get_record(recid) rec.patch(create_new_set_patch(set_name)) else: #use minter for this oaiid = OaiIdProvider.create('rec',recid) rec = Record.get_record(recid) rec.patch(create_oaiid_patch(oaiid)) rec.patch(create_new_set_patch(set_name))
def _del_records_from_set(ids, set_name): for recid, oaiid in ids: rec = Record.get_record(recid) old_datastamp = _get_oai_set_datastamp(rec) rec.patch(delete_set_patch(set_name, old_datastamp))