Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ MCR.Access.Strategy.SubmittedCategory=MCR.Access.Strategy.SubmittedCategories
# needs to be replaced with one property per disabled property type
MIR.Viewer.DisableDerivateType=MCR.Derivate.DisplayFilters.mir.Filter.Filters.20.Mappings.show-file-viewer.[thumbnail,...]
MIR.OwnerStrategy.FallbackClass=MIR.OwnerStrategy.Fallback.Class
MIR.Metadata.Admindata.ShowRealUserName=MIR.AdmindataBox.ShowRealUserName
31 changes: 29 additions & 2 deletions mir-module/src/main/resources/config/mir/mycore.properties
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ MCR.ContentTransformer.mets-dfg.Stylesheet=xslt/mets/mets-dfg.xsl
# Configure METSEditor #
##############################################################################
MIR.METSEditor.enable=false
MIR.Metadata.Admindata.ShowRealUserName=false

#############################################################################
# HTML Editor #
Expand Down Expand Up @@ -249,7 +248,8 @@ MCR.URIResolver.xslIncludes.mycoreobjectXML=%MCR.URIResolver.xslIncludes.mycoreo
MCR.URIResolver.xslIncludes.RDF-mods-journal=%MCR.URIResolver.xslIncludes.RDF-mods-journal%,resource:xslt/RDF-mods-journal-mir.xsl
MCR.URIResolver.xslIncludes.solrResponse=%MCR.URIResolver.xslIncludes.solrResponse%,resource:xslt/response-mir.xsl
MCR.URIResolver.xslIncludes.xeditorTemplates=%MCR.URIResolver.xslIncludes.xeditorTemplates%,resource:xslt/xeditor-mir-templates.xsl
MCR.URIResolver.xslIncludes.functions=%MCR.URIResolver.xslIncludes.functions%,functions/miraccesskeyutil.xsl,functions/mirdateconverter.xsl,functions/mireditorutils.xsl,functions/mirmapper.xsl,functions/mirorcidutil.xsl,functions/mirstrutils.xsl,functions/mirvalidationhelper.xsl
MCR.URIResolver.xslIncludes.functions=%MCR.URIResolver.xslIncludes.functions%,functions/miraccesskeyutil.xsl,functions/mirdateconverter.xsl,functions/mireditorutils.xsl,functions/mirmapper.xsl,functions/mirmods.xsl,functions/mirobject.xsl,functions/mirorcidutil.xsl,functions/mirstrutils.xsl,functions/mirvalidationhelper.xsl,\
metadata/functions/mirboxfields.xsl,metadata/functions/mirdates.xsl,metadata/functions/mirnotes.xsl
MCR.URIResolver.xslIncludes.objectTypes=resource:xslt/mods.xsl
MIR.AVPlayer.Stylesheet=metadata/mir-video.js.xsl
MCR.URIResolver.xslImports.modsmeta=metadata/mods-metadata-base.xsl,metadata/mir-browse.xsl,metadata/mir-breadcrumbs.xsl,metadata/mir-metadata-box.xsl,metadata/mir-admindata-box.xsl,metadata/mir-abstract.xsl,metadata/mir-collapse-files.xsl,metadata/mir-file-upload.xsl,metadata/mir-edit.xsl,metadata/mir-share.xsl,%MIR.AVPlayer.Stylesheet%,metadata/mir-viewer.xsl,metadata/mir-citation.xsl,metadata/mir-thumbnail.xsl,metadata/mir-export.xsl,metadata/mir-history.xsl,metadata/mir-epusta.xsl,metadata/mir-workflow.xsl
Expand Down Expand Up @@ -294,6 +294,33 @@ MIR.xMetaDissPlus.rights.rightsReserved2free=true
MIR.xMetaDissPlus.person.termsOfAddress2academicTitle=false


