From a290129ba0318b4956023632abacd2027dc65f14 Mon Sep 17 00:00:00 2001 From: Camelia Dumitru <62257307+Camelia-Orcid@users.noreply.github.com> Date: Wed, 28 Aug 2024 01:07:25 +0100 Subject: [PATCH] Refactor the code to include the DateUtils under orcid-utils package (#7071) * Refactor the code to include the DateUtils under orcid-utils package * Refactored StringUtils from core and persistence packages under utils --------- Co-authored-by: Angel Montenegro --- .../common/filter/ApiVersionCheckFilter.java | 2 +- .../filter/DefaultApiVersionFilter.java | 2 +- .../api/common/filter/TokenTargetFilter.java | 2 +- .../api/common/jaxb/OrcidExceptionMapper.java | 4 +- .../oauth/RevokeTokenEndpointFilter.java | 2 +- .../NotificationsApiServiceDelegatorImpl.java | 2 +- ...erviceDelegator_ActivitiesSummaryTest.java | 2 +- ...mberV2ApiServiceDelegator_GroupIdTest.java | 2 +- ...MemberV2ApiServiceDelegator_WorksTest.java | 2 +- ...erviceDelegator_ActivitiesSummaryTest.java | 2 +- ...mberV3ApiServiceDelegator_GroupIdTest.java | 2 +- ...MemberV3ApiServiceDelegator_WorksTest.java | 2 +- orcid-core/pom.xml | 7 +- .../adapter/impl/MapperFacadeFactory.java | 2 +- .../core/aop/ProfileLastModifiedAspect.java | 2 +- .../core/cli/CreateNewClientSecrets.java | 4 +- .../core/cli/DeleteWorkByIdentifier.java | 2 +- .../cli/FindGroupsWithMixedVisibility.java | 2 +- .../org/orcid/core/cli/ReindexProfiles.java | 2 +- .../core/cli/anonymize/AnonymizeText.java | 2 +- .../core/cli/anonymize/WorkPojoFromCsv.java | 2 +- .../orcid/core/locale/LocaleManagerImpl.java | 2 +- .../manager/impl/EncryptionManagerImpl.java | 2 +- .../impl/GroupIdRecordManagerImpl.java | 2 +- .../impl/OrcidSecurityManagerImpl.java | 2 +- .../core/manager/impl/OrgManagerImpl.java | 2 +- .../impl/BiographyManagerReadOnlyImpl.java | 2 +- .../PersonalDetailsManagerReadOnlyImpl.java | 2 +- .../impl/RecordManagerReadOnlyImpl.java | 2 +- .../v3/impl/GroupIdRecordManagerImpl.java | 2 +- .../manager/v3/impl/MembersManagerImpl.java | 2 +- .../v3/impl/OrcidSecurityManagerImpl.java | 2 +- .../impl/BiographyManagerReadOnlyImpl.java | 2 +- .../impl/EmailManagerReadOnlyImpl.java | 2 +- .../GivenPermissionToManagerReadOnlyImpl.java | 2 +- .../PersonalDetailsManagerReadOnlyImpl.java | 2 +- .../impl/RecordManagerReadOnlyImpl.java | 2 +- .../v3/validator/ActivityValidator.java | 2 +- .../manager/validator/ActivityValidator.java | 2 +- .../orcid/core/orgs/grouping/OrgGrouping.java | 2 +- .../security/DefaultPermissionChecker.java | 2 +- .../security/OrcidUserDetailsServiceImpl.java | 2 +- .../java/org/orcid/core/utils/DateUtils.java | 162 ------------------ .../orcid/core/utils/PasswordResetToken.java | 3 + .../orcid/core/utils/ReleaseNameUtils.java | 2 + .../orcid/core/utils/VerifyEmailUtils.java | 2 + .../core/utils/VerifyRegistrationToken.java | 2 +- .../v3/identifiers/resolvers/DOIResolver.java | 2 +- .../orcid/pojo/ajaxForm/AffiliationForm.java | 2 +- .../java/org/orcid/pojo/ajaxForm/Date.java | 2 +- .../org/orcid/pojo/ajaxForm/KeywordForm.java | 2 +- .../java/org/orcid/pojo/ajaxForm/Text.java | 2 +- .../org/orcid/pojo/ajaxForm/WorkForm.java | 4 +- ...orkExternalIdentifiersConverterV2Test.java | 2 +- ...orkExternalIdentifiersConverterV3Test.java | 2 +- .../v2/latest/JpaJaxbAddressAdapterTest.java | 2 +- .../latest/JpaJaxbEducationAdapterTest.java | 2 +- .../v2/latest/JpaJaxbEmailAdapterTest.java | 2 +- .../latest/JpaJaxbEmploymentAdapterTest.java | 2 +- .../JpaJaxbExternalIdentifierAdapterTest.java | 2 +- .../v2/latest/JpaJaxbFundingAdapterTest.java | 2 +- .../v2/latest/JpaJaxbKeywordAdapterTest.java | 2 +- .../v2/latest/JpaJaxbNameAdapterTest.java | 2 +- .../JpaJaxbNotificationAdapterTest.java | 2 +- .../latest/JpaJaxbOtherNameAdapterTest.java | 2 +- .../latest/JpaJaxbPeerReviewAdapterTest.java | 2 +- .../JpaJaxbResearcherUrlAdapterTest.java | 2 +- .../v2/latest/JpaJaxbWorkAdapterTest.java | 2 +- .../adapter/v3/JpaJaxbAddressAdapterTest.java | 2 +- .../adapter/v3/JpaJaxbClientAdapterTest.java | 2 +- .../v3/JpaJaxbDistinctionAdapterTest.java | 2 +- .../v3/JpaJaxbEducationAdapterTest.java | 2 +- .../adapter/v3/JpaJaxbEmailAdapterTest.java | 2 +- .../v3/JpaJaxbEmploymentAdapterTest.java | 2 +- .../JpaJaxbExternalIdentifierAdapterTest.java | 2 +- .../adapter/v3/JpaJaxbFundingAdapterTest.java | 2 +- .../v3/JpaJaxbInvitedPositionAdapterTest.java | 2 +- .../adapter/v3/JpaJaxbKeywordAdapterTest.java | 2 +- .../v3/JpaJaxbMembershipAdapterTest.java | 2 +- .../adapter/v3/JpaJaxbNameAdapterTest.java | 2 +- .../v3/JpaJaxbNotificationAdapterTest.java | 2 +- .../v3/JpaJaxbOtherNameAdapterTest.java | 2 +- .../v3/JpaJaxbPeerReviewAdapterTest.java | 2 +- .../v3/JpaJaxbQualificationAdapterTest.java | 2 +- .../JpaJaxbResearchResourceAdapterTest.java | 2 +- .../v3/JpaJaxbResearcherUrlAdapterTest.java | 2 +- .../adapter/v3/JpaJaxbServiceAdapterTest.java | 2 +- .../adapter/v3/JpaJaxbWorkAdapterTest.java | 2 +- .../impl/RegistrationManagerImplTest.java | 2 +- .../core/manager/v3/EmailManagerTest.java | 2 +- .../core/manager/v3/MembersManagerTest.java | 2 +- .../org/orcid/core/utils/DateUtilsTest.java | 2 +- .../core/utils/OrcidStringUtilsTest.java | 2 +- .../ajaxForm/AffiliationFormTestBase.java | 2 +- .../org/orcid/pojo/ajaxForm/PojoUtilTest.java | 2 +- orcid-persistence/pom.xml | 7 +- .../jpa/entities/BaseContributorEntity.java | 10 +- .../jpa/entities/ClientSecretEntity.java | 4 +- .../OrgAffiliationRelationEntity.java | 26 +-- .../jpa/entities/PeerReviewEntity.java | 11 +- .../jpa/entities/ProfileFundingEntity.java | 21 +-- .../persistence/util/OrcidStringUtils.java | 53 ------ .../autospam/cli/AutoLockSpamRecords.java | 3 +- .../scheduler/email/cli/SendBadOrgsEmail.java | 2 +- .../cli/manager/EmailMessageSenderTest.java | 2 +- orcid-utils/pom.xml | 8 + .../main/java/org/orcid}/utils/NullUtils.java | 2 +- .../org/orcid}/utils/OrcidStringUtils.java | 6 +- .../frontend/cli/AutoLockSpamRecords.java | 2 +- .../spring/OrcidAuthenticationProvider.java | 2 +- .../web/controllers/AdminController.java | 2 +- .../web/controllers/BaseController.java | 2 +- .../web/controllers/ClaimController.java | 2 +- .../web/controllers/ClientsController.java | 2 +- .../controllers/DeveloperToolsController.java | 2 +- .../controllers/EmailDomainController.java | 2 +- .../web/controllers/HomeController.java | 2 +- .../controllers/ManageProfileController.java | 2 +- .../OauthRegistrationController.java | 2 +- .../controllers/PasswordResetController.java | 2 +- .../controllers/RegistrationController.java | 2 +- .../web/controllers/SpamController.java | 2 +- .../web/controllers/helper/OauthHelper.java | 2 +- .../orcid/pojo/ajaxForm/WorkFormTest.java | 2 +- .../ManageProfileControllerTest.java | 2 +- 125 files changed, 174 insertions(+), 377 deletions(-) delete mode 100644 orcid-core/src/main/java/org/orcid/core/utils/DateUtils.java delete mode 100644 orcid-persistence/src/main/java/org/orcid/persistence/util/OrcidStringUtils.java rename {orcid-core/src/main/java/org/orcid/core => orcid-utils/src/main/java/org/orcid}/utils/NullUtils.java (97%) rename {orcid-core/src/main/java/org/orcid/core => orcid-utils/src/main/java/org/orcid}/utils/OrcidStringUtils.java (96%) diff --git a/orcid-api-common/src/main/java/org/orcid/api/common/filter/ApiVersionCheckFilter.java b/orcid-api-common/src/main/java/org/orcid/api/common/filter/ApiVersionCheckFilter.java index c3716a70a82..dd04afa2a40 100644 --- a/orcid-api-common/src/main/java/org/orcid/api/common/filter/ApiVersionCheckFilter.java +++ b/orcid-api-common/src/main/java/org/orcid/api/common/filter/ApiVersionCheckFilter.java @@ -12,8 +12,8 @@ import org.orcid.core.exception.OrcidBadRequestException; import org.orcid.core.locale.LocaleManager; import org.orcid.core.manager.impl.OrcidUrlManager; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.pojo.ajaxForm.PojoUtil; +import org.orcid.utils.OrcidStringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMethod; diff --git a/orcid-api-common/src/main/java/org/orcid/api/common/filter/DefaultApiVersionFilter.java b/orcid-api-common/src/main/java/org/orcid/api/common/filter/DefaultApiVersionFilter.java index 1850c50e5d4..bd7538716d8 100644 --- a/orcid-api-common/src/main/java/org/orcid/api/common/filter/DefaultApiVersionFilter.java +++ b/orcid-api-common/src/main/java/org/orcid/api/common/filter/DefaultApiVersionFilter.java @@ -22,9 +22,9 @@ import org.orcid.core.manager.impl.OrcidUrlManager; import org.orcid.core.togglz.Features; import org.orcid.core.utils.JsonUtils; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.jaxb.model.v3.release.error.OrcidError; import org.orcid.pojo.ajaxForm.PojoUtil; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.filter.OncePerRequestFilter; diff --git a/orcid-api-common/src/main/java/org/orcid/api/common/filter/TokenTargetFilter.java b/orcid-api-common/src/main/java/org/orcid/api/common/filter/TokenTargetFilter.java index 43a523d48c5..dd367992c82 100644 --- a/orcid-api-common/src/main/java/org/orcid/api/common/filter/TokenTargetFilter.java +++ b/orcid-api-common/src/main/java/org/orcid/api/common/filter/TokenTargetFilter.java @@ -11,7 +11,7 @@ import org.orcid.core.exception.OrcidUnauthorizedException; import org.orcid.core.oauth.OrcidOauth2TokenDetailService; import org.orcid.persistence.jpa.entities.ProfileEntity; -import org.orcid.core.utils.OrcidStringUtils; +import org.orcid.utils.OrcidStringUtils; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder; 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 8819b3422f5..0c0621161b0 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 @@ -27,8 +27,8 @@ import org.orcid.core.manager.impl.OrcidUrlManager; import org.orcid.core.oauth.OAuthError; import org.orcid.core.oauth.OAuthErrorUtils; -import org.orcid.core.utils.DateUtils; -import org.orcid.core.utils.OrcidStringUtils; +import org.orcid.utils.DateUtils; +import org.orcid.utils.OrcidStringUtils; import org.orcid.core.version.ApiSection; import org.orcid.jaxb.model.message.DeprecatedDate; import org.orcid.jaxb.model.message.ErrorDesc; diff --git a/orcid-api-common/src/main/java/org/orcid/api/common/security/oauth/RevokeTokenEndpointFilter.java b/orcid-api-common/src/main/java/org/orcid/api/common/security/oauth/RevokeTokenEndpointFilter.java index af5bfb02083..be3f6fae8a4 100644 --- a/orcid-api-common/src/main/java/org/orcid/api/common/security/oauth/RevokeTokenEndpointFilter.java +++ b/orcid-api-common/src/main/java/org/orcid/api/common/security/oauth/RevokeTokenEndpointFilter.java @@ -11,7 +11,7 @@ import javax.servlet.http.HttpServletResponse; import org.orcid.core.locale.LocaleManager; -import org.orcid.core.utils.OrcidStringUtils; +import org.orcid.utils.OrcidStringUtils; import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; diff --git a/orcid-api-web/src/main/java/org/orcid/api/notificationsV2/server/delegator/impl/NotificationsApiServiceDelegatorImpl.java b/orcid-api-web/src/main/java/org/orcid/api/notificationsV2/server/delegator/impl/NotificationsApiServiceDelegatorImpl.java index 7afee08a401..0e80bada0a4 100644 --- a/orcid-api-web/src/main/java/org/orcid/api/notificationsV2/server/delegator/impl/NotificationsApiServiceDelegatorImpl.java +++ b/orcid-api-web/src/main/java/org/orcid/api/notificationsV2/server/delegator/impl/NotificationsApiServiceDelegatorImpl.java @@ -31,7 +31,7 @@ import org.orcid.jaxb.model.notification.permission_v2.NotificationPermission; import org.orcid.jaxb.model.notification_v2.Notification; import org.orcid.persistence.jpa.entities.ProfileEntity; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; diff --git a/orcid-api-web/src/test/java/org/orcid/api/memberV2/server/delegator/MemberV2ApiServiceDelegator_ActivitiesSummaryTest.java b/orcid-api-web/src/test/java/org/orcid/api/memberV2/server/delegator/MemberV2ApiServiceDelegator_ActivitiesSummaryTest.java index d596268390f..9143d0ea9a8 100644 --- a/orcid-api-web/src/test/java/org/orcid/api/memberV2/server/delegator/MemberV2ApiServiceDelegator_ActivitiesSummaryTest.java +++ b/orcid-api-web/src/test/java/org/orcid/api/memberV2/server/delegator/MemberV2ApiServiceDelegator_ActivitiesSummaryTest.java @@ -51,7 +51,7 @@ import org.orcid.test.DBUnitTest; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.test.helper.Utils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; @RunWith(OrcidJUnit4ClassRunner.class) diff --git a/orcid-api-web/src/test/java/org/orcid/api/memberV2/server/delegator/MemberV2ApiServiceDelegator_GroupIdTest.java b/orcid-api-web/src/test/java/org/orcid/api/memberV2/server/delegator/MemberV2ApiServiceDelegator_GroupIdTest.java index f2e4f0d25e3..7287af89772 100644 --- a/orcid-api-web/src/test/java/org/orcid/api/memberV2/server/delegator/MemberV2ApiServiceDelegator_GroupIdTest.java +++ b/orcid-api-web/src/test/java/org/orcid/api/memberV2/server/delegator/MemberV2ApiServiceDelegator_GroupIdTest.java @@ -49,7 +49,7 @@ import org.orcid.test.DBUnitTest; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.test.helper.Utils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.util.ReflectionTestUtils; diff --git a/orcid-api-web/src/test/java/org/orcid/api/memberV2/server/delegator/MemberV2ApiServiceDelegator_WorksTest.java b/orcid-api-web/src/test/java/org/orcid/api/memberV2/server/delegator/MemberV2ApiServiceDelegator_WorksTest.java index 4b07fa959f3..ee0ab2c8a08 100644 --- a/orcid-api-web/src/test/java/org/orcid/api/memberV2/server/delegator/MemberV2ApiServiceDelegator_WorksTest.java +++ b/orcid-api-web/src/test/java/org/orcid/api/memberV2/server/delegator/MemberV2ApiServiceDelegator_WorksTest.java @@ -75,7 +75,7 @@ import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.test.TargetProxyHelper; import org.orcid.test.helper.Utils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.test.context.ContextConfiguration; diff --git a/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator_ActivitiesSummaryTest.java b/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator_ActivitiesSummaryTest.java index be20e8d4250..f21cdb6c516 100644 --- a/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator_ActivitiesSummaryTest.java +++ b/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator_ActivitiesSummaryTest.java @@ -19,7 +19,7 @@ import org.junit.runner.RunWith; import org.orcid.api.common.util.v3.ActivityUtils; import org.orcid.core.exception.OrcidUnauthorizedException; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.orcid.core.utils.SecurityContextTestUtils; import org.orcid.jaxb.model.groupid_v2.GroupIdRecord; import org.orcid.jaxb.model.message.ScopePathType; diff --git a/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator_GroupIdTest.java b/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator_GroupIdTest.java index c30dfd7eb4e..bdeb4db805f 100644 --- a/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator_GroupIdTest.java +++ b/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator_GroupIdTest.java @@ -55,7 +55,7 @@ import org.orcid.test.DBUnitTest; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.test.helper.v3.Utils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.util.ReflectionTestUtils; diff --git a/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator_WorksTest.java b/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator_WorksTest.java index 9bc2e126f35..66bfe400818 100644 --- a/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator_WorksTest.java +++ b/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator_WorksTest.java @@ -81,7 +81,7 @@ import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.test.TargetProxyHelper; import org.orcid.test.helper.v3.Utils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.test.context.ContextConfiguration; diff --git a/orcid-core/pom.xml b/orcid-core/pom.xml index ba336b43cd6..ece6526400d 100644 --- a/orcid-core/pom.xml +++ b/orcid-core/pom.xml @@ -316,12 +316,7 @@ 2.0.1 - - - org.jsoup - jsoup - 1.15.4 - + javax.ws.rs diff --git a/orcid-core/src/main/java/org/orcid/core/adapter/impl/MapperFacadeFactory.java b/orcid-core/src/main/java/org/orcid/core/adapter/impl/MapperFacadeFactory.java index a68bf4f3b55..734a95b7d2c 100644 --- a/orcid-core/src/main/java/org/orcid/core/adapter/impl/MapperFacadeFactory.java +++ b/orcid-core/src/main/java/org/orcid/core/adapter/impl/MapperFacadeFactory.java @@ -110,7 +110,7 @@ import org.orcid.persistence.jpa.entities.StartDateEntity; import org.orcid.persistence.jpa.entities.WorkEntity; import org.orcid.pojo.ajaxForm.PojoUtil; -import org.orcid.core.utils.OrcidStringUtils; +import org.orcid.utils.OrcidStringUtils; import org.springframework.beans.factory.FactoryBean; import ma.glasnost.orika.CustomMapper; diff --git a/orcid-core/src/main/java/org/orcid/core/aop/ProfileLastModifiedAspect.java b/orcid-core/src/main/java/org/orcid/core/aop/ProfileLastModifiedAspect.java index d7d43cd04a3..dfa98e251f1 100644 --- a/orcid-core/src/main/java/org/orcid/core/aop/ProfileLastModifiedAspect.java +++ b/orcid-core/src/main/java/org/orcid/core/aop/ProfileLastModifiedAspect.java @@ -12,7 +12,7 @@ import org.orcid.persistence.dao.ProfileLastModifiedDao; import org.orcid.persistence.jpa.entities.IndexingStatus; import org.orcid.persistence.jpa.entities.OrcidAware; -import org.orcid.persistence.util.OrcidStringUtils; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; diff --git a/orcid-core/src/main/java/org/orcid/core/cli/CreateNewClientSecrets.java b/orcid-core/src/main/java/org/orcid/core/cli/CreateNewClientSecrets.java index 81982a58ef1..21b69a3b35e 100644 --- a/orcid-core/src/main/java/org/orcid/core/cli/CreateNewClientSecrets.java +++ b/orcid-core/src/main/java/org/orcid/core/cli/CreateNewClientSecrets.java @@ -18,8 +18,8 @@ import org.orcid.core.manager.EncryptionManager; import org.orcid.persistence.jpa.entities.ClientDetailsEntity; import org.orcid.persistence.jpa.entities.ClientSecretEntity; -import org.orcid.core.utils.DateUtils; -import org.orcid.core.utils.NullUtils; +import org.orcid.utils.DateUtils; +import org.orcid.utils.NullUtils; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.transaction.TransactionStatus; diff --git a/orcid-core/src/main/java/org/orcid/core/cli/DeleteWorkByIdentifier.java b/orcid-core/src/main/java/org/orcid/core/cli/DeleteWorkByIdentifier.java index b99428f5223..8d9a137942e 100644 --- a/orcid-core/src/main/java/org/orcid/core/cli/DeleteWorkByIdentifier.java +++ b/orcid-core/src/main/java/org/orcid/core/cli/DeleteWorkByIdentifier.java @@ -13,7 +13,7 @@ import org.kohsuke.args4j.Option; import org.orcid.persistence.dao.GenericDao; import org.orcid.persistence.jpa.entities.WorkEntity; -import org.orcid.core.utils.NullUtils; +import org.orcid.utils.NullUtils; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; diff --git a/orcid-core/src/main/java/org/orcid/core/cli/FindGroupsWithMixedVisibility.java b/orcid-core/src/main/java/org/orcid/core/cli/FindGroupsWithMixedVisibility.java index f18bd3c52c2..1af2280d9fc 100644 --- a/orcid-core/src/main/java/org/orcid/core/cli/FindGroupsWithMixedVisibility.java +++ b/orcid-core/src/main/java/org/orcid/core/cli/FindGroupsWithMixedVisibility.java @@ -17,7 +17,7 @@ import org.orcid.jaxb.model.v3.release.record.summary.WorkGroup; import org.orcid.jaxb.model.v3.release.record.summary.WorkSummary; import org.orcid.jaxb.model.v3.release.record.summary.Works; -import org.orcid.core.utils.NullUtils; +import org.orcid.utils.NullUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.ApplicationContext; diff --git a/orcid-core/src/main/java/org/orcid/core/cli/ReindexProfiles.java b/orcid-core/src/main/java/org/orcid/core/cli/ReindexProfiles.java index e16b76be217..0aff903a704 100644 --- a/orcid-core/src/main/java/org/orcid/core/cli/ReindexProfiles.java +++ b/orcid-core/src/main/java/org/orcid/core/cli/ReindexProfiles.java @@ -12,7 +12,7 @@ import org.kohsuke.args4j.Option; import org.orcid.persistence.dao.ProfileDao; import org.orcid.persistence.jpa.entities.IndexingStatus; -import org.orcid.core.utils.NullUtils; +import org.orcid.utils.NullUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.ApplicationContext; diff --git a/orcid-core/src/main/java/org/orcid/core/cli/anonymize/AnonymizeText.java b/orcid-core/src/main/java/org/orcid/core/cli/anonymize/AnonymizeText.java index ea28eb8ed9f..339640ce691 100644 --- a/orcid-core/src/main/java/org/orcid/core/cli/anonymize/AnonymizeText.java +++ b/orcid-core/src/main/java/org/orcid/core/cli/anonymize/AnonymizeText.java @@ -18,8 +18,8 @@ import org.orcid.jaxb.model.v3.release.record.WorkContributors; import org.orcid.pojo.ajaxForm.ActivityExternalIdentifier; import org.orcid.pojo.ajaxForm.PojoUtil; +import org.orcid.utils.OrcidStringUtils; import org.orcid.core.contributors.roles.works.WorkContributorRoleConverter; -import org.orcid.core.utils.OrcidStringUtils; public class AnonymizeText { diff --git a/orcid-core/src/main/java/org/orcid/core/cli/anonymize/WorkPojoFromCsv.java b/orcid-core/src/main/java/org/orcid/core/cli/anonymize/WorkPojoFromCsv.java index fda52399b77..02a1ef512f1 100644 --- a/orcid-core/src/main/java/org/orcid/core/cli/anonymize/WorkPojoFromCsv.java +++ b/orcid-core/src/main/java/org/orcid/core/cli/anonymize/WorkPojoFromCsv.java @@ -12,7 +12,7 @@ import org.orcid.jaxb.model.v3.release.record.ExternalIDs; import org.orcid.jaxb.model.v3.release.record.Work; import org.orcid.pojo.ajaxForm.PojoUtil; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/orcid-core/src/main/java/org/orcid/core/locale/LocaleManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/locale/LocaleManagerImpl.java index 3a1b714962f..57d34c40fc2 100644 --- a/orcid-core/src/main/java/org/orcid/core/locale/LocaleManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/locale/LocaleManagerImpl.java @@ -11,8 +11,8 @@ import org.orcid.core.manager.CountryManager; import org.orcid.jaxb.model.message.OrcidProfile; import org.orcid.persistence.jpa.entities.CountryIsoEntity; +import org.orcid.utils.OrcidStringUtils; import org.orcid.core.utils.FunctionsOverCollections; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.core.utils.UTF8Control; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.Cacheable; diff --git a/orcid-core/src/main/java/org/orcid/core/manager/impl/EncryptionManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/impl/EncryptionManagerImpl.java index a7d01787b36..5288c614584 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/impl/EncryptionManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/impl/EncryptionManagerImpl.java @@ -11,7 +11,7 @@ import org.orcid.core.crypto.DesEncrypter; import org.orcid.core.manager.EncryptionManager; import org.orcid.pojo.ajaxForm.PojoUtil; -import org.orcid.core.utils.OrcidStringUtils; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.InitializingBean; diff --git a/orcid-core/src/main/java/org/orcid/core/manager/impl/GroupIdRecordManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/impl/GroupIdRecordManagerImpl.java index 7eb87b7ad89..62ede48ca9c 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/impl/GroupIdRecordManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/impl/GroupIdRecordManagerImpl.java @@ -22,7 +22,7 @@ import org.orcid.jaxb.model.groupid_v2.GroupIdRecord; import org.orcid.persistence.jpa.entities.GroupIdRecordEntity; import org.orcid.persistence.jpa.entities.SourceEntity; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; diff --git a/orcid-core/src/main/java/org/orcid/core/manager/impl/OrcidSecurityManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/impl/OrcidSecurityManagerImpl.java index 039defb9604..2011545cc1d 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/impl/OrcidSecurityManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/impl/OrcidSecurityManagerImpl.java @@ -56,7 +56,7 @@ import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.persistence.jpa.entities.SourceAwareEntity; import org.orcid.persistence.jpa.entities.SourceEntity; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; diff --git a/orcid-core/src/main/java/org/orcid/core/manager/impl/OrgManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/impl/OrgManagerImpl.java index 5380f32da8c..4ba3bbc03ba 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/impl/OrgManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/impl/OrgManagerImpl.java @@ -9,7 +9,6 @@ import org.orcid.core.manager.OrgManager; import org.orcid.core.manager.SourceManager; import org.orcid.core.manager.read_only.ClientDetailsManagerReadOnly; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.jaxb.model.common_v2.OrganizationHolder; import org.orcid.jaxb.model.message.Iso3166Country; import org.orcid.jaxb.model.message.Organization; @@ -21,6 +20,7 @@ import org.orcid.persistence.jpa.entities.OrgEntity; import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.persistence.jpa.entities.SourceEntity; +import org.orcid.utils.OrcidStringUtils; import au.com.bytecode.opencsv.CSVWriter; diff --git a/orcid-core/src/main/java/org/orcid/core/manager/read_only/impl/BiographyManagerReadOnlyImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/read_only/impl/BiographyManagerReadOnlyImpl.java index f6867309ef5..1092c82abc7 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/read_only/impl/BiographyManagerReadOnlyImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/read_only/impl/BiographyManagerReadOnlyImpl.java @@ -7,7 +7,7 @@ import org.orcid.jaxb.model.record_v2.Biography; import org.orcid.persistence.dao.BiographyDao; import org.orcid.persistence.jpa.entities.BiographyEntity; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/orcid-core/src/main/java/org/orcid/core/manager/read_only/impl/PersonalDetailsManagerReadOnlyImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/read_only/impl/PersonalDetailsManagerReadOnlyImpl.java index 1d6f5f7881a..502ac65d179 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/read_only/impl/PersonalDetailsManagerReadOnlyImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/read_only/impl/PersonalDetailsManagerReadOnlyImpl.java @@ -15,7 +15,7 @@ import org.orcid.jaxb.model.record_v2.OtherName; import org.orcid.jaxb.model.record_v2.OtherNames; import org.orcid.jaxb.model.record_v2.PersonalDetails; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; /** * diff --git a/orcid-core/src/main/java/org/orcid/core/manager/read_only/impl/RecordManagerReadOnlyImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/read_only/impl/RecordManagerReadOnlyImpl.java index 2bef77bf706..d797f3f5fb0 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/read_only/impl/RecordManagerReadOnlyImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/read_only/impl/RecordManagerReadOnlyImpl.java @@ -28,7 +28,7 @@ import org.orcid.jaxb.model.record_v2.SubmissionDate; import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.pojo.ajaxForm.PojoUtil; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/GroupIdRecordManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/GroupIdRecordManagerImpl.java index 82f7435983a..9e75ee8e5dc 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/GroupIdRecordManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/GroupIdRecordManagerImpl.java @@ -22,7 +22,7 @@ import org.orcid.jaxb.model.v3.release.groupid.GroupIdRecord; import org.orcid.persistence.jpa.entities.GroupIdRecordEntity; import org.orcid.persistence.jpa.entities.SourceEntity; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; diff --git a/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/MembersManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/MembersManagerImpl.java index 93ecee8648c..57d0cc675cb 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/MembersManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/MembersManagerImpl.java @@ -24,7 +24,6 @@ import org.orcid.core.manager.v3.SourceManager; import org.orcid.core.manager.v3.read_only.ClientManagerReadOnly; import org.orcid.core.security.OrcidWebRole; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.jaxb.model.clientgroup.ClientType; import org.orcid.jaxb.model.clientgroup.MemberType; import org.orcid.jaxb.model.message.CreationMethod; @@ -47,6 +46,7 @@ import org.orcid.pojo.ajaxForm.Member; import org.orcid.pojo.ajaxForm.PojoUtil; import org.orcid.pojo.ajaxForm.Text; +import org.orcid.utils.OrcidStringUtils; import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.support.TransactionCallbackWithoutResult; diff --git a/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/OrcidSecurityManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/OrcidSecurityManagerImpl.java index 5067b4195e3..49d2a35ec90 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/OrcidSecurityManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/OrcidSecurityManagerImpl.java @@ -63,7 +63,7 @@ import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.persistence.jpa.entities.SourceAwareEntity; import org.orcid.persistence.jpa.entities.SourceEntity; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; diff --git a/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/BiographyManagerReadOnlyImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/BiographyManagerReadOnlyImpl.java index b6424478255..d5b593fa2bc 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/BiographyManagerReadOnlyImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/BiographyManagerReadOnlyImpl.java @@ -7,7 +7,7 @@ import org.orcid.jaxb.model.v3.release.record.Biography; import org.orcid.persistence.dao.BiographyDao; import org.orcid.persistence.jpa.entities.BiographyEntity; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/EmailManagerReadOnlyImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/EmailManagerReadOnlyImpl.java index d564337e081..6dbf3888dd9 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/EmailManagerReadOnlyImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/EmailManagerReadOnlyImpl.java @@ -24,7 +24,7 @@ import org.orcid.persistence.jpa.entities.EmailEntity; import org.orcid.pojo.EmailFrequencyOptions; import org.orcid.pojo.ajaxForm.PojoUtil; -import org.orcid.core.utils.OrcidStringUtils; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/GivenPermissionToManagerReadOnlyImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/GivenPermissionToManagerReadOnlyImpl.java index 9407f53275d..bff0477f981 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/GivenPermissionToManagerReadOnlyImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/GivenPermissionToManagerReadOnlyImpl.java @@ -13,7 +13,7 @@ import org.orcid.persistence.jpa.entities.GivenPermissionToEntity; import org.orcid.pojo.DelegateForm; import org.orcid.pojo.ajaxForm.Text; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.cache.annotation.Cacheable; public class GivenPermissionToManagerReadOnlyImpl extends ManagerReadOnlyBaseImpl implements GivenPermissionToManagerReadOnly { diff --git a/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/PersonalDetailsManagerReadOnlyImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/PersonalDetailsManagerReadOnlyImpl.java index ac425f95c8f..fec622b2869 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/PersonalDetailsManagerReadOnlyImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/PersonalDetailsManagerReadOnlyImpl.java @@ -15,7 +15,7 @@ import org.orcid.jaxb.model.v3.release.record.OtherName; import org.orcid.jaxb.model.v3.release.record.OtherNames; import org.orcid.jaxb.model.v3.release.record.PersonalDetails; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; /** * diff --git a/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/RecordManagerReadOnlyImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/RecordManagerReadOnlyImpl.java index c10ca1e3ad0..efb9a5bcba7 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/RecordManagerReadOnlyImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/RecordManagerReadOnlyImpl.java @@ -9,7 +9,7 @@ import org.orcid.core.manager.v3.read_only.EmailManagerReadOnly; import org.orcid.core.manager.v3.read_only.PersonDetailsManagerReadOnly; import org.orcid.core.manager.v3.read_only.RecordManagerReadOnly; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.orcid.core.utils.SourceEntityUtils; import org.orcid.jaxb.model.common.AvailableLocales; import org.orcid.jaxb.model.common.OrcidType; diff --git a/orcid-core/src/main/java/org/orcid/core/manager/v3/validator/ActivityValidator.java b/orcid-core/src/main/java/org/orcid/core/manager/v3/validator/ActivityValidator.java index b0d4fdbbe66..2740e0e3cbe 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/v3/validator/ActivityValidator.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/v3/validator/ActivityValidator.java @@ -68,7 +68,7 @@ import org.orcid.jaxb.model.v3.release.record.WorkTitle; import org.orcid.persistence.jpa.entities.SourceEntity; import org.orcid.pojo.ajaxForm.PojoUtil; -import org.orcid.core.utils.OrcidStringUtils; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/orcid-core/src/main/java/org/orcid/core/manager/validator/ActivityValidator.java b/orcid-core/src/main/java/org/orcid/core/manager/validator/ActivityValidator.java index a4c50219c31..f4e86b931f0 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/validator/ActivityValidator.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/validator/ActivityValidator.java @@ -58,7 +58,7 @@ import org.orcid.jaxb.model.record_v2.WorkType; import org.orcid.persistence.jpa.entities.SourceEntity; import org.orcid.pojo.ajaxForm.PojoUtil; -import org.orcid.core.utils.OrcidStringUtils; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/orcid-core/src/main/java/org/orcid/core/orgs/grouping/OrgGrouping.java b/orcid-core/src/main/java/org/orcid/core/orgs/grouping/OrgGrouping.java index f656fc5296e..103cb43feb1 100644 --- a/orcid-core/src/main/java/org/orcid/core/orgs/grouping/OrgGrouping.java +++ b/orcid-core/src/main/java/org/orcid/core/orgs/grouping/OrgGrouping.java @@ -21,8 +21,8 @@ import org.orcid.pojo.OrgDisambiguated; import org.orcid.pojo.OrgDisambiguatedExternalIdentifiers; import org.orcid.pojo.grouping.OrgGroup; +import org.orcid.utils.OrcidStringUtils; import org.orcid.core.utils.FunderIdentifierType; -import org.orcid.core.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; diff --git a/orcid-core/src/main/java/org/orcid/core/security/DefaultPermissionChecker.java b/orcid-core/src/main/java/org/orcid/core/security/DefaultPermissionChecker.java index b8abd132e20..a338652ad67 100644 --- a/orcid-core/src/main/java/org/orcid/core/security/DefaultPermissionChecker.java +++ b/orcid-core/src/main/java/org/orcid/core/security/DefaultPermissionChecker.java @@ -20,7 +20,7 @@ import org.orcid.core.manager.ProfileEntityManager; import org.orcid.core.oauth.OrcidOAuth2Authentication; import org.orcid.core.oauth.OrcidOauth2TokenDetailService; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.orcid.jaxb.model.message.OrcidIdentifier; import org.orcid.jaxb.model.message.OrcidMessage; import org.orcid.jaxb.model.message.ScopePathType; diff --git a/orcid-core/src/main/java/org/orcid/core/security/OrcidUserDetailsServiceImpl.java b/orcid-core/src/main/java/org/orcid/core/security/OrcidUserDetailsServiceImpl.java index 814b8d7fb7c..9841f2c7c03 100644 --- a/orcid-core/src/main/java/org/orcid/core/security/OrcidUserDetailsServiceImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/security/OrcidUserDetailsServiceImpl.java @@ -33,7 +33,7 @@ import org.orcid.persistence.dao.ProfileDao; import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.pojo.ajaxForm.PojoUtil; -import org.orcid.core.utils.OrcidStringUtils; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; diff --git a/orcid-core/src/main/java/org/orcid/core/utils/DateUtils.java b/orcid-core/src/main/java/org/orcid/core/utils/DateUtils.java deleted file mode 100644 index 41669580d6f..00000000000 --- a/orcid-core/src/main/java/org/orcid/core/utils/DateUtils.java +++ /dev/null @@ -1,162 +0,0 @@ -package org.orcid.core.utils; - -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.HashMap; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.xml.datatype.DatatypeConfigurationException; -import javax.xml.datatype.DatatypeConstants; -import javax.xml.datatype.DatatypeFactory; -import javax.xml.datatype.XMLGregorianCalendar; - -import org.apache.commons.lang.StringUtils; - -/** - * TODO: Once the jersey migration is over, this should go back to the orcid-utils package so it could be reused form the orcid-persistence package - * Use this instead: https://github.com/ORCID/ORCID-Source/blob/main/orcid-utils/src/main/java/org/orcid/utils/DateUtils.java - */ -@Deprecated -public class DateUtils { - - private static final Pattern DATE_PATTERN = Pattern.compile("(\\d+)(?:-(\\d+))?(?:-(\\d+))?(T\\d\\d:\\d\\d:\\d\\d)?"); - - //Thread safe: see source http://www.docjar.com/html/api/com/sun/org/apache/xerces/internal/jaxp/datatype/DatatypeFactoryImpl.java.html - //see also analysis: http://www.javajirawat.com/2015/09/xmlgregoriancalendar-datatypefactory.html - private static DatatypeFactory dataTypeFactory; - - /** - * @see http - * ://www.crossref.org/schema/info/CrossRefSchemaDocumentation4.1.0.pdf - */ - private static Map seasonsAndQuartersToMonth = new HashMap(); - static { - seasonsAndQuartersToMonth.put("21", "03"); - seasonsAndQuartersToMonth.put("22", "06"); - seasonsAndQuartersToMonth.put("23", "09"); - seasonsAndQuartersToMonth.put("24", "12"); - seasonsAndQuartersToMonth.put("31", "01"); - seasonsAndQuartersToMonth.put("32", "04"); - seasonsAndQuartersToMonth.put("33", "07"); - seasonsAndQuartersToMonth.put("34", "10"); - } - - public static XMLGregorianCalendar convertToXMLGregorianCalendar(String dateString) { - return convertToXMLGregorianCalendar(dateString, true); - } - - public static XMLGregorianCalendar convertToXMLGregorianCalendar(String dateString, boolean tidy) { - String tidyDateString = dateString; - if(tidy) { - tidyDateString = tidy(dateString); - } - if (tidyDateString == null) { - return null; - } - DatatypeFactory dataTypeFactory = createDataTypeFactory(); - try { - return dataTypeFactory.newXMLGregorianCalendar(tidyDateString); - } catch (IllegalArgumentException e) { - return null; - } - } - - public static XMLGregorianCalendar convertToXMLGregorianCalendar(long time) { - GregorianCalendar gregorianCalendar = new GregorianCalendar(); - gregorianCalendar.setTimeInMillis(time); - return convertToXMLGregorianCalendar(gregorianCalendar); - } - - public static XMLGregorianCalendar convertToXMLGregorianCalendar(GregorianCalendar gregorianCalendar) { - return createDataTypeFactory().newXMLGregorianCalendar(gregorianCalendar); - } - - public static XMLGregorianCalendar convertToXMLGregorianCalendar(Date date) { - if (date == null) { - return null; - } - return convertToXMLGregorianCalendar(date.getTime()); - } - - public static XMLGregorianCalendar convertToXMLGregorianCalendarNoTimeZoneNoMillis(Date date) { - XMLGregorianCalendar basicCalender = convertToXMLGregorianCalendar(date); - basicCalender.setTimezone(DatatypeConstants.FIELD_UNDEFINED); - basicCalender.setMillisecond(DatatypeConstants.FIELD_UNDEFINED); - return basicCalender; - } - - public static Date convertToDate(String dateString) { - String tidyDateString = tidy(dateString); - if (tidyDateString == null) { - return null; - } - return convertToXMLGregorianCalendar(tidyDateString).toGregorianCalendar().getTime(); - } - - public static Date convertToDate(XMLGregorianCalendar xmlGregorianCalendar) { - if (xmlGregorianCalendar == null) { - return null; - } - return xmlGregorianCalendar.toGregorianCalendar().getTime(); - } - - private static String tidy(String dateString) { - if (dateString == null) { - return null; - } - Matcher matcher = DATE_PATTERN.matcher(dateString); - if (!matcher.matches()) { - return null; - } - String year = matcher.group(1); - String month = matcher.group(2); - String day = matcher.group(3); - String time = matcher.group(4); - - StringBuilder builder = new StringBuilder(); - builder.append(StringUtils.leftPad(year, 4, '0')); - if (month != null) { - builder.append('-'); - month = mapSeasonsAndQuartersToMonth(month); - builder.append(StringUtils.leftPad(month, 2, '0')); - - } - if (day != null) { - builder.append('-'); - builder.append(StringUtils.leftPad(day, 2, '0')); - } - if (time != null) { - builder.append(time); - } - return builder.toString(); - } - - public static boolean olderThan(Date date, int days) { - return date.getTime() < new Date().getTime() - days * 24 * 60 * 60 * 1000; - } - - private static String mapSeasonsAndQuartersToMonth(String month) { - if (seasonsAndQuartersToMonth.containsKey(month)) { - return seasonsAndQuartersToMonth.get(month); - } else { - return month; - } - } - - private static DatatypeFactory createDataTypeFactory() { - if (dataTypeFactory == null){ - synchronized (DateUtils.class){ - if (dataTypeFactory == null) - try { - dataTypeFactory = DatatypeFactory.newInstance(); - } catch (DatatypeConfigurationException e) { - throw new RuntimeException("Couldn't create org.orcid.test.data type factory", e); - } - } - } - return dataTypeFactory; - } - -} diff --git a/orcid-core/src/main/java/org/orcid/core/utils/PasswordResetToken.java b/orcid-core/src/main/java/org/orcid/core/utils/PasswordResetToken.java index 0aea0978de2..a9efaa96eac 100644 --- a/orcid-core/src/main/java/org/orcid/core/utils/PasswordResetToken.java +++ b/orcid-core/src/main/java/org/orcid/core/utils/PasswordResetToken.java @@ -12,6 +12,9 @@ import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; +import org.orcid.utils.DateUtils; +import org.orcid.utils.NullUtils; + public class PasswordResetToken { // public static final String RESET_TOKEN_DATE_FORMAT = "dd/MM/yyyy HH:mm:ss"; diff --git a/orcid-core/src/main/java/org/orcid/core/utils/ReleaseNameUtils.java b/orcid-core/src/main/java/org/orcid/core/utils/ReleaseNameUtils.java index badf9dbf24b..57b0ff096dd 100644 --- a/orcid-core/src/main/java/org/orcid/core/utils/ReleaseNameUtils.java +++ b/orcid-core/src/main/java/org/orcid/core/utils/ReleaseNameUtils.java @@ -7,6 +7,8 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; +import org.orcid.utils.DateUtils; + /** * * @author Will Simpson diff --git a/orcid-core/src/main/java/org/orcid/core/utils/VerifyEmailUtils.java b/orcid-core/src/main/java/org/orcid/core/utils/VerifyEmailUtils.java index d1abc34709c..22368423d76 100644 --- a/orcid-core/src/main/java/org/orcid/core/utils/VerifyEmailUtils.java +++ b/orcid-core/src/main/java/org/orcid/core/utils/VerifyEmailUtils.java @@ -17,6 +17,8 @@ import org.springframework.context.MessageSource; import org.springframework.stereotype.Component; +import org.orcid.utils.DateUtils; + @Component public class VerifyEmailUtils { diff --git a/orcid-core/src/main/java/org/orcid/core/utils/VerifyRegistrationToken.java b/orcid-core/src/main/java/org/orcid/core/utils/VerifyRegistrationToken.java index 9744b5f93b3..205727eafb4 100644 --- a/orcid-core/src/main/java/org/orcid/core/utils/VerifyRegistrationToken.java +++ b/orcid-core/src/main/java/org/orcid/core/utils/VerifyRegistrationToken.java @@ -8,7 +8,7 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; -import org.orcid.core.utils.NullUtils; +import org.orcid.utils.NullUtils; /** * diff --git a/orcid-core/src/main/java/org/orcid/core/utils/v3/identifiers/resolvers/DOIResolver.java b/orcid-core/src/main/java/org/orcid/core/utils/v3/identifiers/resolvers/DOIResolver.java index 353c283d1a8..a05868cd6e8 100644 --- a/orcid-core/src/main/java/org/orcid/core/utils/v3/identifiers/resolvers/DOIResolver.java +++ b/orcid-core/src/main/java/org/orcid/core/utils/v3/identifiers/resolvers/DOIResolver.java @@ -20,7 +20,6 @@ import org.orcid.core.exception.UnexpectedResponseCodeException; import org.orcid.core.locale.LocaleManager; import org.orcid.core.manager.IdentifierTypeManager; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.core.utils.v3.identifiers.PIDNormalizationService; import org.orcid.core.utils.v3.identifiers.PIDResolverCache; import org.orcid.core.utils.v3.identifiers.normalizers.DOINormalizer; @@ -47,6 +46,7 @@ import org.orcid.pojo.PIDResolutionResult; import org.orcid.pojo.WorkExtended; import org.orcid.pojo.ajaxForm.PojoUtil; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; diff --git a/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/AffiliationForm.java b/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/AffiliationForm.java index f203c31151a..4065ff8661f 100644 --- a/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/AffiliationForm.java +++ b/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/AffiliationForm.java @@ -33,7 +33,7 @@ import org.orcid.jaxb.model.v3.release.record.summary.QualificationSummary; import org.orcid.jaxb.model.v3.release.record.summary.ServiceSummary; import org.orcid.pojo.OrgDisambiguatedExternalIdentifiers; -import org.orcid.core.utils.OrcidStringUtils; +import org.orcid.utils.OrcidStringUtils; public class AffiliationForm extends VisibilityForm implements ErrorsInterface, Serializable { diff --git a/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/Date.java b/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/Date.java index a9c4f1d4964..bff2ca60bdc 100644 --- a/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/Date.java +++ b/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/Date.java @@ -13,7 +13,7 @@ import org.orcid.jaxb.model.v3.release.common.LastModifiedDate; import org.orcid.jaxb.model.v3.release.common.Month; import org.orcid.jaxb.model.v3.release.common.Year; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; public class Date implements ErrorsInterface, Required, Serializable, Comparable { diff --git a/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/KeywordForm.java b/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/KeywordForm.java index 69cba085e2d..3e02ed87b79 100644 --- a/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/KeywordForm.java +++ b/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/KeywordForm.java @@ -9,7 +9,7 @@ import org.orcid.jaxb.model.v3.release.common.LastModifiedDate; import org.orcid.jaxb.model.v3.release.common.Source; import org.orcid.jaxb.model.v3.release.record.Keyword; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; /** * diff --git a/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/Text.java b/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/Text.java index f865ab6dc37..5ffbca7d119 100644 --- a/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/Text.java +++ b/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/Text.java @@ -4,7 +4,7 @@ import java.util.ArrayList; import java.util.List; -import org.orcid.core.utils.OrcidStringUtils; +import org.orcid.utils.OrcidStringUtils; public class Text implements ErrorsInterface, Required, Serializable, Comparable { diff --git a/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/WorkForm.java b/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/WorkForm.java index 9c6f8b87b60..19c1db1dfdf 100644 --- a/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/WorkForm.java +++ b/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/WorkForm.java @@ -5,8 +5,8 @@ import java.util.List; import org.apache.commons.lang.StringUtils; -import org.orcid.core.utils.DateUtils; -import org.orcid.core.utils.OrcidStringUtils; +import org.orcid.utils.DateUtils; +import org.orcid.utils.OrcidStringUtils; import org.orcid.jaxb.model.common.CitationType; import org.orcid.jaxb.model.common.Relationship; import org.orcid.jaxb.model.common.WorkType; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/jsonidentifier/converter/JSONWorkExternalIdentifiersConverterV2Test.java b/orcid-core/src/test/java/org/orcid/core/adapter/jsonidentifier/converter/JSONWorkExternalIdentifiersConverterV2Test.java index 54b50dfdf19..472e6b53aab 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/jsonidentifier/converter/JSONWorkExternalIdentifiersConverterV2Test.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/jsonidentifier/converter/JSONWorkExternalIdentifiersConverterV2Test.java @@ -24,7 +24,7 @@ import org.orcid.persistence.jpa.entities.PublicationDateEntity; import org.orcid.persistence.jpa.entities.WorkEntity; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; public class JSONWorkExternalIdentifiersConverterV2Test { diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/jsonidentifier/converter/JSONWorkExternalIdentifiersConverterV3Test.java b/orcid-core/src/test/java/org/orcid/core/adapter/jsonidentifier/converter/JSONWorkExternalIdentifiersConverterV3Test.java index 11ea3a78339..b657ae52b14 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/jsonidentifier/converter/JSONWorkExternalIdentifiersConverterV3Test.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/jsonidentifier/converter/JSONWorkExternalIdentifiersConverterV3Test.java @@ -27,7 +27,7 @@ import org.orcid.persistence.jpa.entities.WorkEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; @RunWith(OrcidJUnit4ClassRunner.class) diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbAddressAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbAddressAdapterTest.java index cab9d06abe8..f1e31f52849 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbAddressAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbAddressAdapterTest.java @@ -17,7 +17,7 @@ import org.orcid.core.adapter.JpaJaxbAddressAdapter; import org.orcid.core.adapter.MockSourceNameCache; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.orcid.jaxb.model.common_v2.Iso3166Country; import org.orcid.jaxb.model.common_v2.Visibility; import org.orcid.jaxb.model.record_v2.Address; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbEducationAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbEducationAdapterTest.java index 4ce9926ef12..439db06bab0 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbEducationAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbEducationAdapterTest.java @@ -29,7 +29,7 @@ import org.orcid.persistence.jpa.entities.StartDateEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; /** diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbEmailAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbEmailAdapterTest.java index 7cb4aa9708b..29df960ae9e 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbEmailAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbEmailAdapterTest.java @@ -22,7 +22,7 @@ import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; /** diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbEmploymentAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbEmploymentAdapterTest.java index 1f061d9934f..758af02ac88 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbEmploymentAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbEmploymentAdapterTest.java @@ -33,7 +33,7 @@ import org.orcid.persistence.jpa.entities.StartDateEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; /** diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbExternalIdentifierAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbExternalIdentifierAdapterTest.java index 71c6c09f813..07d4177980c 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbExternalIdentifierAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbExternalIdentifierAdapterTest.java @@ -21,7 +21,7 @@ import org.orcid.persistence.jpa.entities.ExternalIdentifierEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; /** diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbFundingAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbFundingAdapterTest.java index 72ed1b39964..2054aab2f03 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbFundingAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbFundingAdapterTest.java @@ -27,7 +27,7 @@ import org.orcid.persistence.jpa.entities.StartDateEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; /** diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbKeywordAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbKeywordAdapterTest.java index 23bb8e4a73f..874ad9c4f0a 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbKeywordAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbKeywordAdapterTest.java @@ -22,7 +22,7 @@ import org.orcid.persistence.jpa.entities.ProfileKeywordEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; /** diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbNameAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbNameAdapterTest.java index 7704ee8ed1f..18df3b7ea6e 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbNameAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbNameAdapterTest.java @@ -24,7 +24,7 @@ import org.orcid.persistence.jpa.entities.RecordNameEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; /** diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbNotificationAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbNotificationAdapterTest.java index 2ed1c7d1580..f33b67f6cc5 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbNotificationAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbNotificationAdapterTest.java @@ -32,7 +32,7 @@ import org.orcid.persistence.jpa.entities.NotificationItemEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; /** diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbOtherNameAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbOtherNameAdapterTest.java index ada78133f32..073650c59e9 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbOtherNameAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbOtherNameAdapterTest.java @@ -22,7 +22,7 @@ import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; /** diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbPeerReviewAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbPeerReviewAdapterTest.java index a337e3fa662..74408ebfeb2 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbPeerReviewAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbPeerReviewAdapterTest.java @@ -32,7 +32,7 @@ import org.orcid.persistence.jpa.entities.SourceEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; /** diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbResearcherUrlAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbResearcherUrlAdapterTest.java index 88fbbdac01f..bab56f6e8bf 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbResearcherUrlAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbResearcherUrlAdapterTest.java @@ -22,7 +22,7 @@ import org.orcid.persistence.jpa.entities.ResearcherUrlEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; /** diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbWorkAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbWorkAdapterTest.java index fd35dc68f64..044797b73b4 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbWorkAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v2/latest/JpaJaxbWorkAdapterTest.java @@ -36,7 +36,7 @@ import org.orcid.pojo.ajaxForm.PojoUtil; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; /** diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbAddressAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbAddressAdapterTest.java index e5cbf7ebafe..fddcd90466b 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbAddressAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbAddressAdapterTest.java @@ -33,7 +33,7 @@ import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.util.ReflectionTestUtils; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbClientAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbClientAdapterTest.java index cd801421bc6..9049e32e55a 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbClientAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbClientAdapterTest.java @@ -33,7 +33,7 @@ import org.orcid.persistence.jpa.entities.EmailType; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; @RunWith(OrcidJUnit4ClassRunner.class) diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbDistinctionAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbDistinctionAdapterTest.java index ddf386597a5..3492d642abb 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbDistinctionAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbDistinctionAdapterTest.java @@ -38,7 +38,7 @@ import org.orcid.persistence.jpa.entities.StartDateEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.util.ReflectionTestUtils; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbEducationAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbEducationAdapterTest.java index e7a7027d351..01e6e44044d 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbEducationAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbEducationAdapterTest.java @@ -38,7 +38,7 @@ import org.orcid.persistence.jpa.entities.StartDateEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.util.ReflectionTestUtils; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbEmailAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbEmailAdapterTest.java index 653759f242e..6fb86a0a529 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbEmailAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbEmailAdapterTest.java @@ -32,7 +32,7 @@ import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.util.ReflectionTestUtils; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbEmploymentAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbEmploymentAdapterTest.java index 06575e3bf24..c7e365bb90d 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbEmploymentAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbEmploymentAdapterTest.java @@ -41,7 +41,7 @@ import org.orcid.persistence.jpa.entities.StartDateEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.util.ReflectionTestUtils; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbExternalIdentifierAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbExternalIdentifierAdapterTest.java index f1a3989c82b..2c8c8bacbe6 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbExternalIdentifierAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbExternalIdentifierAdapterTest.java @@ -33,7 +33,7 @@ import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.util.ReflectionTestUtils; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbFundingAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbFundingAdapterTest.java index f79e73acc67..f2fd299c648 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbFundingAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbFundingAdapterTest.java @@ -25,7 +25,7 @@ import org.orcid.core.manager.SourceNameCacheManager; import org.orcid.core.manager.v3.read_only.RecordNameManagerReadOnly; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.orcid.jaxb.model.common.FundingType; import org.orcid.jaxb.model.v3.release.common.FuzzyDate; import org.orcid.jaxb.model.v3.release.common.Visibility; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbInvitedPositionAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbInvitedPositionAdapterTest.java index 632445894f7..ea2e1890243 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbInvitedPositionAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbInvitedPositionAdapterTest.java @@ -37,7 +37,7 @@ import org.orcid.persistence.jpa.entities.StartDateEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.util.ReflectionTestUtils; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbKeywordAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbKeywordAdapterTest.java index 344831a9bdc..abcb6e9288e 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbKeywordAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbKeywordAdapterTest.java @@ -32,7 +32,7 @@ import org.orcid.persistence.jpa.entities.ProfileKeywordEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.util.ReflectionTestUtils; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbMembershipAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbMembershipAdapterTest.java index 11e16f3c9b7..243c3f7bed1 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbMembershipAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbMembershipAdapterTest.java @@ -37,7 +37,7 @@ import org.orcid.persistence.jpa.entities.StartDateEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.util.ReflectionTestUtils; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbNameAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbNameAdapterTest.java index 9754922a234..991845e61b8 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbNameAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbNameAdapterTest.java @@ -23,7 +23,7 @@ import org.orcid.persistence.jpa.entities.RecordNameEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; /** diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbNotificationAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbNotificationAdapterTest.java index 31057a5c3d5..4a3806568ae 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbNotificationAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbNotificationAdapterTest.java @@ -33,7 +33,7 @@ import org.orcid.persistence.jpa.entities.NotificationItemEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; /** diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbOtherNameAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbOtherNameAdapterTest.java index a42fd32ab92..0eb14db708f 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbOtherNameAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbOtherNameAdapterTest.java @@ -31,7 +31,7 @@ import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.util.ReflectionTestUtils; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbPeerReviewAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbPeerReviewAdapterTest.java index e18c0443b83..498cd9de9c0 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbPeerReviewAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbPeerReviewAdapterTest.java @@ -41,7 +41,7 @@ import org.orcid.persistence.jpa.entities.SourceEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.util.ReflectionTestUtils; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbQualificationAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbQualificationAdapterTest.java index b7deccc5ab1..110ba66a1f7 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbQualificationAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbQualificationAdapterTest.java @@ -37,7 +37,7 @@ import org.orcid.persistence.jpa.entities.StartDateEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.util.ReflectionTestUtils; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbResearchResourceAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbResearchResourceAdapterTest.java index 7df0a2677e8..34b288fc03e 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbResearchResourceAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbResearchResourceAdapterTest.java @@ -25,7 +25,7 @@ import org.orcid.core.manager.SourceNameCacheManager; import org.orcid.core.manager.v3.read_only.RecordNameManagerReadOnly; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.orcid.jaxb.model.v3.release.common.Visibility; import org.orcid.jaxb.model.v3.release.record.ResearchResource; import org.orcid.jaxb.model.v3.release.record.summary.ResearchResourceSummary; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbResearcherUrlAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbResearcherUrlAdapterTest.java index bd2eb276071..4d052d85369 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbResearcherUrlAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbResearcherUrlAdapterTest.java @@ -24,7 +24,7 @@ import org.orcid.core.manager.SourceNameCacheManager; import org.orcid.core.manager.v3.read_only.RecordNameManagerReadOnly; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.orcid.jaxb.model.v3.release.common.Visibility; import org.orcid.jaxb.model.v3.release.record.ResearcherUrl; import org.orcid.jaxb.model.v3.release.record.ResearcherUrls; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbServiceAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbServiceAdapterTest.java index fc98cdba090..6f4de964d43 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbServiceAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbServiceAdapterTest.java @@ -37,7 +37,7 @@ import org.orcid.persistence.jpa.entities.StartDateEntity; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.util.ReflectionTestUtils; diff --git a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbWorkAdapterTest.java b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbWorkAdapterTest.java index 6a43fc45165..874b5322b1e 100644 --- a/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbWorkAdapterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/adapter/v3/JpaJaxbWorkAdapterTest.java @@ -43,7 +43,7 @@ import org.orcid.pojo.ajaxForm.PojoUtil; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.core.utils.DateFieldsOnBaseEntityUtils; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.util.ReflectionTestUtils; diff --git a/orcid-core/src/test/java/org/orcid/core/manager/impl/RegistrationManagerImplTest.java b/orcid-core/src/test/java/org/orcid/core/manager/impl/RegistrationManagerImplTest.java index bda40388b09..89b4b6768ed 100644 --- a/orcid-core/src/test/java/org/orcid/core/manager/impl/RegistrationManagerImplTest.java +++ b/orcid-core/src/test/java/org/orcid/core/manager/impl/RegistrationManagerImplTest.java @@ -52,7 +52,7 @@ import org.orcid.test.DBUnitTest; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.test.TargetProxyHelper; -import org.orcid.core.utils.OrcidStringUtils; +import org.orcid.utils.OrcidStringUtils; import org.springframework.security.oauth2.common.exceptions.InvalidRequestException; import org.springframework.test.context.ContextConfiguration; diff --git a/orcid-core/src/test/java/org/orcid/core/manager/v3/EmailManagerTest.java b/orcid-core/src/test/java/org/orcid/core/manager/v3/EmailManagerTest.java index c128609d290..9e5ded2bbaa 100644 --- a/orcid-core/src/test/java/org/orcid/core/manager/v3/EmailManagerTest.java +++ b/orcid-core/src/test/java/org/orcid/core/manager/v3/EmailManagerTest.java @@ -35,7 +35,6 @@ import org.mockito.MockitoAnnotations; import org.orcid.core.BaseTest; import org.orcid.core.manager.EncryptionManager; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.jaxb.model.v3.release.common.Visibility; import org.orcid.jaxb.model.v3.release.record.Email; import org.orcid.jaxb.model.v3.release.record.Emails; @@ -45,6 +44,7 @@ import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.persistence.jpa.entities.SourceEntity; import org.orcid.test.TargetProxyHelper; +import org.orcid.utils.OrcidStringUtils; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.test.util.ReflectionTestUtils; diff --git a/orcid-core/src/test/java/org/orcid/core/manager/v3/MembersManagerTest.java b/orcid-core/src/test/java/org/orcid/core/manager/v3/MembersManagerTest.java index 5d6b420806b..43db8f97854 100644 --- a/orcid-core/src/test/java/org/orcid/core/manager/v3/MembersManagerTest.java +++ b/orcid-core/src/test/java/org/orcid/core/manager/v3/MembersManagerTest.java @@ -33,7 +33,7 @@ import org.orcid.test.DBUnitTest; import org.orcid.test.OrcidJUnit4ClassRunner; import org.orcid.test.TargetProxyHelper; -import org.orcid.core.utils.OrcidStringUtils; +import org.orcid.utils.OrcidStringUtils; import org.springframework.test.context.ContextConfiguration; @RunWith(OrcidJUnit4ClassRunner.class) diff --git a/orcid-core/src/test/java/org/orcid/core/utils/DateUtilsTest.java b/orcid-core/src/test/java/org/orcid/core/utils/DateUtilsTest.java index 610e672c2bd..e723598f512 100644 --- a/orcid-core/src/test/java/org/orcid/core/utils/DateUtilsTest.java +++ b/orcid-core/src/test/java/org/orcid/core/utils/DateUtilsTest.java @@ -6,7 +6,7 @@ import javax.xml.datatype.XMLGregorianCalendar; import org.junit.Test; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; /** * diff --git a/orcid-core/src/test/java/org/orcid/core/utils/OrcidStringUtilsTest.java b/orcid-core/src/test/java/org/orcid/core/utils/OrcidStringUtilsTest.java index 27e4402369b..8a5c71fdde2 100644 --- a/orcid-core/src/test/java/org/orcid/core/utils/OrcidStringUtilsTest.java +++ b/orcid-core/src/test/java/org/orcid/core/utils/OrcidStringUtilsTest.java @@ -1,7 +1,7 @@ package org.orcid.core.utils; import org.junit.Test; -import org.orcid.core.utils.OrcidStringUtils; +import org.orcid.utils.OrcidStringUtils; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/orcid-core/src/test/java/org/orcid/pojo/ajaxForm/AffiliationFormTestBase.java b/orcid-core/src/test/java/org/orcid/pojo/ajaxForm/AffiliationFormTestBase.java index 516eedb3c7b..43e7ddd3d06 100644 --- a/orcid-core/src/test/java/org/orcid/pojo/ajaxForm/AffiliationFormTestBase.java +++ b/orcid-core/src/test/java/org/orcid/pojo/ajaxForm/AffiliationFormTestBase.java @@ -25,7 +25,7 @@ import org.orcid.jaxb.model.v3.release.record.ExternalIDs; import org.orcid.jaxb.model.v3.release.record.summary.AffiliationSummary; import org.orcid.jaxb.model.v3.release.record.summary.DistinctionSummary; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; public abstract class AffiliationFormTestBase { XMLGregorianCalendar created; diff --git a/orcid-core/src/test/java/org/orcid/pojo/ajaxForm/PojoUtilTest.java b/orcid-core/src/test/java/org/orcid/pojo/ajaxForm/PojoUtilTest.java index 8f6a9b7c542..fbb864a707a 100644 --- a/orcid-core/src/test/java/org/orcid/pojo/ajaxForm/PojoUtilTest.java +++ b/orcid-core/src/test/java/org/orcid/pojo/ajaxForm/PojoUtilTest.java @@ -14,7 +14,7 @@ import org.orcid.jaxb.model.v3.release.common.Year; import org.orcid.jaxb.model.v3.release.record.Affiliation; import org.orcid.jaxb.model.v3.release.record.Employment; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; public class PojoUtilTest { diff --git a/orcid-persistence/pom.xml b/orcid-persistence/pom.xml index d3e6e2bef73..b071541a8d2 100644 --- a/orcid-persistence/pom.xml +++ b/orcid-persistence/pom.xml @@ -53,7 +53,12 @@ - + + + ${project.parent.groupId} + orcid-utils + ${project.parent.version} + org.orcid orcid-test diff --git a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/BaseContributorEntity.java b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/BaseContributorEntity.java index 4dbc0d5e6e7..4edaf75d8cd 100644 --- a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/BaseContributorEntity.java +++ b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/BaseContributorEntity.java @@ -7,7 +7,7 @@ import javax.persistence.ManyToOne; import javax.persistence.MappedSuperclass; -import org.orcid.persistence.util.OrcidStringUtils; +import org.orcid.utils.NullUtils; /** * @author Declan Newman (declan) Date: 08/08/2012 @@ -72,19 +72,19 @@ public int compareTo(BaseContributorEntity other) { if (other == null) { return -1; } - int compareSequenceTypes = OrcidStringUtils.compareObjectsNullSafe(sequence, other.getSequence()); + int compareSequenceTypes = NullUtils.compareObjectsNullSafe(sequence, other.getSequence()); if (compareSequenceTypes != 0) { return compareSequenceTypes; } - int compareRoles = OrcidStringUtils.compareObjectsNullSafe(contributorRole, other.getContributorRole()); + int compareRoles = NullUtils.compareObjectsNullSafe(contributorRole, other.getContributorRole()); if (compareRoles != 0) { return compareRoles; } - int compareCreditNames = OrcidStringUtils.compareObjectsNullSafe(creditName, other.getCreditName()); + int compareCreditNames = NullUtils.compareObjectsNullSafe(creditName, other.getCreditName()); if (compareCreditNames != 0) { return compareCreditNames; } - int compareEmails = OrcidStringUtils.compareObjectsNullSafe(contributorEmail, other.getContributorEmail()); + int compareEmails = NullUtils.compareObjectsNullSafe(contributorEmail, other.getContributorEmail()); if (compareEmails != 0) { return compareEmails; } diff --git a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/ClientSecretEntity.java b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/ClientSecretEntity.java index c8ec186ccc7..2d9bdaa5bb5 100644 --- a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/ClientSecretEntity.java +++ b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/ClientSecretEntity.java @@ -14,7 +14,7 @@ import javax.persistence.Transient; import org.orcid.persistence.jpa.entities.keys.ClientSecretPk; -import org.orcid.persistence.util.OrcidStringUtils; +import org.orcid.utils.NullUtils; /** * @@ -101,7 +101,7 @@ public void setDecryptedClientSecret(String decryptedClientSecret) { public int compareTo(ClientSecretEntity other) { Date otherLastModified = other.getLastModified(); Date thisLastModified = getLastModified(); - int dateComparison = OrcidStringUtils.compareObjectsNullSafe(thisLastModified, otherLastModified); + int dateComparison = NullUtils.compareObjectsNullSafe(thisLastModified, otherLastModified); if (dateComparison != 0) { return -dateComparison; } diff --git a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/OrgAffiliationRelationEntity.java b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/OrgAffiliationRelationEntity.java index 45790874c3f..cb1bc3c95a6 100644 --- a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/OrgAffiliationRelationEntity.java +++ b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/OrgAffiliationRelationEntity.java @@ -12,7 +12,7 @@ import javax.persistence.SequenceGenerator; import javax.persistence.Table; -import org.orcid.persistence.util.OrcidStringUtils; +import org.orcid.utils.NullUtils; /** * @@ -176,43 +176,43 @@ public int compareTo(OrgAffiliationRelationEntity other) { } private int compareEnds(FuzzyDateEntity endDate, FuzzyDateEntity otherEndDate) { - if (OrcidStringUtils.anyNull(endDate, otherEndDate)) { - return -OrcidStringUtils.compareNulls(endDate, otherEndDate); + if (NullUtils.anyNull(endDate, otherEndDate)) { + return -NullUtils.compareNulls(endDate, otherEndDate); } return -endDate.compareTo(otherEndDate); } private int compareStarts(FuzzyDateEntity startDate, FuzzyDateEntity otherStartDate) { - if (OrcidStringUtils.anyNull(startDate, otherStartDate)) { - return OrcidStringUtils.compareNulls(startDate, otherStartDate); + if (NullUtils.anyNull(startDate, otherStartDate)) { + return NullUtils.compareNulls(startDate, otherStartDate); } return -startDate.compareTo(otherStartDate); } private int compareTypes(String affiliationType, String otherAffiliationType) { - if (OrcidStringUtils.anyNull(affiliationType, otherAffiliationType)) { - return OrcidStringUtils.compareNulls(affiliationType, otherAffiliationType); + if (NullUtils.anyNull(affiliationType, otherAffiliationType)) { + return NullUtils.compareNulls(affiliationType, otherAffiliationType); } return affiliationType.compareTo(otherAffiliationType); } private int compareNames(String name, String otherName) { - if (OrcidStringUtils.anyNull(name, otherName)) { - return OrcidStringUtils.compareNulls(name, otherName); + if (NullUtils.anyNull(name, otherName)) { + return NullUtils.compareNulls(name, otherName); } return name.compareTo(otherName); } private int compareDepartments(String department, String otherDepartment) { - if (OrcidStringUtils.anyNull(department, otherDepartment)) { - return OrcidStringUtils.compareNulls(department, otherDepartment); + if (NullUtils.anyNull(department, otherDepartment)) { + return NullUtils.compareNulls(department, otherDepartment); } return department.compareTo(otherDepartment); } private int compareTitles(String title, String otherTitle) { - if (OrcidStringUtils.anyNull(title, otherTitle)) { - return OrcidStringUtils.compareNulls(title, otherTitle); + if (NullUtils.anyNull(title, otherTitle)) { + return NullUtils.compareNulls(title, otherTitle); } return title.compareTo(otherTitle); } diff --git a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/PeerReviewEntity.java b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/PeerReviewEntity.java index f2fc4425fac..6326a794194 100644 --- a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/PeerReviewEntity.java +++ b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/PeerReviewEntity.java @@ -13,7 +13,8 @@ import javax.persistence.Table; import org.apache.commons.lang3.StringUtils; -import org.orcid.persistence.util.OrcidStringUtils; +import org.orcid.utils.OrcidStringUtils; +import org.orcid.utils.NullUtils; @Entity @@ -218,17 +219,17 @@ public int compareTo(PeerReviewEntity other) { throw new NullPointerException("Can't compare with null"); } - int typeCompare = OrcidStringUtils.compareObjectsNullSafe(type, other.getType()); + int typeCompare = NullUtils.compareObjectsNullSafe(type, other.getType()); if(typeCompare != 0) { return typeCompare; } - int roleCompare = OrcidStringUtils.compareObjectsNullSafe(role, other.getRole()); + int roleCompare = NullUtils.compareObjectsNullSafe(role, other.getRole()); if(roleCompare != 0) { return roleCompare; } - int completionDateCompare = OrcidStringUtils.compareObjectsNullSafe((FuzzyDateEntity)completionDate, (FuzzyDateEntity)other.getCompletionDate()); + int completionDateCompare = NullUtils.compareObjectsNullSafe((FuzzyDateEntity)completionDate, (FuzzyDateEntity)other.getCompletionDate()); if(completionDateCompare != 0) { return completionDateCompare; } @@ -264,7 +265,7 @@ public int compareTo(PeerReviewEntity other) { return subjectExtIdCompare; } - int subjectTypeCompare = OrcidStringUtils.compareObjectsNullSafe(subjectType, other.getSubjectType()); + int subjectTypeCompare = NullUtils.compareObjectsNullSafe(subjectType, other.getSubjectType()); if(subjectTypeCompare != 0) { return subjectTypeCompare; } diff --git a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/ProfileFundingEntity.java b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/ProfileFundingEntity.java index 85a052d9c18..30c9eb46906 100644 --- a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/ProfileFundingEntity.java +++ b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/ProfileFundingEntity.java @@ -15,7 +15,8 @@ import javax.persistence.SequenceGenerator; import javax.persistence.Table; -import org.orcid.persistence.util.OrcidStringUtils; +import org.orcid.utils.OrcidStringUtils; +import org.orcid.utils.NullUtils; /** * orcid-entities - Dec 6, 2011 - ProfileInstitutionEntity @@ -251,7 +252,7 @@ public int compareTo(ProfileFundingEntity other) { return compareStarts; } - int compareNumericAmounts = OrcidStringUtils.compareObjectsNullSafe(numericAmount, other.getNumericAmount()); + int compareNumericAmounts = NullUtils.compareObjectsNullSafe(numericAmount, other.getNumericAmount()); if (compareNumericAmounts != 0) { return compareNumericAmounts; } @@ -290,29 +291,29 @@ public int compareTo(ProfileFundingEntity other) { } private int compareTypes(String type, String otherType) { - if (OrcidStringUtils.anyNull(type, otherType)) { - return -OrcidStringUtils.compareNulls(type, otherType); + if (NullUtils.anyNull(type, otherType)) { + return -NullUtils.compareNulls(type, otherType); } return -type.compareTo(otherType); } private int compareEnds(FuzzyDateEntity endDate, FuzzyDateEntity otherEndDate) { - if (OrcidStringUtils.anyNull(endDate, otherEndDate)) { - return -OrcidStringUtils.compareNulls(endDate, otherEndDate); + if (NullUtils.anyNull(endDate, otherEndDate)) { + return -NullUtils.compareNulls(endDate, otherEndDate); } return -endDate.compareTo(otherEndDate); } private int compareStarts(FuzzyDateEntity startDate, FuzzyDateEntity otherStartDate) { - if (OrcidStringUtils.anyNull(startDate, otherStartDate)) { - return OrcidStringUtils.compareNulls(startDate, otherStartDate); + if (NullUtils.anyNull(startDate, otherStartDate)) { + return NullUtils.compareNulls(startDate, otherStartDate); } return -startDate.compareTo(otherStartDate); } private int compareLongs(Long l1, Long l2 ) { - if (OrcidStringUtils.anyNull(l1, l2)) { - return OrcidStringUtils.compareNulls(l1, l2); + if (NullUtils.anyNull(l1, l2)) { + return NullUtils.compareNulls(l1, l2); } return l1.compareTo(l2); } diff --git a/orcid-persistence/src/main/java/org/orcid/persistence/util/OrcidStringUtils.java b/orcid-persistence/src/main/java/org/orcid/persistence/util/OrcidStringUtils.java deleted file mode 100644 index 99d47606f89..00000000000 --- a/orcid-persistence/src/main/java/org/orcid/persistence/util/OrcidStringUtils.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.orcid.persistence.util; - -import java.util.regex.Pattern; - -import org.apache.commons.lang.StringUtils; - -/** - * TODO: Once the jersey migration is over, this should go back to the orcid-utils package so it could be reused form the orcid-persistence package - */ -@Deprecated -public class OrcidStringUtils { - public static String ORCID_STRING = "(\\d{4}-){3}\\d{3}[\\dX]"; - public static final Pattern orcidPattern = Pattern.compile(ORCID_STRING); - - public static int compareStrings(String string, String otherString) { - if (anyNull(string, otherString)) { - return compareNulls(string, otherString); - } - return string.compareTo(otherString); - } - - public static boolean anyNull(Object... objects) { - for (Object object : objects) { - if (object == null) { - return true; - } - } - return false; - } - - public static int compareNulls(Object thisObject, Object otherObject) { - if (thisObject == null) { - return otherObject == null ? 0 : 1; - } else { - return otherObject == null ? -1 : 0; - } - } - - public static > int compareObjectsNullSafe(T thisObject, T otherObject) { - if (anyNull(thisObject, otherObject)) { - return compareNulls(thisObject, otherObject); - } - return thisObject.compareTo(otherObject); - } - - public static boolean isValidOrcid(String orcid) { - if (StringUtils.isNotBlank(orcid)) { - return orcidPattern.matcher(orcid).matches(); - } else { - return false; - } - } -} diff --git a/orcid-scheduler-web/src/main/java/org/orcid/scheduler/autospam/cli/AutoLockSpamRecords.java b/orcid-scheduler-web/src/main/java/org/orcid/scheduler/autospam/cli/AutoLockSpamRecords.java index c3bc2534485..0648d3678ff 100644 --- a/orcid-scheduler-web/src/main/java/org/orcid/scheduler/autospam/cli/AutoLockSpamRecords.java +++ b/orcid-scheduler-web/src/main/java/org/orcid/scheduler/autospam/cli/AutoLockSpamRecords.java @@ -21,13 +21,12 @@ import org.orcid.core.manager.v3.ProfileEntityManager; import org.orcid.core.manager.v3.ResearcherUrlManager; import org.orcid.core.togglz.OrcidTogglzConfiguration; -import org.orcid.core.utils.OrcidStringUtils; - import org.orcid.jaxb.model.v3.release.record.Biography; import org.orcid.jaxb.model.v3.release.record.ResearcherUrls; import org.orcid.persistence.dao.OrcidOauth2TokenDetailDao; import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.scheduler.autospam.AutospamEmailSender; +import org.orcid.utils.OrcidStringUtils; import org.orcid.utils.alerting.SlackManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/orcid-scheduler-web/src/main/java/org/orcid/scheduler/email/cli/SendBadOrgsEmail.java b/orcid-scheduler-web/src/main/java/org/orcid/scheduler/email/cli/SendBadOrgsEmail.java index 5a7bab1fd16..08c5034d970 100644 --- a/orcid-scheduler-web/src/main/java/org/orcid/scheduler/email/cli/SendBadOrgsEmail.java +++ b/orcid-scheduler-web/src/main/java/org/orcid/scheduler/email/cli/SendBadOrgsEmail.java @@ -38,7 +38,7 @@ import org.orcid.persistence.jpa.entities.OrgEntity; import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.persistence.jpa.entities.ProfileFundingEntity; -import org.orcid.core.utils.NullUtils; +import org.orcid.utils.NullUtils; import org.orcid.utils.email.MailGunManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/orcid-scheduler-web/src/test/java/org/orcid/scheduler/email/cli/manager/EmailMessageSenderTest.java b/orcid-scheduler-web/src/test/java/org/orcid/scheduler/email/cli/manager/EmailMessageSenderTest.java index 80f7eeaef37..a0351048890 100644 --- a/orcid-scheduler-web/src/test/java/org/orcid/scheduler/email/cli/manager/EmailMessageSenderTest.java +++ b/orcid-scheduler-web/src/test/java/org/orcid/scheduler/email/cli/manager/EmailMessageSenderTest.java @@ -28,7 +28,7 @@ import org.orcid.core.manager.ProfileEntityCacheManager; import org.orcid.core.manager.v3.RecordNameManager; import org.orcid.core.togglz.Features; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.orcid.jaxb.model.common.ActionType; import org.orcid.jaxb.model.common.AvailableLocales; import org.orcid.jaxb.model.common.Relationship; diff --git a/orcid-utils/pom.xml b/orcid-utils/pom.xml index 7402e8621ad..d7b361ba22d 100644 --- a/orcid-utils/pom.xml +++ b/orcid-utils/pom.xml @@ -105,6 +105,14 @@ 2.3.6 runtime + + + + + org.jsoup + jsoup + 1.15.4 + diff --git a/orcid-core/src/main/java/org/orcid/core/utils/NullUtils.java b/orcid-utils/src/main/java/org/orcid/utils/NullUtils.java similarity index 97% rename from orcid-core/src/main/java/org/orcid/core/utils/NullUtils.java rename to orcid-utils/src/main/java/org/orcid/utils/NullUtils.java index f44b4073c00..1f6542f9690 100644 --- a/orcid-core/src/main/java/org/orcid/core/utils/NullUtils.java +++ b/orcid-utils/src/main/java/org/orcid/utils/NullUtils.java @@ -1,4 +1,4 @@ -package org.orcid.core.utils; +package org.orcid.utils; /** * @author Will Simpson diff --git a/orcid-core/src/main/java/org/orcid/core/utils/OrcidStringUtils.java b/orcid-utils/src/main/java/org/orcid/utils/OrcidStringUtils.java similarity index 96% rename from orcid-core/src/main/java/org/orcid/core/utils/OrcidStringUtils.java rename to orcid-utils/src/main/java/org/orcid/utils/OrcidStringUtils.java index 78b1feb018e..64fae323f02 100644 --- a/orcid-core/src/main/java/org/orcid/core/utils/OrcidStringUtils.java +++ b/orcid-utils/src/main/java/org/orcid/utils/OrcidStringUtils.java @@ -1,4 +1,4 @@ -package org.orcid.core.utils; +package org.orcid.utils; import java.util.Enumeration; import java.util.HashMap; @@ -13,10 +13,6 @@ import org.jsoup.nodes.Entities.EscapeMode; import org.jsoup.safety.Safelist; -/** - * TODO: Once the jersey migration is over, this should go back to the orcid-utils package so it could be reused form the orcid-persistence package - * */ -@Deprecated public class OrcidStringUtils { public static String ORCID_STRING = "(\\d{4}-){3}\\d{3}[\\dX]"; diff --git a/orcid-web/src/main/java/org/orcid/frontend/cli/AutoLockSpamRecords.java b/orcid-web/src/main/java/org/orcid/frontend/cli/AutoLockSpamRecords.java index d8fa32cd5b9..45edfe6e6d4 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/cli/AutoLockSpamRecords.java +++ b/orcid-web/src/main/java/org/orcid/frontend/cli/AutoLockSpamRecords.java @@ -18,12 +18,12 @@ import org.orcid.core.manager.v3.NotificationManager; import org.orcid.core.manager.v3.ProfileEntityManager; import org.orcid.core.togglz.OrcidTogglzConfiguration; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.frontend.email.RecordEmailSender; import org.orcid.jaxb.model.record_v2.Affiliation; import org.orcid.persistence.dao.OrcidOauth2TokenDetailDao; import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.pojo.ajaxForm.PojoUtil; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.ApplicationContext; diff --git a/orcid-web/src/main/java/org/orcid/frontend/spring/OrcidAuthenticationProvider.java b/orcid-web/src/main/java/org/orcid/frontend/spring/OrcidAuthenticationProvider.java index a354c3e0a0e..580af789385 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/spring/OrcidAuthenticationProvider.java +++ b/orcid-web/src/main/java/org/orcid/frontend/spring/OrcidAuthenticationProvider.java @@ -14,11 +14,11 @@ import org.orcid.core.manager.v3.read_only.EmailManagerReadOnly; import org.orcid.core.security.OrcidUserDetailsService; import org.orcid.core.togglz.Features; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.frontend.web.exception.Bad2FARecoveryCodeException; import org.orcid.frontend.web.exception.Bad2FAVerificationCodeException; import org.orcid.frontend.web.exception.VerificationCodeFor2FARequiredException; import org.orcid.persistence.jpa.entities.ProfileEntity; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/AdminController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/AdminController.java index 37c59ee65f9..3d031f763e5 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/AdminController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/AdminController.java @@ -24,7 +24,6 @@ import org.orcid.core.manager.v3.ProfileEntityManager; import org.orcid.core.manager.v3.SpamManager; import org.orcid.core.manager.v3.read_only.RecordNameManagerReadOnly; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.frontend.email.RecordEmailSender; import org.orcid.frontend.web.util.PasswordConstants; import org.orcid.jaxb.model.clientgroup.ClientType; @@ -43,6 +42,7 @@ import org.orcid.pojo.ProfileDeprecationRequest; import org.orcid.pojo.ProfileDetails; import org.orcid.pojo.ajaxForm.PojoUtil; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/BaseController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/BaseController.java index bd090eed4c8..91184fd0603 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/BaseController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/BaseController.java @@ -41,7 +41,6 @@ import org.orcid.core.manager.v3.read_only.ResearcherUrlManagerReadOnly; import org.orcid.core.oauth.OrcidProfileUserDetails; import org.orcid.core.togglz.Features; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.core.utils.ReleaseNameUtils; import org.orcid.frontend.web.forms.validate.OrcidUrlValidator; import org.orcid.frontend.web.forms.validate.RedirectUriValidator; @@ -74,6 +73,7 @@ import org.orcid.pojo.ajaxForm.Text; import org.orcid.pojo.ajaxForm.Visibility; import org.orcid.pojo.ajaxForm.VisibilityForm; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/ClaimController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/ClaimController.java index 2714fd2e775..1180b606489 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/ClaimController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/ClaimController.java @@ -18,7 +18,6 @@ import org.orcid.core.manager.ProfileEntityCacheManager; import org.orcid.core.manager.v3.NotificationManager; import org.orcid.core.manager.v3.ProfileEntityManager; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.frontend.email.RecordEmailSender; import org.orcid.jaxb.model.common.AvailableLocales; import org.orcid.jaxb.model.v3.release.notification.amended.AmendedSection; @@ -26,6 +25,7 @@ import org.orcid.pojo.EmailRequest; import org.orcid.pojo.ajaxForm.Claim; import org.orcid.pojo.ajaxForm.PojoUtil; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/ClientsController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/ClientsController.java index 23086054036..7124d36958d 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/ClientsController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/ClientsController.java @@ -17,7 +17,6 @@ import org.orcid.core.manager.v3.ClientDetailsManager; import org.orcid.core.manager.v3.ClientManager; import org.orcid.core.manager.v3.read_only.ClientManagerReadOnly; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.jaxb.model.clientgroup.ClientType; import org.orcid.jaxb.model.clientgroup.RedirectUriType; import org.orcid.jaxb.model.message.ScopePathType; @@ -26,6 +25,7 @@ import org.orcid.pojo.ajaxForm.PojoUtil; import org.orcid.pojo.ajaxForm.RedirectUri; import org.orcid.pojo.ajaxForm.Text; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.access.prepost.PreAuthorize; diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/DeveloperToolsController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/DeveloperToolsController.java index 174a368d21e..3334936b164 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/DeveloperToolsController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/DeveloperToolsController.java @@ -15,12 +15,12 @@ import org.orcid.core.manager.v3.read_only.ClientManagerReadOnly; import org.orcid.core.manager.v3.read_only.EmailManagerReadOnly; import org.orcid.core.profile.history.ProfileHistoryEventType; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.jaxb.model.clientgroup.RedirectUriType; import org.orcid.pojo.ajaxForm.Client; import org.orcid.pojo.ajaxForm.PojoUtil; import org.orcid.pojo.ajaxForm.RedirectUri; import org.orcid.pojo.ajaxForm.Text; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/EmailDomainController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/EmailDomainController.java index fe252420836..823824d0b5b 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/EmailDomainController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/EmailDomainController.java @@ -5,8 +5,8 @@ import org.orcid.core.common.manager.EmailDomainManager; import org.orcid.core.solr.OrcidSolrOrgsClient; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.persistence.jpa.entities.EmailDomainEntity; +import org.orcid.utils.OrcidStringUtils; import org.orcid.utils.solr.entities.OrgDisambiguatedSolrDocument; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/HomeController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/HomeController.java index 9ecb15454cb..e4831dafb13 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/HomeController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/HomeController.java @@ -23,13 +23,13 @@ import org.orcid.core.security.OrcidWebRole; import org.orcid.core.stats.StatisticsManager; import org.orcid.core.togglz.Features; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.core.utils.UTF8Control; import org.orcid.jaxb.model.common.AvailableLocales; import org.orcid.persistence.jpa.entities.ProfileEntity; import org.orcid.pojo.PublicRecordPersonDetails; import org.orcid.pojo.UserStatus; import org.orcid.pojo.ajaxForm.PojoUtil; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/ManageProfileController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/ManageProfileController.java index bf7696cb5db..e3e99fb1b3f 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/ManageProfileController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/ManageProfileController.java @@ -35,7 +35,6 @@ import org.orcid.core.manager.v3.read_only.RecordNameManagerReadOnly; import org.orcid.core.togglz.Features; import org.orcid.core.utils.JsonUtils; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.core.utils.v3.OrcidIdentifierUtils; import org.orcid.frontend.email.RecordEmailSender; import org.orcid.frontend.web.util.CommonPasswords; @@ -57,6 +56,7 @@ import org.orcid.pojo.ManageDelegate; import org.orcid.pojo.ManageSocialAccount; import org.orcid.pojo.ajaxForm.*; +import org.orcid.utils.OrcidStringUtils; import org.orcid.utils.alerting.SlackManager; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/OauthRegistrationController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/OauthRegistrationController.java index 7470af33e84..8a203209136 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/OauthRegistrationController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/OauthRegistrationController.java @@ -12,13 +12,13 @@ import org.apache.commons.lang.StringUtils; import org.orcid.core.constants.OrcidOauth2Constants; import org.orcid.core.utils.OrcidRequestUtil; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.frontend.web.controllers.helper.OauthHelper; import org.orcid.jaxb.model.message.CreationMethod; import org.orcid.pojo.ajaxForm.OauthRegistrationForm; import org.orcid.pojo.ajaxForm.PojoUtil; import org.orcid.pojo.ajaxForm.RequestInfoForm; import org.orcid.pojo.ajaxForm.Text; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.core.Authentication; diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/PasswordResetController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/PasswordResetController.java index e2f5e4bcd8b..75ecfad1edf 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/PasswordResetController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/PasswordResetController.java @@ -24,7 +24,6 @@ import org.orcid.core.manager.RegistrationManager; import org.orcid.core.manager.v3.ProfileEntityManager; import org.orcid.core.manager.v3.read_only.EmailManagerReadOnly; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.core.utils.PasswordResetToken; import org.orcid.frontend.email.RecordEmailSender; import org.orcid.frontend.spring.ShibbolethAjaxAuthenticationSuccessHandler; @@ -42,6 +41,7 @@ import org.orcid.pojo.ajaxForm.Reactivation; import org.orcid.pojo.ajaxForm.Registration; import org.orcid.pojo.ajaxForm.Text; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; 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 2e51f201868..d74d99c4ec8 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 @@ -36,7 +36,6 @@ import org.orcid.core.security.OrcidUserDetailsService; import org.orcid.core.togglz.Features; import org.orcid.core.utils.OrcidRequestUtil; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.frontend.email.RecordEmailSender; import org.orcid.frontend.spring.ShibbolethAjaxAuthenticationSuccessHandler; import org.orcid.frontend.spring.SocialAjaxAuthenticationSuccessHandler; @@ -56,6 +55,7 @@ import org.orcid.pojo.ajaxForm.Registration; import org.orcid.pojo.ajaxForm.RequestInfoForm; import org.orcid.pojo.ajaxForm.Text; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.authentication.AuthenticationManager; diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/SpamController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/SpamController.java index 1a5d99aef03..7625b1d5799 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/SpamController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/SpamController.java @@ -3,8 +3,8 @@ import javax.annotation.Resource; import org.orcid.core.manager.v3.SpamManager; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.pojo.Spam; +import org.orcid.utils.OrcidStringUtils; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/helper/OauthHelper.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/helper/OauthHelper.java index 9219c26f400..f267d285f60 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/helper/OauthHelper.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/helper/OauthHelper.java @@ -15,7 +15,6 @@ import org.orcid.core.manager.v3.ProfileEntityManager; import org.orcid.core.manager.v3.read_only.RecordNameManagerReadOnly; import org.orcid.core.oauth.OrcidProfileUserDetails; -import org.orcid.core.utils.OrcidStringUtils; import org.orcid.frontend.web.controllers.BaseControllerUtil; import org.orcid.frontend.web.controllers.RegistrationController; import org.orcid.frontend.web.exception.OauthInvalidRequestException; @@ -26,6 +25,7 @@ import org.orcid.pojo.ajaxForm.PojoUtil; import org.orcid.pojo.ajaxForm.RequestInfoForm; import org.orcid.pojo.ajaxForm.ScopeInfoForm; +import org.orcid.utils.OrcidStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.NoSuchMessageException; diff --git a/orcid-web/src/test/java/orcid/pojo/ajaxForm/WorkFormTest.java b/orcid-web/src/test/java/orcid/pojo/ajaxForm/WorkFormTest.java index e6146eedf08..73c15018658 100644 --- a/orcid-web/src/test/java/orcid/pojo/ajaxForm/WorkFormTest.java +++ b/orcid-web/src/test/java/orcid/pojo/ajaxForm/WorkFormTest.java @@ -8,7 +8,7 @@ import java.io.ObjectOutputStream; import java.util.Date; import org.junit.Test; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.orcid.jaxb.model.common.CitationType; import org.orcid.jaxb.model.common.ContributorRole; import org.orcid.jaxb.model.common.Iso3166Country; diff --git a/orcid-web/src/test/java/org/orcid/frontend/web/controllers/ManageProfileControllerTest.java b/orcid-web/src/test/java/org/orcid/frontend/web/controllers/ManageProfileControllerTest.java index 677f1278681..a89a4fa8d3a 100644 --- a/orcid-web/src/test/java/org/orcid/frontend/web/controllers/ManageProfileControllerTest.java +++ b/orcid-web/src/test/java/org/orcid/frontend/web/controllers/ManageProfileControllerTest.java @@ -45,7 +45,7 @@ import org.orcid.core.manager.v3.read_only.RecordNameManagerReadOnly; import org.orcid.core.oauth.OrcidProfileUserDetails; import org.orcid.core.security.OrcidWebRole; -import org.orcid.core.utils.DateUtils; +import org.orcid.utils.DateUtils; import org.orcid.core.utils.v3.OrcidIdentifierUtils; import org.orcid.frontend.email.RecordEmailSender; import org.orcid.jaxb.model.v3.release.common.CreditName;