Skip to content

Commit

Permalink
Merge pull request #6 from /issues/5-add_support_for_relatedItem_type…
Browse files Browse the repository at this point in the history
…_series

#5 - added support for relatedItem/@type='series'
  • Loading branch information
rochpaul authored Aug 27, 2019
2 parents ea50505 + cc49499 commit 9e89b75
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"type": "string",
"indexed": true,
"stored": true,
"multiValued": false
"multiValued": true
}
}
10 changes: 5 additions & 5 deletions src/main/resources/xsl/duepublico-series-layout.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<xsl:template match="/">
<xsl:for-each select="/mycoreobject">
<xsl:choose>
<xsl:when test="metadata/def.modsContainer/modsContainer/mods:mods/mods:relatedItem[@type='host']">
<xsl:apply-templates select="metadata/def.modsContainer/modsContainer/mods:mods/mods:relatedItem[@type='host']" mode="seriesLayout" />
<xsl:when test="metadata/def.modsContainer/modsContainer/mods:mods/mods:relatedItem[contains('host series',@type)]">
<xsl:apply-templates select="metadata/def.modsContainer/modsContainer/mods:mods/mods:relatedItem[contains('host series',@type)]" mode="seriesLayout" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="seriesLayout" />
Expand All @@ -29,10 +29,10 @@
<xsl:apply-imports />
</xsl:template>

<xsl:template match="mods:relatedItem[@type='host'][@xlink:href]" mode="seriesLayout">
<xsl:template match="mods:relatedItem[contains('host series',@type)][@xlink:href]" mode="seriesLayout">
<xsl:choose>
<xsl:when test="mods:relatedItem[@type='host'][@xlink:href]">
<xsl:apply-templates select="mods:relatedItem[@type='host'][@xlink:href]" mode="seriesLayout" />
<xsl:when test="mods:relatedItem[contains('host series',@type)][@xlink:href]">
<xsl:apply-templates select="mods:relatedItem[contains('host series',@type)][@xlink:href]" mode="seriesLayout" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="document(concat('notnull:mcrobject:',@xlink:href))/mycoreobject" mode="seriesLayout" />
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/xsl/solr-navigation.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

<xsl:template match="mycoreobject">
<xsl:apply-imports />
<xsl:apply-templates select="metadata/def.modsContainer/modsContainer/mods:mods/mods:relatedItem[@type='host'][@xlink:href]" mode="rootID" />
<xsl:apply-templates select="metadata/def.modsContainer/modsContainer/mods:mods/mods:relatedItem[contains('host series',@type)][@xlink:href]" mode="rootID" />
</xsl:template>

<!-- go up all the ancestors to find ID of root object that has no parent (root of series/journal) -->
<xsl:template match="mods:relatedItem[@type='host'][@xlink:href]" mode="rootID">
<xsl:template match="mods:relatedItem[contains('host series',@type)][@xlink:href]" mode="rootID">
<xsl:choose>
<xsl:when test="mods:relatedItem[@type='host'][@xlink:href]">
<xsl:apply-templates select="mods:relatedItem[@type='host'][@xlink:href]" mode="rootID" />
<xsl:when test="mods:relatedItem[contains('host series',@type)][@xlink:href]">
<xsl:apply-templates select="mods:relatedItem[contains('host series',@type)][@xlink:href]" mode="rootID" />
</xsl:when>
<xsl:otherwise>
<field name="root">
Expand Down

0 comments on commit 9e89b75

Please sign in to comment.