diff --git a/src/xproc/publish.xpl b/src/xproc/publish.xpl index 4ddf9fa88128f3bde890d8e0df7e6fe19daf6d9a..13d3a29f1db788677c4bf1e5024f5c724679fe7a 100644 --- a/src/xproc/publish.xpl +++ b/src/xproc/publish.xpl @@ -6,6 +6,14 @@ <p:option name="objectId" required="true"/> <p:option name="targetUri" required="true"/> + <p:uuid name="uuid-source" version="4" match="@create"> + <p:input port="source"> + <p:inline> + <uuid create=""/> + </p:inline> + </p:input> + </p:uuid> + <p:choose> <p:when test="doc-available(resolve-uri($targetUri))"> <p:error code="TargetFileExists"> @@ -31,6 +39,9 @@ <p:xslt name="normalize"> <p:with-param name="objectId" select="$objectId"/> + <p:with-param name="eventCreateUUID" select="/uuid/@create"> + <p:pipe step="uuid-source" port="result"/> + </p:with-param> <p:input port="source"> <p:pipe step="validate-kitodo" port="result"/> </p:input> diff --git a/src/xslt/mets.xsl b/src/xslt/mets.xsl index 77b129a7d31427528ff5507b7479cdcc8f96e400..06f03808e6fb620cf49e66471f88d3aeda108a69 100644 --- a/src/xslt/mets.xsl +++ b/src/xslt/mets.xsl @@ -11,6 +11,7 @@ <!-- Normalisiert die von Kitodo.Production erzeugte METS-Datei --> <xsl:param name="objectId" as="xs:string" required="yes"/> + <xsl:param name="eventCreateUUID" as="xs:string" required="yes"/> <xsl:key name="files" match="file" use="@ID"/> @@ -24,7 +25,29 @@ </mets> </xsl:template> - <xsl:template match="amdSec"/> + <xsl:template match="amdSec"> + <amdSec> + <digiprovMD ID="id.{$eventCreateUUID}" CREATED="{current-dateTime()}"> + <mdWrap MDTYPE="PREMIS:EVENT"> + <xmlData> + <premis:event xmlns:premis="http://www.loc.gov/premis/v3"> + <premis:eventIdentifier> + <premis:eventIdentifierType>UUID</premis:eventIdentifierType> + <premis:eventIdentifierValue><xsl:value-of select="$eventCreateUUID"/></premis:eventIdentifierValue> + </premis:eventIdentifier> + <premis:eventType valueURI="http://id.loc.gov/vocabulary/preservation/eventType/creation">creation</premis:eventType> + <premis:eventDataTime><xsl:value-of select="/mets/metsHdr/@CREATEDATE"/></premis:eventDataTime> + <premis:linkingAgentIdentifier> + <premis:linkingAgentIdentifierType>Name</premis:linkingAgentIdentifierType> + <premis:linkingAgentIdentifierValue><xsl:value-of select="/mets/metsHdr/agent/name"/></premis:linkingAgentIdentifierValue> + <premis:linkingAgentRole valueURI="http://id.loc.gov/vocabulary/preservation/eventRelatedAgentRole/exe">executing program</premis:linkingAgentRole> + </premis:linkingAgentIdentifier> + </premis:event> + </xmlData> + </mdWrap> + </digiprovMD> + </amdSec> + </xsl:template> <xsl:template match="@ADMID"/> @@ -35,7 +58,7 @@ </xsl:template> <xsl:template match="metsHdr"> - <metsHdr CREATEDATE="{@CREATEDATE}" LASTMODDATE="{current-dateTime()}"> + <metsHdr CREATEDATE="{@CREATEDATE}" LASTMODDATE="{current-dateTime()}" ADMID="id.{$eventCreateUUID}"> <agent ROLE="CUSTODIAN" TYPE="ORGANIZATION"> <name>Herzog August Bibliothek Wolfenbüttel</name> </agent>