From e095f54bd644d6a6096b2ae102bddb8f85355e06 Mon Sep 17 00:00:00 2001 From: Camelia Dumitru <62257307+Camelia-Orcid@users.noreply.github.com> Date: Tue, 26 Mar 2024 15:01:08 +0000 Subject: [PATCH 01/10] mapping to treat diacritics as equivalent for org name (#7011) --- .../org/conf/mapping-ISOLatin1Accent.txt | 246 ++++++++++++++++++ solr-config/cores/org/conf/schema.xml | 4 + 2 files changed, 250 insertions(+) create mode 100644 solr-config/cores/org/conf/mapping-ISOLatin1Accent.txt diff --git a/solr-config/cores/org/conf/mapping-ISOLatin1Accent.txt b/solr-config/cores/org/conf/mapping-ISOLatin1Accent.txt new file mode 100644 index 00000000000..ede7742581b --- /dev/null +++ b/solr-config/cores/org/conf/mapping-ISOLatin1Accent.txt @@ -0,0 +1,246 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Syntax: +# "source" => "target" +# "source".length() > 0 (source cannot be empty.) +# "target".length() >= 0 (target can be empty.) + +# example: +# "À" => "A" +# "\u00C0" => "A" +# "\u00C0" => "\u0041" +# "ß" => "ss" +# "\t" => " " +# "\n" => "" + +# À => A +"\u00C0" => "A" + +# Á => A +"\u00C1" => "A" + +#  => A +"\u00C2" => "A" + +# à => A +"\u00C3" => "A" + +# Ä => A +"\u00C4" => "A" + +# Å => A +"\u00C5" => "A" + +# Æ => AE +"\u00C6" => "AE" + +# Ç => C +"\u00C7" => "C" + +# È => E +"\u00C8" => "E" + +# É => E +"\u00C9" => "E" + +# Ê => E +"\u00CA" => "E" + +# Ë => E +"\u00CB" => "E" + +# Ì => I +"\u00CC" => "I" + +# Í => I +"\u00CD" => "I" + +# Î => I +"\u00CE" => "I" + +# Ï => I +"\u00CF" => "I" + +# IJ => IJ +"\u0132" => "IJ" + +# Ð => D +"\u00D0" => "D" + +# Ñ => N +"\u00D1" => "N" + +# Ò => O +"\u00D2" => "O" + +# Ó => O +"\u00D3" => "O" + +# Ô => O +"\u00D4" => "O" + +# Õ => O +"\u00D5" => "O" + +# Ö => O +"\u00D6" => "O" + +# Ø => O +"\u00D8" => "O" + +# Œ => OE +"\u0152" => "OE" + +# Þ +"\u00DE" => "TH" + +# Ù => U +"\u00D9" => "U" + +# Ú => U +"\u00DA" => "U" + +# Û => U +"\u00DB" => "U" + +# Ü => U +"\u00DC" => "U" + +# Ý => Y +"\u00DD" => "Y" + +# Ÿ => Y +"\u0178" => "Y" + +# à => a +"\u00E0" => "a" + +# á => a +"\u00E1" => "a" + +# â => a +"\u00E2" => "a" + +# ã => a +"\u00E3" => "a" + +# ä => a +"\u00E4" => "a" + +# å => a +"\u00E5" => "a" + +# æ => ae +"\u00E6" => "ae" + +# ç => c +"\u00E7" => "c" + +# è => e +"\u00E8" => "e" + +# é => e +"\u00E9" => "e" + +# ê => e +"\u00EA" => "e" + +# ë => e +"\u00EB" => "e" + +# ì => i +"\u00EC" => "i" + +# í => i +"\u00ED" => "i" + +# î => i +"\u00EE" => "i" + +# ï => i +"\u00EF" => "i" + +# ij => ij +"\u0133" => "ij" + +# ð => d +"\u00F0" => "d" + +# ñ => n +"\u00F1" => "n" + +# ò => o +"\u00F2" => "o" + +# ó => o +"\u00F3" => "o" + +# ô => o +"\u00F4" => "o" + +# õ => o +"\u00F5" => "o" + +# ö => o +"\u00F6" => "o" + +# ø => o +"\u00F8" => "o" + +# œ => oe +"\u0153" => "oe" + +# ß => ss +"\u00DF" => "ss" + +# þ => th +"\u00FE" => "th" + +# ù => u +"\u00F9" => "u" + +# ú => u +"\u00FA" => "u" + +# û => u +"\u00FB" => "u" + +# ü => u +"\u00FC" => "u" + +# ý => y +"\u00FD" => "y" + +# ÿ => y +"\u00FF" => "y" + +# ff => ff +"\uFB00" => "ff" + +# fi => fi +"\uFB01" => "fi" + +# fl => fl +"\uFB02" => "fl" + +# ffi => ffi +"\uFB03" => "ffi" + +# ffl => ffl +"\uFB04" => "ffl" + +# ſt => ft +"\uFB05" => "ft" + +# st => st +"\uFB06" => "st" diff --git a/solr-config/cores/org/conf/schema.xml b/solr-config/cores/org/conf/schema.xml index 173bb8ee6db..c439c93830b 100644 --- a/solr-config/cores/org/conf/schema.xml +++ b/solr-config/cores/org/conf/schema.xml @@ -281,12 +281,16 @@ --> + + + + From 5b65116b86a2a30f74d92f6141b3a32e7668e8a0 Mon Sep 17 00:00:00 2001 From: github actions Date: Tue, 26 Mar 2024 15:14:05 +0000 Subject: [PATCH 02/10] v2.55.0 changelog update --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f9f5e03b6c..0fb7f2020e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v2.55.0 - 2024-03-26 + +[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.54.0...v2.55.0) + ## v2.54.0 - 2024-03-19 [Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.53.0...v2.54.0) From 8e7884aa6d71f898f489d27bc883acd1222420cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 09:35:22 -0600 Subject: [PATCH 03/10] Bump guava from 31.1-jre to 32.0.0-jre (#6818) Bumps [guava](https://github.com/google/guava) from 31.1-jre to 32.0.0-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) --- updated-dependencies: - dependency-name: com.google.guava:guava dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4783a7489a8..8db2798b0da 100644 --- a/pom.xml +++ b/pom.xml @@ -912,7 +912,7 @@ the software. com.google.guava guava - 31.1-jre + 32.0.0-jre From ea84fb2c999533c54687310470f22b5a87ef741e Mon Sep 17 00:00:00 2001 From: github actions Date: Mon, 1 Apr 2024 15:55:11 +0000 Subject: [PATCH 04/10] v2.56.0 changelog update --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fb7f2020e2..bb7bbe5635b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v2.56.0 - 2024-04-01 + +[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.55.0...v2.56.0) + ## v2.55.0 - 2024-03-26 [Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.54.0...v2.55.0) From ce88ec773fcf031fcc2de89eb121691f74410843 Mon Sep 17 00:00:00 2001 From: Angel Montenegro Date: Mon, 1 Apr 2024 10:12:55 -0600 Subject: [PATCH 05/10] Multiple fixes202401 (#7013) * Deactivated records should get 409 on GET requests * Log short error for some exceptions and fix the affiliation start date validation on registration --- .../api/common/jaxb/OrcidExceptionMapper.java | 6 +++ .../controllers/RegistrationController.java | 53 +++++++++---------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/orcid-api-common/src/main/java/org/orcid/api/common/jaxb/OrcidExceptionMapper.java b/orcid-api-common/src/main/java/org/orcid/api/common/jaxb/OrcidExceptionMapper.java index f5d675a56b6..8029a6e5263 100644 --- a/orcid-api-common/src/main/java/org/orcid/api/common/jaxb/OrcidExceptionMapper.java +++ b/orcid-api-common/src/main/java/org/orcid/api/common/jaxb/OrcidExceptionMapper.java @@ -35,9 +35,11 @@ import org.orcid.core.exception.OrcidDuplicatedElementException; import org.orcid.core.exception.OrcidInvalidScopeException; import org.orcid.core.exception.OrcidNoBioException; +import org.orcid.core.exception.OrcidNoResultException; import org.orcid.core.exception.OrcidNonPublicElementException; import org.orcid.core.exception.OrcidNotClaimedException; import org.orcid.core.exception.OrcidNotificationException; +import org.orcid.core.exception.OrcidUnauthorizedException; import org.orcid.core.exception.OrcidValidationException; import org.orcid.core.locale.LocaleManager; import org.orcid.core.manager.OrcidSecurityManager; @@ -138,6 +140,10 @@ public Response toResponse(Throwable t) { logShortError(t, clientId); } else if (t instanceof TokenMgrError) { logShortError(t, clientId); + } else if (t instanceof OrcidNoResultException) { + logShortError(t, clientId); + } else if (t instanceof OrcidUnauthorizedException) { + logShortError(t, clientId); } else { LOGGER.error("An exception has occured processing request from client " + clientId, t); } diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/RegistrationController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/RegistrationController.java index d9af23f4b77..0ee568b55dd 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/RegistrationController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/RegistrationController.java @@ -21,12 +21,12 @@ import org.apache.commons.codec.binary.Base64; import org.apache.commons.lang.StringUtils; import org.jasypt.exceptions.EncryptionOperationNotPossibleException; +import org.orcid.core.common.manager.EventManager; import org.orcid.core.constants.EmailConstants; import org.orcid.core.constants.OrcidOauth2Constants; import org.orcid.core.manager.EncryptionManager; import org.orcid.core.manager.ProfileEntityCacheManager; import org.orcid.core.manager.RegistrationManager; -import org.orcid.core.common.manager.EventManager; import org.orcid.core.manager.v3.OrcidSearchManager; import org.orcid.core.manager.v3.ProfileHistoryEventManager; import org.orcid.core.manager.v3.read_only.AffiliationsManagerReadOnly; @@ -43,16 +43,12 @@ import org.orcid.frontend.spring.SocialAjaxAuthenticationSuccessHandler; import org.orcid.frontend.spring.web.social.config.SocialSignInUtils; import org.orcid.frontend.web.controllers.helper.OauthHelper; -import org.orcid.frontend.web.controllers.helper.SearchOrcidSolrCriteria; import org.orcid.frontend.web.util.RecaptchaVerifier; import org.orcid.jaxb.model.common.AvailableLocales; import org.orcid.jaxb.model.message.CreationMethod; import org.orcid.jaxb.model.v3.release.common.Visibility; -import org.orcid.jaxb.model.v3.release.record.Affiliation; import org.orcid.jaxb.model.v3.release.record.AffiliationType; -import org.orcid.jaxb.model.v3.release.record.Employment; import org.orcid.persistence.constants.SendEmailFrequency; -import org.orcid.pojo.OrgDisambiguated; import org.orcid.pojo.Redirect; import org.orcid.pojo.ajaxForm.AffiliationForm; import org.orcid.pojo.ajaxForm.Date; @@ -337,17 +333,17 @@ public void validateRegistrationFields(HttpServletRequest request, Registration if (!AffiliationType.EMPLOYMENT.equals(AffiliationType.fromValue(affiliationForm.getAffiliationType().getValue()))) { setError(affiliationForm.getAffiliationType(), "Invalid affiliation type"); } - if (reg.getAffiliationForm().getDepartmentName() != null) { + if (affiliationForm.getDepartmentName() != null) { if (affiliationForm.getDepartmentName().getValue() != null && affiliationForm.getDepartmentName().getValue().trim().length() > 1000) { setError(affiliationForm.getDepartmentName(), "common.length_less_1000"); } } - if (reg.getAffiliationForm().getRoleTitle() != null) { + if (affiliationForm.getRoleTitle() != null) { if (!PojoUtil.isEmpty(affiliationForm.getRoleTitle()) && affiliationForm.getRoleTitle().getValue().trim().length() > 1000) { setError(affiliationForm.getRoleTitle(), "common.length_less_1000"); } } - if (reg.getAffiliationForm().getStartDate() != null) { + if (affiliationForm.getStartDate() != null) { if(!validDate(affiliationForm.getStartDate())) { setError(affiliationForm.getStartDate(), "common.dates.invalid"); } @@ -361,6 +357,9 @@ public void validateRegistrationFields(HttpServletRequest request, Registration copyErrors(reg.getPassword(), reg); copyErrors(reg.getPasswordConfirm(), reg); copyErrors(reg.getTermsOfUse(), reg); + if(reg.getAffiliationForm() != null && reg.getAffiliationForm().getStartDate() != null) { + copyErrors(reg.getAffiliationForm().getStartDate(), reg); + } additionalEmailsValidateOnRegister(request, reg); for (Text emailAdditional : reg.getEmailsAdditional()) { @@ -612,36 +611,36 @@ protected boolean validDate(Date date) { .toFormatter(), new DateTimeFormatterBuilder().appendPattern("yyyyMM").parseDefaulting(ChronoField.DAY_OF_MONTH, 1).toFormatter(), new DateTimeFormatterBuilder().appendPattern("yyyyMMdd").parseStrict().toFormatter() }; - String dateString = date.getYear(); - // If the month is empty and day provided is an invalid date - if (StringUtils.isBlank(date.getMonth())) { - if (!StringUtils.isBlank(date.getDay())) { + String dateString = date.getYear(); + + // If year is blank and month or day is not, then it is invalid + if (StringUtils.isBlank(date.getYear())) { + if (!StringUtils.isBlank(date.getMonth()) || !StringUtils.isBlank(date.getDay())) { return false; } - } - else if (StringUtils.isBlank(date.getYear())) { - if (!StringUtils.isBlank(date.getDay()) && !StringUtils.isBlank(date.getMonth())) { + } else if (StringUtils.isBlank(date.getMonth())) { + // If the month is empty and day is not empty, then it is invalid + if (!StringUtils.isBlank(date.getDay())) { return false; } - } - else { - dateString += date.getMonth(); + } else { + dateString += StringUtils.leftPad(date.getMonth(), 2, '0'); if (!StringUtils.isBlank(date.getDay())) { - dateString += date.getDay(); + dateString += StringUtils.leftPad(date.getDay(), 2, '0'); } } - for (DateTimeFormatter formatter : formatters) { - try { - LocalDate localDate = LocalDate.parse(dateString, formatter); - if (PojoUtil.isEmpty(date.getDay()) || localDate.getDayOfMonth() == Integer.parseInt(date.getDay())) { - // formatter will correct day to last valid day of month if - // it is too great + if(StringUtils.isBlank(dateString)) { + return true; + } else { + for (DateTimeFormatter formatter : formatters) { + try { + LocalDate.parse(dateString, formatter); return true; + } catch (DateTimeParseException e) { } - } catch (DateTimeParseException e) { } - } + } return false; } From d43c7a29a08ea02eddc204e65bdc149a7537e8f4 Mon Sep 17 00:00:00 2001 From: github actions Date: Mon, 1 Apr 2024 16:25:29 +0000 Subject: [PATCH 06/10] v2.57.0 changelog update --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb7bbe5635b..bf2066c2e28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v2.57.0 - 2024-04-01 + +[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.56.0...v2.57.0) + ## v2.56.0 - 2024-04-01 [Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.55.0...v2.56.0) From 4702228002a96c510452b80be2098ec6b4476788 Mon Sep 17 00:00:00 2001 From: Leonardo Mendoza Fernadez Date: Wed, 3 Apr 2024 16:44:57 -0600 Subject: [PATCH 07/10] 9181-prod-old-header-layout-displayed-briefly-on-public-page --- orcid-core/src/main/java/org/orcid/core/togglz/Features.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/orcid-core/src/main/java/org/orcid/core/togglz/Features.java b/orcid-core/src/main/java/org/orcid/core/togglz/Features.java index a8f6a15f7f7..424448ff27e 100644 --- a/orcid-core/src/main/java/org/orcid/core/togglz/Features.java +++ b/orcid-core/src/main/java/org/orcid/core/togglz/Features.java @@ -19,8 +19,6 @@ public enum Features implements Feature { @Label("Registration 2.1: Add affiliations on registration") REGISTRATION_2_1, - @Label("New public record header") - NEW_RECORD_HEADER, @Label("Registration 2.0") REGISTRATION_2_0, From e2208b0f8d39dd6880ad866662a13979edb9e695 Mon Sep 17 00:00:00 2001 From: github actions Date: Wed, 3 Apr 2024 23:04:11 +0000 Subject: [PATCH 08/10] v2.57.1 changelog update --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf2066c2e28..a08b59d5944 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v2.57.1 - 2024-04-03 + +[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.57.0...v2.57.1) + +- [#7017](https://github.com/ORCID/ORCID-Source/pull/7017): 9181-prod-old-header-layout-displayed-briefly-on-public-page + ## v2.57.0 - 2024-04-01 [Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.56.0...v2.57.0) From ceb7ce361e96d02ecc61a198accb0763bf96b773 Mon Sep 17 00:00:00 2001 From: Daniel Palafox Date: Wed, 3 Apr 2024 19:34:54 -0600 Subject: [PATCH 09/10] feature: Start collection daily pub api stats (#7016) * feature: Start collection daily pub api stats * fix: Delete event stats in tests * fix: Remove unused class * feature: Add ip table to event and event_stats --------- Co-authored-by: Daniel Palafox --- .../core/common/manager/EventManager.java | 4 +- .../common/manager/impl/EventManagerImpl.java | 13 +- .../java/org/orcid/core/togglz/Features.java | 5 +- .../org/orcid/persistence/dao/EventDao.java | 5 + .../orcid/persistence/dao/EventStatsDao.java | 5 + .../persistence/dao/impl/EventDaoImpl.java | 21 +- .../dao/impl/EventStatsDaoImpl.java | 53 ++- .../persistence/jpa/entities/EventEntity.java | 10 + .../jpa/entities/EventStatsEntity.java | 10 + .../persistence/jpa/entities}/EventType.java | 7 +- .../src/main/resources/db-master.xml | 2 + .../db/updates/add_ip_col_in_events.xml | 23 + .../db/updates/dw_papi_event_stats.xml | 45 ++ .../orcid/persistence/dao/EventDaoTest.java | 16 + .../persistence/dao/EventStatsDaoTest.java | 76 +++- .../server/PublicV3ApiServiceImplV3_0.java | 58 ++- .../PublicV3ApiServiceDelegator.java | 3 + .../impl/PublicV3ApiServiceDelegatorImpl.java | 14 + ...licV3ApiServiceVersionedDelegatorImpl.java | 420 ------------------ .../orcid/scheduler/web/event/EventStats.java | 4 + .../web/event/impl/EventStatsImpl.java | 28 +- .../resources/orcid-scheduler-context.xml | 2 + .../main/resources/data/EventEntityData.xml | 19 + .../frontend/oauth2/OauthController.java | 2 +- .../AjaxAuthenticationSuccessHandler.java | 2 +- ...olethAjaxAuthenticationSuccessHandler.java | 2 +- .../web/controllers/LoginController.java | 2 +- .../controllers/OauthAuthorizeController.java | 2 +- .../controllers/PublicRecordController.java | 2 +- .../controllers/RegistrationController.java | 2 +- .../web/controllers/ShibbolethController.java | 2 +- 31 files changed, 414 insertions(+), 445 deletions(-) rename {orcid-core/src/main/java/org/orcid/core/utils => orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities}/EventType.java (76%) create mode 100644 orcid-persistence/src/main/resources/db/updates/add_ip_col_in_events.xml create mode 100644 orcid-persistence/src/main/resources/db/updates/dw_papi_event_stats.xml delete mode 100644 orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/impl/PublicV3ApiServiceVersionedDelegatorImpl.java diff --git a/orcid-core/src/main/java/org/orcid/core/common/manager/EventManager.java b/orcid-core/src/main/java/org/orcid/core/common/manager/EventManager.java index 51439b40d4b..544c1e3302d 100644 --- a/orcid-core/src/main/java/org/orcid/core/common/manager/EventManager.java +++ b/orcid-core/src/main/java/org/orcid/core/common/manager/EventManager.java @@ -2,7 +2,7 @@ import javax.servlet.http.HttpServletRequest; -import org.orcid.core.utils.EventType; +import org.orcid.persistence.jpa.entities.EventType; /** * @@ -13,4 +13,6 @@ public interface EventManager { void createEvent(EventType eventType, HttpServletRequest request); + void createPapiEvent(String clientId, String ip, boolean anonymous); + } diff --git a/orcid-core/src/main/java/org/orcid/core/common/manager/impl/EventManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/common/manager/impl/EventManagerImpl.java index 82cd09d7501..ef94b970d14 100644 --- a/orcid-core/src/main/java/org/orcid/core/common/manager/impl/EventManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/common/manager/impl/EventManagerImpl.java @@ -13,12 +13,12 @@ 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.persistence.jpa.entities.EventType; import org.orcid.pojo.ajaxForm.PojoUtil; import org.orcid.pojo.ajaxForm.RequestInfoForm; @@ -105,4 +105,15 @@ private String removeAttributesFromUrl(String url) { } return url; } + + @Override + public void createPapiEvent(String clientId, String ip, boolean anonymous) { + EventEntity eventEntity = new EventEntity(); + eventEntity.setEventType(EventType.PAPI.getValue()); + eventEntity.setClientId(clientId); + eventEntity.setIp(ip); + eventEntity.setLabel(anonymous ? "anonymous" : null); + eventEntity.setDateCreated(new Date()); + eventDao.createEvent(eventEntity); + } } diff --git a/orcid-core/src/main/java/org/orcid/core/togglz/Features.java b/orcid-core/src/main/java/org/orcid/core/togglz/Features.java index 424448ff27e..42e0745b55d 100644 --- a/orcid-core/src/main/java/org/orcid/core/togglz/Features.java +++ b/orcid-core/src/main/java/org/orcid/core/togglz/Features.java @@ -54,7 +54,10 @@ public enum Features implements Feature { SEND_ADD_WORKS_EMAILS, @Label("Delete events older than 90 days from the DB ") - DELETE_EVENTS; + DELETE_EVENTS, + + @Label("Track public events stats ") + PAPI_EVENTS; public boolean isActive() { return FeatureContext.getFeatureManager().isActive(this); diff --git a/orcid-persistence/src/main/java/org/orcid/persistence/dao/EventDao.java b/orcid-persistence/src/main/java/org/orcid/persistence/dao/EventDao.java index 78a2bf775f6..a363136f35b 100644 --- a/orcid-persistence/src/main/java/org/orcid/persistence/dao/EventDao.java +++ b/orcid-persistence/src/main/java/org/orcid/persistence/dao/EventDao.java @@ -1,6 +1,7 @@ package org.orcid.persistence.dao; import org.orcid.persistence.jpa.entities.EventEntity; +import org.orcid.persistence.jpa.entities.EventType; import java.util.List; @@ -18,6 +19,10 @@ public interface EventDao { void delete(long id); List findAll(); + + List findByEventType(EventType eventType); void deleteEventsByDate(Integer numberOfDays); + + void deletePapiEvents(Integer numberOfDays); } diff --git a/orcid-persistence/src/main/java/org/orcid/persistence/dao/EventStatsDao.java b/orcid-persistence/src/main/java/org/orcid/persistence/dao/EventStatsDao.java index c0c77b7730f..d0b4e24c867 100644 --- a/orcid-persistence/src/main/java/org/orcid/persistence/dao/EventStatsDao.java +++ b/orcid-persistence/src/main/java/org/orcid/persistence/dao/EventStatsDao.java @@ -1,6 +1,7 @@ package org.orcid.persistence.dao; import org.orcid.persistence.jpa.entities.EventStatsEntity; +import org.orcid.persistence.jpa.entities.EventType; import java.util.List; @@ -13,5 +14,9 @@ public interface EventStatsDao { void createEventStats(); + void createPapiEventStats(); + List findAll(); + + void deleteStatsByType(EventType eventType); } diff --git a/orcid-persistence/src/main/java/org/orcid/persistence/dao/impl/EventDaoImpl.java b/orcid-persistence/src/main/java/org/orcid/persistence/dao/impl/EventDaoImpl.java index e3e71561c4e..ef2b15ce69e 100644 --- a/orcid-persistence/src/main/java/org/orcid/persistence/dao/impl/EventDaoImpl.java +++ b/orcid-persistence/src/main/java/org/orcid/persistence/dao/impl/EventDaoImpl.java @@ -7,6 +7,7 @@ import org.orcid.persistence.dao.EventDao; import org.orcid.persistence.jpa.entities.EventEntity; +import org.orcid.persistence.jpa.entities.EventType; import org.springframework.transaction.annotation.Transactional; import java.util.List; @@ -49,9 +50,27 @@ public List findAll() { @Override @Transactional public void deleteEventsByDate(Integer numberOfDays) { - String query = "DELETE FROM event where CAST(date_created as date) < CAST(now() - (CAST('1' AS INTERVAL DAY) * :numberOfDays) as date)"; + String query = "DELETE FROM event where CAST(date_created as date) < CAST(now() - (CAST('1' AS INTERVAL DAY) * :numberOfDays) as date) AND event_type != :eventType"; Query queryDelete = entityManager.createNativeQuery(query); + queryDelete.setParameter("eventType", EventType.PAPI.getValue()); queryDelete.setParameter("numberOfDays", numberOfDays); queryDelete.executeUpdate(); } + + @Override + @Transactional + public void deletePapiEvents(Integer numberOfDays) { + String query = "DELETE FROM event where CAST(date_created as date) < CAST(now() - (CAST('1' AS INTERVAL DAY) * :numberOfDays) as date) AND event_type = :eventType"; + Query queryDelete = entityManager.createNativeQuery(query); + queryDelete.setParameter("eventType", EventType.PAPI.getValue()); + queryDelete.setParameter("numberOfDays", numberOfDays); + queryDelete.executeUpdate(); + } + + @Override + public List findByEventType(EventType eventType) { + TypedQuery query = entityManager.createQuery("from EventEntity where eventType = :eventType", EventEntity.class); + query.setParameter("eventType", eventType.getValue()); + return query.getResultList(); + } } diff --git a/orcid-persistence/src/main/java/org/orcid/persistence/dao/impl/EventStatsDaoImpl.java b/orcid-persistence/src/main/java/org/orcid/persistence/dao/impl/EventStatsDaoImpl.java index 2e68e076ad5..5245acc6e8e 100644 --- a/orcid-persistence/src/main/java/org/orcid/persistence/dao/impl/EventStatsDaoImpl.java +++ b/orcid-persistence/src/main/java/org/orcid/persistence/dao/impl/EventStatsDaoImpl.java @@ -1,6 +1,7 @@ package org.orcid.persistence.dao.impl; import org.orcid.persistence.dao.EventStatsDao; +import org.orcid.persistence.jpa.entities.EventType; import org.orcid.persistence.jpa.entities.EventStatsEntity; import org.springframework.transaction.annotation.Transactional; @@ -8,6 +9,9 @@ import javax.persistence.EntityManager; import javax.persistence.Query; import javax.persistence.TypedQuery; + +import java.math.BigInteger; +import java.util.ArrayList; import java.util.List; /** @@ -25,9 +29,11 @@ public void createEventStats() { "INSERT INTO event_stats (event_type, client_id, count, date, date_created, last_modified) " + "SELECT event_type, client_id, COUNT(id), CAST(e.date_created as date), now(), now() " + "FROM event as e " + - "WHERE CAST(e.date_created as date) = CAST(now() - (CAST('1' AS INTERVAL DAY) * 1) as date) " + + "WHERE event_type != '"+ EventType.PAPI.getValue() + "' " + + "AND CAST(e.date_created as date) = CAST(now() - (CAST('1' AS INTERVAL DAY) * 1) as date) " + "GROUP BY event_type, client_id, CAST(e.date_created as date) " + "ORDER BY CAST(e.date_created as date) DESC;"; + Query insertQuery = entityManager.createNativeQuery(query); insertQuery.executeUpdate(); } @@ -37,4 +43,49 @@ public List findAll() { TypedQuery query = entityManager.createQuery("from EventStatsEntity", EventStatsEntity.class); return query.getResultList(); } + + @Override + @Transactional + public void createPapiEventStats() { + String query = + "SELECT event_type, client_id, ip, label, count(*), CAST(date_created as date), now(), now() " + + "FROM event " + + "WHERE event_type = '"+ EventType.PAPI.getValue() + "' " + + "AND CAST(date_created as date) = CAST(now() - (CAST('1' AS INTERVAL DAY) * 1) as date) " + + "GROUP BY event_type, client_id, ip, label, CAST(date_created as date) " + + "ORDER BY CAST(date_created as date) DESC;"; + + Query queryList = entityManager.createNativeQuery(query); + List eventsList = queryList.getResultList(); + List eventsListToRemove = new ArrayList<>(); + if (eventsList.size() > 0) { + eventsList.forEach(item -> { + if (item[3] == "anonymous" && item[4] != null && ((BigInteger) item[4]).intValue() < 1000) { + eventsListToRemove.add(item); + } + }); + eventsList.removeAll(eventsListToRemove); + eventsList.forEach(item -> { + String insertQuery = "INSERT INTO event_stats (event_type, client_id, ip, count, date, date_created, last_modified) VALUES (:eventType, :clientId, :ip, :count, :date, :dateCreated, :lastModified)"; + Query insertQueryClients = entityManager.createNativeQuery(insertQuery); + insertQueryClients.setParameter("eventType", item[0]); + insertQueryClients.setParameter("clientId", item[1]); + insertQueryClients.setParameter("ip", item[2]); + insertQueryClients.setParameter("count", item[4]); + insertQueryClients.setParameter("date", item[5]); + insertQueryClients.setParameter("dateCreated", item[6]); + insertQueryClients.setParameter("lastModified", item[7]); + insertQueryClients.executeUpdate(); + }); + } + } + + @Override + @Transactional + public void deleteStatsByType(EventType eventType) { + String query = "DELETE FROM event_stats where event_type = :eventType"; + Query queryDelete = entityManager.createNativeQuery(query); + queryDelete.setParameter("eventType", eventType.getValue()); + queryDelete.executeUpdate(); + } } diff --git a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/EventEntity.java b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/EventEntity.java index c656f6fd44b..bce397fbd89 100644 --- a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/EventEntity.java +++ b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/EventEntity.java @@ -22,6 +22,7 @@ public class EventEntity { private static final long serialVersionUID = 1L; private Long id; private String clientId; + private String ip; private String eventType; private String label; private Date dateCreated; @@ -56,6 +57,15 @@ public void setClientId(String client_id) { this.clientId = client_id; } + @Column(name = "ip") + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + @Column(name = "label") public String getLabel() { return label; diff --git a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/EventStatsEntity.java b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/EventStatsEntity.java index 9134bdaa496..2e0dd7cdd11 100644 --- a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/EventStatsEntity.java +++ b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/EventStatsEntity.java @@ -22,6 +22,7 @@ public class EventStatsEntity extends BaseEntity{ private Long id; private String eventType; private String clientId; + private String ip; private Integer count; private Date date; @@ -55,6 +56,15 @@ public void setClientId(String client_id) { this.clientId = client_id; } + @Column(name = "ip") + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + @Column(name = "count") public Integer getCount() { return count; diff --git a/orcid-core/src/main/java/org/orcid/core/utils/EventType.java b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/EventType.java similarity index 76% rename from orcid-core/src/main/java/org/orcid/core/utils/EventType.java rename to orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/EventType.java index d5c248dd171..6166e64d144 100644 --- a/orcid-core/src/main/java/org/orcid/core/utils/EventType.java +++ b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/EventType.java @@ -1,4 +1,4 @@ -package org.orcid.core.utils; +package org.orcid.persistence.jpa.entities; public enum EventType { SIGN_IN("Sign-In"), @@ -6,7 +6,8 @@ public enum EventType { AUTHORIZE("Authorize"), AUTHORIZE_DENY("Authorize-Deny"), REAUTHORIZE("Reauthorize"), - PUBLIC_PAGE("Public-Page"); + PUBLIC_PAGE("Public-Page"), + PAPI("Public-API"); private final String value; @@ -17,4 +18,4 @@ public enum EventType { public String getValue() { return value; } -} +} \ No newline at end of file diff --git a/orcid-persistence/src/main/resources/db-master.xml b/orcid-persistence/src/main/resources/db-master.xml index 44b53d3e311..fda8f31a661 100644 --- a/orcid-persistence/src/main/resources/db-master.xml +++ b/orcid-persistence/src/main/resources/db-master.xml @@ -385,4 +385,6 @@ + + diff --git a/orcid-persistence/src/main/resources/db/updates/add_ip_col_in_events.xml b/orcid-persistence/src/main/resources/db/updates/add_ip_col_in_events.xml new file mode 100644 index 00000000000..c0346ae2467 --- /dev/null +++ b/orcid-persistence/src/main/resources/db/updates/add_ip_col_in_events.xml @@ -0,0 +1,23 @@ + + + + + + + + + ALTER TABLE event ADD ip VARCHAR(15); + + + + + + + + + ALTER TABLE event_stats ADD ip VARCHAR(15); + + + \ No newline at end of file diff --git a/orcid-persistence/src/main/resources/db/updates/dw_papi_event_stats.xml b/orcid-persistence/src/main/resources/db/updates/dw_papi_event_stats.xml new file mode 100644 index 00000000000..6be18bfd3ea --- /dev/null +++ b/orcid-persistence/src/main/resources/db/updates/dw_papi_event_stats.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + SELECT event_type, client_id, count, DATE_TRUNC('day', date), DATE_TRUNC('day', date) as last_modified + FROM event_stats WHERE event_type != 'Public-API' + ORDER BY DATE_TRUNC('day', date_created) DESC; + + + + + + SELECT 1 FROM pg_roles WHERE rolname='dw_user' + + GRANT SELECT ON TABLE dw_event_stats to dw_user; + + + + + + + + SELECT event_type, client_id, ip, count, DATE_TRUNC('day', date), DATE_TRUNC('day', date) as last_modified + FROM event_stats WHERE event_type = 'Public-API' + ORDER BY DATE_TRUNC('day', date_created) DESC; + + + + + + SELECT 1 FROM pg_roles WHERE rolname='dw_user' + + GRANT SELECT ON TABLE dw_papi_event_stats to dw_user; + + + \ No newline at end of file diff --git a/orcid-persistence/src/test/java/org/orcid/persistence/dao/EventDaoTest.java b/orcid-persistence/src/test/java/org/orcid/persistence/dao/EventDaoTest.java index 025c8b0d440..e672c47654a 100644 --- a/orcid-persistence/src/test/java/org/orcid/persistence/dao/EventDaoTest.java +++ b/orcid-persistence/src/test/java/org/orcid/persistence/dao/EventDaoTest.java @@ -17,6 +17,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.orcid.persistence.jpa.entities.EventEntity; +import org.orcid.persistence.jpa.entities.EventType; import org.orcid.test.DBUnitTest; import org.orcid.test.OrcidJUnit4ClassRunner; import org.springframework.test.context.ContextConfiguration; @@ -81,4 +82,19 @@ public void testWriteEvent() throws IllegalAccessException { eventDao.delete(eventEntity.getId()); } + + @Test + public void deletePapiEventsByDate() { + List eventEntityList = eventDao.findByEventType(EventType.PAPI); + + assertNotNull(eventEntityList); + assertEquals(3, eventEntityList.size()); + + eventDao.deletePapiEvents(90); + + eventEntityList = eventDao.findByEventType(EventType.PAPI); + + assertNotNull(eventEntityList); + assertEquals(0, eventEntityList.size()); + } } diff --git a/orcid-persistence/src/test/java/org/orcid/persistence/dao/EventStatsDaoTest.java b/orcid-persistence/src/test/java/org/orcid/persistence/dao/EventStatsDaoTest.java index 780f294d37a..42d0b7a76c4 100644 --- a/orcid-persistence/src/test/java/org/orcid/persistence/dao/EventStatsDaoTest.java +++ b/orcid-persistence/src/test/java/org/orcid/persistence/dao/EventStatsDaoTest.java @@ -4,6 +4,7 @@ import org.junit.runner.RunWith; import org.orcid.persistence.jpa.entities.EventEntity; import org.orcid.persistence.jpa.entities.EventStatsEntity; +import org.orcid.persistence.jpa.entities.EventType; import org.orcid.test.OrcidJUnit4ClassRunner; import org.springframework.test.context.ContextConfiguration; @@ -16,6 +17,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; @RunWith(OrcidJUnit4ClassRunner.class) @ContextConfiguration(inheritInitializers = false, inheritLocations = false, locations = {"classpath:test-orcid-persistence-context.xml"}) @@ -36,15 +38,81 @@ public void createEventStats() { List eventStatsEntityList = eventStatsDao.findAll(); assertNotNull(eventStatsEntityList); - assertEquals(1, eventStatsEntityList.size()); + assertEquals(2, eventStatsEntityList.size()); assertEquals(Integer.valueOf(20), eventStatsEntityList.get(0).getCount()); + assertEquals(Integer.valueOf(20), eventStatsEntityList.get(1).getCount()); + + eventStatsDao.deleteStatsByType(EventType.SIGN_IN); } - private void createEvents() { + @Test + public void createPapiEventStats() { + createPapiEvents(); + + eventStatsDao.createPapiEventStats(); + + List eventStatsEntityList = eventStatsDao.findAll(); + + assertNotNull(eventStatsEntityList); + assertEquals(3, eventStatsEntityList.size()); + + assertEquals("Client 1", eventStatsEntityList.get(0).getClientId()); + assertEquals("105.21.229.72", eventStatsEntityList.get(0).getIp()); + assertEquals(Integer.valueOf(10), eventStatsEntityList.get(0).getCount()); + + assertEquals("Client 2", eventStatsEntityList.get(1).getClientId()); + assertEquals("105.21.229.73", eventStatsEntityList.get(1).getIp()); + assertEquals(Integer.valueOf(10), eventStatsEntityList.get(1).getCount()); + + assertNull(eventStatsEntityList.get(2).getClientId()); + assertEquals("104.20.228.70", eventStatsEntityList.get(2).getIp()); + assertEquals(Integer.valueOf(1100), eventStatsEntityList.get(2).getCount()); + + + + eventStatsDao.deleteStatsByType(EventType.PAPI); + } + + private void createPapiEvents() { for (int i = 0; i < 20; i++) { EventEntity eventEntity = new EventEntity(); - eventEntity.setEventType("Sign-In"); - eventEntity.setClientId("Client " + 1); + eventEntity.setEventType(EventType.PAPI.getValue()); + eventEntity.setClientId("Client " + (i % 2 == 0 ? 1 : 2)); + eventEntity.setIp("105.21.229.7" + (i % 2 == 0 ? 2 : 3)); + LocalDate date = LocalDate.now().minusDays(1); + Instant instant = date.atStartOfDay(ZoneId.systemDefault()).toInstant(); + eventEntity.setDateCreated(Date.from(instant)); + eventDao.createEvent(eventEntity); + } + + for (int i = 0; i < 10; i++) { + EventEntity eventEntity = new EventEntity(); + eventEntity.setEventType(EventType.PAPI.getValue()); + eventEntity.setIp("105.21.229.71"); + eventEntity.setLabel("anonymous"); + LocalDate date = LocalDate.now().minusDays(1); + Instant instant = date.atStartOfDay(ZoneId.systemDefault()).toInstant(); + eventEntity.setDateCreated(Date.from(instant)); + eventDao.createEvent(eventEntity); + } + + for (int i = 0; i < 1100; i++) { + EventEntity eventEntity = new EventEntity(); + eventEntity.setEventType(EventType.PAPI.getValue()); + eventEntity.setIp("104.20.228.70"); + eventEntity.setLabel("anonymous"); + LocalDate date = LocalDate.now().minusDays(1); + Instant instant = date.atStartOfDay(ZoneId.systemDefault()).toInstant(); + eventEntity.setDateCreated(Date.from(instant)); + eventDao.createEvent(eventEntity); + } + } + + private void createEvents() { + for (int i = 0; i < 40; i++) { + EventEntity eventEntity = new EventEntity(); + eventEntity.setEventType(EventType.SIGN_IN.getValue()); + eventEntity.setClientId("Client " + (i % 2 == 0 ? 1 : 2)) ; LocalDate date = LocalDate.now().minusDays(1); Instant instant = date.atStartOfDay(ZoneId.systemDefault()).toInstant(); eventEntity.setDateCreated(Date.from(instant)); diff --git a/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/PublicV3ApiServiceImplV3_0.java b/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/PublicV3ApiServiceImplV3_0.java index 1507919ad57..7581c577c7b 100644 --- a/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/PublicV3ApiServiceImplV3_0.java +++ b/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/PublicV3ApiServiceImplV3_0.java @@ -125,7 +125,6 @@ public class PublicV3ApiServiceImplV3_0 { public Response viewSwagger() { return swaggerUIBuilder.build(); } - @GET @Produces(value = { MediaType.APPLICATION_JSON }) @@ -149,6 +148,7 @@ public Response viewStatusJson() { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(ACTIVITIES) public Response viewActivities(@PathParam("orcid") String orcid, @Context HttpServletRequest httpRequest) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewActivities(orcid); } @@ -157,6 +157,7 @@ public Response viewActivities(@PathParam("orcid") String orcid, @Context HttpSe OrcidApiConstants.APPLICATION_CITEPROC }) @Path(WORK + PUTCODE) public Response viewWork(@PathParam("orcid") String orcid, @PathParam("putCode") Long putCode, @Context HttpServletRequest httpRequest) { + serviceDelegator.trackEvents(httpRequest); if (OrcidApiConstants.APPLICATION_CITEPROC.equals(httpRequest.getHeader("Accept"))) return serviceDelegator.viewWorkCitation(orcid, putCode); return serviceDelegator.viewWork(orcid, putCode); @@ -166,6 +167,7 @@ public Response viewWork(@PathParam("orcid") String orcid, @PathParam("putCode") @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(WORK_SUMMARY + PUTCODE) public Response viewWorkSummary(@PathParam("orcid") String orcid, @PathParam("putCode") Long putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewWorkSummary(orcid, putCode); } @@ -173,6 +175,7 @@ public Response viewWorkSummary(@PathParam("orcid") String orcid, @PathParam("pu @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(WORKS) public Response viewWorks(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewWorks(orcid); } @@ -180,6 +183,7 @@ public Response viewWorks(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(BULK_WORKS) public Response viewSpecifiedWorks(@PathParam("orcid") String orcid, @PathParam("putCodes") String putCodes) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewBulkWorks(orcid, putCodes); } @@ -187,6 +191,7 @@ public Response viewSpecifiedWorks(@PathParam("orcid") String orcid, @PathParam( @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(FUNDING + PUTCODE) public Response viewFunding(@PathParam("orcid") String orcid, @PathParam("putCode") Long putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewFunding(orcid, putCode); } @@ -194,13 +199,15 @@ public Response viewFunding(@PathParam("orcid") String orcid, @PathParam("putCod @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(FUNDING_SUMMARY + PUTCODE) public Response viewFundingSummary(@PathParam("orcid") String orcid, @PathParam("putCode") Long putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewFundingSummary(orcid, putCode); } @GET @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(FUNDINGS) - public Response viewFundings(@PathParam("orcid") String orcid) { + public Response viewFundings(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewFundings(orcid); } @@ -208,6 +215,7 @@ public Response viewFundings(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(EDUCATION + PUTCODE) public Response viewEducation(@PathParam("orcid") String orcid, @PathParam("putCode") Long putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewEducation(orcid, putCode); } @@ -215,6 +223,7 @@ public Response viewEducation(@PathParam("orcid") String orcid, @PathParam("putC @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(EDUCATION_SUMMARY + PUTCODE) public Response viewEducationSummary(@PathParam("orcid") String orcid, @PathParam("putCode") Long putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewEducationSummary(orcid, putCode); } @@ -222,6 +231,7 @@ public Response viewEducationSummary(@PathParam("orcid") String orcid, @PathPara @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(EDUCATIONS) public Response viewEducations(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewEducations(orcid); } @@ -229,6 +239,7 @@ public Response viewEducations(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(EMPLOYMENT + PUTCODE) public Response viewEmployment(@PathParam("orcid") String orcid, @PathParam("putCode") Long putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewEmployment(orcid, putCode); } @@ -236,6 +247,7 @@ public Response viewEmployment(@PathParam("orcid") String orcid, @PathParam("put @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(EMPLOYMENT_SUMMARY + PUTCODE) public Response viewEmploymentSummary(@PathParam("orcid") String orcid, @PathParam("putCode") Long putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewEmploymentSummary(orcid, putCode); } @@ -243,6 +255,7 @@ public Response viewEmploymentSummary(@PathParam("orcid") String orcid, @PathPar @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(EMPLOYMENTS) public Response viewEmployments(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewEmployments(orcid); } @@ -250,6 +263,7 @@ public Response viewEmployments(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(PEER_REVIEW + PUTCODE) public Response viewPeerReview(@PathParam("orcid") String orcid, @PathParam("putCode") Long putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewPeerReview(orcid, putCode); } @@ -257,6 +271,7 @@ public Response viewPeerReview(@PathParam("orcid") String orcid, @PathParam("put @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(PEER_REVIEW_SUMMARY + PUTCODE) public Response viewPeerReviewSummary(@PathParam("orcid") String orcid, @PathParam("putCode") Long putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewPeerReviewSummary(orcid, putCode); } @@ -264,6 +279,7 @@ public Response viewPeerReviewSummary(@PathParam("orcid") String orcid, @PathPar @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(PEER_REVIEWS) public Response viewPeerReviews(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewPeerReviews(orcid); } @@ -271,6 +287,7 @@ public Response viewPeerReviews(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(RESEARCHER_URLS) public Response viewResearcherUrls(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewResearcherUrls(orcid); } @@ -278,6 +295,7 @@ public Response viewResearcherUrls(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(RESEARCHER_URLS + PUTCODE) public Response viewResearcherUrl(@PathParam("orcid") String orcid, @PathParam("putCode") String putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewResearcherUrl(orcid, Long.valueOf(putCode)); } @@ -285,6 +303,7 @@ public Response viewResearcherUrl(@PathParam("orcid") String orcid, @PathParam(" @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(EMAIL) public Response viewEmails(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewEmails(orcid); } @@ -292,6 +311,7 @@ public Response viewEmails(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(PERSONAL_DETAILS) public Response viewPersonalDetails(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewPersonalDetails(orcid); } @@ -299,6 +319,7 @@ public Response viewPersonalDetails(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(OTHER_NAMES) public Response viewOtherNames(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewOtherNames(orcid); } @@ -306,6 +327,7 @@ public Response viewOtherNames(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(OTHER_NAMES + PUTCODE) public Response viewOtherName(@PathParam("orcid") String orcid, @PathParam("putCode") String putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewOtherName(orcid, Long.valueOf(putCode)); } @@ -313,6 +335,7 @@ public Response viewOtherName(@PathParam("orcid") String orcid, @PathParam("putC @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(EXTERNAL_IDENTIFIERS) public Response viewExternalIdentifiers(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewExternalIdentifiers(orcid); } @@ -320,6 +343,7 @@ public Response viewExternalIdentifiers(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(EXTERNAL_IDENTIFIERS + PUTCODE) public Response viewExternalIdentifier(@PathParam("orcid") String orcid, @PathParam("putCode") String putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewExternalIdentifier(orcid, Long.valueOf(putCode)); } @@ -327,6 +351,7 @@ public Response viewExternalIdentifier(@PathParam("orcid") String orcid, @PathPa @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(KEYWORDS) public Response viewKeywords(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewKeywords(orcid); } @@ -334,6 +359,7 @@ public Response viewKeywords(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(KEYWORDS + PUTCODE) public Response viewKeyword(@PathParam("orcid") String orcid, @PathParam("putCode") String putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewKeyword(orcid, Long.valueOf(putCode)); } @@ -341,6 +367,7 @@ public Response viewKeyword(@PathParam("orcid") String orcid, @PathParam("putCod @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(ADDRESS) public Response viewAddresses(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewAddresses(orcid); } @@ -348,6 +375,7 @@ public Response viewAddresses(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(ADDRESS + PUTCODE) public Response viewAddress(@PathParam("orcid") String orcid, @PathParam("putCode") String putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewAddress(orcid, Long.valueOf(putCode)); } @@ -355,6 +383,7 @@ public Response viewAddress(@PathParam("orcid") String orcid, @PathParam("putCod @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(BIOGRAPHY) public Response viewBiography(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewBiography(orcid); } @@ -362,6 +391,7 @@ public Response viewBiography(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(PERSON) public Response viewPerson(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewPerson(orcid); } @@ -370,6 +400,7 @@ public Response viewPerson(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON, JSON_LD }) @Path(OrcidApiConstants.RECORD_SIMPLE) public Response viewRecord(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewRecord(orcid); } @@ -378,6 +409,7 @@ public Response viewRecord(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(OrcidApiConstants.RECORD_RECORD) public Response viewRecordRecord(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewRecord(orcid); } @@ -385,6 +417,7 @@ public Response viewRecordRecord(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(SEARCH_PATH) public Response searchByQuery(@QueryParam("q") @DefaultValue("") String query, @Context UriInfo uriInfo) { + serviceDelegator.trackEvents(httpRequest); Map> solrParams = new HashMap<>(uriInfo.getQueryParameters()); Response jsonQueryResults = serviceDelegator.searchByQuery(solrParams); return jsonQueryResults; @@ -394,6 +427,7 @@ public Response searchByQuery(@QueryParam("q") @DefaultValue("") String query, @ @Produces(TEXT_CSV) @Path(CSV_SEARCH_PATH) public Response searchByQueryCSV(@QueryParam("q") @DefaultValue("") String query, @Context UriInfo uriInfo) { + serviceDelegator.trackEvents(httpRequest); Map> solrParams = new HashMap<>(uriInfo.getQueryParameters()); Response csvQueryResults = serviceDelegator.searchByQueryCSV(solrParams); return csvQueryResults; @@ -403,6 +437,7 @@ public Response searchByQueryCSV(@QueryParam("q") @DefaultValue("") String query @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(EXPANDED_SEARCH_PATH) public Response expandedSearchByQuery(@QueryParam("q") @DefaultValue("") String query, @Context UriInfo uriInfo) { + serviceDelegator.trackEvents(httpRequest); Map> solrParams = new HashMap<>(uriInfo.getQueryParameters()); Response queryResults = serviceDelegator.expandedSearchByQuery(solrParams); return queryResults; @@ -411,6 +446,7 @@ public Response expandedSearchByQuery(@QueryParam("q") @DefaultValue("") String @Path(CLIENT_PATH) @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) public Response viewClient(@PathParam("client_id") String clientId) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewClient(clientId); } @@ -418,6 +454,7 @@ public Response viewClient(@PathParam("client_id") String clientId) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(DISTINCTION + PUTCODE) public Response viewDistinction(@PathParam("orcid") String orcid, @PathParam("putCode") String putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewDistinction(orcid, Long.valueOf(putCode)); } @@ -425,6 +462,7 @@ public Response viewDistinction(@PathParam("orcid") String orcid, @PathParam("pu @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(DISTINCTIONS) public Response viewDistinctions(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewDistinctions(orcid); } @@ -432,6 +470,7 @@ public Response viewDistinctions(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(DISTINCTION_SUMMARY + PUTCODE) public Response viewDistinctionSummary(@PathParam("orcid") String orcid, @PathParam("putCode") String putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewDistinctionSummary(orcid, Long.valueOf(putCode)); } @@ -439,6 +478,7 @@ public Response viewDistinctionSummary(@PathParam("orcid") String orcid, @PathPa @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(INVITED_POSITION + PUTCODE) public Response viewInvitedPosition(@PathParam("orcid") String orcid, @PathParam("putCode") String putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewInvitedPosition(orcid, Long.valueOf(putCode)); } @@ -446,6 +486,7 @@ public Response viewInvitedPosition(@PathParam("orcid") String orcid, @PathParam @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(INVITED_POSITIONS) public Response viewInvitedPositions(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewInvitedPositions(orcid); } @@ -453,6 +494,7 @@ public Response viewInvitedPositions(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(INVITED_POSITION_SUMMARY + PUTCODE) public Response viewInvitedPositionSummary(@PathParam("orcid") String orcid, @PathParam("putCode") String putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewInvitedPositionSummary(orcid, Long.valueOf(putCode)); } @@ -460,6 +502,7 @@ public Response viewInvitedPositionSummary(@PathParam("orcid") String orcid, @Pa @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(MEMBERSHIP + PUTCODE) public Response viewMembership(@PathParam("orcid") String orcid, @PathParam("putCode") String putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewMembership(orcid, Long.valueOf(putCode)); } @@ -467,6 +510,7 @@ public Response viewMembership(@PathParam("orcid") String orcid, @PathParam("put @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(MEMBERSHIPS) public Response viewMemberships(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewMemberships(orcid); } @@ -474,6 +518,7 @@ public Response viewMemberships(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(MEMBERSHIP_SUMMARY + PUTCODE) public Response viewMembershipSummary(@PathParam("orcid") String orcid, @PathParam("putCode") String putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewMembershipSummary(orcid, Long.valueOf(putCode)); } @@ -481,6 +526,7 @@ public Response viewMembershipSummary(@PathParam("orcid") String orcid, @PathPar @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(QUALIFICATION + PUTCODE) public Response viewQualification(@PathParam("orcid") String orcid, @PathParam("putCode") String putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewQualification(orcid, Long.valueOf(putCode)); } @@ -488,6 +534,7 @@ public Response viewQualification(@PathParam("orcid") String orcid, @PathParam(" @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(QUALIFICATIONS) public Response viewQualifications(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewQualifications(orcid); } @@ -495,6 +542,7 @@ public Response viewQualifications(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(QUALIFICATION_SUMMARY + PUTCODE) public Response viewQualificationSummary(@PathParam("orcid") String orcid, @PathParam("putCode") String putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewQualificationSummary(orcid, Long.valueOf(putCode)); } @@ -502,6 +550,7 @@ public Response viewQualificationSummary(@PathParam("orcid") String orcid, @Path @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(SERVICE + PUTCODE) public Response viewService(@PathParam("orcid") String orcid, @PathParam("putCode") String putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewService(orcid, Long.valueOf(putCode)); } @@ -509,6 +558,7 @@ public Response viewService(@PathParam("orcid") String orcid, @PathParam("putCod @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(SERVICES) public Response viewServices(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewServices(orcid); } @@ -516,6 +566,7 @@ public Response viewServices(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(SERVICE_SUMMARY + PUTCODE) public Response viewServiceSummary(@PathParam("orcid") String orcid, @PathParam("putCode") String putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewServiceSummary(orcid, Long.valueOf(putCode)); } @@ -523,6 +574,7 @@ public Response viewServiceSummary(@PathParam("orcid") String orcid, @PathParam( @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(RESEARCH_RESOURCE + PUTCODE) public Response viewResearchResource(@PathParam("orcid") String orcid, @PathParam("putCode") String putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewResearchResource(orcid, Long.valueOf(putCode)); } @@ -530,6 +582,7 @@ public Response viewResearchResource(@PathParam("orcid") String orcid, @PathPara @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(RESEARCH_RESOURCES) public Response viewResearchResources(@PathParam("orcid") String orcid) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewResearchResources(orcid); } @@ -537,6 +590,7 @@ public Response viewResearchResources(@PathParam("orcid") String orcid) { @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON }) @Path(RESEARCH_RESOURCE_SUMMARY + PUTCODE) public Response viewResearchResourceSummary(@PathParam("orcid") String orcid, @PathParam("putCode") String putCode) { + serviceDelegator.trackEvents(httpRequest); return serviceDelegator.viewResearchResourceSummary(orcid, Long.valueOf(putCode)); } diff --git a/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/PublicV3ApiServiceDelegator.java b/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/PublicV3ApiServiceDelegator.java index 368107244b6..a96e8649e0d 100644 --- a/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/PublicV3ApiServiceDelegator.java +++ b/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/PublicV3ApiServiceDelegator.java @@ -3,6 +3,7 @@ import java.util.List; import java.util.Map; +import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; /** @@ -132,4 +133,6 @@ public interface PublicV3ApiServiceDelegator> solrParams); + void trackEvents(HttpServletRequest httpRequest); + } diff --git a/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/impl/PublicV3ApiServiceDelegatorImpl.java b/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/impl/PublicV3ApiServiceDelegatorImpl.java index 783c9db5272..f714009c6c3 100644 --- a/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/impl/PublicV3ApiServiceDelegatorImpl.java +++ b/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/impl/PublicV3ApiServiceDelegatorImpl.java @@ -7,6 +7,7 @@ import java.util.Map; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; @@ -15,6 +16,7 @@ import org.orcid.api.common.writer.citeproc.V3WorkToCiteprocTranslator; import org.orcid.api.publicV3.server.delegator.PublicV3ApiServiceDelegator; import org.orcid.api.publicV3.server.security.PublicAPISecurityManagerV3; +import org.orcid.core.common.manager.EventManager; import org.orcid.core.exception.OrcidBadRequestException; import org.orcid.core.exception.OrcidNoResultException; import org.orcid.core.exception.SearchStartParameterLimitExceededException; @@ -44,6 +46,7 @@ import org.orcid.core.manager.v3.read_only.ResearcherUrlManagerReadOnly; import org.orcid.core.manager.v3.read_only.WorkManagerReadOnly; import org.orcid.core.oauth.openid.OpenIDConnectKeyService; +import org.orcid.core.utils.OrcidRequestUtil; import org.orcid.core.utils.v3.ContributorUtils; import org.orcid.core.utils.v3.SourceUtils; import org.orcid.core.version.impl.Api3_0LastModifiedDatesHelper; @@ -209,6 +212,9 @@ public class PublicV3ApiServiceDelegatorImpl @Resource(name = "recordNameManagerReadOnlyV3") private RecordNameManagerReadOnly recordNameManagerReadOnlyV3; + @Resource + private EventManager eventManager; + @Value("${org.orcid.core.baseUri}") private String baseUrl; @@ -961,4 +967,12 @@ public Response viewResearchResourceSummary(String orcid, Long putCode) { return Response.ok(e).build(); } + @Override + public void trackEvents(HttpServletRequest httpRequest) { + String clientId = orcidSecurityManager.getClientIdFromAPIRequest(); + String ip = OrcidRequestUtil.getIpAddress(httpRequest); + + eventManager.createPapiEvent(clientId, ip, clientId == null ? true : false); + } + } diff --git a/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/impl/PublicV3ApiServiceVersionedDelegatorImpl.java b/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/impl/PublicV3ApiServiceVersionedDelegatorImpl.java deleted file mode 100644 index 96d5062bc89..00000000000 --- a/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/impl/PublicV3ApiServiceVersionedDelegatorImpl.java +++ /dev/null @@ -1,420 +0,0 @@ -package org.orcid.api.publicV3.server.delegator.impl; - -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.ws.rs.core.Response; - -import org.orcid.api.publicV3.server.delegator.PublicV3ApiServiceDelegator; -import org.orcid.core.exception.DeactivatedException; -import org.orcid.core.manager.OrcidSecurityManager; -import org.orcid.core.manager.ProfileEntityCacheManager; -import org.orcid.core.version.V3Convertible; -import org.orcid.core.version.V3VersionConverterChain; - - -/** - * TODO: DELETE ME! We dont need versioned delegator since there are no RCs anymore - * */ -public class PublicV3ApiServiceVersionedDelegatorImpl implements PublicV3ApiServiceDelegator { - - private PublicV3ApiServiceDelegator publicV3ApiServiceDelegator; - - private String externalVersion; - - @Resource - private ProfileEntityCacheManager profileEntityCacheManager; - - @Resource - private OrcidSecurityManager orcidSecurityManager; - - @Resource - private V3VersionConverterChain v3VersionConverterChain; - - public void setPublicV3ApiServiceDelegator( - PublicV3ApiServiceDelegator publicV3ApiServiceDelegator) { - this.publicV3ApiServiceDelegator = publicV3ApiServiceDelegator; - } - - @Override - public Response viewStatusSimple() { - return publicV3ApiServiceDelegator.viewStatusSimple(); - } - - @Override - public Response viewActivities(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewActivities(orcid)); - } - - @Override - public Response viewWork(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewWork(orcid, putCode)); - } - - @Override - public Response viewWorks(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewWorks(orcid)); - } - - @Override - public Response viewWorkCitation(String orcid, Long putCode) { - checkProfileStatus(orcid); - // DO not downgrade non-orcid schema responses (this is citeproc); - return publicV3ApiServiceDelegator.viewWorkCitation(orcid, putCode); - // return - // processReponse(publicV2ApiServiceDelegator.viewWorkCitation(orcid, - // putCode), orcid); - } - - @Override - public Response viewWorkSummary(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewWorkSummary(orcid, putCode)); - } - - @Override - public Response viewFunding(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewFunding(orcid, putCode)); - } - - @Override - public Response viewFundings(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewFundings(orcid)); - } - - @Override - public Response viewFundingSummary(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewFundingSummary(orcid, putCode)); - } - - @Override - public Response viewEducation(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewEducation(orcid, putCode)); - } - - @Override - public Response viewEducations(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewEducations(orcid)); - } - - @Override - public Response viewEducationSummary(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewEducationSummary(orcid, putCode)); - } - - @Override - public Response viewEmployment(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewEmployment(orcid, putCode)); - } - - @Override - public Response viewEmployments(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewEmployments(orcid)); - } - - @Override - public Response viewEmploymentSummary(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewEmploymentSummary(orcid, putCode)); - } - - @Override - public Response viewPeerReview(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewPeerReview(orcid, putCode)); - } - - @Override - public Response viewPeerReviews(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewPeerReviews(orcid)); - } - - @Override - public Response viewPeerReviewSummary(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewPeerReviewSummary(orcid, putCode)); - } - - @Override - public Response viewGroupIdRecord(Long putCode) { - return publicV3ApiServiceDelegator.viewGroupIdRecord(putCode); - } - - @Override - public Response viewGroupIdRecords(String pageSize, String pageNum) { - return publicV3ApiServiceDelegator.viewGroupIdRecords(pageSize, pageNum); - } - - @Override - public Response viewResearcherUrls(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewResearcherUrls(orcid)); - } - - @Override - public Response viewResearcherUrl(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewResearcherUrl(orcid, putCode)); - } - - @Override - public Response viewEmails(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewEmails(orcid)); - } - - @Override - public Response viewOtherNames(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewOtherNames(orcid)); - } - - @Override - public Response viewOtherName(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewOtherName(orcid, putCode)); - } - - @Override - public Response viewPersonalDetails(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewPersonalDetails(orcid)); - } - - @Override - public Response viewExternalIdentifiers(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewExternalIdentifiers(orcid)); - } - - @Override - public Response viewExternalIdentifier(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewExternalIdentifier(orcid, putCode)); - } - - @Override - public Response viewBiography(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewBiography(orcid)); - } - - @Override - public Response viewKeywords(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewKeywords(orcid)); - } - - @Override - public Response viewKeyword(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewKeyword(orcid, putCode)); - } - - @Override - public Response viewAddresses(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewAddresses(orcid)); - } - - @Override - public Response viewAddress(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewAddress(orcid, putCode)); - } - - @Override - public Response viewPerson(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewPerson(orcid)); - } - - @Override - public Response viewRecord(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewRecord(orcid)); - } - - @Override - public Response searchByQuery(Map> solrParams) { - return processReponse(publicV3ApiServiceDelegator.searchByQuery(solrParams)); - } - - @Override - public Response searchByQueryCSV(Map> solrParams) { - return processReponse(publicV3ApiServiceDelegator.searchByQueryCSV(solrParams)); - } - - @Override - public Response expandedSearchByQuery(Map> solrParams) { - return processReponse(publicV3ApiServiceDelegator.expandedSearchByQuery(solrParams)); - } - - @Override - public Response viewBulkWorks(String orcid, String putCodes) { - return processReponse(publicV3ApiServiceDelegator.viewBulkWorks(orcid, putCodes)); - } - - @Override - public Response viewStatus() { - return publicV3ApiServiceDelegator.viewStatus(); - } - - @Override - public Response viewDistinction(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewDistinction(orcid, putCode)); - } - - @Override - public Response viewDistinctions(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewDistinctions(orcid)); - } - - @Override - public Response viewDistinctionSummary(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewDistinctionSummary(orcid, putCode)); - } - - @Override - public Response viewInvitedPosition(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewInvitedPosition(orcid, putCode)); - } - - @Override - public Response viewInvitedPositions(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewInvitedPositions(orcid)); - } - - @Override - public Response viewInvitedPositionSummary(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewInvitedPositionSummary(orcid, putCode)); - } - - @Override - public Response viewMembership(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewMembership(orcid, putCode)); - } - - @Override - public Response viewMemberships(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewMemberships(orcid)); - } - - @Override - public Response viewMembershipSummary(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewMembershipSummary(orcid, putCode)); - } - - @Override - public Response viewQualification(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewQualification(orcid, putCode)); - } - - @Override - public Response viewQualifications(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewQualifications(orcid)); - } - - @Override - public Response viewQualificationSummary(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewQualificationSummary(orcid, putCode)); - } - - @Override - public Response viewService(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewService(orcid, putCode)); - } - - @Override - public Response viewServices(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewServices(orcid)); - } - - @Override - public Response viewServiceSummary(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewServiceSummary(orcid, putCode)); - } - - @Override - public Response viewResearchResource(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewResearchResource(orcid, putCode)); - } - - @Override - public Response viewResearchResources(String orcid) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewResearchResources(orcid)); - } - - @Override - public Response viewResearchResourceSummary(String orcid, Long putCode) { - checkProfileStatus(orcid); - return processReponse(publicV3ApiServiceDelegator.viewResearchResourceSummary(orcid, putCode)); - } - - private Response processReponse(Response response) { - Object entity = response.getEntity(); - V3Convertible result = null; - if (entity != null) { - result = v3VersionConverterChain.upgrade(new V3Convertible(entity, PublicV3ApiServiceDelegator.LATEST_V3_VERSION), externalVersion); - return Response.fromResponse(response).entity(result.getObjectToConvert()).build(); - } - return response; - } - - private void checkProfileStatus(String orcid) { - try { - orcidSecurityManager.checkProfile(orcid); - } catch(DeactivatedException e) { - // Ignore the DeactivatedException since we should be able to return the empty element - } - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - public void setMemberV3ApiServiceDelegator(PublicV3ApiServiceDelegator publicV3ApiServiceDelegator) { - this.publicV3ApiServiceDelegator = publicV3ApiServiceDelegator; - } - - public String getExternalVersion() { - return externalVersion; - } - - public void setExternalVersion(String externalVersion) { - this.externalVersion = externalVersion; - } - - @Override - public Response viewClient(String clientId) { - return publicV3ApiServiceDelegator.viewClient(clientId); - } - -} diff --git a/orcid-scheduler-web/src/main/java/org/orcid/scheduler/web/event/EventStats.java b/orcid-scheduler-web/src/main/java/org/orcid/scheduler/web/event/EventStats.java index 91d6a941e82..0d83dcf5098 100644 --- a/orcid-scheduler-web/src/main/java/org/orcid/scheduler/web/event/EventStats.java +++ b/orcid-scheduler-web/src/main/java/org/orcid/scheduler/web/event/EventStats.java @@ -5,4 +5,8 @@ public interface EventStats { void saveEventStats(); void deleteEvents(); + + void savePapiEventStats(); + + void deletePapiEvents(); } diff --git a/orcid-scheduler-web/src/main/java/org/orcid/scheduler/web/event/impl/EventStatsImpl.java b/orcid-scheduler-web/src/main/java/org/orcid/scheduler/web/event/impl/EventStatsImpl.java index b77eac25a28..5087e88bbd2 100644 --- a/orcid-scheduler-web/src/main/java/org/orcid/scheduler/web/event/impl/EventStatsImpl.java +++ b/orcid-scheduler-web/src/main/java/org/orcid/scheduler/web/event/impl/EventStatsImpl.java @@ -23,12 +23,13 @@ public class EventStatsImpl implements EventStats { @Value("${org.orcid.scheduler.event.deleteEvents.numberOfDays:90}") private int DELETE_EVENTS_OLDER_THAN_DAYS; + + @Value("${org.orcid.scheduler.event.deletePapiEvents.numberOfDays:90}") + private int DELETE_PAPI_EVENTS_OLDER_THAN_DAYS; @Override public void saveEventStats() { - LocalDate date = LocalDate.now().minusDays(1); - String currentDate = date.getDayOfMonth() + "/" + date.getMonth() + "/" + date.getYear(); - LOGGER.info("Storing aggregate data to event_stats table of the day" + currentDate); + LOGGER.info("Storing aggregate data to event_stats table of the day " + getCurrentDate()); eventStatsDao.createEventStats(); } @@ -39,4 +40,25 @@ public void deleteEvents() { eventDao.deleteEventsByDate(DELETE_EVENTS_OLDER_THAN_DAYS); } } + + @Override + public void savePapiEventStats() { + if (Features.PAPI_EVENTS.isActive()) { + LOGGER.info("Storing aggregate data to event_stats table of the day " + getCurrentDate()); + eventStatsDao.createPapiEventStats(); + } + } + + @Override + public void deletePapiEvents() { + if (Features.PAPI_EVENTS.isActive()) { + LOGGER.info("Deleting events older than "+ DELETE_PAPI_EVENTS_OLDER_THAN_DAYS +" days"); + eventDao.deletePapiEvents(DELETE_PAPI_EVENTS_OLDER_THAN_DAYS); + } + } + + private String getCurrentDate() { + LocalDate date = LocalDate.now().minusDays(1); + return date.getDayOfMonth() + "/" + date.getMonth() + "/" + date.getYear(); + } } diff --git a/orcid-scheduler-web/src/main/resources/orcid-scheduler-context.xml b/orcid-scheduler-web/src/main/resources/orcid-scheduler-context.xml index 4c4af0b225a..0a3bf32b1ea 100644 --- a/orcid-scheduler-web/src/main/resources/orcid-scheduler-context.xml +++ b/orcid-scheduler-web/src/main/resources/orcid-scheduler-context.xml @@ -43,6 +43,8 @@ + + diff --git a/orcid-test/src/main/resources/data/EventEntityData.xml b/orcid-test/src/main/resources/data/EventEntityData.xml index 83aa14b811b..c2f5c16ebc5 100644 --- a/orcid-test/src/main/resources/data/EventEntityData.xml +++ b/orcid-test/src/main/resources/data/EventEntityData.xml @@ -18,4 +18,23 @@ date_created="2023-01-01 15:31:00.00" /> + + + + + + diff --git a/orcid-web/src/main/java/org/orcid/frontend/oauth2/OauthController.java b/orcid-web/src/main/java/org/orcid/frontend/oauth2/OauthController.java index a544d63b92f..8d39c939f21 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/oauth2/OauthController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/oauth2/OauthController.java @@ -23,13 +23,13 @@ import org.orcid.core.oauth.service.OrcidAuthorizationEndpoint; import org.orcid.core.oauth.service.OrcidOAuth2RequestValidator; import org.orcid.core.togglz.Features; -import org.orcid.core.utils.EventType; import org.orcid.frontend.web.controllers.BaseControllerUtil; import org.orcid.frontend.web.controllers.helper.OauthHelper; import org.orcid.frontend.web.exception.OauthInvalidRequestException; import org.orcid.jaxb.model.message.ScopePathType; import org.orcid.persistence.jpa.entities.ClientDetailsEntity; import org.orcid.persistence.jpa.entities.ClientGrantedAuthorityEntity; +import org.orcid.persistence.jpa.entities.EventType; import org.orcid.pojo.ajaxForm.PojoUtil; import org.orcid.pojo.ajaxForm.RequestInfoForm; import org.springframework.security.core.context.SecurityContext; diff --git a/orcid-web/src/main/java/org/orcid/frontend/spring/AjaxAuthenticationSuccessHandler.java b/orcid-web/src/main/java/org/orcid/frontend/spring/AjaxAuthenticationSuccessHandler.java index 599baf46329..46236b48987 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/spring/AjaxAuthenticationSuccessHandler.java +++ b/orcid-web/src/main/java/org/orcid/frontend/spring/AjaxAuthenticationSuccessHandler.java @@ -8,7 +8,7 @@ import org.orcid.core.common.manager.EventManager; import org.orcid.core.togglz.Features; -import org.orcid.core.utils.EventType; +import org.orcid.persistence.jpa.entities.EventType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; diff --git a/orcid-web/src/main/java/org/orcid/frontend/spring/ShibbolethAjaxAuthenticationSuccessHandler.java b/orcid-web/src/main/java/org/orcid/frontend/spring/ShibbolethAjaxAuthenticationSuccessHandler.java index c515ff5d4a1..767072bb6b5 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/spring/ShibbolethAjaxAuthenticationSuccessHandler.java +++ b/orcid-web/src/main/java/org/orcid/frontend/spring/ShibbolethAjaxAuthenticationSuccessHandler.java @@ -14,8 +14,8 @@ import org.orcid.core.common.manager.EventManager; import org.orcid.core.manager.InstitutionalSignInManager; import org.orcid.core.togglz.Features; -import org.orcid.core.utils.EventType; import org.orcid.frontend.web.exception.FeatureDisabledException; +import org.orcid.persistence.jpa.entities.EventType; import org.orcid.pojo.RemoteUser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/LoginController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/LoginController.java index 3184290f6f7..67485237aaa 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/LoginController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/LoginController.java @@ -24,7 +24,6 @@ import org.orcid.core.oauth.service.OrcidOAuth2RequestValidator; import org.orcid.core.security.OrcidUserDetailsService; import org.orcid.core.togglz.Features; -import org.orcid.core.utils.EventType; import org.orcid.frontend.spring.web.social.config.SocialSignInUtils; import org.orcid.frontend.spring.web.social.config.SocialType; import org.orcid.frontend.spring.web.social.config.UserCookieGenerator; @@ -33,6 +32,7 @@ import org.orcid.jaxb.model.v3.release.common.Visibility; import org.orcid.jaxb.model.v3.release.record.Name; import org.orcid.persistence.jpa.entities.ClientDetailsEntity; +import org.orcid.persistence.jpa.entities.EventType; import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.persistence.jpa.entities.UserconnectionEntity; import org.orcid.persistence.jpa.entities.UserconnectionPK; diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/OauthAuthorizeController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/OauthAuthorizeController.java index d1f258b4550..f1145848e5b 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/OauthAuthorizeController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/OauthAuthorizeController.java @@ -16,10 +16,10 @@ import org.orcid.core.oauth.OrcidProfileUserDetails; import org.orcid.core.oauth.OrcidRandomValueTokenServices; import org.orcid.core.togglz.Features; -import org.orcid.core.utils.EventType; import org.orcid.frontend.web.controllers.helper.OauthHelper; import org.orcid.jaxb.model.message.ScopePathType; import org.orcid.persistence.jpa.entities.ClientDetailsEntity; +import org.orcid.persistence.jpa.entities.EventType; import org.orcid.pojo.ajaxForm.OauthAuthorizeForm; import org.orcid.pojo.ajaxForm.PojoUtil; import org.orcid.pojo.ajaxForm.RequestInfoForm; diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/PublicRecordController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/PublicRecordController.java index 8ff400efbe6..1458506b188 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/PublicRecordController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/PublicRecordController.java @@ -44,7 +44,6 @@ import org.orcid.core.manager.v3.read_only.WorkManagerReadOnly; import org.orcid.core.oauth.OrcidOauth2TokenDetailService; import org.orcid.core.togglz.Features; -import org.orcid.core.utils.EventType; import org.orcid.core.utils.v3.SourceUtils; import org.orcid.frontend.web.pagination.Page; import org.orcid.frontend.web.pagination.ResearchResourcePaginator; @@ -62,6 +61,7 @@ import org.orcid.jaxb.model.v3.release.record.PersonExternalIdentifiers; import org.orcid.jaxb.model.v3.release.record.PersonalDetails; import org.orcid.jaxb.model.v3.release.record.ResearcherUrls; +import org.orcid.persistence.jpa.entities.EventType; import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.pojo.PeerReviewMinimizedSummary; import org.orcid.pojo.PublicRecord; diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/RegistrationController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/RegistrationController.java index 0ee568b55dd..2e51f201868 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/RegistrationController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/RegistrationController.java @@ -35,7 +35,6 @@ import org.orcid.core.profile.history.ProfileHistoryEventType; import org.orcid.core.security.OrcidUserDetailsService; import org.orcid.core.togglz.Features; -import org.orcid.core.utils.EventType; import org.orcid.core.utils.OrcidRequestUtil; import org.orcid.core.utils.OrcidStringUtils; import org.orcid.frontend.email.RecordEmailSender; @@ -49,6 +48,7 @@ import org.orcid.jaxb.model.v3.release.common.Visibility; import org.orcid.jaxb.model.v3.release.record.AffiliationType; import org.orcid.persistence.constants.SendEmailFrequency; +import org.orcid.persistence.jpa.entities.EventType; import org.orcid.pojo.Redirect; import org.orcid.pojo.ajaxForm.AffiliationForm; import org.orcid.pojo.ajaxForm.Date; diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/ShibbolethController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/ShibbolethController.java index 818670ab8f6..af640fa637a 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/ShibbolethController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/ShibbolethController.java @@ -22,9 +22,9 @@ import org.orcid.core.oauth.OrcidProfileUserDetails; import org.orcid.core.security.OrcidUserDetailsService; import org.orcid.core.togglz.Features; -import org.orcid.core.utils.EventType; import org.orcid.core.utils.JsonUtils; import org.orcid.frontend.web.exception.FeatureDisabledException; +import org.orcid.persistence.jpa.entities.EventType; import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.persistence.jpa.entities.UserConnectionStatus; import org.orcid.persistence.jpa.entities.UserconnectionEntity; From e06eeb50f775a932a89b78e2ac42f32f6c3a8ccd Mon Sep 17 00:00:00 2001 From: github actions Date: Thu, 4 Apr 2024 01:47:38 +0000 Subject: [PATCH 10/10] v2.57.2 changelog update --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a08b59d5944..ac758ab27a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## v2.57.2 - 2024-04-04 + +[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.57.1...v2.57.2) + +### Feature + +- Start collection daily pub api stats (#7016) + ## v2.57.1 - 2024-04-03 [Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.57.0...v2.57.1)