From cb6bc5029301ec2efa392cf9df50f685eb12d5e0 Mon Sep 17 00:00:00 2001 From: Jose Blanco Date: Thu, 22 Aug 2024 15:16:31 -0400 Subject: [PATCH] request copy change and DataCite Schema 4 change --- .../requestitem/RequestItemEmailNotifier.java | 32 +++- .../xmlworkflow/XmlWorkflowServiceImpl.java | 10 ++ dspace/config/crosswalks/DIM2DataCite.xsl | 141 +++++++++++------- dspace/config/emails/request_item.granted | 2 +- dspace/config/emails/request_item.grantor | 11 ++ dspace/config/emails/request_item.rejected | 2 +- dspace/config/item-submission.xml | 4 +- dspace/config/modules/oai.cfg | 11 +- dspace/config/submission-forms.xml | 36 +++-- 9 files changed, 178 insertions(+), 71 deletions(-) create mode 100644 dspace/config/emails/request_item.grantor diff --git a/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemEmailNotifier.java b/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemEmailNotifier.java index bdb0c30c3d68..7718db5e066a 100644 --- a/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemEmailNotifier.java +++ b/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemEmailNotifier.java @@ -32,7 +32,8 @@ import org.dspace.handle.service.HandleService; import org.dspace.services.ConfigurationService; - +// import org.dspace.content.service.ItemService; +// import org.dspace.content.MetadataSchemaEnum; /** * Send item requests and responses by email. @@ -62,6 +63,11 @@ public class RequestItemEmailNotifier { protected final RequestItemAuthorExtractor requestItemAuthorExtractor; + + // @Inject + // protected ItemService itemService; + + @Inject public RequestItemEmailNotifier(RequestItemAuthorExtractor requestItemAuthorExtractor) { this.requestItemAuthorExtractor = requestItemAuthorExtractor; @@ -165,8 +171,14 @@ public void sendResponse(Context context, RequestItem ri, String subject, grantors = List.of(); } + //Need Grantor name and email, this would be the following metadata requestitem.email and requestitem.name + String grantorName; String grantorAddress; + + //grantorAddress = itemService.getMetadataFirstValue(ri.getItem(), MetadataSchemaEnum.DC.getName(), "requestcopy", "email", Item.ANY); + //grantorName = itemService.getMetadataFirstValue(ri.getItem(), MetadataSchemaEnum.DC.getName(), "requestcopy", "name", Item.ANY); + if (grantors.isEmpty()) { grantorName = configurationService.getProperty("mail.admin.name"); grantorAddress = configurationService.getProperty("mail.admin"); @@ -221,6 +233,16 @@ public void sendResponse(Context context, RequestItem ri, String subject, context.restoreAuthSystemState(); } email.send(); + + //Send email to grantor to let grantor know that email was sent out. + Email email_grantor = Email.getEmail(I18nUtil.getEmailFilename(context.getCurrentLocale(), + "request_item.grantor" )); + //email_grantor.setSubject("Your email was sent out."); + email_grantor.addRecipient(grantorAddress); + email_grantor.addArgument(ri.getReqName()); + email_grantor.addArgument(ri.getReqEmail()); + email_grantor.send(); + } else { boolean sendRejectEmail = configurationService .getBooleanProperty("request.item.reject.email", true); @@ -228,6 +250,14 @@ public void sendResponse(Context context, RequestItem ri, String subject, // email. However, by default, the rejection email is sent back. if (sendRejectEmail) { email.send(); + + Email email_grantor = Email.getEmail(I18nUtil.getEmailFilename(context.getCurrentLocale(), + "request_item.grantor" )); + //email_grantor.setSubject("Your email was sent out."); + email_grantor.addRecipient(grantorAddress); + email_grantor.addArgument(ri.getReqName()); + email_grantor.addArgument(ri.getReqEmail()); + email_grantor.send(); } } } catch (MessagingException | IOException | SQLException | AuthorizeException e) { diff --git a/dspace-api/src/main/java/org/dspace/xmlworkflow/XmlWorkflowServiceImpl.java b/dspace-api/src/main/java/org/dspace/xmlworkflow/XmlWorkflowServiceImpl.java index 5874c2dc3cee..cd8c6520193e 100644 --- a/dspace-api/src/main/java/org/dspace/xmlworkflow/XmlWorkflowServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/xmlworkflow/XmlWorkflowServiceImpl.java @@ -834,6 +834,16 @@ protected void notifyOfArchive(Context context, Item item, Collection coll) } email.addRecipient(ep.getEmail()); + // If configed, send email to Deep Blue that shows deposit + // item was deposited. + boolean sendToAdmin = configurationService.getBooleanProperty( + "deposit.notify.admin", false); + if ( sendToAdmin ) + { + email.addRecipient(configurationService.getProperty("feedback.recipient")); + } + + // UM Change To find out if there was a proxy depositor. // For Proxie depoist. String SubmitterMsg = "You submitted"; diff --git a/dspace/config/crosswalks/DIM2DataCite.xsl b/dspace/config/crosswalks/DIM2DataCite.xsl index 3d87c4e31146..dcb046384076 100644 --- a/dspace/config/crosswalks/DIM2DataCite.xsl +++ b/dspace/config/crosswalks/DIM2DataCite.xsl @@ -3,24 +3,28 @@ - + 10.33577 @@ -46,9 +50,9 @@ properties are in the metadata of the item to export. The classe named above respects this. --> - + - + @@ -219,7 +223,17 @@ Template call for ResourceType DataCite allows the ResourceType to ouccre not more than once. --> - + + + + + + + + Other + + + - + - + + + @@ -246,7 +268,7 @@ - @@ -255,6 +277,13 @@ + + - + + @@ -295,9 +332,17 @@ company as well. We have to ensure to use URIs of our prefix as primary identifiers only. --> - + - + + + + + + + + + @@ -313,16 +358,20 @@ + en-US + en-US AlternativeTitle + en-US Subtitle + en-US TranslatedTitle @@ -341,6 +390,7 @@ --> + en-US @@ -409,7 +459,7 @@ or @qualifier='issued' or @qualifier='submitted' or @qualifier='updated')]"> - - Issued + Submitted Updated - + - + @@ -512,7 +561,7 @@ resolveUrlToHandle(context, altId) until one is recognized or all have been tested. --> - + @@ -561,20 +610,9 @@ Adds Rights information --> - - - - - - - - - - - - - - + + + + en-US - + Abstract TableOfContents - Other + Other diff --git a/dspace/config/emails/request_item.granted b/dspace/config/emails/request_item.granted index 37ee5c29bd0c..bc3acad7cda4 100644 --- a/dspace/config/emails/request_item.granted +++ b/dspace/config/emails/request_item.granted @@ -23,4 +23,4 @@ ${params[5]} #end Best regards, -The ${config.get('dspace.name')} Team +The Deep Blue Documents Team diff --git a/dspace/config/emails/request_item.grantor b/dspace/config/emails/request_item.grantor new file mode 100644 index 000000000000..495f40a2bdb2 --- /dev/null +++ b/dspace/config/emails/request_item.grantor @@ -0,0 +1,11 @@ +## Sent to the person requesting a copy of a restricted document when the +## request is granted. +## +## Parameters: +## {0} name of person requesting the item +## {1} email of person requesting the item +#set($subject = 'Your email was sent out.') + + +Your response to ${params[0]} (${params[1]}) was sent out. + diff --git a/dspace/config/emails/request_item.rejected b/dspace/config/emails/request_item.rejected index c5a13860b648..a98072faf59f 100644 --- a/dspace/config/emails/request_item.rejected +++ b/dspace/config/emails/request_item.rejected @@ -23,4 +23,4 @@ ${params[5]} #end Best regards, -The ${config.get('dspace.name')} Team +The Deep Blue Documents Team diff --git a/dspace/config/item-submission.xml b/dspace/config/item-submission.xml index 415d85b35563..0b08e0654de6 100644 --- a/dspace/config/item-submission.xml +++ b/dspace/config/item-submission.xml @@ -19,9 +19,11 @@ + + true - onebox + twobox Enter subject keywords or phrases here. @@ -741,7 +741,7 @@ true - onebox + twobox Enter environment (e.g. "Northern Hardwoods") @@ -755,7 +755,7 @@ true - onebox + twobox Enter subject here. @@ -769,7 +769,7 @@ true - onebox + twobox Enter keywords or phrases here. @@ -1064,7 +1064,7 @@ true - onebox + twobox Up to six keywords/short phrases describing your thesis @@ -1110,6 +1110,20 @@ University, degree grantor is required + + + + dc + description + mapping + true + + dropdown + If you are also a depositor in another collection and you'd like to associate your work with it, you may select the collection(s) here (e.g. a thesis may be added to the general thesis collection as well as appear in the relevant departmental collection(s) ). This box will be blank if you are not a depositor in other collections + + + + @@ -1264,7 +1278,7 @@ ispartofseries true - onebox + twobox Any series, number, version, or release assigned to this item. @@ -1318,7 +1332,7 @@ true - onebox + twobox Enter subject keywords or phrases here. @@ -1651,7 +1665,7 @@ true - onebox + twobox Req'd: Enter ONE word or phrase per text box, up to 9 keyword fields Three keywords are required @@ -2038,7 +2052,7 @@ true - onebox + twobox Up to six keywords/short phrases describing your thesis @@ -2530,7 +2544,7 @@ true - onebox + twobox Enter subject keywords or phrases here.