#866: BibReformat: add option(s) to refresh selected records only when needed
-------------------------+-----------------
Reporter: jcaffaro | Owner:
Type: enhancement | Status: new
Priority: minor | Milestone:
Component: BibFormat | Version:
Keywords: bibreformat |
-------------------------+-----------------
BibReformat basically runs in two different modes, which currently do not
allow to cover some interesting use cases.
In the default mode (let's call it "mode A") BibReformat processes all the
records for which a cache is '''missing''' or '''out of date''' (metadata
has been updated), in the chosen output format. Records that have an up-
to-date cache are not processed. Eg:
{{{
$ bibreformat -o HB -s 5m
}}}
In the other mode ("mode B") BibReformat is not selecting records based on
the freshness of the cache (or its existence), but based on criteria such
as '''collection''', '''search pattern''', '''record id''', etc. Eg:
{{{
$ bibreformat -p 'title:foo' -o HB -s 5m
$ bibreformat -i 15,17,28 -o HB -s 5m
}}}
In this mode B the BibReformat documentation says that the reformatting is
'''forced''': the cache is updated even if the record metadata has not
been changed. This mode is needed for eg. when a format template has been
updated (so it would probably never been run periodically).
The current modes do not cover the following cases:
1. One wants to pre-format a '''selection''' of records, and have the
cache periodically '''updated (or created) only if needed''' (i.e.
metadata has changed since last run, or cache does not exist). This would
be useful for eg. if one wants to create (and update periodically) the HD
cache for a given collection only, if the HD output of the records in this
specific collection is time-consuming.
2. One wants to update the cache of a selection of records, but not create
the cache if it does not exist. This is similar to case 1) above, but in
that case we do only want to consider records that had been previously
selected for a preformatting. This would be useful if an admin picks from
time to time a few records to pre-format (for eg. runs a single-shot
'{{{bibreformat -o HD -i 15}}}') and wants them periodically updated in
the future without cluttering BibSched with many bibreformat periodical
tasks.
The cleanest to cover 1) might be to update the existing mode B so that
the reformatting is not forced, unless the {{{--force}}} option is used.
Case 2) can be covered with the addition of a {{{--no-creation}}} or
{{{--refresh-only}}} option. These options could be used together, in both
mode A and B.
Alternatively (if it is desired to not change the behaviour of the current
mode B, ie. reformatting is still "forced" in second mode by default), a
{{{--refresh-only-if-needed}}} option might be added to cover 1), and an
option such as {{{--no-creation}}} or {{{--refresh-only}}} could be added
to cover case 2).
(The focus is mostly on having clear options and expected behaviours,
rather than on the implementation, which should not be big issue)
--
Ticket URL: <http://invenio-software.org/ticket/866>
Invenio <http://invenio-software.org>