[Koha] importing, marc mapping, progress

Scott Scriven koha-main at toykeeper.net
Tue Aug 10 11:34:45 NZST 2004


Hello...

I was thinking about building a full MARC display today, and then
came across some related messages...  Anyway, here is how I was
thinking of implementing a more complete display.  It essentially
involves a marc tag list consumable by the template, and a
generic CSS-friendly display controlled by a separate CSS file.
Details are below:

  Build a hash of marc data for each relevant record.  Perhaps
  two-layered, to account for both fields and subfields.  These
  will go into a list I'll call "records".  Pass this to the
  display template along with the koha data.

  While displaying the records, the template should pull out and
  consume (remove from the hash) whatever fields are desired,
  then display the rest afterward, in a generic format.  To
  prevent display of a field, the template should consume it
  without printing it.

  The template would generate output similar to...
  (pseudocode, but for clarity, code is in <? ?>'s)

    <div class="book_overview">
      <div class="245a"><h4>Title:</h4>
        <span class="245a"><? print record["245"]["a"] ?></span>
        <? delete record["245"]["a"] ?>
      </div>
      <div class="100a"><h4>Author:</h4>
        <span class="100a"><? print record["100"]["a"] ?></span>
        <? delete record["100"]["a"] ?>
      </div>
    </div>

  ... and below (any info not used above) ...  a titled div for each
  tag, containing a titled div for each subfield and the actual
  data in a span:

                Additional MARC Info
  +------------------------------------------------+
  | Additional author (700)                        |
  | +--------------------------------------------+ |
  | | Personal Name (700 $a): Doe, John          | |
  | +--------------------------------------------+ |
  | +--------------------------------------------+ |
  | | Description (700 $g): blah blah blah       | |
  | +--------------------------------------------+ |
  +------------------------------------------------+

    <div class="marc">
      <? for each tag in record: ?>
        <div class="<? print tag ?>">
          <h3><? print tag_names[tag], (tag) ?>/h3>
          <? for each field in record[tag]:  ?>
            <div class="<? print tag, field ?>">
              <h4><? print tag_names[tag], (tag) ?></h4>
              <span class="<? print tag, field ?>">
                <? print record[tag][field] ?>
              </span>
            </div>
          <? end for ?>
        </div>
      <? end for ?>
    </div>

  Layout detail would then be implemented with CSS, with generic
  formatting for most tags and special formatting for any known
  tags which should stand out.  See http://csszengarden.com/ for
  details of how this sort of layout can work.

Anyway, this would require the template to do a little more than
just print out variables.  It would need to call functions and/or
unset hash entries.  Is that possible?

Does any of this sound reasonable?  Should I be posting on the
dev list instead?

* Paul POULAIN <paul.poulain at free.fr> wrote:
> >BTW, notice also that NPL is now listing _all_ of the notes from all of
> >the MARC note fields on the OPAC detail page.  Once we get the code a
> >little cleaner and more universal (so it works for UNIMARC or no-MARC
> >libraries), we'll be committing it to CVS.   NPL is also looking into
> >doing the same thing with all of the MARC subject tags, thus bypassing the
> >Koha tables to pull information directly from the MARC tables.
> > 
> >
> Also note that in 2.2, the OPAC as well as the librarian interface will 
> have 3 view for a given biblio :
> * "simple" (=the OPAC view in 2.0)
> * MARC (= complete view)
> * ISBD. The ISBD format is still on the way. There are several rules in 
> ISBD that are not easy to code (more complex when you need something 
> that works with UNIMARC, MARC21, and any MARC flavour). However, the 
> ISBD display will be a systempref parameter & builded from the MARC 
> tables (=complete record)


-- Scott



More information about the Koha mailing list