Hi Ferran,

Ferran Jorba wrote:
This AB is for authority records.  [..]  For example, a typical entry would be:

 000065982 001__ 65982
 000065982 008 __010507 ||acznnaabn          |a aaa     d
 000065982 100 1_ $a Coma i Ferrer, Joan M. $c (Pseudònim de Josep Faulí)
 000065982 500 1_ $a Faulí, Josep, $d 1932-2006
 000065982 970 __ $a tracesaut-557
 000065982 980 __ $a TRACESAUT

I see.
(We use the convention to start output formats that produce HTML with the letter 'H' AB -> HAB or HBA...)

One solution would be to have a special additional field for authority
records that would duplicate the 980__a (eg. to 980__d. Not sure it is
really clean...), and to have an output format that has duplicated rules
for each case, such as below:
tag 980__d:
MYCOLLECTION1---html_authority_detailed_coll1.bft
MYCOLLECTION2---html_authority_detailed_coll2.bft
tag 980__a:
MYCOLLECTION1---html_detailed_coll1.bft
MYCOLLECTION2---html_detailed_coll2.bft

Another (more complicated) solution is to have the following setup:
HB and HD output formats links both in all cases to the very same template "foo.bft". This foo template contains a single format element "BFE_FOO_ELEMENT". You can then write in Python your own custom rules to produce a formatting using your AB output format in the case of authority records, or another format in other cases.
For eg. (not tested):

from invenio.bibformat import format_record
def format(bfo):
    if bfo.format.upper() == "HB":
        if bfo.field('xxx') == 'yyy':
            # Express your conditions to use one format or the other
            return format_record(bfo.recID, of="AB")
        else:
            return format_record(bfo.recID, of="HBORIG")
    elif bfo.format.upper() == 'HD'
        if bfo.field('xxx') == 'yyy':
            return format_record(bfo.recID, of="AD")
        else:
            return format_record(bfo.recID, of="HDORIG")

(where HDORIG and HBORIG are the renamed original output formats HD and
HB)
The whole point in this setup is to be able to keep the output formats
separate, and to be able to freely express the conditions under which
one format is used instead of another. One could even go further by
guessing what is the currently displayed collection to use a different
formatting.

Summing up, we have something that works *except* the first cached
page.  So I may have to change the hardcoded 'hb' in line 397 according
to the self.name collection name (out of the loop, that is).

But if I understand well, AB is not chosen by default when you hit the search button, is that true?

(In general it would be interesting to be able to define a default
output format for a given collection)

[..] we like a presentation more gallery-like, such as this:
 http://pares.mcu.es/cartelesGC/AdminControlServlet?COP=6

[..] Are we dreaming too much?  Do you have any suggestion or future plans?

It shouldn't be too difficult. There is already the "portfolio" format
to achieve a similar effect:
<http://invenio-demo.cern.ch/search?cc=Pictures&of=hp>
<http://cdsweb.cern.ch/search?cc=Photos&rg=50&of=hp>

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

Reply via email to