##############################################################################
# Metadata and admin box (detail page) #
##############################################################################
MCR.URIResolver.xslIncludes.metadatabox=metadata/metadata-box/title.xsl,\
metadata/metadata-box/conference.xsl,metadata/metadata-box/name.xsl,metadata/metadata-box/parent.xsl,\
metadata/metadata-box/related-item.xsl,metadata/metadata-box/edition.xsl,\
metadata/metadata-box/dates.xsl,metadata/metadata-box/identifier.xsl,\
metadata/metadata-box/language.xsl,metadata/metadata-box/type-of-resource.xsl,\
metadata/metadata-box/physical-description.xsl,metadata/metadata-box/funding.xsl,\
metadata/metadata-box/place.xsl,metadata/metadata-box/publisher.xsl,\
metadata/metadata-box/subject.xsl,metadata/metadata-box/classification.xsl,\
metadata/metadata-box/part.xsl,metadata/metadata-box/location.xsl,metadata/metadata-box/corporate.xsl,\
metadata/metadata-box/characteristics.xsl,metadata/metadata-box/note.xsl
MIR.MetadataBox.Fields=title,conference,name,parent,related-item,related-item.volume,related-item.issue,edition,\
dates.created,dates.submitted,dates.accepted,dates.reviewed,dates.captured,dates.issued,dates.modified,\
identifier,identifier.issn,language,type-of-resource,physical-description.form,physical-description.note,\
physical-description,funding,place,place.creation,\
publisher,publisher.creation,subject.geographic,subject,classification,part,location.url,location.physical,\
location.shelf,corporate,characteristics,note

MCR.URIResolver.xslIncludes.admindatabox=metadata/admindata-box/state.xsl,\
metadata/admindata-box/created.xsl,metadata/admindata-box/note.xsl,metadata/admindata-box/modified.xsl,\
metadata/admindata-box/object-id.xsl,metadata/admindata-box/identifier.xsl,metadata/admindata-box/version.xsl
MIR.AdmindataBox.Fields=state,created,created.by,note,modified,modified.by,object-id,identifier.intern,version
MIR.AdmindataBox.ShowRealUserName=false


##############################################################################
# Website #
##############################################################################
Expand Down
23 changes: 23 additions & 0 deletions mir-module/src/main/resources/xslt/functions/mirmods.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0"
xmlns:mcrmods="http://www.mycore.de/xslt/mods"
xmlns:mirmods="http://www.mycore.de/xslt/mirmods"
xmlns:mods="http://www.loc.gov/mods/v3"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="#all">

<xsl:function name="mirmods:genres" as="xs:string*">
<xsl:param name="mods" as="element(mods:mods)?" />

<xsl:variable name="genre" select="$mods/mods:genre[@type='intern'][1]" />
<xsl:if test="$genre">
<xsl:variable name="hierarchy" select="mcrmods:to-mycoreclass($genre, 'parent')//category/@ID ! string()" />
<xsl:sequence select="
if (exists($hierarchy)) then reverse($hierarchy)
else substring-after($genre/@valueURI, '#')[. != '']
" />
</xsl:if>
</xsl:function>

</xsl:stylesheet>
13 changes: 13 additions & 0 deletions mir-module/src/main/resources/xslt/functions/mirobject.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0"
xmlns:mirobject="http://www.mycore.de/xslt/mirobject"
xmlns:mods="http://www.loc.gov/mods/v3"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="#all">

<xsl:function name="mirobject:mods" as="element(mods:mods)?">
<xsl:param name="object" as="element(mycoreobject)" />
<xsl:sequence select="$object/metadata/def.modsContainer/modsContainer/mods:mods" />
</xsl:function>

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

<xsl:template match="field" mode="admindata-box-field">
<xsl:message>WARN: unknown admin box field '<xsl:value-of select="@name" />'</xsl:message>
</xsl:template>

</xsl:stylesheet>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="#all">

<xsl:mode name="admindata-box-field" on-no-match="deep-skip" on-multiple-match="fail" />

<xsl:template name="admindata-box-fields">
<xsl:param name="names" as="xs:string*" />
<xsl:param name="object" select="." as="element(mycoreobject)" />

<xsl:variable name="fields">
<xsl:for-each select="$names">
<field name="{.}" />
</xsl:for-each>
</xsl:variable>

<xsl:for-each select="$fields/field">
<xsl:apply-templates select="." mode="admindata-box-field">
<xsl:with-param name="object" select="$object" />
<xsl:with-param name="field-name" select="string(@name)" tunnel="yes" />
</xsl:apply-templates>
</xsl:for-each>
</xsl:template>

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

