Skip to content

Commit

Permalink
Merge branch 'main' into REGISTRATION_2_0
Browse files Browse the repository at this point in the history
  • Loading branch information
leomendoza123 authored Nov 28, 2023
2 parents bcf960a + 6da202b commit 897bb44
Show file tree
Hide file tree
Showing 41 changed files with 962 additions and 419 deletions.
5 changes: 5 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,8 @@ source_file = orcid-core/src/main/resources/i18n/notification_share_en.propertie
source_lang = en
type = UNICODEPROPERTIES

[o:orcid-inc-1:p:registry:r:email-add-work]
file_filter = orcid-core/src/main/resources/i18n/email_add_works_to_record_<lang>.properties
source_file = orcid-core/src/main/resources/i18n/email_add_works_to_record_en.properties
source_lang = en
type = UNICODEPROPERTIES
85 changes: 85 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,88 @@
## v2.45.0 - 2023-11-22

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.44.15...v2.45.0)

## v2.44.15 - 2023-11-22

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.44.14...v2.44.15)

- [#6931](https://github.com/ORCID/ORCID-Source/pull/6931): fix: Add new email schedule to send email to encourage email to add w…

### Fix

- Remove unnecessary console log
- Add new email schedule to send email to encourage email to add works

## v2.44.14 - 2023-11-21

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.44.13...v2.44.14)

- [#6938](https://github.com/ORCID/ORCID-Source/pull/6938): force pull

## v2.44.13 - 2023-11-17

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.44.12...v2.44.13)

- [#6937](https://github.com/ORCID/ORCID-Source/pull/6937): Transifex

## v2.44.12 - 2023-11-16

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.44.11...v2.44.12)

