View | Details | Raw Unified | Return to bug 11232
Collapse All | Expand All

(-)a/debian/templates/marc21-retrieval-info-bib-dom.xml (+2 lines)
Lines 14-22 Link Here
14
            outputcharset="utf-8"/>
14
            outputcharset="utf-8"/>
15
    </backend>
15
    </backend>
16
  </retrieval>
16
  </retrieval>
17
  <retrieval syntax="xml"/>
17
  <retrieval syntax="xml" name="index"/> <!-- allow viewing index entries -->
18
  <retrieval syntax="xml" name="index"/> <!-- allow viewing index entries -->
18
  <retrieval syntax="xml" name="marc"
19
  <retrieval syntax="xml" name="marc"
19
             identifier="info:srw/schema/1/marcxml-v1.1"/>
20
             identifier="info:srw/schema/1/marcxml-v1.1"/>
20
  <retrieval syntax="xml" name="marcxml"
21
  <retrieval syntax="xml" name="marcxml"
21
             identifier="info:srw/schema/1/marcxml-v1.1"/>
22
             identifier="info:srw/schema/1/marcxml-v1.1"/>
23
  <retrieval syntax="xml" name="zebra::*" />
22
</retrievalinfo>
24
</retrievalinfo>
(-)a/debian/templates/normarc-retrieval-info-bib-dom.xml (+2 lines)
Lines 14-22 Link Here
14
            outputcharset="utf-8"/>
14
            outputcharset="utf-8"/>
15
    </backend>
15
    </backend>
16
  </retrieval>
16
  </retrieval>
17
  <retrieval syntax="xml"/>
17
  <retrieval syntax="xml" name="index"/> <!-- allow viewing index entries -->
18
  <retrieval syntax="xml" name="index"/> <!-- allow viewing index entries -->
18
  <retrieval syntax="xml" name="marc"
19
  <retrieval syntax="xml" name="marc"
19
             identifier="info:srw/schema/1/marcxml-v1.1"/>
20
             identifier="info:srw/schema/1/marcxml-v1.1"/>
20
  <retrieval syntax="xml" name="marcxml"
21
  <retrieval syntax="xml" name="marcxml"
21
             identifier="info:srw/schema/1/marcxml-v1.1"/>
22
             identifier="info:srw/schema/1/marcxml-v1.1"/>
23
  <retrieval syntax="xml" name="zebra::*" />
22
</retrievalinfo>
24
</retrievalinfo>
(-)a/debian/templates/unimarc-retrieval-info-bib-dom.xml (+2 lines)
Lines 14-22 Link Here
14
            outputcharset="utf-8"/>
14
            outputcharset="utf-8"/>
15
    </backend>
15
    </backend>
16
  </retrieval>
16
  </retrieval>
17
  <retrieval syntax="xml"/>
17
  <retrieval syntax="xml" name="index"/> <!-- allow viewing index entries -->
18
  <retrieval syntax="xml" name="index"/> <!-- allow viewing index entries -->
18
  <retrieval syntax="xml" name="marc"
19
  <retrieval syntax="xml" name="marc"
19
             identifier="info:srw/schema/1/marcxml-v1.1"/>
20
             identifier="info:srw/schema/1/marcxml-v1.1"/>
20
  <retrieval syntax="xml" name="marcxml"
21
  <retrieval syntax="xml" name="marcxml"
21
             identifier="info:srw/schema/1/marcxml-v1.1"/>
22
             identifier="info:srw/schema/1/marcxml-v1.1"/>
23
  <retrieval syntax="xml" name="zebra::*" />
22
</retrievalinfo>
24
</retrievalinfo>
(-)a/etc/zebradb/retrieval-info-bib-dom.xml (+7 lines)
Lines 15-18 Link Here
15
    </backend>
15
    </backend>
16
  </retrieval>
16
  </retrieval>
17
  <retrieval syntax="xml"/>
17
  <retrieval syntax="xml"/>
18
  <retrieval syntax="xml" name="index"/> <!-- allow viewing index entries -->
19
  <retrieval syntax="xml" name="marc"
20
             identifier="info:srw/schema/1/marcxml-v1.1"/>
21
  <retrieval syntax="xml" name="marcxml"
22
             identifier="info:srw/schema/1/marcxml-v1.1"/>
23
<!-- enable access to Zebra's internal data -->
24
  <retrieval syntax="xml" name="zebra::*" />
18
</retrievalinfo>
25
</retrievalinfo>
(-)a/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl (-6 / +91 lines)
Lines 12-21 Link Here
12
    <xsl:template match="text()"/>
12
    <xsl:template match="text()"/>
13
13
14
    <!-- Keys on tags referenced in the index definitions -->
14
    <!-- Keys on tags referenced in the index definitions -->
