Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.mycore.common.MCRCache;
import org.mycore.common.MCRException;
import org.mycore.common.config.MCRConfiguration2;
import org.mycore.common.xml.MCRXMLFunctions;
import org.mycore.datamodel.classifications2.MCRCategLinkReference;
import org.mycore.datamodel.classifications2.MCRCategLinkService;
import org.mycore.datamodel.classifications2.MCRCategLinkServiceFactory;
Expand Down Expand Up @@ -163,11 +164,12 @@ private boolean checkDerivatePermission(MCRObjectID derivateId, String permissio
return OBJECT_BASE_STRATEGY.checkPermission(permissionId, permission);
}

// 1. check if the object has a assigned identifier
// 1. check if the object has an assigned identifier and the derivate is exported
if (MCRAccessManager.PERMISSION_WRITE.equalsIgnoreCase(permission) ||
MCRAccessManager.PERMISSION_DELETE.equalsIgnoreCase(permission)) {
final boolean hasRegisteredPI = hasRegisteredPI(objectId);
if (hasRegisteredPI && !canEditPI()) {
final boolean isExported = MCRXMLFunctions.isDerivateDisplayEnabled(derivateId.toString(), "export");
if (hasRegisteredPI && isExported && !canEditPI()) {
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="ISO-8859-1"?>

<xed:template xmlns:xed="http://www.mycore.de/xeditor" xmlns:mir="http://www.mycore.de/mir">
<xed:template xmlns:xed="http://www.mycore.de/xeditor" xmlns:mir="http://www.mycore.de/mir"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:param name="MIR.Editor.Derivate.EditableIntentServiceFlags" select="en"/>

<xed:template id="in.out">
<xed:source uri="notnull:checkPermissionChain:{$derivateid}:writedb:xslStyle:editor/derivate2xeditor:mcrobject:{$derivateid}" />
Expand Down Expand Up @@ -52,6 +55,114 @@
</xed:bind>
</xed:template>

<xed:template id="flags">
<xed:if test="$MIR.Editor.Derivate.EditableIntentServiceFlags != 'false'">
<div class="mir-form-group row">
<label class="col-md-3 col-form-label text-end d-inline form-label">
<xed:output i18n="mir.flags"/>
</label>
<div class="col-md-2">
<xed:bind xpath="service/servflags/servflag[@type='intent-show-file-viewer']">
<xed:choose>
<xed:when test="xed:call-java('org.mycore.access.MCRAccessManager','checkPermission',$derivateid,'manage-intent-show-file-viewer')">
<select class="form-control form-control-inline form-select">
<option value="">
<xed:output i18n="mir.flags.intent.default"/>
</option>
<option value="false">
<xed:output i18n="component.viewer.modal.no"/>
</option>
<option value="true">
<xed:output i18n="component.viewer.modal.yes"/>
</option>
</select>
</xed:when>
<xed:otherwise>
<select class="form-control form-control-inline form-select" disabled="disabled">
<option value="">
<xed:output i18n="mir.flags.intent.default"/>
</option>
<option value="false">
<xed:output i18n="component.viewer.modal.no"/>
</option>
<option value="true">
<xed:output i18n="component.viewer.modal.yes"/>
</option>
</select>
</xed:otherwise>
</xed:choose>
</xed:bind>
</div>
<div class="col-md-2">
<xed:bind xpath="service/servflags/servflag[@type='intent-show-file-area']">
<xed:choose>
<xed:when test="xed:call-java('org.mycore.access.MCRAccessManager','checkPermission',$derivateid,'manage-intent-show-file-area')">
<select class="form-control form-control-inline form-select">
<option value="">
<xed:output i18n="mir.flags.intent.default"/>
</option>
<option value="false">
<xed:output i18n="component.viewer.modal.no"/>
</option>
<option value="true">
<xed:output i18n="component.viewer.modal.yes"/>
</option>
</select>
</xed:when>
<xed:otherwise>
<select class="form-control form-control-inline form-select" disabled="disabled">
<option value="">
<xed:output i18n="mir.flags.intent.default"/>
</option>
<option value="false">
<xed:output i18n="component.viewer.modal.no"/>
</option>
<option value="true">
<xed:output i18n="component.viewer.modal.yes"/>
</option>
</select>
</xed:otherwise>
</xed:choose>
</xed:bind>
</div>
<div class="col-md-2">
<xed:bind xpath="service/servflags/servflag[@type='intent-export']">
<xed:choose>
<xed:when test="xed:call-java('org.mycore.access.MCRAccessManager','checkPermission',$derivateid,'manage-intent-export')">
<select class="form-control form-control-inline form-select">
<option value="">
<xed:output i18n="mir.flags.intent.default"/>
</option>
<option value="false">
<xed:output i18n="component.viewer.modal.no"/>
</option>
<option value="true">
<xed:output i18n="component.viewer.modal.yes"/>
</option>
</select>
</xed:when>
<xed:otherwise>
<select class="form-control form-control-inline form-select" disabled="disabled">
<option value="">
<xed:output i18n="mir.flags.intent.default"/>
</option>
<option value="false">
<xed:output i18n="component.viewer.modal.no"/>
</option>
<option value="true">
<xed:output i18n="component.viewer.modal.yes"/>
</option>
</select>
</xed:otherwise>
</xed:choose>
</xed:bind>
</div>
<mir:help-pmud help-text="{i18n:mir.help.derivate.flags}" pmud="false" />
</div>
<xed:cleanup-rule xpath="//service/servflags/servflag[starts-with(@type,'intent-')]" relevant-if="string-length(text()) &gt; 0"/>
</xed:if>
</xed:template>

<xed:template id="title_repeat">
<xed:repeat xpath="derivate/titles[@class='MCRMetaLangText'][@heritable='false'][1]/title">
<div class="mir-form-group row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
ref="derivate_types"/>
<xed:include uri="xslStyle:editor/mir2xeditor:webapp:editor/editor-derivate-includes.xed"
ref="mir_access"/>
<xed:if></xed:if>
<xed:include uri="xslStyle:editor/mir2xeditor:webapp:editor/editor-derivate-includes.xed"
ref="flags"/>
<xed:include uri="webapp:editor/editor-derivate-includes.xed" ref="cancel.submit"/>
</div>
</xed:bind>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ MIR.OAS.GraphProviderURL=MIR.ePuSta.GraphProviderURL
MIR.OAS.Prefix=MIR.ePuSta.Prefix
MIR.Strategy.AccessKey.ObjectTypes=MCR.ACL.AccessKey.Strategy.AllowedObjectTypes
MCR.Access.Strategy.SubmittedCategory=MCR.Access.Strategy.SubmittedCategories
MIR.Viewer.DisableDerivateType=MCR.Derivate.DisplayFilter.Filter.Filters.20.Mappings.show-file-viewer
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@ mir.export.format.wordbib =
mir.export.format.wordbib.description = wird von Microsoft Office Word ab Version 2007 verwendet, um Literaturverzeichnisse zu verwalten.
mir.export.more = (mehr)
mir.extent = Umfang:
mir.flags = Vorschau / Dateiliste / Export
mir.flags.intent.default = Standard
mir.form.editor.dynamic.header = Eingabeformular f\u00FCr
mir.form.editor.dynamic.header.in = in
mir.form.editor.dynamic.partof = Erschienen in
Expand Down Expand Up @@ -422,6 +424,7 @@ mir.help.date.submitted =
mir.help.date.submitted.range = Datum oder Zeitraum der Einreichung. Das Datum muss im ISO Format mit Bindestrich YYYY-MM-DD, YYYY-MM oder YYYY\r\nangegeben werden.\r\n<br />\r\nBeispiel: 2003-01-27 oder 2010 oder 2009-01
mir.help.date.updated = Datum der Aktualisierung. Das Datum muss im ISO Format mit Bindestrich YYYY-MM-DD, YYYY-MM oder YYYY\r\nangegeben werden.\r\n<br />\r\nBeispiel: 2003-01-27 oder 2010 oder 2009-01
mir.help.date.updated.range = Datum oder Zeitraum der Aktualisierung. Das Datum muss im ISO Format mit Bindestrich YYYY-MM-DD, YYYY-MM oder YYYY\r\nangegeben werden.\r\n<br />\r\nBeispiel: 2003-01-27 oder 2010 oder 2009-01
mir.help.derivate.flags = Einstellung, ob Nutzenden, die diesen Dateibereich sehen d\u00FCrfen, eine Vorschau bzw. die Dateiliste angezeigt werden soll (die Dateiliste wird jedoch immer angezeigt, wenn dieser Dateibereich auch geschrieben werden darf) bzw. ob dieser Dateibereich in Dateiexporten (verlinkt in den HTML- und OAI-Metadaten) ber\u00FCcksichtigt werden soll. Die Option 'Standard' f\u00FChrt zu einem Standardverhalten, basierend auf dem Typ des Dateibereichs.
mir.help.derivate.label = Technische Beschriftung f\u00FCr die interne Verwendung.
mir.help.derivate.title = Beschriftung f\u00FCr die Darstellung auf der Webseite in Abh\u00E4ngigkeit von der Sprache.
mir.help.doi.handle.urn = Falls bereits eine DOI, ein Handle oder eine URN f\u00FCr Ihren Beitrag vergeben wurde, ist dieser persistente Identifikator hier anzugeben.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,8 @@ mir.export.format.wordbib =
mir.export.format.wordbib.description = is used by Microsoft Office Word 2007 or later, to manage bibliographic references.
mir.export.more = (more)
mir.extent = Extent:
mir.flags = Preview / File listing / Export
mir.flags.intent.default = Default
mir.form.editor.dynamic.header = Submission form for
mir.form.editor.dynamic.header.in = in
mir.form.editor.dynamic.partof = Part of
Expand Down Expand Up @@ -409,6 +411,7 @@ mir.help.date.submitted =
mir.help.date.submitted.range = Date or period of submission. The date must be in the ISO format with hyphen YYYY-MM-DD, YYYY-MM or YYYY be specified.\r\n<br />\r\nExample: 2003-01-27 or 2010 or 2009-01
mir.help.date.updated = Date of the update. The date must be in the ISO format with hyphen YYYY-MM-DD, YYYY-MM or YYYY be specified.\r\n<br />\r\nExample: 2003-01-27 or 2010 or 2009-01
mir.help.date.updated.range = Date or period of the update. The date must be in the ISO format with hyphen YYYY-MM-DD, YYYY-MM or YYYY be specified.\r\n<br />\r\nExample: 2003-01-27 or 2010 or 2009-01
mir.help.derivate.flags = Setting whether users who are allowed to see this file area should be shown a preview or the file list (however, the file list is always displayed if this file area is allowed to be written to) or whether this file area should be taken into account in file exports (linked in the HTML and OAI metadata). The 'Default' option results in default behavior based on the derivate type.
mir.help.derivate.label = Technical label for internal use.
mir.help.derivate.title = Label presented on website in depend of language.
mir.help.doi.handle.urn = If a persistent identifier (e.g. DOI, URN) has been assigned to this dataset already, please enter it here.
Expand Down
28 changes: 26 additions & 2 deletions mir-module/src/main/resources/config/mir/mycore.properties
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ MCR.classbrowser.folder.closed=far fa-plus-square
MCR.classbrowser.folder.open=far fa-minus-square
MCR.classbrowser.folder.leaf=far fa-square

MCR.classeditor.additionalLanguages=x-access,x-auth,x-bibl,x-disable,x-display,x-dnb-cc,x-dnb-other,x-export,x-group,x-hosts,x-group,x-logo,x-mapping,x-miless,x-source,x-term,x-uri
MCR.classeditor.additionalLanguages=x-access,x-auth,x-bibl,x-disable,x-display,x-dnb-cc,x-dnb-other,x-group,x-hosts,x-group,x-logo,x-mapping,x-miless,x-source,x-term,x-uri

##############################################################################
# Additional Events #
Expand Down Expand Up @@ -337,6 +337,30 @@ MIR.xMetaDissPlus.diniPublType.classificationId=diniPublType2022
MIR.xMetaDissPlus.rights.rightsReserved2free=true
MIR.xMetaDissPlus.person.termsOfAddress2academicTitle=false


##############################################################################
# Website #
##############################################################################

# include form fields do set intent-flags in derivate editor and
# enable intent-flag-based override of derivate-type-based intent-mapping
MIR.Editor.Derivate.EditableIntentServiceFlags=false

MCR.Derivate.DisplayFilter.Class=org.mycore.common.xml.derivate.MCRTranslatingDerivateDisplayFilter
MCR.Derivate.DisplayFilter.Translations.compress=export
MCR.Derivate.DisplayFilter.Translations.enhance=export
MCR.Derivate.DisplayFilter.Filter.Class=org.mycore.common.xml.derivate.MCRCombinedDerivateDisplayFilter
MCR.Derivate.DisplayFilter.Filter.Filters.10.Class=org.mycore.common.xml.derivate.MCRServiceFlagDerivateDisplayFilter
MCR.Derivate.DisplayFilter.Filter.Filters.10.Enabled=%MIR.Editor.Derivate.EditableIntentServiceFlags%
MCR.Derivate.DisplayFilter.Filter.Filters.20.Class=org.mycore.common.xml.derivate.MCRDerivateTypeDerivateDisplayFilter
MCR.Derivate.DisplayFilter.Filter.Filters.20.Mappings.show-file-viewer.thumbnail=true
MCR.Derivate.DisplayFilter.Filter.Filters.20.Mappings.show-file-viewer.toc=false
MCR.Derivate.DisplayFilter.Filter.Filters.20.Mappings.show-file-area.thumbnail=false
MCR.Derivate.DisplayFilter.Filter.Filters.20.Mappings.show-file-area.toc=false
MCR.Derivate.DisplayFilter.Filter.Filters.20.Mappings.export.thumbnail=false
MCR.Derivate.DisplayFilter.Filter.Filters.20.Mappings.export.toc=false


##############################################################################
# Support for Podcasts #
##############################################################################
Expand Down Expand Up @@ -770,7 +794,7 @@ MIR.Layout.Display.Div=mir-edit,mir-abstract-badges
MIR.Layout.Abstract.Type.Classification=

MIR.NotFullAccessInfo.Genres=
MIR.Viewer.DisableDerivateType=thumbnail

##############################################################################
# Canonical link for any metadata frontpage #
##############################################################################
Expand Down
Loading
Loading