Hi all,
I'm attempting to create a custom approval workflow which requires the SBI
action of a document type to insert a record into the database but
should not index it (record shouldnt appear in collection).
I've hit a snag modifying the Insert_Record function of SBI, not sure how
to edit the line in bold to give the required behaviour ?
def Insert_Record(parameters, curdir, form, user_info=None):
31 """
32 Insert record in curdir/recmysql using BibUpload. The file must
33 therefore already have been created prior to this execution of
34 this function, for eg. using "Make_Record".
35 """
36 global rn
37 if os.path.exists(os.path.join(curdir, "recmysql")):
38 recfile = "recmysql"
39 else:
40 raise InvenioWebSubmitFunctionError("Could not find record
file")
41 initial_file = os.path.join(curdir, recfile)
42 tmp_fd, final_file = tempfile.mkstemp(dir=CFG_TMPDIR,
43 prefix="%s_%s" % \
44 (rn.replace('/', '_'),
45
time.strftime("%Y-%m-%d_%H:%M:%S")))
46 os.close(tmp_fd)
47 shutil.copy(initial_file, final_file)
* 48 bibupload_id = task_low_level_submission('bibupload',
'websubmit.Insert_Record', '-r', '-i', final_file, '-P', '3')*
49 open(os.path.join(curdir, 'bibupload_id'),
'w').write(str(bibupload_id))
50 return ""
In practice, it's only after a validator "approves" the submission that the
record is indexed and appears in the collection.
This differs from the Demo Book submission(refereed) since it would be
helpful that a user can modify the record before it's
approved and even the validator has to view the entire record contents and
then approve it. (approval here simply means giving a submission
the go-ahead to appear in the collections)
Thoughts/corrections are welcome.
Thanks.
Allan.