<xsl:template match="field[@name='created']" mode="admindata-box-field">
<xsl:param name="object" as="element(mycoreobject)" />

<xsl:call-template name="service-date-row">
<xsl:with-param name="date" select="$object/service/servdates/servdate[@type='createdate'][1]" />
<xsl:with-param name="label-key" select="'metaData.createdAt'" />
</xsl:call-template>
</xsl:template>

<xsl:template match="field[@name='created.by']" mode="admindata-box-field">
<xsl:param name="object" as="element(mycoreobject)" />

<xsl:call-template name="user-info-row">
<xsl:with-param name="userid" select="$object/service/servflags/servflag[@type='createdby'][1]" />
</xsl:call-template>
</xsl:template>

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

<xsl:import href="resource:xslt/metadata/common/metadata-row.xsl" />
<xsl:import href="resource:xslt/metadata/admindata-box/common/fields.xsl" />
<xsl:import href="resource:xslt/metadata/admindata-box/common/fields-fallback.xsl" />
<xsl:import href="resource:xslt/metadata/admindata-box/shared/date.xsl" />
<xsl:import href="resource:xslt/metadata/admindata-box/shared/user.xsl" />

</xsl:stylesheet>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0"
xmlns:mirobject="http://www.mycore.de/xslt/mirobject"
xmlns:mods="http://www.loc.gov/mods/v3"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="#all">

<xsl:template match="field[@name='identifier.intern']" mode="admindata-box-field">
<xsl:param name="object" as="element(mycoreobject)" />
<xsl:variable name="mods" select="mirobject:mods($object)" />

<xsl:variable name="intern-identifiers" select="$mods/mods:identifier[@type='intern']" />
<xsl:if test="$intern-identifiers">
<xsl:call-template name="meta-row">
<xsl:with-param name="label-key" select="'component.mods.metaData.dictionary.identifier.intern'" />
<xsl:with-param name="value">
<xsl:for-each select="$intern-identifiers">
<xsl:if test="position() != 1">
<br />
</xsl:if>
<xsl:value-of select="." />
</xsl:for-each>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>

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

<xsl:template match="field[@name='modified']" mode="admindata-box-field">
<xsl:param name="object" as="element(mycoreobject)" />

<xsl:call-template name="service-date-row">
<xsl:with-param name="date" select="$object/service/servdates/servdate[@type='modifydate'][1]" />
<xsl:with-param name="label-key" select="'metaData.lastChanged'" />
</xsl:call-template>
</xsl:template>

<xsl:template match="field[@name='modified.by']" mode="admindata-box-field">
<xsl:param name="object" as="element(mycoreobject)" />

<xsl:call-template name="user-info-row">
<xsl:with-param name="userid" select="$object/service/servflags/servflag[@type='modifiedby'][1]" />
</xsl:call-template>
</xsl:template>

</xsl:stylesheet>
26 changes: 26 additions & 0 deletions mir-module/src/main/resources/xslt/metadata/admindata-box/note.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0"
xmlns:mirnotes="http://www.mycore.de/xslt/mirnotes"
xmlns:mirobject="http://www.mycore.de/xslt/mirobject"
xmlns:mods="http://www.loc.gov/mods/v3"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="#all">

<xsl:template match="field[@name='note']" mode="admindata-box-field">
<xsl:param name="object" as="element(mycoreobject)" />
<xsl:variable name="mods" select="mirobject:mods($object)" />

<xsl:for-each select="$mods/mods:note[mirnotes:visible(., ('editor', 'admin'))]">
<xsl:variable name="label" select="mirnotes:label(.)" />
<xsl:call-template name="meta-row">
<xsl:with-param name="label" select="if ($label) then $label else mirnotes:type(.)" />
<xsl:with-param name="value">
<xsl:call-template name="lf2br">
<xsl:with-param name="string" select="." />
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:template>

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

<xsl:template match="field[@name='object-id']" mode="admindata-box-field">
<xsl:param name="object" as="element(mycoreobject)" />

<xsl:call-template name="meta-row">
<xsl:with-param name="label-key" select="'metaData.ID'" />
<xsl:with-param name="value" select="string($object/@ID)" />
</xsl:call-template>
</xsl:template>

