Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions mir-module/src/main/resources/config/mir/mycore.properties
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ MCR.RestApi.Draft.MCRAccessKey2=true
# Configure DFGViewer #
##############################################################################
MIR.DFGViewer.enable=false
MCR.ContentTransformer.mets-dfg.Class=org.mycore.common.content.transformer.MCRXSLTransformer
MCR.ContentTransformer.mets-dfg.TransformerFactoryClass=%XALAN%
MCR.ContentTransformer.mets-dfg.Stylesheet=xsl/mets/mets-dfg.xsl
MCR.ContentTransformer.mets-dfg.Stylesheet=xslt/mets/mets-dfg.xsl

# add if DFGViewer is enabled (MIR.DFGViewer.enable=true)
# MIR.DFGViewer.DV.Owner=
Expand Down
8 changes: 0 additions & 8 deletions mir-module/src/main/resources/xsl/mets/mets-dfg.xsl

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:mcrxml="xalan://org.mycore.common.xml.MCRXMLFunctions"
<xsl:stylesheet version="3.0"
xmlns:mcrclassification="http://www.mycore.de/xslt/classification"
xmlns:mets="http://www.loc.gov/METS/"
xmlns:mods="http://www.loc.gov/mods/v3"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xalan="http://xml.apache.org/xalan"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="mcrxml xalan">
exclude-result-prefixes="#all">

<xsl:param name="WebApplicationBaseURL" />
<xsl:param name="objectID" />
<xsl:param name="license" select="'CC-BY-NC-SA'" />
<xsl:param name="MIR.DFGViewer.DV.Owner" select="''" />
<xsl:param name="MIR.DFGViewer.DV.OwnerLogo" select="''" />
Expand All @@ -33,12 +31,11 @@

