Bugzilla – Attachment 31456 Details for
Bug 11232
Retrieve facets from Zebra
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11232: MARC21 facet definition and updated XSL file for DOM
Bug-11232-MARC21-facet-definition-and-updated-XSL-.patch (text/plain), 7.63 KB, created by
Tomás Cohen Arazi (tcohen)
on 2014-09-08 13:34:37 UTC
(
hide
)
Description:
Bug 11232: MARC21 facet definition and updated XSL file for DOM
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2014-09-08 13:34:37 UTC
Size:
7.63 KB
patch
obsolete
>From af315d4673b99956e054347d68bed4ae55a393ac Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Thu, 4 Sep 2014 13:12:09 -0300 >Subject: [PATCH] Bug 11232: MARC21 facet definition and updated XSL file for > DOM > >This patch adds the facets definitions to the biblio-koha-indexdefs.xml, based >on what is hardcoded on C4::Koha::getFacets(). > >The biblio-zebra-indexdefs.xsl file for MARC21 is generated using the usual: > >xsltproc ...koha-indexdefs-to-zebra.xsl ...marc21/biblios/biblio-koha-indexdefs.xml > \ > ...marc21/biblios/biblio-zebra-indexdefs.xsl > >Sponsored-by: Universidad Nacional de Cordoba >--- > .../marc21/biblios/biblio-koha-indexdefs.xml | 41 ++++++++++- > .../marc21/biblios/biblio-zebra-indexdefs.xsl | 80 +++++++++++++++++++++- > 2 files changed, 119 insertions(+), 2 deletions(-) > >diff --git a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >index d3ee630..c44e985 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >@@ -1,5 +1,6 @@ > <?xml version="1.0" encoding="utf-8"?> >-<kohaidx:index_defs xmlns:kohaidx="http://www.koha-community.org/schemas/index-defs"> >+<kohaidx:index_defs xmlns:kohaidx="http://www.koha-community.org/schemas/index-defs" >+ xmlns="http://www.koha-community.org/schemas/index-defs"> > <!--record.abs line 40: xelm /record/leader llength:w:range(data,0,5),rtype:w:range(data,6,1),Bib-level:w:range(data,7,1)--> > <id>marc:datafield[@tag='999']/marc:subfield[@code='c']</id> > <index_leader xmlns="http://www.koha-community.org/schemas/index-defs" offset="0" length="5"> >@@ -1284,4 +1285,42 @@ > <target_index>Note:w</target_index> > <target_index>Note:p</target_index> > </index_subfields> >+ >+ <facet tag="100" subfields="a"> >+ <target_index>au:0</target_index> >+ </facet> >+ <facet tag="110" subfields="a"> >+ <target_index>au:0</target_index> >+ </facet> >+ <facet tag="440" subfields="a"> >+ <target_index>se:0</target_index> >+ </facet> >+ <facet tag="490" subfields="a"> >+ <target_index>se:0</target_index> >+ </facet> >+ <facet tag="630" subfields="a"> >+ <target_index>su-ut:0</target_index> >+ </facet> >+ <facet tag="650" subfields="a"> >+ <target_index>su-to:0</target_index> >+ </facet> >+ <facet tag="651" subfields="a"> >+ <target_index>su-geo:0</target_index> >+ </facet> >+ <facet tag="700" subfields="a"> >+ <target_index>au:0</target_index> >+ </facet> >+ <facet tag="942" subfields="c"> >+ <target_index>itype:0</target_index> >+ </facet> >+ <facet tag="952" subfields="a"> >+ <target_index>homebranch:0</target_index> >+ </facet> >+ <facet tag="952" subfields="b"> >+ <target_index>holdingbranch:0</target_index> >+ </facet> >+ <facet tag="952" subfields="c"> >+ <target_index>location:0</target_index> >+ </facet> >+ > </kohaidx:index_defs> >diff --git a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl b/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >index a4aad7b..cd6db2a 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >@@ -12,6 +12,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > <xslo:template match="text()"/> > <xslo:template match="text()" mode="index_subfields"/> > <xslo:template match="text()" mode="index_data_field"/> >+ <xslo:template match="text()" mode="index_facets"/> > <xslo:template match="text()" mode="index_heading"/> > <xslo:template match="text()" mode="index_heading_conditional"/> > <xslo:template match="text()" mode="index_match_heading"/> >@@ -27,7 +28,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:if> > </xslo:template> > <xslo:template match="marc:record"> >- <xslo:variable name="idfield" select="normalize-space(marc:datafield[@tag='999']/marc:subfield[@code='c'])"/> >+ <xslo:variable name="idfield" select="normalize-space()"/> > <z:record type="update"> > <xslo:attribute name="z:id"> > <xslo:value-of select="$idfield"/> >@@ -35,6 +36,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > <xslo:apply-templates/> > <xslo:apply-templates mode="index_subfields"/> > <xslo:apply-templates mode="index_data_field"/> >+ <xslo:apply-templates mode="index_facets"/> > <xslo:apply-templates mode="index_heading"/> > <xslo:apply-templates mode="index_heading_conditional"/> > <xslo:apply-templates mode="index_match_heading"/> >@@ -2344,6 +2346,82 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > <xslo:value-of select="normalize-space($raw_heading)"/> > </z:index> > </xslo:template> >+ <xslo:template mode="index_facets" match="marc:datafield[@tag='100']"> >+ <xslo:if test="not(@ind1='z')"> >+ <z:index name="au:0"> >+ <xslo:value-of select="marc:subfield[@code='a']"/> >+ </z:index> >+ </xslo:if> >+ </xslo:template> >+ <xslo:template mode="index_facets" match="marc:datafield[@tag='110']"> >+ <xslo:if test="not(@ind1='z')"> >+ <z:index name="au:0"> >+ <xslo:value-of select="marc:subfield[@code='a']"/> >+ </z:index> >+ </xslo:if> >+ </xslo:template> >+ <xslo:template mode="index_facets" match="marc:datafield[@tag='440']"> >+ <xslo:if test="not(@ind1='z')"> >+ <z:index name="se:0"> >+ <xslo:value-of select="marc:subfield[@code='a']"/> >+ </z:index> >+ </xslo:if> >+ </xslo:template> >+ <xslo:template mode="index_facets" match="marc:datafield[@tag='490']"> >+ <xslo:if test="not(@ind1='z')"> >+ <z:index name="se:0"> >+ <xslo:value-of select="marc:subfield[@code='a']"/> >+ </z:index> >+ </xslo:if> >+ </xslo:template> >+ <xslo:template mode="index_facets" match="marc:datafield[@tag='630']"> >+ <xslo:if test="not(@ind1='z')"> >+ <z:index name="su-ut:0"> >+ <xslo:value-of select="marc:subfield[@code='a']"/> >+ </z:index> >+ </xslo:if> >+ </xslo:template> >+ <xslo:template mode="index_facets" match="marc:datafield[@tag='650']"> >+ <xslo:if test="not(@ind1='z')"> >+ <z:index name="su-to:0"> >+ <xslo:value-of select="marc:subfield[@code='a']"/> >+ </z:index> >+ </xslo:if> >+ </xslo:template> >+ <xslo:template mode="index_facets" match="marc:datafield[@tag='651']"> >+ <xslo:if test="not(@ind1='z')"> >+ <z:index name="su-geo:0"> >+ <xslo:value-of select="marc:subfield[@code='a']"/> >+ </z:index> >+ </xslo:if> >+ </xslo:template> >+ <xslo:template mode="index_facets" match="marc:datafield[@tag='700']"> >+ <xslo:if test="not(@ind1='z')"> >+ <z:index name="au:0"> >+ <xslo:value-of select="marc:subfield[@code='a']"/> >+ </z:index> >+ </xslo:if> >+ </xslo:template> >+ <xslo:template mode="index_facets" match="marc:datafield[@tag='942']"> >+ <xslo:if test="not(@ind1='z')"> >+ <z:index name="itype:0"> >+ <xslo:value-of select="marc:subfield[@code='c']"/> >+ </z:index> >+ </xslo:if> >+ </xslo:template> >+ <xslo:template mode="index_facets" match="marc:datafield[@tag='952']"> >+ <xslo:if test="not(@ind1='z')"> >+ <z:index name="homebranch:0"> >+ <xslo:value-of select="marc:subfield[@code='a']"/> >+ </z:index> >+ <z:index name="holdingbranch:0"> >+ <xslo:value-of select="marc:subfield[@code='b']"/> >+ </z:index> >+ <z:index name="location:0"> >+ <xslo:value-of select="marc:subfield[@code='c']"/> >+ </z:index> >+ </xslo:if> >+ </xslo:template> > <xslo:template mode="index_all" match="text()"> > <z:index name="Any:w Any:p"> > <xslo:value-of select="."/> >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11232
:
26911
|
31426
|
31427
|
31428
|
31429
|
31430
|
31431
|
31432
|
31433
|
31434
|
31435
|
31436
|
31455
|
31456
|
31457
|
31458
|
31459
|
31460
|
31781
|
31782
|
31783
|
31784
|
31785
|
31786
|
31795
|
31796
|
31797
|
31798
|
31799
|
31800
|
32152
|
32153
|
32154
|
32155
|
32156
|
32157
|
32330
|
32331
|
32350
|
32352
|
32353
|
32354
|
32355
|
32356
|
32357
|
32358
|
32359
|
32360