15
    <xsl:key name="index_control_field_tag"   match="kohaidx:index_control_field"   use="@tag"/>
15
    <xsl:key name="index_control_field_tag" match="kohaidx:index_control_field" use="@tag"/>
16
    <xsl:key name="index_subfields_tag" match="kohaidx:index_subfields" use="@tag"/>
16
    <xsl:key name="index_subfields_tag"     match="kohaidx:index_subfields"     use="@tag"/>
17
    <xsl:key name="index_heading_tag"   match="kohaidx:index_heading"   use="@tag"/>
17
    <xsl:key name="index_heading_tag"       match="kohaidx:index_heading"       use="@tag"/>
18
    <xsl:key name="index_data_field_tag"   match="kohaidx:index_data_field"   use="@tag"/>
18
    <xsl:key name="index_data_field_tag"    match="kohaidx:index_data_field"    use="@tag"/>
19
    <xsl:key name="index_heading_conditional_tag" match="kohaidx:index_heading_conditional" use="@tag"/>
19
    <xsl:key name="index_heading_conditional_tag" match="kohaidx:index_heading_conditional" use="@tag"/>
20
    <xsl:key name="index_match_heading_tag" match="kohaidx:index_match_heading" use="@tag"/>
20
    <xsl:key name="index_match_heading_tag" match="kohaidx:index_match_heading" use="@tag"/>
21
21
Lines 33-38 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
33
            <xslo:template match="text()"/>
33
            <xslo:template match="text()"/>
34
            <xslo:template match="text()" mode="index_subfields"/>
34
            <xslo:template match="text()" mode="index_subfields"/>
35
            <xslo:template match="text()" mode="index_data_field"/>
35
            <xslo:template match="text()" mode="index_data_field"/>
36
            <xslo:template match="text()" mode="index_facets"/>
36
            <xslo:template match="text()" mode="index_heading"/>
37
            <xslo:template match="text()" mode="index_heading"/>
37
            <xslo:template match="text()" mode="index_heading_conditional"/>
38
            <xslo:template match="text()" mode="index_heading_conditional"/>
38
            <xslo:template match="text()" mode="index_match_heading"/>
39
            <xslo:template match="text()" mode="index_match_heading"/>
Lines 57-62 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
57
                    <xslo:apply-templates/>
58
                    <xslo:apply-templates/>
58
                    <xslo:apply-templates mode="index_subfields"/>
59
                    <xslo:apply-templates mode="index_subfields"/>
59
                    <xslo:apply-templates mode="index_data_field"/>
60
                    <xslo:apply-templates mode="index_data_field"/>
61
                    <xslo:apply-templates mode="index_facets"/>
60
                    <xslo:apply-templates mode="index_heading"/>
62
                    <xslo:apply-templates mode="index_heading"/>
61
                    <xslo:apply-templates mode="index_heading_conditional"/>
63
                    <xslo:apply-templates mode="index_heading_conditional"/>
62
                    <xslo:apply-templates mode="index_match_heading"/>
64
                    <xslo:apply-templates mode="index_match_heading"/>
Lines 69-74 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
69
            <xsl:call-template name="handle-index-control-field"/>
71
            <xsl:call-template name="handle-index-control-field"/>
70
            <xsl:call-template name="handle-index-subfields"/>
72
            <xsl:call-template name="handle-index-subfields"/>
71
            <xsl:call-template name="handle-index-data-field"/>
73
            <xsl:call-template name="handle-index-data-field"/>
74
            <xsl:call-template name="handle-index-facets"/>
72
            <xsl:call-template name="handle-index-heading"/>
75
            <xsl:call-template name="handle-index-heading"/>
73
            <xsl:call-template name="handle-index-heading-conditional"/>
76
            <xsl:call-template name="handle-index-heading-conditional"/>
74
            <xsl:call-template name="handle-index-match-heading"/>
77
            <xsl:call-template name="handle-index-match-heading"/>
Lines 104-110 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
104
        </xslo:variable>
107
        </xslo:variable>
105
    </xsl:template>
108
    </xsl:template>
106
109
107
    <xsl:template match="kohaidx:index_subject_thesaurus">   
110
    <xsl:template match="kohaidx:index_subject_thesaurus">
108
        <xsl:variable name="tag"><xsl:value-of select="@tag"/></xsl:variable>
111
        <xsl:variable name="tag"><xsl:value-of select="@tag"/></xsl:variable>
109
        <xsl:variable name="offset"><xsl:value-of select="@offset"/></xsl:variable>
112
        <xsl:variable name="offset"><xsl:value-of select="@offset"/></xsl:variable>
110
        <xsl:variable name="length"><xsl:value-of select="@length"/></xsl:variable>
113
        <xsl:variable name="length"><xsl:value-of select="@length"/></xsl:variable>