- [#6936](https://github.com/ORCID/ORCID-Source/pull/6936): fix: Add missing capture event in shibboleth account link
- [#6935](https://github.com/ORCID/ORCID-Source/pull/6935): allways send 2 days reminder
- [#6934](https://github.com/ORCID/ORCID-Source/pull/6934): Fix NPE on social sign in

### Fix

- Add missing capture event in shibboleth account link

## v2.44.11 - 2023-11-16

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.44.10...v2.44.11)

- [#6933](https://github.com/ORCID/ORCID-Source/pull/6933): Add missing keys

## v2.44.10 - 2023-11-16

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.44.9...v2.44.10)

- [#6932](https://github.com/ORCID/ORCID-Source/pull/6932): Just one query

## v2.44.9 - 2023-11-14

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.44.8...v2.44.9)

- [#6930](https://github.com/ORCID/ORCID-Source/pull/6930): Remove orcid, redirect_url, public_page and last_modified from event

## v2.44.8 - 2023-11-14

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.44.7...v2.44.8)

- [#6929](https://github.com/ORCID/ORCID-Source/pull/6929): Changed the code to use triples

## v2.44.7 - 2023-11-09

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.44.6...v2.44.7)

- [#6927](https://github.com/ORCID/ORCID-Source/pull/6927): Add more logging for when the request changes during oauth

## v2.44.6 - 2023-11-08

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.44.5...v2.44.6)

- [#6926](https://github.com/ORCID/ORCID-Source/pull/6926): fix: Add create event to ShibbolethController and Add missing member …

### Fix

- Add create event to ShibbolethController and Add missing member name

## v2.44.5 - 2023-11-03

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.44.4...v2.44.5)

- [#6925](https://github.com/ORCID/ORCID-Source/pull/6925): Is there is more than one org with no parent, we should not suggest a…

## v2.44.4 - 2023-11-02

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.44.3...v2.44.4)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
package org.orcid.core.common.manager;

import org.orcid.core.utils.EventType;
import org.orcid.pojo.ajaxForm.RequestInfoForm;

import javax.servlet.http.HttpServletRequest;

import org.orcid.core.utils.EventType;

/**
*
* @author Daniel Palafox
*
*/
public interface EventManager {

boolean removeEvents(String orcid);

void createEvent(String orcid, EventType eventType, HttpServletRequest request, RequestInfoForm requestInfoForm);
void createEvent(EventType eventType, HttpServletRequest request);

}
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
package org.orcid.core.common.manager.impl;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.Date;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;
import org.orcid.core.common.manager.EventManager;
import org.orcid.core.constants.OrcidOauth2Constants;
import org.orcid.core.manager.ClientDetailsEntityCacheManager;
import org.orcid.core.manager.v3.read_only.RecordNameManagerReadOnly;
import org.orcid.core.utils.EventType;
import org.orcid.jaxb.model.clientgroup.ClientType;
import org.orcid.jaxb.model.v3.release.record.Name;
import org.orcid.persistence.dao.EventDao;
import org.orcid.persistence.jpa.entities.ClientDetailsEntity;
import org.orcid.persistence.jpa.entities.EventEntity;
import org.orcid.pojo.ajaxForm.PojoUtil;
import org.orcid.pojo.ajaxForm.RequestInfoForm;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;

/**
*
* @author Daniel Palafox
Expand All @@ -30,47 +35,49 @@ public class EventManagerImpl implements EventManager {
@Resource
private ClientDetailsEntityCacheManager clientDetailsEntityCacheManager;

@Override
public boolean removeEvents(String orcid) {
return eventDao.removeEvents(orcid);
}
@Resource(name = "recordNameManagerReadOnlyV3")
private RecordNameManagerReadOnly recordNameManagerReadOnly;

@Override
public void createEvent(String orcid, EventType eventType, HttpServletRequest request, RequestInfoForm requestInfoForm) {
public void createEvent(EventType eventType, HttpServletRequest request) {
String label = "Website";
String clientId = null;
String redirectUrl = null;
String publicPage = null;

if (eventType == EventType.PUBLIC_PAGE) {
publicPage = orcid;
orcid = null;
} else {
if (request != null) {
Boolean isOauth2ScreensRequest = (Boolean) request.getSession().getAttribute(OrcidOauth2Constants.OAUTH_2SCREENS);
if (isOauth2ScreensRequest != null && isOauth2ScreensRequest) {
String queryString = (String) request.getSession().getAttribute(OrcidOauth2Constants.OAUTH_QUERY_STRING);
clientId = getParameterValue(queryString, "client_id");
redirectUrl = getParameterValue(queryString, "redirect_uri");
ClientDetailsEntity clientDetailsEntity = clientDetailsEntityCacheManager.retrieve(clientId);
label = "OAuth " + clientDetailsEntity.getClientName();
}
} else if (requestInfoForm != null) {
if (request != null) {
Boolean isOauth2ScreensRequest = (Boolean) request.getSession().getAttribute(OrcidOauth2Constants.OAUTH_2SCREENS);
RequestInfoForm requestInfoForm = (RequestInfoForm) request.getSession().getAttribute("requestInfoForm");
if (requestInfoForm != null) {
clientId = requestInfoForm.getClientId();
redirectUrl = removeAttributesFromUrl(requestInfoForm.getRedirectUrl());
label = "OAuth " + requestInfoForm.getClientName();
label = "OAuth " + requestInfoForm.getMemberName() + " " + requestInfoForm.getClientName();
} else if (isOauth2ScreensRequest != null && isOauth2ScreensRequest) {
String queryString = (String) request.getSession().getAttribute(OrcidOauth2Constants.OAUTH_QUERY_STRING);
clientId = getParameterValue(queryString, "client_id");
ClientDetailsEntity clientDetailsEntity = clientDetailsEntityCacheManager.retrieve(clientId);
String memberName = "";
String clientName = clientDetailsEntity.getClientName();

if (ClientType.PUBLIC_CLIENT.equals(clientDetailsEntity.getClientType())) {
memberName = "PubApp";
} else if (!PojoUtil.isEmpty(clientDetailsEntity.getGroupProfileId())) {
Name name = recordNameManagerReadOnly.getRecordName(clientDetailsEntity.getGroupProfileId());
if (name != null) {
memberName = name.getCreditName() != null ? name.getCreditName().getContent() : "";
}
}

if (StringUtils.isBlank(memberName)) {
memberName = clientName;
}
label = "OAuth " + memberName + " " + clientName;
}
}

EventEntity eventEntity = new EventEntity();

eventEntity.setOrcid(orcid);
eventEntity.setEventType(eventType.getValue());
eventEntity.setClientId(clientId);
eventEntity.setRedirectUrl(redirectUrl);
eventEntity.setLabel(label);
eventEntity.setPublicPage(publicPage);

eventEntity.setDateCreated(new Date());
eventDao.createEvent(eventEntity);
}

Expand Down
5 changes: 4 additions & 1 deletion orcid-core/src/main/java/org/orcid/core/togglz/Features.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ public enum Features implements Feature {
ENABLE_NEW_IDS,

@Label("Send verification emails for 2, 7 and 28 days. If disabled 2 days only verification emails will be sent.")
SEND_ALL_VERIFICATION_EMAILS;
SEND_ALL_VERIFICATION_EMAILS,

@Label("Send add works emails for 7, 28 and 90 days.")
SEND_ADD_WORKS_EMAILS;

public boolean isActive() {
return FeatureContext.getFeatureManager().isActive(this);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
email.addWorks.subject=[ORCID] Add Research Outputs to your ORCID record

email.addWorks.header.yourOrcidId=Your ORCID iD:
email.addWorks.header.yourOrcidRecordIs=Your ORCID record is
email.addWorks.header.dear=Dear

email.addWorks.weHaveNoticed=We have noticed that you have not yet added any research outputs to your ORCID record. Adding these will help reduce your administrative burden when read and imported into other systems, ensure you are recognized for your research contributions, and disambiguate you from other researchers with the same name!
email.addWorks.getStarted=Get started with these popular ORCID integrations:
email.addWorks.belowAreLinks=Below are links to 4 popular ORCID integrations that allow you to sign in to your OCID record, grant permission to the service to add your selected research outputs to your ORCID record.

email.addWorks.forAddingJournal=For adding journal articles:
email.addWorks.allowsYouToSearch=allows you to search and add works by title or DOI.

email.addWorks.forAddingLife=For adding life sciences literature:
email.addWorks.allowsYouToImport=allows you to import works from the Europe PubMed database, which includes all articles indexed by PubMed Central.

email.addWorks.forAddingMultiple=For adding multiple published articles:
email.addWorks.allowsYouToAddYourScopus=allows you to add your Scopus Author ID to your record as well as importing works associated with your Scopus Author ID.

email.addWorks.allowsYouClaim=allows you to claim and import works from the Bielefeld Academic Search Engine. To use, you must first create a BASE user account. Recommended for authors of open access publications.

email.addWorks.weHaveSeachAndLink=We have more `search and link` wizards available within
email.addWorks.yourOrcidRecord=your ORCID record

email.addWorks.ifYouAreHavingTrouble=If you are having trouble adding your research outputs or you would like to know more about how to add data to your ORCID record, please visit our
email.addWorks.orcidHelpCenter=ORCID Help Center

email.addWorks.footer.warmRegards=Warm Regards,
email.addWorks.footer.orcidSupportTeam=ORCID Support Team
email.addWorks.footer.youHaveReceivedThisEmail=You have received this email because you opted in to tips and features emails from ORCID. You can opt out of these at
email.addWorks.footer.accountSettings=account settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
email.addWorks.subject=LR

email.addWorks.header.yourOrcidId=LR
email.addWorks.header.yourOrcidRecordIs=LR
email.addWorks.header.dear=LR

email.addWorks.weHaveNoticed=LR
email.addWorks.getStarted=LR
email.addWorks.belowAreLinks=LR

email.addWorks.forAddingJournal=LR
email.addWorks.allowsYouToSearch=LR

email.addWorks.forAddingLife=LR
email.addWorks.allowsYouToImport=LR

email.addWorks.forAddingMultiple=LR
email.addWorks.allowsYouToAddYourScopus=LR

email.addWorks.allowsYouClaim=LR

email.addWorks.weHaveSeachAndLink=LR
email.addWorks.yourOrcidRecord=LR

email.addWorks.ifYouAreHavingTrouble=LR
email.addWorks.orcidHelpCenter=LR

email.addWorks.footer.warmRegards=LR
email.addWorks.footer.orcidSupportTeam=LR
email.addWorks.footer.youHaveReceivedThisEmail=LR
email.addWorks.footer.accountSettings=LRa
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
email.addWorks.subject=RL

email.addWorks.header.yourOrcidId=RL
email.addWorks.header.yourOrcidRecordIs=RL
email.addWorks.header.dear=RL

email.addWorks.weHaveNoticed=RL
email.addWorks.getStarted=RL
email.addWorks.belowAreLinks=RL

email.addWorks.forAddingJournal=RL
email.addWorks.allowsYouToSearch=RL

email.addWorks.forAddingLife=RL
email.addWorks.allowsYouToImport=RL

email.addWorks.forAddingMultiple=RL
email.addWorks.allowsYouToAddYourScopus=RL

email.addWorks.allowsYouClaim=RL

email.addWorks.weHaveSeachAndLink=RL
email.addWorks.yourOrcidRecord=RL

email.addWorks.ifYouAreHavingTrouble=RL
email.addWorks.orcidHelpCenter=RL

email.addWorks.footer.warmRegards=RL
email.addWorks.footer.orcidSupportTeam=RL
email.addWorks.footer.youHaveReceivedThisEmail=RL
email.addWorks.footer.accountSettings=RLa
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
email.addWorks.subject=XX

email.addWorks.header.yourOrcidId=XX
email.addWorks.header.yourOrcidRecordIs=XX
email.addWorks.header.dear=XX

email.addWorks.weHaveNoticed=XX
email.addWorks.getStarted=XX
email.addWorks.belowAreLinks=XX

email.addWorks.forAddingJournal=XX
email.addWorks.allowsYouToSearch=XX

email.addWorks.forAddingLife=XX
email.addWorks.allowsYouToImport=XX

email.addWorks.forAddingMultiple=XX
email.addWorks.allowsYouToAddYourScopus=XX

email.addWorks.allowsYouClaim=XX

email.addWorks.weHaveSeachAndLink=XX
email.addWorks.yourOrcidRecord=XX

email.addWorks.ifYouAreHavingTrouble=XX
email.addWorks.orcidHelpCenter=XX

email.addWorks.footer.warmRegards=XX
email.addWorks.footer.orcidSupportTeam=XX
email.addWorks.footer.youHaveReceivedThisEmail=XX
email.addWorks.footer.accountSettings=XXa
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,7 @@ email.common.email.preferences=LR
email.common.privacy_policy=LR
email.common.privacy_policy_2=LR
email.common.address1=LR
email.common.address2=LR
email.common.address2=LR
email.welcome.your_id.id=LR
email.welcome.your_id.link=LR
email.common.received_email_as_service=LR
3 changes: 3 additions & 0 deletions orcid-core/src/main/resources/i18n/email_common_rl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ email.common.privacy_policy=RL
email.common.privacy_policy_2=RL
email.common.address1=RL
email.common.address2=RL
email.welcome.your_id.id=RL
email.welcome.your_id.link=RL
email.common.received_email_as_service=RL
3 changes: 3 additions & 0 deletions orcid-core/src/main/resources/i18n/email_common_xx.properties
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ email.common.privacy_policy=X
email.common.privacy_policy_2=X
email.common.address1=X
email.common.address2=X
email.welcome.your_id.id=X
email.welcome.your_id.link=X
email.common.received_email_as_service=X
Loading

0 comments on commit 897bb44

Please sign in to comment.