mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-15 05:53:08 +00:00
Merge pull request #9442 from AndrewAlesik/main
Added switcher to writing personal data of submitter into dc.description.provenance metadata
This commit is contained in:
@@ -28,6 +28,7 @@ import org.dspace.event.Event;
|
|||||||
import org.dspace.identifier.Identifier;
|
import org.dspace.identifier.Identifier;
|
||||||
import org.dspace.identifier.IdentifierException;
|
import org.dspace.identifier.IdentifierException;
|
||||||
import org.dspace.identifier.service.IdentifierService;
|
import org.dspace.identifier.service.IdentifierService;
|
||||||
|
import org.dspace.services.ConfigurationService;
|
||||||
import org.dspace.supervision.SupervisionOrder;
|
import org.dspace.supervision.SupervisionOrder;
|
||||||
import org.dspace.supervision.service.SupervisionOrderService;
|
import org.dspace.supervision.service.SupervisionOrderService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -56,6 +57,9 @@ public class InstallItemServiceImpl implements InstallItemService {
|
|||||||
|
|
||||||
Logger log = LogManager.getLogger(InstallItemServiceImpl.class);
|
Logger log = LogManager.getLogger(InstallItemServiceImpl.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected ConfigurationService configurationService;
|
||||||
|
|
||||||
protected InstallItemServiceImpl() {
|
protected InstallItemServiceImpl() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,14 +274,20 @@ public class InstallItemServiceImpl implements InstallItemService {
|
|||||||
// Create provenance description
|
// Create provenance description
|
||||||
StringBuffer provmessage = new StringBuffer();
|
StringBuffer provmessage = new StringBuffer();
|
||||||
|
|
||||||
if (item.getSubmitter() != null) {
|
//behavior to generate provenance message, if set true, personal data (e.g. email) of submitter will be hidden
|
||||||
|
//default value false, personal data of submitter will be shown in provenance message
|
||||||
|
String isProvenancePrivacyActiveProperty =
|
||||||
|
configurationService.getProperty("metadata.privacy.dc.description.provenance", "false");
|
||||||
|
boolean isProvenancePrivacyActive = Boolean.parseBoolean(isProvenancePrivacyActiveProperty);
|
||||||
|
|
||||||
|
if (item.getSubmitter() != null && !isProvenancePrivacyActive) {
|
||||||
provmessage.append("Submitted by ").append(item.getSubmitter().getFullName())
|
provmessage.append("Submitted by ").append(item.getSubmitter().getFullName())
|
||||||
.append(" (").append(item.getSubmitter().getEmail()).append(") on ")
|
.append(" (").append(item.getSubmitter().getEmail()).append(") on ")
|
||||||
.append(now.toString());
|
.append(now.toString());
|
||||||
} else {
|
} else {
|
||||||
// else, null submitter
|
// else, null submitter
|
||||||
provmessage.append("Submitted by unknown (probably automated) on")
|
provmessage.append("Submitted by unknown (probably automated or submitter hidden) on ")
|
||||||
.append(now.toString());
|
.append(now.toString());
|
||||||
}
|
}
|
||||||
provmessage.append("\n");
|
provmessage.append("\n");
|
||||||
|
|
||||||
|
@@ -1191,14 +1191,20 @@ public class XmlWorkflowServiceImpl implements XmlWorkflowService {
|
|||||||
// Create provenance description
|
// Create provenance description
|
||||||
StringBuffer provmessage = new StringBuffer();
|
StringBuffer provmessage = new StringBuffer();
|
||||||
|
|
||||||
if (myitem.getSubmitter() != null) {
|
//behavior to generate provenance message, if set true, personal data (e.g. email) of submitter will be hidden
|
||||||
|
//default value false, personal data of submitter will be shown in provenance message
|
||||||
|
String isProvenancePrivacyActiveProperty =
|
||||||
|
configurationService.getProperty("metadata.privacy.dc.description.provenance", "false");
|
||||||
|
boolean isProvenancePrivacyActive = Boolean.parseBoolean(isProvenancePrivacyActiveProperty);
|
||||||
|
|
||||||
|
if (myitem.getSubmitter() != null && !isProvenancePrivacyActive) {
|
||||||
provmessage.append("Submitted by ").append(myitem.getSubmitter().getFullName())
|
provmessage.append("Submitted by ").append(myitem.getSubmitter().getFullName())
|
||||||
.append(" (").append(myitem.getSubmitter().getEmail()).append(") on ")
|
.append(" (").append(myitem.getSubmitter().getEmail()).append(") on ")
|
||||||
.append(now.toString());
|
.append(now.toString());
|
||||||
} else {
|
} else {
|
||||||
// else, null submitter
|
// else, null submitter
|
||||||
provmessage.append("Submitted by unknown (probably automated) on")
|
provmessage.append("Submitted by unknown (probably automated or submitter hidden) on ")
|
||||||
.append(now.toString());
|
.append(now.toString());
|
||||||
}
|
}
|
||||||
if (action != null) {
|
if (action != null) {
|
||||||
provmessage.append(" workflow start=").append(action.getProvenanceStartId()).append("\n");
|
provmessage.append(" workflow start=").append(action.getProvenanceStartId()).append("\n");
|
||||||
|
@@ -979,6 +979,11 @@ webui.licence_bundle.show = false
|
|||||||
metadata.hide.dc.description.provenance = true
|
metadata.hide.dc.description.provenance = true
|
||||||
metadata.hide.person.email = true
|
metadata.hide.person.email = true
|
||||||
|
|
||||||
|
# Behavior to generate provenance message, if set true,
|
||||||
|
# personal data (e.g. email) of submitter will be hidden in dc.description.provenance
|
||||||
|
# Disabled by default. To enable, uncomment the next line
|
||||||
|
# metadata.privacy.dc.description.provenance = true
|
||||||
|
|
||||||
##### Settings for Submission Process #####
|
##### Settings for Submission Process #####
|
||||||
|
|
||||||
# Whether or not we REQUIRE that a file be uploaded
|
# Whether or not we REQUIRE that a file be uploaded
|
||||||
@@ -1679,4 +1684,4 @@ include = ${module_dir}/usage-statistics.cfg
|
|||||||
include = ${module_dir}/versioning.cfg
|
include = ${module_dir}/versioning.cfg
|
||||||
include = ${module_dir}/workflow.cfg
|
include = ${module_dir}/workflow.cfg
|
||||||
include = ${module_dir}/external-providers.cfg
|
include = ${module_dir}/external-providers.cfg
|
||||||
include = ${module_dir}/ldn.cfg
|
include = ${module_dir}/ldn.cfg
|
Reference in New Issue
Block a user