Dear Devin,

Devin Bougie wrote:
[..] no 8564 tags are created for that record. The file is available from the "Fulltext" tab on the HTML Detailed view, but the "Information" tab says "No fulltext." If we then use the MBI interface to modify the records title, for example, everything is corrected.

please add the attached "Fix_MARC.py" function just after the
"Move_Files_to_Storage" function of your SRV functions flow:

$ cp Fix_MARC.py /opt/cds-invenio/lib/python/invenio/websubmit_functions/
$ firefox
<https://edms.classe.cornell.edu/admin/websubmit/websubmitadmin.py/functionlist>
[Add New Function] -> function name: [Fix_MARC]
<https://edms.classe.cornell.edu/admin/websubmit/websubmitadmin.py/doctypeconfiguresubmissionfunctions?doctype=DEMOART&action=SRV&viewSubmissionFunctions=view+functions>
[Add a Function] -> function name: [Fix_MARC] Step [2] Score [40]

This function updates the 8564_ fields of the metadata to match the
entries in the file-related tables of the database. This is needed
only for SRV submissions in CDS Invenio 0.99.1.

Note that SRV submissions in later versions of CDS Invenio will use
slightly different functions, which do not need to use this Fix_MARC
function.

Best regards
--
Jerome Caffaro ** CERN Document Server ** <http://cds.cern.ch/>
## 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 Move_Files_to_Storage(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 ""


Reply via email to