Skip to content

Commit

Permalink
#550 Made type of HISinOne servflag configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Possommi committed Sep 10, 2024
1 parent 3e761df commit dd6611f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package de.uni_jena.thunibib.his.xml;

import org.mycore.common.config.MCRConfiguration2;

public class HISInOneServiceFlag {
static final String SERVFLAG_TYPE = MCRConfiguration2.getStringOrThrow("ThUniBib.HISinOne.servflag.type");

private HISInOneServiceFlag() {
}

public static String getName() {
return "his-id";
return HISInOneServiceFlag.SERVFLAG_TYPE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ ThUniBib.HISinOne.BaseURL = https:
ThUniBib.HISinOne.BaseURL.API.Path = api/v1/
ThUniBib.HISinOne.ClientKey =
ThUniBib.HISinOne.ClientSecret =
ThUniBib.HISinOne.servflag.type = MyCoRe-HISinOne

ThUniBib.HISinOne.Publication.Transformer.Name = res-publication-json-detailed
ThUniBib.HISinOne.Journal.Transformer.Name = res-json-journal-base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<xsl:param name="MCR.user2.matching.lead_id"/>
<xsl:param name="ThUniBib.HISinOne.BaseURL"/>
<xsl:param name="ThUniBib.HISinOne.BaseURL.API.Path"/>
<xsl:param name="ThUniBib.HISinOne.servflag.type"/>
<xsl:param name="WebApplicationBaseURL"/>

<xsl:variable name="origin" select="document('classification:metadata:-1:children:ORIGIN')/mycoreclass/categories" />
Expand Down Expand Up @@ -332,10 +333,9 @@
</xsl:copy>
</xsl:template>

<xsl:template match="//servflags[servflag[@type = 'his-id']]">
<xsl:template match="//servflags[servflag[@type = $ThUniBib.HISinOne.servflag.type]]">
<xsl:copy>
<xsl:copy-of select="*|@*"/>
<xsl:variable name="hisid" select="servflag[@type = 'his-id']"/>
<xsl:variable name="genre" select="fn:substring-after(//mycoreobject//mods:mods/mods:genre[@type='intern']/@valueURI, '#')"/>

<xsl:variable name="lockVersion">
Expand All @@ -349,7 +349,7 @@
</xsl:choose>
</xsl:variable>

<servflag type="his-id-lockVersion">
<servflag type="{$ThUniBib.HISinOne.servflag.type}-lockVersion">
<xsl:value-of select="$lockVersion"/>
</servflag>
</xsl:copy>
Expand Down

0 comments on commit dd6611f

Please sign in to comment.