<xsl:variable name="derivateOwnerId">
<xsl:choose>
<!-- it is derivate -->
<xsl:when test="$derobject">
<xsl:value-of select="mcrxml:getMCRObjectID($derobject)" />
<xsl:value-of
select="(document(concat('mcrobject:', $derobject))/mycorederivate/derivate/linkmetas/linkmeta/@xlink:href, $objectID)[1]" />
</xsl:when>
<xsl:otherwise>
<!--it is a regular mcrobj -->
<xsl:value-of select="$mcrobject" />
</xsl:otherwise>
</xsl:choose>
Expand All @@ -53,17 +50,20 @@
<mets:mdWrap MIMETYPE="text/xml" MDTYPE="OTHER" OTHERMDTYPE="DVRIGHTS">
<mets:xmlData>
<dv:rights xmlns:dv="http://dfg-viewer.de/">
<!-- owner name -->
<dv:owner><xsl:value-of select="$MIR.DFGViewer.DV.Owner" /></dv:owner>
<dv:ownerLogo><xsl:value-of select="$MIR.DFGViewer.DV.OwnerLogo" /></dv:ownerLogo>
<dv:ownerSiteURL><xsl:value-of select="$MIR.DFGViewer.DV.OwnerSiteURL" /></dv:ownerSiteURL>
<dv:ownerContact/>
<dv:ownerContact />
<dv:license>
<xsl:choose>
<xsl:when test="$entity/mycoreobject/metadata/def.modsContainer/modsContainer/mods:mods/mods:accessCondition[@type='use and reproduction']">
<xsl:variable name="licenseClass" select="'mir_licenses'" />
<xsl:variable name="licenseId" select="substring-after($entity/mycoreobject/metadata/def.modsContainer/modsContainer/mods:mods/mods:accessCondition[@type='use and reproduction']/@xlink-href, '#')" />
Comment thread
rsteph-de marked this conversation as resolved.
<xsl:value-of select="mcrxml:getDisplayName($licenseClass, $licenseId)" />
<xsl:variable name="licenseId"
select="substring-after($entity/mycoreobject/metadata/def.modsContainer/modsContainer/mods:mods/mods:accessCondition[@type='use and reproduction']/@xlink:href, '#')" />
<xsl:value-of
select="(
Comment thread
toKrause marked this conversation as resolved.
Outdated
mcrclassification:label-text($CurrentLang, mcrclassification:category('mir_licenses', $licenseId)),
mcrclassification:label-text($DefaultLang, mcrclassification:category('mir_licenses', $licenseId))
)[1]" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$license" />
Expand All @@ -74,31 +74,28 @@
</mets:xmlData>
</mets:mdWrap>
</mets:rightsMD>
<mets:digiprovMD>
<xsl:attribute name="ID">
<xsl:value-of select="concat('digiprovMD',$sectionID)" />
</xsl:attribute>
<mets:digiprovMD ID="{concat('digiprovMD', $sectionID)}">
<mets:mdWrap MIMETYPE="text/xml" MDTYPE="OTHER" OTHERMDTYPE="DVLINKS">
<mets:xmlData>
<dv:links xmlns:dv="http://dfg-viewer.de/">
<xsl:variable name="ppn"
select="substring-after($entity/mycoreobject/metadata/def.modsContainer/modsContainer/mods:mods/mods:identifier[@type='uri'], ':ppn:')" />
select="substring-after($entity/mycoreobject/metadata/def.modsContainer/modsContainer/mods:mods/mods:identifier[@type='uri'], ':ppn:')" />
<xsl:if test="$ppn">
<dv:reference>
<xsl:variable name="catalogURL"
select="concat(substring-before($MIR.DFGViewer.DV.OPAC.CATALOG.URL, '{PPN}'), $ppn , substring-after($MIR.DFGViewer.DV.OPAC.CATALOG.URL, '{PPN}'))" />
select="concat(substring-before($MIR.DFGViewer.DV.OPAC.CATALOG.URL, '{PPN}'), $ppn, substring-after($MIR.DFGViewer.DV.OPAC.CATALOG.URL, '{PPN}'))" />
<xsl:variable name="uriResolved"
select="document(concat($catalogURL,'?format=xml'))//rdf:Description[@rdf:about=normalize-space($catalogURL)]/*[local-name() = 'page']/@rdf:resource" />
select="document(concat($catalogURL, '?format=xml'))//rdf:Description[@rdf:about=normalize-space($catalogURL)]/*[local-name()='page']/@rdf:resource" />
<xsl:value-of select="$uriResolved" />
</dv:reference>
</xsl:if>
<dv:presentation>
<xsl:choose>
<xsl:when test="$mcrobject">
<xsl:value-of select="concat($WebApplicationBaseURL,'receive/',$mcrobject)" />
<xsl:value-of select="concat($WebApplicationBaseURL, 'receive/', $mcrobject)" />
</xsl:when>
<xsl:when test="$derobject">
<xsl:value-of select="concat($WebApplicationBaseURL,'receive/',mcrxml:getMCRObjectID($derobject))" />
<xsl:value-of select="concat($WebApplicationBaseURL, 'receive/', $derivateOwnerId)" />
</xsl:when>
</xsl:choose>
</dv:presentation>
Expand Down
24 changes: 24 additions & 0 deletions mir-module/src/main/resources/xslt/mets/mets-dfg.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0"
xmlns:mets="http://www.loc.gov/METS/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="#all">

<xsl:output method="xml" encoding="utf-8" />

<xsl:include href="resource:xslt/default-parameters.xsl" />
<xsl:include href="xslInclude:functions" />

<xsl:param name="MCR.Module-iview2.SupportedContentTypes" />
<xsl:param name="objectID" />
<xsl:param name="derivateID" select="substring-after(/mets:mets/mets:dmdSec/@ID, '_')" />
<xsl:param name="MCR.Viewer.PDFCreatorURI" />

<xsl:param name="ThumbnailBaseURL" select="concat($ServletsBaseURL, 'MCRDFGThumbnail/')" />
<xsl:param name="ImageBaseURL" select="concat($ServletsBaseURL, 'MCRDFGServlet/')" />
<xsl:param name="WebApplicationServletsURL" select="concat($WebApplicationBaseURL, 'servlets/')" />
<xsl:param name="copyFileGrp" select="()" />

<xsl:include href="resource:xslt/mets/mets-dfgProfile.xsl" />

</xsl:stylesheet>
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
<xsl:stylesheet version="3.0"
xmlns:mets="http://www.loc.gov/METS/"
xmlns:xalan="http://xml.apache.org/xalan"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="">
exclude-result-prefixes="#all">

