Hi Jerome,
Many thanks for your function. Once I changed the name of the def to
"Fix_MARC", it worked as promised.
The entire function we're using is attached below.
Thanks again,
Devin
------
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## CDS Invenio is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with CDS Invenio; if not, write to the Free Software
Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
"""Function for updating 8564 fields of the metadata"""
__revision__ = "$Id$"
import os
from invenio.config import CFG_BINDIR
from invenio.dbquery import run_sql
def Fix_MARC(parameters, curdir, form, user_info=None):
"""
The function updates the metadata of the record (8564_ fields) to
match the state of the files table in the database.
"""
global sysno
# Update the MARC
bibdocfile_bin = os.path.join(CFG_BINDIR, 'bibdocfile --yes-i-know')
os.system(bibdocfile_bin + " --fix-marc --recid=" + sysno)
# Delete the HB BibFormat cache in the DB, so that the fulltext
# links do not point to possible dead files
run_sql("DELETE from bibfmt WHERE format='HB' AND id_bibrec=%s",
(sysno,))
return ""