</xsl:stylesheet>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0"
xmlns:local="http://www.mycore.de/xslt/mirlocal/admindata-box/shared/date"
xmlns:mcri18n="http://www.mycore.de/xslt/i18n"
xmlns:mirdateconverter="http://www.mycore.de/xslt/mirdateconverter"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="#all">

<xsl:template name="service-date-row">
<xsl:param name="date" as="element()?" />
<xsl:param name="label-key" as="xs:string" />

<xsl:if test="$date">
<xsl:call-template name="meta-row">
<xsl:with-param name="label-key" select="$label-key" />
<xsl:with-param name="value" select="local:format-service-date($date)" />
</xsl:call-template>
</xsl:if>
</xsl:template>

<xsl:function name="local:format-service-date" as="xs:string">
<xsl:param name="date" as="element()" />

<xsl:variable name="normalized" select="mirdateconverter:convert-date($date, 'ISO8601')" />

<xsl:sequence select="
if (matches($normalized, '^\d{4}-\d{2}-\d{2}$') and $normalized castable as xs:date)
then format-date(xs:date($normalized), mcri18n:translate('metaData.dateYearMonthDay.xsl3'))
else if ($normalized castable as xs:dateTime)
then format-dateTime(xs:dateTime($normalized), mcri18n:translate('metaData.dateTime.xsl3'))
else $normalized
" />
</xsl:function>

</xsl:stylesheet>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0"
xmlns:mcracl="http://www.mycore.de/xslt/acl"
xmlns:mcrproperty="http://www.mycore.de/xslt/property"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="#all">

<xsl:variable name="show-real-user-name" select="mcrproperty:get('MIR.AdmindataBox.ShowRealUserName') = 'true'" />

<xsl:template name="user-info-row">
<xsl:param name="userid" as="xs:string?" />
<xsl:param name="label-key" select="'mir.metaData.detailBox.by'" as="xs:string" />

<xsl:variable name="user" select="if ($userid) then document('notnull:user:' || $userid)/user else ()" />
<xsl:variable name="userid-with-realm" select="$user/@name || '@' || $user/@realm" />

<xsl:call-template name="meta-row">
<xsl:with-param name="label-key" select="$label-key" />
<xsl:with-param name="value-title" select="
if (string-length($user/realName) &gt; 0) then $userid-with-realm else ()
" />
<xsl:with-param name="value">
<xsl:choose>
<xsl:when test="not($user)">
<span class="not_found">
<xsl:value-of select="$userid" />
</span>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="display-name" select="
if (string-length($user/realName) &gt; 0 and $show-real-user-name)
then string($user/realName)
else string($user/@name)
" />
<xsl:choose>
<xsl:when test="mcracl:check-permission('POOLPRIVILEGE', 'administrate-users')">
<a href="{$WebApplicationBaseURL}servlets/MCRUserServlet?action=show&amp;id={encode-for-uri($userid-with-realm)}">
<xsl:value-of select="$display-name" />
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$display-name" />
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:template>

</xsl:stylesheet>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0"
xmlns:mcrclass="http://www.mycore.de/xslt/classification"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="#all">

<xsl:template match="field[@name='state']" mode="admindata-box-field">
<xsl:param name="object" as="element(mycoreobject)" />

<xsl:call-template name="meta-row">
<xsl:with-param name="label-key" select="'component.mods.metaData.dictionary.status'" />
<xsl:with-param name="value">
<xsl:for-each select="$object/service/servstates/servstate">
<xsl:variable name="category" select="mcrclass:category(@classid, @categid)" />
<xsl:variable name="label" select="
if ($category) then mcrclass:current-label-text($category) else string(@categid)
" />
<xsl:variable name="href" select="string($category/url/@xlink:href)" />
<xsl:choose>
<xsl:when test="$href">
<!-- MCRObjectID should not contain a ':' so it must be an external link then -->
<a href="{if (contains($href, ':')) then $href else $WebApplicationBaseURL || 'receive/' || $href}">
<xsl:value-of select="$label" />
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$label" />
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:with-param>
</xsl:call-template>
</xsl:template>

</xsl:stylesheet>
Loading