Dear Devin,

Devin Bougie wrote:
[..] this correct thumbnail does replace the "?" icon in the HTML
Brief and HTML Detailed view of the record if I take either of the
following actions (for example). - change the record's title - move
the record to a new collection

The output of a record that has been cached by bibreformat is
refreshed only when its metadata has changed, which is not the
case in the scenario you describe (the file is replaced, the
metadata is untouched). In your case, the brief output still
links to the old picture, which does apparently no longer exists,
overwritten by the new file, with a new name (that behavior
really depends on the way your SRV step is configured). Hence the
broken link to the image.
(You say that the HTML detailed view is affected by this problem:
this is most probably because you are also creating caches of the
detailed pages, which is usually not necessary)

A 'bibreformat' did not help, as this tool does only process records
for which the metadata has changed too (unless you 'force' the
reformatting. Check bibreformat --help)

One solution is to trigger a reformatting using a custom WebSubmit
function placed just at the end of your SRV functions list. You can
also simply delete the 'hb' output of the record so that it is
formatted "on-the-fly" until the periodical bibreformat task processes
it. For example, the WebSubmit function could be:
(untested sample code, simplified to the max)

import os
from invenio.dbquery import run_sql
def Clean_HB_Format(parameters, curdir, form):
    """
    Reset HB format of the current record, provided the recid is
    stored in the SN file in curdir.
    """
    filed = file(os.path.join(curdir, 'SN'))
    recid = filed.read().strip()
    filed.close()
    run_sql("DELETE FROM bibfmt WHERE id_bibrec=%s and format='hb'",
            (recid,))


Note that the next version of Invenio will be packed with much cleaner
and customizable SRV sample functions that will avoid this kind of
problems.

Best regards
--
Jerome Caffaro ** CERN Document Server ** <http://cds.cern.ch/>

Reply via email to