Lines 288-293 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
288
            </xslo:for-each>
291
            </xslo:for-each>
289
    </xsl:template>
292
    </xsl:template>
290
293
294
    <xsl:template name="handle-index-facets">
295
      <xsl:for-each select="facet">
296
        <xsl:variable name="indexes">
297
          <xsl:call-template name="get-facets-target-indexes"/>
298
        </xsl:variable>
299
        <xsl:if test="not($indexes='')">
300
          <xslo:template mode="index_facets">
301
            <xsl:attribute name="match">
302
            <xsl:text>marc:datafield[@tag='</xsl:text>
303
            <xsl:value-of select="@tag"/>
304
            <xsl:text>']</xsl:text>
305
            </xsl:attribute>
306
            <xslo:if>
307
              <xsl:attribute name="test">
308
                <xsl:text>not(@ind1='z')</xsl:text>
309
              </xsl:attribute>
310
              <z:index>
311
              <xsl:attribute name="name">
312
                <xsl:value-of select="normalize-space($indexes)"/>
313
              </xsl:attribute>
314
              <xsl:call-template name="build-facet-value">
315
                <xsl:with-param name="subfields" select="@subfields"/>
316
              </xsl:call-template>
317
              </z:index>
318
            </xslo:if>
319
          </xslo:template>
320
        </xsl:if>
321
      </xsl:for-each>
322
    </xsl:template>
323
291
    <xsl:template name="handle-index-data-field">
324
    <xsl:template name="handle-index-data-field">
292
        <xsl:for-each select="//kohaidx:index_data_field[generate-id() = generate-id(key('index_data_field_tag', @tag)[1])]">
325
        <xsl:for-each select="//kohaidx:index_data_field[generate-id() = generate-id(key('index_data_field_tag', @tag)[1])]">
293
            <xslo:template mode="index_data_field">
326
            <xslo:template mode="index_data_field">
Lines 475-478 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
475
            <xsl:value-of select="." /><xsl:text> </xsl:text>
508
            <xsl:value-of select="." /><xsl:text> </xsl:text>
476
        </xsl:for-each>
509
        </xsl:for-each>
477
    </xsl:template>
510
    </xsl:template>
511
512
    <xsl:template name="get-facets-target-indexes">
513
        <xsl:for-each select="target_index">
514
            <xsl:value-of select="." /><xsl:text> </xsl:text>
515
        </xsl:for-each>
516
    </xsl:template>
517
518
    <!-- traverse subfields string character-wise -->
519
    <xsl:template name="build-facet-value">
520
      <xsl:param name="subfields"/>
521
      <xsl:if test="string-length($subfields) &gt; 0">
522
        <xslo:value-of>
523
          <xsl:attribute name="select">
524
              <xsl:text>marc:subfield[@code='</xsl:text>
525
              <xsl:value-of select="substring($subfields,1,1)"/>
526
              <xsl:text>']</xsl:text>
527
          </xsl:attribute>
528
        </xslo:value-of>
529
        <xsl:call-template name="build-facet-value-cont">
530
          <xsl:with-param name="prev" select="substring($subfields,1,1)"/>
531
          <xsl:with-param name="subfields" select="substring($subfields,2)"/>
532
        </xsl:call-template>
533
      </xsl:if>
534
    </xsl:template>
535
536
    <xsl:template name="build-facet-value-cont">
537
      <xsl:param name="prev"/>
538
      <xsl:param name="subfields"/>
539
      <xsl:if test="string-length($subfields) &gt; 0">
540
        <xslo:if>
541
            <xsl:attribute name="test">
542
                <xsl:text>marc:subfield[@code='</xsl:text>
543
                <xsl:value-of select="$prev"/>
544
                <xsl:text>'] and marc:subfield[@code='</xsl:text>
545
                <xsl:value-of select="substring($subfields,1,1)"/>
546
                <xsl:text>']</xsl:text>
547
            </xsl:attribute>
548
            <xslo:text>::*::</xslo:text>
549
        </xslo:if>
550
        <xslo:value-of>
551
          <xsl:attribute name="select">
552
              <xsl:text>marc:subfield[@code='</xsl:text>
553
              <xsl:value-of select="substring($subfields,1,1)"/>
554
              <xsl:text>']</xsl:text>
555
          </xsl:attribute>
556
        </xslo:value-of>
557
        <xsl:call-template name="build-facet-value-cont">
558
          <xsl:with-param name="prev" select="substring($subfields,1,1)"/>
559
          <xsl:with-param name="subfields" select="substring($subfields,2)"/>
560
        </xsl:call-template>
561
      </xsl:if>
562
    </xsl:template>
563
478
</xsl:stylesheet>
564
</xsl:stylesheet>
479
- 

Return to bug 11232