Dear Ferran,
I have noticed a couple of issues, if it matters. The first one is that
my AB (or ab) format is not stored in bibfmt (cache) table:
$ echo "select format from bibfmt;" | dbexec | sort | uniq -c
1 format
67404 HB
67404 xm
That's normal: when run, the BibReformat task precreates caches of the
HB format only, since it is the one used in search results lists. And
the XM is there too because it is the source of every output (you get
XM for "free", without having to run BibReformat).
To have another format cached by BibReformat, one would for example
periodically run:
$ sudo -u apache /opt/cds-invenio/bin/bibreformat -o HD
(which would be more or less useless, since HD output is used to display
single records at a time, hence not so resource hungry)
Now I am wondering why you need the AB output format? It this the output
format (linked to some custom template, etc) that you expect to be used
on the cached collection page? If so, then as you guessed:
And, am I wrong or it is just hardcoded this way?
http://cdsware.cern.ch/repo/?p=cds-invenio.git;a=blob;f=modules/websearch/lib/websearch_webcoll.py#l417)
def create_latest_additions_info(self, rg=CFG_WEBSEARCH_INSTANT_BROWSE,
ln=CFG_SITE_LANG):
[...]
for idx in range(total-1, total-to_display-1, -1):
recid = recIDs[idx]
self.latest_additions_info.append({'id': recid,
'format': format_record(recid,
"hb", ln=ln),
'date': get_creation_date(recid, fmt="%Y-%m-%d<br />%H:%i")})
HB output format is hardcoded to be used in search results list AND
cached collection pages (HD is hardcoded to be used on /record/xxx
pages, HS hardcoded to be used on /record/xxx/usage pages, etc.). See
output formats as generic entry points for some particular type of
outputs. Then adapt the formatting by linking different types of format
templates to the output format.
Do not consider this hardcoded stuff as a limitation of the system:
after all, there must be an entry point, and you have all the power
at the level of the output format rules to route to various formattings.
Then why would one need to add new output formats, since they are
hardcoded? Well, they are primarily used to offer alternative outputs
to the data, such as BibTeX, EndNote, etc (such as proposed through the
"output format" menu on search results pages and "Export as .." links on
detailed pages). All output formats except a few core one (XM, HD, HB,
XR, HS) can be considered as optional, and are not so tied into the
system.
So should I do some temporary hacks like you do?
http://cdsware.cern.ch/repo/?p=cds-invenio.git;a=blob;f=modules/websearch/lib/websearch_webcoll.py#l397
No, unless you want some collections to use AB output format for the
cached page, and some others to use HB. But even in this scenario you
should be ok by simply merging AB into HB (there are complex cases where
this would not be true. Are you in this situation?).
Best regards
--
Jerome Caffaro ** CERN Document Server ** <http://cds.cern.ch/>