<xsl:include href="resource:xsl/mets/mets-iview.xsl" />
<xsl:include href="resource:xsl/mets/mets-amd.xsl" />
<xsl:include href="resource:xsl/mods-enhancer.xsl" />
<xsl:include href="resource:xslt/mets/mets-iview.xsl" />
<xsl:include href="resource:xslt/mets/mets-amd.xsl" />
<xsl:include href="resource:xslt/utils/mods-enhancer.xsl" />

<xsl:output method="xml" encoding="utf-8" />
<xsl:param name="MCR.Module-iview2.SupportedContentTypes" />
<xsl:param name="ServletsBaseURL" />
<xsl:param name="WebApplicationBaseURL" />
<xsl:param name="derivateID" />
<xsl:param name="objectID" />

<xsl:variable name="sourcedoc" select="document(concat('mcrobject:',$objectID))" />
<xsl:variable name="sourcedoc" select="document(concat('mcrobject:', $objectID))" />

<xsl:template match="/mycoreobject" priority="0" mode="metsmeta" xmlns:mods="http://www.loc.gov/mods/v3">
<xsl:apply-templates mode="mods2mods" />
<xsl:apply-templates mode="mods2mods" />
</xsl:template>

<xsl:template match="mycoreobject" priority="0" mode="fallBackEntity">
Expand Down Expand Up @@ -57,15 +49,15 @@
<mets:mets>
<xsl:if test="not(mets:dmdSec)">
<xsl:variable name="emptyDMDSec">
<mets:dmdSec ID="dmd_{$derivateID}"/>
<mets:dmdSec ID="dmd_{$derivateID}" />
</xsl:variable>
<xsl:apply-templates select="xalan:nodeset($emptyDMDSec)" />
<xsl:apply-templates select="$emptyDMDSec/mets:dmdSec" />
</xsl:if>
<xsl:if test="not(mets:amdSec)">
<xsl:variable name="emptryAMDSec">
<xsl:variable name="emptyAMDSec">
<mets:amdSec />
</xsl:variable>
<xsl:apply-templates select="xalan:nodeset($emptryAMDSec)" />
<xsl:apply-templates select="$emptyAMDSec/mets:amdSec" />
</xsl:if>
<xsl:apply-templates />
</mets:mets>
Expand All @@ -75,20 +67,20 @@
<mets:dmdSec ID="dmd_{$derivateID}">
<mets:mdWrap MDTYPE="MODS">
<mets:xmlData>
<xsl:apply-templates mode="metsmeta" select="$sourcedoc/mycoreobject" />
<!-- TODO: add configurable template
<mods:extension>
<mir:entities xmlns:mir="http://www.mycore.de/mir/ns/mods-entities">
<mir:entity type="operator" xlink:type="extended"
xlink:title="xxx">
<mir:site xlink:type="locator" xlink:href="#" />
<mir:logo xlink:type="resource" xlink:href="{$logoBaseUrl}xxx.svg" />
<mir:full-logo xlink:type="resource" xlink:href="{$logoBaseUrl}xxx.svg" />
</mir:entity>
<xsl:apply-templates mode="entities" select="$sourcedoc/mycoreobject" />
</mir:entities>
</mods:extension>
-->
<xsl:apply-templates mode="metsmeta" select="$sourcedoc/mycoreobject" />
<!-- TODO: add configurable template
<mods:extension>
<mir:entities xmlns:mir="http://www.mycore.de/mir/ns/mods-entities">
<mir:entity type="operator" xlink:type="extended"
xlink:title="xxx">
<mir:site xlink:type="locator" xlink:href="#" />
<mir:logo xlink:type="resource" xlink:href="{$logoBaseUrl}xxx.svg" />
<mir:full-logo xlink:type="resource" xlink:href="{$logoBaseUrl}xxx.svg" />
</mir:entity>
<xsl:apply-templates mode="entities" select="$sourcedoc/mycoreobject" />
</mir:entities>
</mods:extension>
-->
</mets:xmlData>
</mets:mdWrap>
</mets:dmdSec>
Expand Down
Loading
Loading