From 12f95f78462508c5a7f4ea20d0fe2454b19c43d2 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Thu, 30 Nov 2023 14:07:05 +0100 Subject: [PATCH 01/23] 108915: Refactored all LinkRepositories to use the plural model name instead of the singular --- .../org/dspace/app/rest/EntityTypeLabelRestController.java | 2 +- .../main/java/org/dspace/app/rest/GroupRestController.java | 2 +- .../org/dspace/app/rest/SubmissionCCLicenseUrlRepository.java | 4 ++-- .../app/rest/WorkflowDefinitionCollectionsLinkRepository.java | 2 +- .../app/rest/WorkflowDefinitionStepsLinkRepository.java | 2 +- .../dspace/app/rest/WorkflowStepActionsLinkRepository.java | 2 +- .../process/SubmissionCCLicenseUrlResourceHalLinkFactory.java | 4 ++-- .../org/dspace/app/rest/model/AuthorizationFeatureRest.java | 1 + .../java/org/dspace/app/rest/model/AuthorizationRest.java | 1 + .../java/org/dspace/app/rest/model/BitstreamFormatRest.java | 1 + .../main/java/org/dspace/app/rest/model/BrowseIndexRest.java | 1 + .../org/dspace/app/rest/model/BulkAccessConditionRest.java | 4 ++-- .../java/org/dspace/app/rest/model/DiscoveryResultsRest.java | 1 + .../src/main/java/org/dspace/app/rest/model/EPersonRest.java | 1 + .../main/java/org/dspace/app/rest/model/EntityTypeRest.java | 2 +- .../src/main/java/org/dspace/app/rest/model/FeedbackRest.java | 3 ++- .../src/main/java/org/dspace/app/rest/model/GroupRest.java | 3 +-- .../main/java/org/dspace/app/rest/model/IdentifierRest.java | 1 + .../java/org/dspace/app/rest/model/MetadataFieldRest.java | 2 +- .../java/org/dspace/app/rest/model/MetadataSchemaRest.java | 1 + .../main/java/org/dspace/app/rest/model/OrcidHistoryRest.java | 1 + .../src/main/java/org/dspace/app/rest/model/PropertyRest.java | 1 + .../main/java/org/dspace/app/rest/model/RegistrationRest.java | 2 +- .../main/java/org/dspace/app/rest/model/RelationshipRest.java | 1 + .../java/org/dspace/app/rest/model/RelationshipTypeRest.java | 1 + .../java/org/dspace/app/rest/model/ResearcherProfileRest.java | 3 ++- .../main/java/org/dspace/app/rest/model/SearchEventRest.java | 1 + .../src/main/java/org/dspace/app/rest/model/SiteRest.java | 1 + .../org/dspace/app/rest/model/SubmissionAccessOptionRest.java | 4 ++-- .../org/dspace/app/rest/model/SubmissionCCLicenseRest.java | 2 +- .../org/dspace/app/rest/model/SubmissionCCLicenseUrlRest.java | 2 +- .../org/dspace/app/rest/model/SubmissionDefinitionRest.java | 1 + .../java/org/dspace/app/rest/model/SubmissionFormRest.java | 1 + .../java/org/dspace/app/rest/model/SubmissionSectionRest.java | 1 + .../java/org/dspace/app/rest/model/SubmissionUploadRest.java | 1 + .../main/java/org/dspace/app/rest/model/SubscriptionRest.java | 2 +- .../java/org/dspace/app/rest/model/SupervisionOrderRest.java | 1 + .../java/org/dspace/app/rest/model/SystemWideAlertRest.java | 1 + .../main/java/org/dspace/app/rest/model/TemplateItemRest.java | 1 + .../main/java/org/dspace/app/rest/model/UsageReportRest.java | 1 + .../java/org/dspace/app/rest/model/VersionHistoryRest.java | 1 + .../src/main/java/org/dspace/app/rest/model/VersionRest.java | 1 + .../main/java/org/dspace/app/rest/model/ViewEventRest.java | 1 + .../main/java/org/dspace/app/rest/model/VocabularyRest.java | 1 + .../java/org/dspace/app/rest/model/WorkflowActionRest.java | 2 +- .../org/dspace/app/rest/model/WorkflowDefinitionRest.java | 2 +- .../main/java/org/dspace/app/rest/model/WorkflowItemRest.java | 1 + .../main/java/org/dspace/app/rest/model/WorkflowStepRest.java | 2 +- .../java/org/dspace/app/rest/model/WorkspaceItemRest.java | 1 + .../rest/repository/AuthorizationEpersonLinkRepository.java | 2 +- .../rest/repository/AuthorizationFeatureLinkRepository.java | 2 +- .../rest/repository/AuthorizationObjectLinkRepository.java | 2 +- .../app/rest/repository/BitstreamBundleLinkRepository.java | 2 +- .../app/rest/repository/BitstreamFormatLinkRepository.java | 2 +- .../app/rest/repository/BitstreamThumbnailLinkRepository.java | 2 +- .../dspace/app/rest/repository/BrowseEntryLinkRepository.java | 2 +- .../dspace/app/rest/repository/BrowseItemLinkRepository.java | 2 +- .../app/rest/repository/BundleBitstreamLinkRepository.java | 2 +- .../dspace/app/rest/repository/BundleItemLinkRepository.java | 2 +- .../rest/repository/BundlePrimaryBitstreamLinkRepository.java | 2 +- .../org/dspace/app/rest/repository/BundleRestRepository.java | 2 +- .../app/rest/repository/ClaimedTaskStepLinkRepository.java | 2 +- .../rest/repository/CollectionAdminGroupLinkRepository.java | 2 +- .../CollectionBitstreamReadGroupLinkRepository.java | 2 +- .../repository/CollectionItemReadGroupLinkRepository.java | 2 +- .../app/rest/repository/CollectionLicenseLinkRepository.java | 2 +- .../app/rest/repository/CollectionLogoLinkRepository.java | 2 +- .../rest/repository/CollectionMappedItemLinkRepository.java | 2 +- .../repository/CollectionParentCommunityLinkRepository.java | 2 +- .../repository/CollectionSubmitterGroupLinkRepository.java | 2 +- .../rest/repository/CommunityAdminGroupLinkRepository.java | 2 +- .../rest/repository/CommunityCollectionLinkRepository.java | 2 +- .../app/rest/repository/CommunityLogoLinkRepository.java | 2 +- .../repository/CommunityParentCommunityLinkRepository.java | 2 +- .../rest/repository/CommunitySubcommunityLinkRepository.java | 2 +- .../app/rest/repository/EPersonGroupLinkRepository.java | 2 +- .../rest/repository/EntityTypeRelationshipLinkRepository.java | 4 ++-- .../repository/ExternalSourceEntityTypeLinkRepository.java | 4 ++-- .../app/rest/repository/GroupEPersonLinkRepository.java | 2 +- .../dspace/app/rest/repository/GroupGroupLinkRepository.java | 2 +- .../app/rest/repository/GroupParentObjectLinkRepository.java | 2 +- .../app/rest/repository/ItemAccessStatusLinkRepository.java | 2 +- .../dspace/app/rest/repository/ItemBundleLinkRepository.java | 2 +- .../app/rest/repository/ItemIdentifierLinkRepository.java | 2 +- .../rest/repository/ItemMappedCollectionLinkRepository.java | 2 +- .../rest/repository/ItemOwningCollectionLinkRepository.java | 2 +- .../app/rest/repository/ItemRelationshipLinkRepository.java | 2 +- .../app/rest/repository/ItemTemplateItemOfLinkRepository.java | 2 +- .../app/rest/repository/ItemThumbnailLinkRepository.java | 2 +- .../dspace/app/rest/repository/ItemVersionLinkRepository.java | 2 +- .../app/rest/repository/PoolTaskStepLinkRepository.java | 2 +- .../app/rest/repository/ProcessFileTypesLinkRepository.java | 2 +- .../app/rest/repository/ProcessFilesLinkRepository.java | 2 +- .../app/rest/repository/ProcessOutputLinkRepository.java | 4 ++-- .../RelationshipTypeRelationshipLinkRepository.java | 2 +- .../repository/ResearcherProfileEPersonLinkRepository.java | 3 ++- .../rest/repository/ResearcherProfileItemLinkRepository.java | 2 +- .../repository/SubscriptionDSpaceObjectLinkRepository.java | 4 ++-- .../rest/repository/SubscriptionEPersonLinkRepository.java | 4 ++-- .../app/rest/repository/SubscriptionRestRepository.java | 4 ++-- .../repository/VersionHistoryDraftVersionLinkRepository.java | 4 ++-- .../app/rest/repository/VersionHistoryLinkRepository.java | 2 +- .../dspace/app/rest/repository/VersionItemLinkRepository.java | 2 +- .../dspace/app/rest/repository/VersionsLinkRepository.java | 2 +- .../VocabularyEntryDetailsChildrenLinkRepository.java | 3 ++- .../VocabularyEntryDetailsParentLinkRepository.java | 3 ++- .../app/rest/repository/VocabularyEntryLinkRepository.java | 2 +- .../app/rest/repository/WorkflowItemStepLinkRepository.java | 2 +- .../WorkspaceItemSupervisionOrdersLinkRepository.java | 3 ++- .../org/dspace/app/rest/WorkflowActionRestRepositoryIT.java | 2 +- .../dspace/app/rest/WorkflowDefinitionRestRepositoryIT.java | 2 +- .../org/dspace/app/rest/WorkflowStepRestRepositoryIT.java | 2 +- .../org/dspace/app/rest/matcher/WorkflowActionMatcher.java | 2 +- .../dspace/app/rest/matcher/WorkflowDefinitionMatcher.java | 2 +- .../java/org/dspace/app/rest/matcher/WorkflowStepMatcher.java | 2 +- .../test/java/org/dspace/app/rest/model/MockObjectRest.java | 1 + .../repository/MockObjectNeverEmbedChildLinkRepository.java | 2 +- .../MockObjectOptionallyEmbedChildLinkRepository.java | 2 +- 118 files changed, 135 insertions(+), 101 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/EntityTypeLabelRestController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/EntityTypeLabelRestController.java index 072975417217..9880f21ab915 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/EntityTypeLabelRestController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/EntityTypeLabelRestController.java @@ -40,7 +40,7 @@ * @author Maria Verdonck (Atmire) on 2019-12-13 */ @RestController -@RequestMapping("/api/" + EntityTypeRest.CATEGORY + "/" + EntityTypeRest.NAME_PLURAL) +@RequestMapping("/api/" + EntityTypeRest.CATEGORY + "/" + EntityTypeRest.PLURAL_NAME) public class EntityTypeLabelRestController { protected final EntityTypeService entityTypeService = ContentServiceFactory.getInstance().getEntityTypeService(); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/GroupRestController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/GroupRestController.java index 522d69fbe84b..f644863e03f3 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/GroupRestController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/GroupRestController.java @@ -47,7 +47,7 @@ * This will be the entry point for the api/eperson/groups endpoint with additional paths to it */ @RestController -@RequestMapping("/api/" + GroupRest.CATEGORY + "/" + GroupRest.GROUPS) +@RequestMapping("/api/" + GroupRest.CATEGORY + "/" + GroupRest.PLURAL_NAME) public class GroupRestController { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/SubmissionCCLicenseUrlRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/SubmissionCCLicenseUrlRepository.java index c32d551cbee3..7e30413d8d59 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/SubmissionCCLicenseUrlRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/SubmissionCCLicenseUrlRepository.java @@ -133,8 +133,8 @@ public Class getDomainClass() { public void afterPropertiesSet() { discoverableEndpointsService.register(this, Arrays.asList( Link.of("/api/" + SubmissionCCLicenseUrlRest.CATEGORY + "/" + - SubmissionCCLicenseUrlRest.PLURAL + "/search", - SubmissionCCLicenseUrlRest.PLURAL + "-search"))); + SubmissionCCLicenseUrlRest.PLURAL_NAME + "/search", + SubmissionCCLicenseUrlRest.PLURAL_NAME + "-search"))); } } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/WorkflowDefinitionCollectionsLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/WorkflowDefinitionCollectionsLinkRepository.java index fd1192e0bb51..53d61216e6e7 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/WorkflowDefinitionCollectionsLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/WorkflowDefinitionCollectionsLinkRepository.java @@ -33,7 +33,7 @@ * * @author Maria Verdonck (Atmire) on 11/12/2019 */ -@Component(WorkflowDefinitionRest.CATEGORY + "." + WorkflowDefinitionRest.NAME + "." +@Component(WorkflowDefinitionRest.CATEGORY + "." + WorkflowDefinitionRest.PLURAL_NAME + "." + WorkflowDefinitionRest.COLLECTIONS_MAPPED_TO) public class WorkflowDefinitionCollectionsLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/WorkflowDefinitionStepsLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/WorkflowDefinitionStepsLinkRepository.java index 24c82ee460e2..bf8ac0cf201e 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/WorkflowDefinitionStepsLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/WorkflowDefinitionStepsLinkRepository.java @@ -32,7 +32,7 @@ * * @author Maria Verdonck (Atmire) on 24/02/2020 */ -@Component(WorkflowDefinitionRest.CATEGORY + "." + WorkflowDefinitionRest.NAME + "." +@Component(WorkflowDefinitionRest.CATEGORY + "." + WorkflowDefinitionRest.PLURAL_NAME + "." + WorkflowDefinitionRest.STEPS) public class WorkflowDefinitionStepsLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/WorkflowStepActionsLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/WorkflowStepActionsLinkRepository.java index f2b6a423f88f..e34b8bb1731b 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/WorkflowStepActionsLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/WorkflowStepActionsLinkRepository.java @@ -30,7 +30,7 @@ * * @author Maria Verdonck (Atmire) on 24/02/2020 */ -@Component(WorkflowStepRest.CATEGORY + "." + WorkflowStepRest.NAME + "." +@Component(WorkflowStepRest.CATEGORY + "." + WorkflowStepRest.PLURAL_NAME + "." + WorkflowStepRest.ACTIONS) public class WorkflowStepActionsLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/process/SubmissionCCLicenseUrlResourceHalLinkFactory.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/process/SubmissionCCLicenseUrlResourceHalLinkFactory.java index 07d5e46c61e0..7ecd8fc3ecf2 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/process/SubmissionCCLicenseUrlResourceHalLinkFactory.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/process/SubmissionCCLicenseUrlResourceHalLinkFactory.java @@ -51,8 +51,8 @@ protected void addLinks(SubmissionCCLicenseUrlResource halResource, final Pageab UriComponentsBuilder uriComponentsBuilder = uriBuilder(getMethodOn().executeSearchMethods( - SubmissionCCLicenseUrlRest.CATEGORY, SubmissionCCLicenseUrlRest.PLURAL, "rightsByQuestions", null, null, - null, null, new LinkedMultiValueMap<>())); + SubmissionCCLicenseUrlRest.CATEGORY, SubmissionCCLicenseUrlRest.PLURAL_NAME, "rightsByQuestions", null, + null, null, null, new LinkedMultiValueMap<>())); for (String key : parameterMap.keySet()) { uriComponentsBuilder.queryParam(key, parameterMap.get(key)); } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationFeatureRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationFeatureRest.java index cf602e2fb3ab..1eae76352442 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationFeatureRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationFeatureRest.java @@ -21,6 +21,7 @@ */ public class AuthorizationFeatureRest extends BaseObjectRest { public static final String NAME = "feature"; + public static final String PLURAL_NAME = "features"; public static final String CATEGORY = RestAddressableModel.AUTHORIZATION; private String description; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationRest.java index 95f288831303..300f45c111a8 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationRest.java @@ -24,6 +24,7 @@ }) public class AuthorizationRest extends BaseObjectRest { public static final String NAME = "authorization"; + public static final String PLURAL_NAME = "authorizations"; public static final String CATEGORY = RestAddressableModel.AUTHORIZATION; public static final String EPERSON = "eperson"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BitstreamFormatRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BitstreamFormatRest.java index 1b02a1d89a4d..96d7ebf3d6c0 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BitstreamFormatRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BitstreamFormatRest.java @@ -20,6 +20,7 @@ */ public class BitstreamFormatRest extends BaseObjectRest { public static final String NAME = "bitstreamformat"; + public static final String PLURAL_NAME = "bitstreamformats"; public static final String CATEGORY = RestAddressableModel.CORE; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BrowseIndexRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BrowseIndexRest.java index f7978f00fdf5..4b5517643f76 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BrowseIndexRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BrowseIndexRest.java @@ -33,6 +33,7 @@ public class BrowseIndexRest extends BaseObjectRest { private static final long serialVersionUID = -4870333170249999559L; public static final String NAME = "browse"; + public static final String PLURAL_NAME = "browses"; public static final String CATEGORY = RestAddressableModel.DISCOVER; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BulkAccessConditionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BulkAccessConditionRest.java index 97d35117d1da..32d38173e7fa 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BulkAccessConditionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BulkAccessConditionRest.java @@ -23,7 +23,7 @@ public class BulkAccessConditionRest extends BaseObjectRest { private static final long serialVersionUID = -7708437586052984082L; public static final String NAME = "bulkaccessconditionoption"; - public static final String PLURAL = "bulkaccessconditionoptions"; + public static final String PLURAL_NAME = "bulkaccessconditionoptions"; public static final String CATEGORY = RestAddressableModel.CONFIGURATION; private String id; @@ -81,4 +81,4 @@ public Class getController() { return RestResourceController.class; } -} \ No newline at end of file +} diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/DiscoveryResultsRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/DiscoveryResultsRest.java index bf1d513a8160..a6db2e58a10a 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/DiscoveryResultsRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/DiscoveryResultsRest.java @@ -21,6 +21,7 @@ public abstract class DiscoveryResultsRest extends BaseObjectRest { @JsonIgnore public static final String NAME = "discover"; + public static final String PLURAL_NAME = "discovers"; public static final String CATEGORY = RestModel.DISCOVER; private String scope; private String query; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EPersonRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EPersonRest.java index 7b4c683322a9..6fb211b8307c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EPersonRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EPersonRest.java @@ -27,6 +27,7 @@ }) public class EPersonRest extends DSpaceObjectRest { public static final String NAME = "eperson"; + public static final String PLURAL_NAME = "epersons"; public static final String CATEGORY = RestAddressableModel.EPERSON; public static final String GROUPS = "groups"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EntityTypeRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EntityTypeRest.java index f777b3a29c18..7600ad838370 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EntityTypeRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EntityTypeRest.java @@ -25,7 +25,7 @@ public class EntityTypeRest extends BaseObjectRest { private static final long serialVersionUID = 8166078961459192770L; public static final String NAME = "entitytype"; - public static final String NAME_PLURAL = "entitytypes"; + public static final String PLURAL_NAME = "entitytypes"; public static final String CATEGORY = "core"; public static final String RELATION_SHIP_TYPES = "relationshiptypes"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/FeedbackRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/FeedbackRest.java index 00f1e92c87c2..9a7fee568e88 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/FeedbackRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/FeedbackRest.java @@ -19,6 +19,7 @@ public class FeedbackRest extends BaseObjectRest { private static final long serialVersionUID = 1L; public static final String NAME = "feedback"; + public static final String PLURAL_NAME = "feedbacks"; public static final String CATEGORY = RestAddressableModel.TOOLS; private String page; @@ -72,4 +73,4 @@ public Class getController() { return RestResourceController.class; } -} \ No newline at end of file +} diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/GroupRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/GroupRest.java index 3f60b2d61fd6..a50aa6384746 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/GroupRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/GroupRest.java @@ -33,9 +33,8 @@ }) public class GroupRest extends DSpaceObjectRest { public static final String NAME = "group"; + public static final String PLURAL_NAME = "groups"; public static final String CATEGORY = RestAddressableModel.EPERSON; - - public static final String GROUPS = "groups"; public static final String SUBGROUPS = "subgroups"; public static final String EPERSONS = "epersons"; public static final String OBJECT = "object"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/IdentifierRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/IdentifierRest.java index 6cfb147ea314..68a12f3166cd 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/IdentifierRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/IdentifierRest.java @@ -21,6 +21,7 @@ public class IdentifierRest extends BaseObjectRest implements RestModel // Set names used in component wiring public static final String NAME = "identifier"; public static final String PLURAL_NAME = "identifiers"; + public static final String CATEGORY = "pid"; private String value; private String identifierType; private String identifierStatus; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/MetadataFieldRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/MetadataFieldRest.java index 4524f82a68cb..2e17f986449c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/MetadataFieldRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/MetadataFieldRest.java @@ -18,7 +18,7 @@ */ public class MetadataFieldRest extends BaseObjectRest { public static final String NAME = "metadatafield"; - public static final String NAME_PLURAL = "metadatafields"; + public static final String PLURAL_NAME = "metadatafields"; public static final String CATEGORY = RestAddressableModel.CORE; @JsonIgnore diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/MetadataSchemaRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/MetadataSchemaRest.java index 655d4c86d87f..fd4ada665179 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/MetadataSchemaRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/MetadataSchemaRest.java @@ -17,6 +17,7 @@ */ public class MetadataSchemaRest extends BaseObjectRest { public static final String NAME = "metadataschema"; + public static final String PLURAL_NAME = "metadataschemas"; public static final String CATEGORY = RestAddressableModel.CORE; private String prefix; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/OrcidHistoryRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/OrcidHistoryRest.java index 02e0f4706208..a793006a2387 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/OrcidHistoryRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/OrcidHistoryRest.java @@ -25,6 +25,7 @@ public class OrcidHistoryRest extends BaseObjectRest { public static final String CATEGORY = RestModel.EPERSON; public static final String NAME = "orcidhistory"; + public static final String PLURAL_NAME = "orcidhistories"; private UUID profileItemId; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/PropertyRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/PropertyRest.java index 365a6790192b..d51f0f6fcca2 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/PropertyRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/PropertyRest.java @@ -18,6 +18,7 @@ */ public class PropertyRest extends BaseObjectRest { public static final String NAME = "property"; + public static final String PLURAL_NAME = "properties"; public static final String CATEGORY = RestAddressableModel.CONFIGURATION; public String getName() { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RegistrationRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RegistrationRest.java index e8397f8ca763..9e525470e39f 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RegistrationRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RegistrationRest.java @@ -21,7 +21,7 @@ public class RegistrationRest extends RestAddressableModel { public static final String NAME = "registration"; - public static final String NAME_PLURAL = "registrations"; + public static final String PLURAL_NAME = "registrations"; public static final String CATEGORY = EPERSON; private String email; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipRest.java index dd35a0726e9d..a4ea16282991 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipRest.java @@ -26,6 +26,7 @@ }) public class RelationshipRest extends BaseObjectRest { public static final String NAME = "relationship"; + public static final String PLURAL_NAME = "relationships"; public static final String CATEGORY = "core"; public static final String RELATIONSHIP_TYPE = "relationshipType"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipTypeRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipTypeRest.java index e3943643a52a..6bfc75621d4b 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipTypeRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipTypeRest.java @@ -18,6 +18,7 @@ public class RelationshipTypeRest extends BaseObjectRest { public static final String NAME = "relationshiptype"; + public static final String PLURAL_NAME = "relationshiptypes"; public static final String CATEGORY = "core"; private String leftwardType; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ResearcherProfileRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ResearcherProfileRest.java index 4224cfeeb924..d6a717a922ae 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ResearcherProfileRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ResearcherProfileRest.java @@ -28,6 +28,7 @@ public class ResearcherProfileRest extends BaseObjectRest { private static final long serialVersionUID = 1L; public static final String CATEGORY = RestModel.EPERSON; public static final String NAME = "profile"; + public static final String PLURAL_NAME = "profiles"; public static final String ITEM = "item"; public static final String EPERSON = "eperson"; @@ -129,4 +130,4 @@ public void setFundingsPreference(String fundingsPreference) { } -} \ No newline at end of file +} diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchEventRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchEventRest.java index 46827711f2ea..42061626387d 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchEventRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchEventRest.java @@ -19,6 +19,7 @@ public class SearchEventRest extends BaseObjectRest { public static final String NAME = "searchevent"; + public static final String PLURAL_NAME = "searchevents"; public static final String CATEGORY = RestAddressableModel.STATISTICS; private String query; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SiteRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SiteRest.java index 533ad47df02c..c45c1004f9f8 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SiteRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SiteRest.java @@ -17,6 +17,7 @@ */ public class SiteRest extends DSpaceObjectRest { public static final String NAME = "site"; + public static final String PLURAL_NAME = "sites"; public static final String CATEGORY = RestAddressableModel.CORE; @Override diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionAccessOptionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionAccessOptionRest.java index 08f4c82f435e..407a39fca5bb 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionAccessOptionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionAccessOptionRest.java @@ -23,7 +23,7 @@ public class SubmissionAccessOptionRest extends BaseObjectRest { private static final long serialVersionUID = -7708437586052984082L; public static final String NAME = "submissionaccessoption"; - public static final String PLURAL = "submissionaccessoptions"; + public static final String PLURAL_NAME = "submissionaccessoptions"; public static final String CATEGORY = RestAddressableModel.CONFIGURATION; private String id; @@ -76,4 +76,4 @@ public Class getController() { return RestResourceController.class; } -} \ No newline at end of file +} diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionCCLicenseRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionCCLicenseRest.java index 23589d5a4655..57315cd1a57b 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionCCLicenseRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionCCLicenseRest.java @@ -20,7 +20,7 @@ */ public class SubmissionCCLicenseRest extends BaseObjectRest { public static final String NAME = "submissioncclicense"; - public static final String PLURAL = "submissioncclicenses"; + public static final String PLURAL_NAME = "submissioncclicenses"; public static final String CATEGORY = RestAddressableModel.CONFIGURATION; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionCCLicenseUrlRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionCCLicenseUrlRest.java index 77263ba3178b..870fe0297247 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionCCLicenseUrlRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionCCLicenseUrlRest.java @@ -17,7 +17,7 @@ */ public class SubmissionCCLicenseUrlRest extends BaseObjectRest { public static final String NAME = "submissioncclicenseUrl"; - public static final String PLURAL = "submissioncclicenseUrls"; + public static final String PLURAL_NAME = "submissioncclicenseUrls"; public static final String CATEGORY = RestAddressableModel.CONFIGURATION; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionDefinitionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionDefinitionRest.java index fb440345c286..1316e3b91b6f 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionDefinitionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionDefinitionRest.java @@ -20,6 +20,7 @@ */ public class SubmissionDefinitionRest extends BaseObjectRest { public static final String NAME = "submissiondefinition"; + public static final String PLURAL_NAME = "submissiondefinitions"; public static final String CATEGORY = RestAddressableModel.CONFIGURATION; private String name; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionFormRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionFormRest.java index 8dededdabb96..fdc6b53e2351 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionFormRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionFormRest.java @@ -18,6 +18,7 @@ */ public class SubmissionFormRest extends BaseObjectRest { public static final String NAME = "submissionform"; + public static final String PLURAL_NAME = "submissionforms"; public static final String NAME_LINK_ON_PANEL = RestAddressableModel.CONFIGURATION; public static final String CATEGORY = RestAddressableModel.CONFIGURATION; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionSectionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionSectionRest.java index 55f7fc035a35..5a827554c522 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionSectionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionSectionRest.java @@ -23,6 +23,7 @@ public class SubmissionSectionRest extends BaseObjectRest { public static final String NAME = "submissionsection"; + public static final String PLURAL_NAME = "submissionsections"; public static final String ATTRIBUTE_NAME = "sections"; private String header; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionUploadRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionUploadRest.java index 4d8504fa0be4..4d0cedc9fecc 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionUploadRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionUploadRest.java @@ -21,6 +21,7 @@ public class SubmissionUploadRest extends BaseObjectRest { public static final String NAME = "submissionupload"; + public static final String PLURAL_NAME = "submissionuploads"; public static final String NAME_LINK_ON_PANEL = RestAddressableModel.CONFIGURATION; public static final String CATEGORY = RestAddressableModel.CONFIGURATION; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubscriptionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubscriptionRest.java index 78a81c38b162..dd94cc60514b 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubscriptionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubscriptionRest.java @@ -21,7 +21,7 @@ public class SubscriptionRest extends BaseObjectRest { private static final long serialVersionUID = 1L; public static final String NAME = "subscription"; - public static final String NAME_PLURAL = "subscriptions"; + public static final String PLURAL_NAME = "subscriptions"; public static final String CATEGORY = "core"; public static final String DSPACE_OBJECT = "resource"; public static final String EPERSON = "eperson"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SupervisionOrderRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SupervisionOrderRest.java index e114fdeb39f2..75a391c9e4dd 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SupervisionOrderRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SupervisionOrderRest.java @@ -19,6 +19,7 @@ public class SupervisionOrderRest extends BaseObjectRest { public static final String NAME = "supervisionorder"; + public static final String PLURAL_NAME = "supervisionorders"; public static final String CATEGORY = RestAddressableModel.CORE; private Integer id; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SystemWideAlertRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SystemWideAlertRest.java index 995ec8e93404..1fde31d45aab 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SystemWideAlertRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SystemWideAlertRest.java @@ -19,6 +19,7 @@ */ public class SystemWideAlertRest extends BaseObjectRest { public static final String NAME = "systemwidealert"; + public static final String PLURAL_NAME = "systemwidealerts"; public static final String CATEGORY = RestAddressableModel.SYSTEM; public String getCategory() { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/TemplateItemRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/TemplateItemRest.java index cc6b11d12af9..48aa30ba1605 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/TemplateItemRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/TemplateItemRest.java @@ -21,6 +21,7 @@ public class TemplateItemRest extends BaseObjectRest { private UUID uuid; public static final String NAME = "itemtemplate"; + public static final String PLURAL_NAME = "itemtemplates"; public static final String CATEGORY = RestAddressableModel.CORE; @JsonIgnore private CollectionRest templateItemOf; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportRest.java index a59535fb9419..1be1a352637b 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportRest.java @@ -20,6 +20,7 @@ */ public class UsageReportRest extends BaseObjectRest { public static final String NAME = "usagereport"; + public static final String PLURAL_NAME = "usagereports"; public static final String CATEGORY = RestModel.STATISTICS; @JsonProperty(value = "report-type") diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionHistoryRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionHistoryRest.java index e93e131aadb7..cb6294dd7449 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionHistoryRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionHistoryRest.java @@ -32,6 +32,7 @@ public class VersionHistoryRest extends BaseObjectRest { private Boolean draftVersion; public static final String NAME = "versionhistory"; + public static final String PLURAL_NAME = "versionhistories"; public static final String CATEGORY = RestAddressableModel.VERSIONING; public static final String VERSIONS = "versions"; public static final String DRAFT_VERSION = "draftVersion"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionRest.java index abdc64295fdc..1ad98067795c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionRest.java @@ -28,6 +28,7 @@ public class VersionRest extends BaseObjectRest { public static final String NAME = "version"; + public static final String PLURAL_NAME = "versions"; public static final String CATEGORY = RestAddressableModel.VERSIONING; public static final String VERSION_HISTORY = "versionhistory"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ViewEventRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ViewEventRest.java index 897a3f86ae99..50163339cea8 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ViewEventRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ViewEventRest.java @@ -19,6 +19,7 @@ public class ViewEventRest extends BaseObjectRest { public static final String NAME = "viewevent"; + public static final String PLURAL_NAME = "viewevents"; public static final String CATEGORY = RestAddressableModel.STATISTICS; private UUID targetId; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyRest.java index cc848b945b2f..b4a62ae383f7 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyRest.java @@ -22,6 +22,7 @@ public class VocabularyRest extends BaseObjectRest { public static final String NAME = "vocabulary"; + public static final String PLURAL_NAME = "vocabularies"; public static final String CATEGORY = RestAddressableModel.SUBMISSION; public static final String ENTRIES = "entries"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowActionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowActionRest.java index 07a2c36cff96..cdfcfa1ee4e5 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowActionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowActionRest.java @@ -23,7 +23,7 @@ public class WorkflowActionRest extends BaseObjectRest { public static final String CATEGORY = "config"; public static final String NAME = "workflowaction"; - public static final String NAME_PLURAL = "workflowactions"; + public static final String PLURAL_NAME = "workflowactions"; private List options; private List advancedOptions; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowDefinitionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowDefinitionRest.java index 7c2de7071bde..c31ca5be5beb 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowDefinitionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowDefinitionRest.java @@ -31,7 +31,7 @@ public class WorkflowDefinitionRest extends BaseObjectRest { public static final String CATEGORY = "config"; public static final String NAME = "workflowdefinition"; - public static final String NAME_PLURAL = "workflowdefinitions"; + public static final String PLURAL_NAME = "workflowdefinitions"; public static final String COLLECTIONS_MAPPED_TO = "collections"; public static final String STEPS = "steps"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowItemRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowItemRest.java index 8f580f441477..226ee0eeceb5 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowItemRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowItemRest.java @@ -22,6 +22,7 @@ }) public class WorkflowItemRest extends AInprogressSubmissionRest { public static final String NAME = "workflowitem"; + public static final String PLURAL_NAME = "workflowitems"; public static final String CATEGORY = RestAddressableModel.WORKFLOW; public static final String STEP = "step"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowStepRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowStepRest.java index 648cffbca80d..3a0491b95c4a 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowStepRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowStepRest.java @@ -27,7 +27,7 @@ public class WorkflowStepRest extends BaseObjectRest { public static final String CATEGORY = "config"; public static final String NAME = "workflowstep"; - public static final String NAME_PLURAL = "workflowsteps"; + public static final String PLURAL_NAME = "workflowsteps"; public static final String ACTIONS = "workflowactions"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkspaceItemRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkspaceItemRest.java index 57a5ab5c7f0e..688f4c7496f8 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkspaceItemRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkspaceItemRest.java @@ -22,6 +22,7 @@ }) public class WorkspaceItemRest extends AInprogressSubmissionRest { public static final String NAME = "workspaceitem"; + public static final String PLURAL_NAME = "workspaceitems"; public static final String CATEGORY = RestAddressableModel.SUBMISSION; public static final String SUPERVISION_ORDERS = "supervisionOrders"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationEpersonLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationEpersonLinkRepository.java index 5ffbd95a775a..dad973b0f845 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationEpersonLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationEpersonLinkRepository.java @@ -25,7 +25,7 @@ /** * Link repository for "eperson" subresource of an individual authorization. */ -@Component(AuthorizationRest.CATEGORY + "." + AuthorizationRest.NAME + "." + AuthorizationRest.EPERSON) +@Component(AuthorizationRest.CATEGORY + "." + AuthorizationRest.PLURAL_NAME + "." + AuthorizationRest.EPERSON) public class AuthorizationEpersonLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationFeatureLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationFeatureLinkRepository.java index cbfa848df33b..6bf8b2236791 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationFeatureLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationFeatureLinkRepository.java @@ -24,7 +24,7 @@ /** * Link repository for "feature" subresource of an individual authorization. */ -@Component(AuthorizationRest.CATEGORY + "." + AuthorizationRest.NAME + "." + AuthorizationRest.FEATURE) +@Component(AuthorizationRest.CATEGORY + "." + AuthorizationRest.PLURAL_NAME + "." + AuthorizationRest.FEATURE) public class AuthorizationFeatureLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationObjectLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationObjectLinkRepository.java index f010b28fa5df..5bf7c1b9b6cc 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationObjectLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationObjectLinkRepository.java @@ -24,7 +24,7 @@ /** * Link repository for "object" subresource of an individual authorization. */ -@Component(AuthorizationRest.CATEGORY + "." + AuthorizationRest.NAME + "." + AuthorizationRest.OBJECT) +@Component(AuthorizationRest.CATEGORY + "." + AuthorizationRest.PLURAL_NAME + "." + AuthorizationRest.OBJECT) public class AuthorizationObjectLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamBundleLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamBundleLinkRepository.java index bcef1ef33d08..17c26174d3f1 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamBundleLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamBundleLinkRepository.java @@ -27,7 +27,7 @@ /** * Link repository for "bundle" subresource of an individual bitstream. */ -@Component(BitstreamRest.CATEGORY + "." + BitstreamRest.NAME + "." + BitstreamRest.BUNDLE) +@Component(BitstreamRest.CATEGORY + "." + BitstreamRest.PLURAL_NAME + "." + BitstreamRest.BUNDLE) public class BitstreamBundleLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamFormatLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamFormatLinkRepository.java index 74454161a031..491eb2c34817 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamFormatLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamFormatLinkRepository.java @@ -27,7 +27,7 @@ /** * Link repository for "format" subresource of an individual bitstream. */ -@Component(BitstreamRest.CATEGORY + "." + BitstreamRest.NAME + "." + BitstreamRest.FORMAT) +@Component(BitstreamRest.CATEGORY + "." + BitstreamRest.PLURAL_NAME + "." + BitstreamRest.FORMAT) public class BitstreamFormatLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamThumbnailLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamThumbnailLinkRepository.java index afe864a8660d..57d5f107e06f 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamThumbnailLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamThumbnailLinkRepository.java @@ -27,7 +27,7 @@ /** * Link repository for the thumbnail Bitstream of a Bitstream */ -@Component(BitstreamRest.CATEGORY + "." + BitstreamRest.NAME + "." + BitstreamRest.THUMBNAIL) +@Component(BitstreamRest.CATEGORY + "." + BitstreamRest.PLURAL_NAME + "." + BitstreamRest.THUMBNAIL) public class BitstreamThumbnailLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired BitstreamService bitstreamService; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BrowseEntryLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BrowseEntryLinkRepository.java index f608595c3dda..cc1fcc9d5d9d 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BrowseEntryLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BrowseEntryLinkRepository.java @@ -40,7 +40,7 @@ * * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(BrowseIndexRest.CATEGORY + "." + BrowseIndexRest.NAME + "." + BrowseIndexRest.LINK_ENTRIES) +@Component(BrowseIndexRest.CATEGORY + "." + BrowseIndexRest.PLURAL_NAME + "." + BrowseIndexRest.LINK_ENTRIES) public class BrowseEntryLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BrowseItemLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BrowseItemLinkRepository.java index baa79bc80ae7..6dcf65fd501c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BrowseItemLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BrowseItemLinkRepository.java @@ -42,7 +42,7 @@ * * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(BrowseIndexRest.CATEGORY + "." + BrowseIndexRest.NAME + "." + BrowseIndexRest.LINK_ITEMS) +@Component(BrowseIndexRest.CATEGORY + "." + BrowseIndexRest.PLURAL_NAME + "." + BrowseIndexRest.LINK_ITEMS) public class BrowseItemLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BundleBitstreamLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BundleBitstreamLinkRepository.java index b0a4488e037e..393b49052071 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BundleBitstreamLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BundleBitstreamLinkRepository.java @@ -29,7 +29,7 @@ /** * Link repository for "bitstreams" subresource of an individual bundle. */ -@Component(BundleRest.CATEGORY + "." + BundleRest.NAME + "." + BundleRest.BITSTREAMS) +@Component(BundleRest.CATEGORY + "." + BundleRest.PLURAL_NAME + "." + BundleRest.BITSTREAMS) public class BundleBitstreamLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BundleItemLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BundleItemLinkRepository.java index 4df81d5054ef..53dedddfbfc4 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BundleItemLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BundleItemLinkRepository.java @@ -28,7 +28,7 @@ /** * Link repository for "item" subresource of an individual bundle. */ -@Component(BundleRest.CATEGORY + "." + BundleRest.NAME + "." + BundleRest.ITEM) +@Component(BundleRest.CATEGORY + "." + BundleRest.PLURAL_NAME + "." + BundleRest.ITEM) public class BundleItemLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BundlePrimaryBitstreamLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BundlePrimaryBitstreamLinkRepository.java index 3d11379cd328..f419b0b8aaf3 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BundlePrimaryBitstreamLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BundlePrimaryBitstreamLinkRepository.java @@ -30,7 +30,7 @@ /** * Link repository for "primaryBitstream" subresource of an individual bundle. */ -@Component(BundleRest.CATEGORY + "." + BundleRest.NAME + "." + BundleRest.PRIMARY_BITSTREAM) +@Component(BundleRest.CATEGORY + "." + BundleRest.PLURAL_NAME + "." + BundleRest.PRIMARY_BITSTREAM) public class BundlePrimaryBitstreamLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BundleRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BundleRestRepository.java index f750743db66e..e12594ddc143 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BundleRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BundleRestRepository.java @@ -49,7 +49,7 @@ * @author Jelle Pelgrims (jelle.pelgrims at atmire.com) */ -@Component(BundleRest.CATEGORY + "." + BundleRest.NAME) +@Component(BundleRest.CATEGORY + "." + BundleRest.PLURAL_NAME) public class BundleRestRepository extends DSpaceObjectRestRepository { private static final Logger log = LogManager.getLogger(); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ClaimedTaskStepLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ClaimedTaskStepLinkRepository.java index 9ee277171e84..3093a2ac0c9f 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ClaimedTaskStepLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ClaimedTaskStepLinkRepository.java @@ -26,7 +26,7 @@ /** * Link repository for the Steps subresources for an individual ClaimedTask */ -@Component(ClaimedTaskRest.CATEGORY + "." + ClaimedTaskRest.NAME + "." + ClaimedTaskRest.STEP) +@Component(ClaimedTaskRest.CATEGORY + "." + ClaimedTaskRest.PLURAL_NAME + "." + ClaimedTaskRest.STEP) public class ClaimedTaskStepLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionAdminGroupLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionAdminGroupLinkRepository.java index b239dc045771..0ce8aa82e307 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionAdminGroupLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionAdminGroupLinkRepository.java @@ -32,7 +32,7 @@ * Link repository for "admingroup" subresource of an individual collection. * */ -@Component(CollectionRest.CATEGORY + "." + CollectionRest.NAME + "." + CollectionRest.ADMIN_GROUP) +@Component(CollectionRest.CATEGORY + "." + CollectionRest.PLURAL_NAME + "." + CollectionRest.ADMIN_GROUP) public class CollectionAdminGroupLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionBitstreamReadGroupLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionBitstreamReadGroupLinkRepository.java index c1b322a49010..55cacf3e33f7 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionBitstreamReadGroupLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionBitstreamReadGroupLinkRepository.java @@ -35,7 +35,7 @@ * Link repository for "BitstreamReadGroup" subresource of an individual collection. * */ -@Component(CollectionRest.CATEGORY + "." + CollectionRest.NAME + "." + CollectionRest.BITSTREAM_READ_GROUP) +@Component(CollectionRest.CATEGORY + "." + CollectionRest.PLURAL_NAME + "." + CollectionRest.BITSTREAM_READ_GROUP) public class CollectionBitstreamReadGroupLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionItemReadGroupLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionItemReadGroupLinkRepository.java index 77acb8e359c8..a8bf3615cf87 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionItemReadGroupLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionItemReadGroupLinkRepository.java @@ -35,7 +35,7 @@ * Link repository for "ItemReadGroup" subresource of an individual collection. * */ -@Component(CollectionRest.CATEGORY + "." + CollectionRest.NAME + "." + CollectionRest.ITEM_READ_GROUP) +@Component(CollectionRest.CATEGORY + "." + CollectionRest.PLURAL_NAME + "." + CollectionRest.ITEM_READ_GROUP) public class CollectionItemReadGroupLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionLicenseLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionLicenseLinkRepository.java index 4aceea599c4b..dcb9705dbc16 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionLicenseLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionLicenseLinkRepository.java @@ -31,7 +31,7 @@ * * @author Luigi Andrea Pascarelli (luigiandrea.pascarelli at 4science.it) */ -@Component(CollectionRest.CATEGORY + "." + CollectionRest.NAME + "." + CollectionRest.LICENSE) +@Component(CollectionRest.CATEGORY + "." + CollectionRest.PLURAL_NAME + "." + CollectionRest.LICENSE) public class CollectionLicenseLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionLogoLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionLogoLinkRepository.java index 94bf99fc1ff7..cf2360dc05fa 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionLogoLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionLogoLinkRepository.java @@ -27,7 +27,7 @@ /** * Link repository for "logo" subresource of an individual collection. */ -@Component(CollectionRest.CATEGORY + "." + CollectionRest.NAME + "." + CollectionRest.LOGO) +@Component(CollectionRest.CATEGORY + "." + CollectionRest.PLURAL_NAME + "." + CollectionRest.LOGO) public class CollectionLogoLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionMappedItemLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionMappedItemLinkRepository.java index 1118d0bd7bd4..02795b312e96 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionMappedItemLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionMappedItemLinkRepository.java @@ -32,7 +32,7 @@ /** * Link repository for "mappedItems" subresource of an individual collection. */ -@Component(CollectionRest.CATEGORY + "." + CollectionRest.NAME + "." + CollectionRest.MAPPED_ITEMS) +@Component(CollectionRest.CATEGORY + "." + CollectionRest.PLURAL_NAME + "." + CollectionRest.MAPPED_ITEMS) public class CollectionMappedItemLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionParentCommunityLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionParentCommunityLinkRepository.java index fd21397b36af..62a6f4e41d7e 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionParentCommunityLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionParentCommunityLinkRepository.java @@ -28,7 +28,7 @@ /** * LinkRepository for the ParentCommunity object for a Collection */ -@Component(CollectionRest.CATEGORY + "." + CollectionRest.NAME + "." + CollectionRest.PARENT_COMMUNITY) +@Component(CollectionRest.CATEGORY + "." + CollectionRest.PLURAL_NAME + "." + CollectionRest.PARENT_COMMUNITY) public class CollectionParentCommunityLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionSubmitterGroupLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionSubmitterGroupLinkRepository.java index 4e6d901387ee..58645479fa61 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionSubmitterGroupLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionSubmitterGroupLinkRepository.java @@ -32,7 +32,7 @@ * Link repository for "submittergroup" subresource of an individual collection. * */ -@Component(CollectionRest.CATEGORY + "." + CollectionRest.NAME + "." + CollectionRest.SUBMITTERS_GROUP) +@Component(CollectionRest.CATEGORY + "." + CollectionRest.PLURAL_NAME + "." + CollectionRest.SUBMITTERS_GROUP) public class CollectionSubmitterGroupLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityAdminGroupLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityAdminGroupLinkRepository.java index b2ca20a7bceb..a3550584080b 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityAdminGroupLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityAdminGroupLinkRepository.java @@ -32,7 +32,7 @@ * Link repository for "admingroup" subresource of an individual community. * */ -@Component(CommunityRest.CATEGORY + "." + CommunityRest.NAME + "." + CommunityRest.ADMIN_GROUP) +@Component(CommunityRest.CATEGORY + "." + CommunityRest.PLURAL_NAME + "." + CommunityRest.ADMIN_GROUP) public class CommunityAdminGroupLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityCollectionLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityCollectionLinkRepository.java index 3c728d8c31b9..f8e88918327e 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityCollectionLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityCollectionLinkRepository.java @@ -40,7 +40,7 @@ /** * Link repository for "collections" subresource of an individual community. */ -@Component(CommunityRest.CATEGORY + "." + CommunityRest.NAME + "." + CommunityRest.COLLECTIONS) +@Component(CommunityRest.CATEGORY + "." + CommunityRest.PLURAL_NAME + "." + CommunityRest.COLLECTIONS) public class CommunityCollectionLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityLogoLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityLogoLinkRepository.java index e3892462a32b..0765e2efa3e1 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityLogoLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityLogoLinkRepository.java @@ -27,7 +27,7 @@ /** * Link repository for "logo" subresource of an individual community. */ -@Component(CommunityRest.CATEGORY + "." + CommunityRest.NAME + "." + CommunityRest.LOGO) +@Component(CommunityRest.CATEGORY + "." + CommunityRest.PLURAL_NAME + "." + CommunityRest.LOGO) public class CommunityLogoLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityParentCommunityLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityParentCommunityLinkRepository.java index ab23f3afed0d..be58f7d26794 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityParentCommunityLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityParentCommunityLinkRepository.java @@ -26,7 +26,7 @@ /** * LinkRepository for the ParentCommunity object for a Community */ -@Component(CommunityRest.CATEGORY + "." + CommunityRest.NAME + "." + CommunityRest.PARENT_COMMUNITY) +@Component(CommunityRest.CATEGORY + "." + CommunityRest.PLURAL_NAME + "." + CommunityRest.PARENT_COMMUNITY) public class CommunityParentCommunityLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunitySubcommunityLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunitySubcommunityLinkRepository.java index 135d964f3f42..a577e97f98e7 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunitySubcommunityLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunitySubcommunityLinkRepository.java @@ -38,7 +38,7 @@ /** * Link repository for "subcommunities" subresource of an individual community. */ -@Component(CommunityRest.CATEGORY + "." + CommunityRest.NAME + "." + CommunityRest.SUBCOMMUNITIES) +@Component(CommunityRest.CATEGORY + "." + CommunityRest.PLURAL_NAME + "." + CommunityRest.SUBCOMMUNITIES) public class CommunitySubcommunityLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EPersonGroupLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EPersonGroupLinkRepository.java index 0aeda20678a4..af38584c1fe0 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EPersonGroupLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EPersonGroupLinkRepository.java @@ -29,7 +29,7 @@ /** * Link repository for the direct "groups" subresource of an individual eperson. */ -@Component(EPersonRest.CATEGORY + "." + EPersonRest.NAME + "." + EPersonRest.GROUPS) +@Component(EPersonRest.CATEGORY + "." + EPersonRest.PLURAL_NAME + "." + EPersonRest.GROUPS) public class EPersonGroupLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EntityTypeRelationshipLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EntityTypeRelationshipLinkRepository.java index 3d71ddd9bb30..cea27f58300b 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EntityTypeRelationshipLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EntityTypeRelationshipLinkRepository.java @@ -31,7 +31,7 @@ * * @author Mykhaylo Boychuk (mykhaylo.boychuk at 4science.it) */ -@Component(EntityTypeRest.CATEGORY + "." + EntityTypeRest.NAME + "." + EntityTypeRest.RELATION_SHIP_TYPES) +@Component(EntityTypeRest.CATEGORY + "." + EntityTypeRest.PLURAL_NAME + "." + EntityTypeRest.RELATION_SHIP_TYPES) public class EntityTypeRelationshipLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @@ -70,4 +70,4 @@ public Page getEntityTypeRelationship(@Nullable HttpServle } } -} \ No newline at end of file +} diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ExternalSourceEntityTypeLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ExternalSourceEntityTypeLinkRepository.java index 4ed39c1893ea..21e87b44d00f 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ExternalSourceEntityTypeLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ExternalSourceEntityTypeLinkRepository.java @@ -34,7 +34,7 @@ * * @author Mykhaylo Boychuk (mykhaylo.boychuk at 4science.it) */ -@Component(ExternalSourceRest.CATEGORY + "." + ExternalSourceRest.NAME + "." + ExternalSourceRest.ENTITY_TYPES) +@Component(ExternalSourceRest.CATEGORY + "." + ExternalSourceRest.PLURAL_NAME + "." + ExternalSourceRest.ENTITY_TYPES) public class ExternalSourceEntityTypeLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @@ -70,4 +70,4 @@ public Page getSupportedEntityTypes(@Nullable HttpServletRequest return converter.toRestPage(entityTypes, pageable, total, utils.obtainProjection()); } -} \ No newline at end of file +} diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/GroupEPersonLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/GroupEPersonLinkRepository.java index b1cdc401f22f..e1de5acc206f 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/GroupEPersonLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/GroupEPersonLinkRepository.java @@ -27,7 +27,7 @@ /** * Link repository for "epersons" subresource of an individual group. */ -@Component(GroupRest.CATEGORY + "." + GroupRest.NAME + "." + GroupRest.EPERSONS) +@Component(GroupRest.CATEGORY + "." + GroupRest.PLURAL_NAME + "." + GroupRest.EPERSONS) public class GroupEPersonLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/GroupGroupLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/GroupGroupLinkRepository.java index 37cf9083b39a..95b0a66abdbc 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/GroupGroupLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/GroupGroupLinkRepository.java @@ -27,7 +27,7 @@ /** * Link repository for "groups" subresource of an individual group. */ -@Component(GroupRest.CATEGORY + "." + GroupRest.NAME + "." + GroupRest.SUBGROUPS) +@Component(GroupRest.CATEGORY + "." + GroupRest.PLURAL_NAME + "." + GroupRest.SUBGROUPS) public class GroupGroupLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/GroupParentObjectLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/GroupParentObjectLinkRepository.java index 3d7cdf8f80c9..8ce43e4af8f6 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/GroupParentObjectLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/GroupParentObjectLinkRepository.java @@ -29,7 +29,7 @@ /** * Link repository for the parent object of a group. */ -@Component(GroupRest.CATEGORY + "." + GroupRest.NAME + "." + GroupRest.OBJECT) +@Component(GroupRest.CATEGORY + "." + GroupRest.PLURAL_NAME + "." + GroupRest.OBJECT) public class GroupParentObjectLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemAccessStatusLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemAccessStatusLinkRepository.java index b2660f51e09c..83e720a413ef 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemAccessStatusLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemAccessStatusLinkRepository.java @@ -29,7 +29,7 @@ /** * Link repository for calculating the access status of an Item */ -@Component(ItemRest.CATEGORY + "." + ItemRest.NAME + "." + ItemRest.ACCESS_STATUS) +@Component(ItemRest.CATEGORY + "." + ItemRest.PLURAL_NAME + "." + ItemRest.ACCESS_STATUS) public class ItemAccessStatusLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemBundleLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemBundleLinkRepository.java index d7525c881a6e..19efe5e8420e 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemBundleLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemBundleLinkRepository.java @@ -28,7 +28,7 @@ /** * Link repository for "bundles" subresource of an individual item. */ -@Component(ItemRest.CATEGORY + "." + ItemRest.NAME + "." + ItemRest.BUNDLES) +@Component(ItemRest.CATEGORY + "." + ItemRest.PLURAL_NAME + "." + ItemRest.BUNDLES) public class ItemBundleLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemIdentifierLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemIdentifierLinkRepository.java index 0714b7329bff..2cc7a62174ae 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemIdentifierLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemIdentifierLinkRepository.java @@ -39,7 +39,7 @@ /** * Link repository for the identifier of an Item */ -@Component(ItemRest.CATEGORY + "." + ItemRest.NAME + "." + ItemRest.IDENTIFIERS) +@Component(ItemRest.CATEGORY + "." + ItemRest.PLURAL_NAME + "." + ItemRest.IDENTIFIERS) public class ItemIdentifierLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired ItemService itemService; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemMappedCollectionLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemMappedCollectionLinkRepository.java index c632cd9d613a..382b1a3b93f7 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemMappedCollectionLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemMappedCollectionLinkRepository.java @@ -31,7 +31,7 @@ /** * Link repository for "mappedCollections" subresource of an individual item. */ -@Component(ItemRest.CATEGORY + "." + ItemRest.NAME + "." + ItemRest.MAPPED_COLLECTIONS) +@Component(ItemRest.CATEGORY + "." + ItemRest.PLURAL_NAME + "." + ItemRest.MAPPED_COLLECTIONS) public class ItemMappedCollectionLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemOwningCollectionLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemOwningCollectionLinkRepository.java index a7ceed900d7e..22c82c4d3dcf 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemOwningCollectionLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemOwningCollectionLinkRepository.java @@ -27,7 +27,7 @@ /** * Link repository for "owningCollection" subresource of an individual item. */ -@Component(ItemRest.CATEGORY + "." + ItemRest.NAME + "." + ItemRest.OWNING_COLLECTION) +@Component(ItemRest.CATEGORY + "." + ItemRest.PLURAL_NAME + "." + ItemRest.OWNING_COLLECTION) public class ItemOwningCollectionLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemRelationshipLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemRelationshipLinkRepository.java index 4a282ee46693..c5f63ab5a887 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemRelationshipLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemRelationshipLinkRepository.java @@ -31,7 +31,7 @@ /** * Link repository for "relationships" subresource of an individual item. */ -@Component(ItemRest.CATEGORY + "." + ItemRest.NAME + "." + ItemRest.RELATIONSHIPS) +@Component(ItemRest.CATEGORY + "." + ItemRest.PLURAL_NAME + "." + ItemRest.RELATIONSHIPS) public class ItemRelationshipLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemTemplateItemOfLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemTemplateItemOfLinkRepository.java index 63f25bc668b3..fb7db2b38de7 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemTemplateItemOfLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemTemplateItemOfLinkRepository.java @@ -27,7 +27,7 @@ /** * Link repository for "templateItemOf" subresource of an individual item. */ -@Component(ItemRest.CATEGORY + "." + ItemRest.NAME + "." + ItemRest.TEMPLATE_ITEM_OF) +@Component(ItemRest.CATEGORY + "." + ItemRest.PLURAL_NAME + "." + ItemRest.TEMPLATE_ITEM_OF) public class ItemTemplateItemOfLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemThumbnailLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemThumbnailLinkRepository.java index 7391d410b6f6..7a42050eec92 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemThumbnailLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemThumbnailLinkRepository.java @@ -29,7 +29,7 @@ /** * Link repository for the thumbnail Bitstream of an Item */ -@Component(ItemRest.CATEGORY + "." + ItemRest.NAME + "." + ItemRest.THUMBNAIL) +@Component(ItemRest.CATEGORY + "." + ItemRest.PLURAL_NAME + "." + ItemRest.THUMBNAIL) public class ItemThumbnailLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired ItemService itemService; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemVersionLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemVersionLinkRepository.java index 95bbddc66587..5e489d5ebf0c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemVersionLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemVersionLinkRepository.java @@ -29,7 +29,7 @@ /** * This is the Repository that will take care of fetching the Version for a given Item */ -@Component(ItemRest.CATEGORY + "." + ItemRest.NAME + "." + ItemRest.VERSION) +@Component(ItemRest.CATEGORY + "." + ItemRest.PLURAL_NAME + "." + ItemRest.VERSION) public class ItemVersionLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/PoolTaskStepLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/PoolTaskStepLinkRepository.java index 6e7f4f84ace3..9e1a41cb92b9 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/PoolTaskStepLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/PoolTaskStepLinkRepository.java @@ -26,7 +26,7 @@ /** * Link repositoy for the Steps subresources of an individual PoolTask */ -@Component(PoolTaskRest.CATEGORY + "." + PoolTaskRest.NAME + "." + PoolTaskRest.STEP) +@Component(PoolTaskRest.CATEGORY + "." + PoolTaskRest.PLURAL_NAME + "." + PoolTaskRest.STEP) public class PoolTaskStepLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ProcessFileTypesLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ProcessFileTypesLinkRepository.java index 16c8115b29f8..1727e720a8da 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ProcessFileTypesLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ProcessFileTypesLinkRepository.java @@ -30,7 +30,7 @@ * It'll retrieve all the bitstreams for the given Process and return a {@link ProcessFileTypesRest} object that holds * a list of Strings where each String represents a unique fileType of the Bitstreams for that Process */ -@Component(ProcessRest.CATEGORY + "." + ProcessRest.NAME + "." + ProcessRest.FILE_TYPES) +@Component(ProcessRest.CATEGORY + "." + ProcessRest.PLURAL_NAME + "." + ProcessRest.FILE_TYPES) public class ProcessFileTypesLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ProcessFilesLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ProcessFilesLinkRepository.java index 5d8251cf19ba..e09a47ad7ceb 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ProcessFilesLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ProcessFilesLinkRepository.java @@ -29,7 +29,7 @@ * {@link org.dspace.content.Bitstream} objects for the Process endpoints * */ -@Component(ProcessRest.CATEGORY + "." + ProcessRest.NAME + "." + ProcessRest.FILES) +@Component(ProcessRest.CATEGORY + "." + ProcessRest.PLURAL_NAME + "." + ProcessRest.FILES) public class ProcessFilesLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { private static final Logger log = LogManager.getLogger(); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ProcessOutputLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ProcessOutputLinkRepository.java index f5b3edced2db..632e7d7c94e0 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ProcessOutputLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ProcessOutputLinkRepository.java @@ -29,7 +29,7 @@ * This linkRepository will deal with calls to the /output endpoint of a given Process. * It'll retrieve the output for the given Process and return this as a {@link BitstreamRest} object */ -@Component(ProcessRest.CATEGORY + "." + ProcessRest.NAME + "." + ProcessRest.OUTPUT) +@Component(ProcessRest.CATEGORY + "." + ProcessRest.PLURAL_NAME + "." + ProcessRest.OUTPUT) public class ProcessOutputLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired @@ -68,4 +68,4 @@ public BitstreamRest getOutputFromProcess(@Nullable HttpServletRequest request, } return converter.toRest(bitstream, projection); } -} \ No newline at end of file +} diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RelationshipTypeRelationshipLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RelationshipTypeRelationshipLinkRepository.java index a6c31d0c1632..46cf6ac3071a 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RelationshipTypeRelationshipLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RelationshipTypeRelationshipLinkRepository.java @@ -27,7 +27,7 @@ /** * Link repository for "relationshipType" subresource of an individual Relationship. */ -@Component(RelationshipRest.CATEGORY + "." + RelationshipRest.NAME + "." + RelationshipRest.RELATIONSHIP_TYPE) +@Component(RelationshipRest.CATEGORY + "." + RelationshipRest.PLURAL_NAME + "." + RelationshipRest.RELATIONSHIP_TYPE) public class RelationshipTypeRelationshipLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ResearcherProfileEPersonLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ResearcherProfileEPersonLinkRepository.java index 92bbf6996d48..58bd9798a371 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ResearcherProfileEPersonLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ResearcherProfileEPersonLinkRepository.java @@ -34,7 +34,8 @@ * @author Luca Giamminonni (luca.giamminonni at 4science.it) * */ -@Component(ResearcherProfileRest.CATEGORY + "." + ResearcherProfileRest.NAME + "." + ResearcherProfileRest.EPERSON) +@Component(ResearcherProfileRest.CATEGORY + "." + ResearcherProfileRest.PLURAL_NAME + "." + + ResearcherProfileRest.EPERSON) public class ResearcherProfileEPersonLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ResearcherProfileItemLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ResearcherProfileItemLinkRepository.java index 5f212b966f86..7aaedc05a2b3 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ResearcherProfileItemLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ResearcherProfileItemLinkRepository.java @@ -31,7 +31,7 @@ * @author Luca Giamminonni (luca.giamminonni at 4science.it) * */ -@Component(ResearcherProfileRest.CATEGORY + "." + ResearcherProfileRest.NAME + "." + ResearcherProfileRest.ITEM) +@Component(ResearcherProfileRest.CATEGORY + "." + ResearcherProfileRest.PLURAL_NAME + "." + ResearcherProfileRest.ITEM) public class ResearcherProfileItemLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionDSpaceObjectLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionDSpaceObjectLinkRepository.java index 95c4714e9cae..f35b6230e5c4 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionDSpaceObjectLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionDSpaceObjectLinkRepository.java @@ -26,7 +26,7 @@ /** * Link repository for "DSpaceObject" of subscription */ -@Component(SubscriptionRest.CATEGORY + "." + SubscriptionRest.NAME + "." + SubscriptionRest.DSPACE_OBJECT) +@Component(SubscriptionRest.CATEGORY + "." + SubscriptionRest.PLURAL_NAME + "." + SubscriptionRest.DSPACE_OBJECT) public class SubscriptionDSpaceObjectLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired @@ -46,4 +46,4 @@ public DSpaceObjectRest getDSpaceObject(@Nullable HttpServletRequest request, In } } -} \ No newline at end of file +} diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionEPersonLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionEPersonLinkRepository.java index dcf612e52daa..96d07ee98802 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionEPersonLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionEPersonLinkRepository.java @@ -26,7 +26,7 @@ /** * Link repository for "eperson" of subscription */ -@Component(SubscriptionRest.CATEGORY + "." + SubscriptionRest.NAME + "." + SubscriptionRest.EPERSON) +@Component(SubscriptionRest.CATEGORY + "." + SubscriptionRest.PLURAL_NAME + "." + SubscriptionRest.EPERSON) public class SubscriptionEPersonLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired @@ -46,4 +46,4 @@ public EPersonRest getEPerson(@Nullable HttpServletRequest request, Integer subs } } -} \ No newline at end of file +} diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionRestRepository.java index ce1bcff11fbc..e6ee87b36878 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionRestRepository.java @@ -278,7 +278,7 @@ public Class getDomainClass() { @Override public void afterPropertiesSet() throws Exception { discoverableEndpointsService.register(this, Arrays.asList(Link.of("/api/" + SubscriptionRest.CATEGORY + - "/" + SubscriptionRest.NAME_PLURAL + "/search", SubscriptionRest.NAME_PLURAL + "-search"))); + "/" + SubscriptionRest.PLURAL_NAME + "/search", SubscriptionRest.PLURAL_NAME + "-search"))); } -} \ No newline at end of file +} diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionHistoryDraftVersionLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionHistoryDraftVersionLinkRepository.java index 21d90ddda07f..9fe2fe84a735 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionHistoryDraftVersionLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionHistoryDraftVersionLinkRepository.java @@ -35,7 +35,7 @@ * * @author Mykhaylo Boychuk (mykhaylo.boychuk at 4science.it) */ -@Component(VersionHistoryRest.CATEGORY + "." + VersionHistoryRest.NAME + "." + VersionHistoryRest.DRAFT_VERSION) +@Component(VersionHistoryRest.CATEGORY + "." + VersionHistoryRest.PLURAL_NAME + "." + VersionHistoryRest.DRAFT_VERSION) public class VersionHistoryDraftVersionLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @@ -79,4 +79,4 @@ public AInprogressSubmissionRest getDraftVersion(@Nullable HttpServletRequest re return null; } -} \ No newline at end of file +} diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionHistoryLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionHistoryLinkRepository.java index 6456a0c2b5dc..f009457e698c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionHistoryLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionHistoryLinkRepository.java @@ -27,7 +27,7 @@ * This is the Repository that takes care of the retrieval of the {@link VersionHistory} object * for a given {@link Version} */ -@Component(VersionRest.CATEGORY + "." + VersionRest.NAME + "." + VersionRest.VERSION_HISTORY) +@Component(VersionRest.CATEGORY + "." + VersionRest.PLURAL_NAME + "." + VersionRest.VERSION_HISTORY) public class VersionHistoryLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionItemLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionItemLinkRepository.java index 4fd692506b71..b89b7b0c6256 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionItemLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionItemLinkRepository.java @@ -27,7 +27,7 @@ * This Repository takes care of the retrieval of the {@link org.dspace.content.Item} objects * for a given {@link Version} */ -@Component(VersionRest.CATEGORY + "." + VersionRest.NAME + "." + VersionRest.ITEM) +@Component(VersionRest.CATEGORY + "." + VersionRest.PLURAL_NAME + "." + VersionRest.ITEM) public class VersionItemLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionsLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionsLinkRepository.java index 2538b51cf16a..ea4f74c6955e 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionsLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionsLinkRepository.java @@ -32,7 +32,7 @@ * This is the Repository that takes care of the retrieval of the {@link Version} objects for a given * {@link VersionHistory} */ -@Component(VersionHistoryRest.CATEGORY + "." + VersionHistoryRest.NAME + "." + VersionHistoryRest.VERSIONS) +@Component(VersionHistoryRest.CATEGORY + "." + VersionHistoryRest.PLURAL_NAME + "." + VersionHistoryRest.VERSIONS) public class VersionsLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyEntryDetailsChildrenLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyEntryDetailsChildrenLinkRepository.java index 1788fa893b36..935b8e9bac26 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyEntryDetailsChildrenLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyEntryDetailsChildrenLinkRepository.java @@ -35,7 +35,8 @@ * * @author Mykhaylo Boychuk (4Science.it) */ -@Component(VocabularyRest.CATEGORY + "." + VocabularyEntryDetailsRest.NAME + "." + VocabularyEntryDetailsRest.CHILDREN) +@Component(VocabularyRest.CATEGORY + "." + VocabularyEntryDetailsRest.PLURAL_NAME + "." + + VocabularyEntryDetailsRest.CHILDREN) public class VocabularyEntryDetailsChildrenLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyEntryDetailsParentLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyEntryDetailsParentLinkRepository.java index d7a1ff85c363..48fc763bc6e0 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyEntryDetailsParentLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyEntryDetailsParentLinkRepository.java @@ -30,7 +30,8 @@ * * @author Mykhaylo Boychuk ($science.it) */ -@Component(VocabularyRest.CATEGORY + "." + VocabularyEntryDetailsRest.NAME + "." + VocabularyEntryDetailsRest.PARENT) +@Component(VocabularyRest.CATEGORY + "." + VocabularyEntryDetailsRest.PLURAL_NAME + "." + + VocabularyEntryDetailsRest.PARENT) public class VocabularyEntryDetailsParentLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyEntryLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyEntryLinkRepository.java index a24bef42c281..b885dcb73f65 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyEntryLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyEntryLinkRepository.java @@ -38,7 +38,7 @@ * * @author Luigi Andrea Pascarelli (luigiandrea.pascarelli at 4science.it) */ -@Component(VocabularyRest.CATEGORY + "." + VocabularyRest.NAME + "." + VocabularyRest.ENTRIES) +@Component(VocabularyRest.CATEGORY + "." + VocabularyRest.PLURAL_NAME + "." + VocabularyRest.ENTRIES) public class VocabularyEntryLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowItemStepLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowItemStepLinkRepository.java index 30aac1579c79..4e7aab34bff1 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowItemStepLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowItemStepLinkRepository.java @@ -31,7 +31,7 @@ /** * Link Repository for the Steps subresources of an individual WorkflowItem */ -@Component(WorkflowItemRest.CATEGORY + "." + WorkflowItemRest.NAME + "." + WorkflowItemRest.STEP) +@Component(WorkflowItemRest.CATEGORY + "." + WorkflowItemRest.PLURAL_NAME + "." + WorkflowItemRest.STEP) public class WorkflowItemStepLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkspaceItemSupervisionOrdersLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkspaceItemSupervisionOrdersLinkRepository.java index e0d57ae0de52..57bb64dcb529 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkspaceItemSupervisionOrdersLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkspaceItemSupervisionOrdersLinkRepository.java @@ -30,7 +30,8 @@ * * @author Mohamed Eskander (mohamed.eskander at 4science dot it) */ -@Component(WorkspaceItemRest.CATEGORY + "." + WorkspaceItemRest.NAME + "." + WorkspaceItemRest.SUPERVISION_ORDERS) +@Component(WorkspaceItemRest.CATEGORY + "." + WorkspaceItemRest.PLURAL_NAME + "." + + WorkspaceItemRest.SUPERVISION_ORDERS) public class WorkspaceItemSupervisionOrdersLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkflowActionRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkflowActionRestRepositoryIT.java index ec963fd2f3bb..9fdc20a7d67a 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkflowActionRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkflowActionRestRepositoryIT.java @@ -46,7 +46,7 @@ public class WorkflowActionRestRepositoryIT extends AbstractControllerIntegratio private GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); private static final String WORKFLOW_ACTIONS_ENDPOINT - = "/api/" + WorkflowActionRest.CATEGORY + "/" + WorkflowActionRest.NAME_PLURAL; + = "/api/" + WorkflowActionRest.CATEGORY + "/" + WorkflowActionRest.PLURAL_NAME; @Test public void getAllWorkflowActions_NonImplementedEndpoint() throws Exception { diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkflowDefinitionRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkflowDefinitionRestRepositoryIT.java index a222839abfbf..ad994be57cca 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkflowDefinitionRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkflowDefinitionRestRepositoryIT.java @@ -48,7 +48,7 @@ public class WorkflowDefinitionRestRepositoryIT extends AbstractControllerIntegr = XmlWorkflowServiceFactory.getInstance().getWorkflowFactory(); private static final String WORKFLOW_DEFINITIONS_ENDPOINT - = "/api/" + WorkflowDefinitionRest.CATEGORY + "/" + WorkflowDefinitionRest.NAME_PLURAL; + = "/api/" + WorkflowDefinitionRest.CATEGORY + "/" + WorkflowDefinitionRest.PLURAL_NAME; @Test public void getAllWorkflowDefinitionsEndpoint() throws Exception { diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkflowStepRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkflowStepRestRepositoryIT.java index e06ba08f6923..4012fd2d33c8 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkflowStepRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkflowStepRestRepositoryIT.java @@ -31,7 +31,7 @@ public class WorkflowStepRestRepositoryIT extends AbstractControllerIntegrationT private XmlWorkflowFactory xmlWorkflowFactory = XmlWorkflowServiceFactory.getInstance().getWorkflowFactory(); private static final String WORKFLOW_ACTIONS_ENDPOINT - = "/api/" + WorkflowStepRest.CATEGORY + "/" + WorkflowStepRest.NAME_PLURAL; + = "/api/" + WorkflowStepRest.CATEGORY + "/" + WorkflowStepRest.PLURAL_NAME; @Test public void getAllWorkflowSteps_NonImplementedEndpoint() throws Exception { diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/WorkflowActionMatcher.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/WorkflowActionMatcher.java index e727eb8accb9..1360e2f4a20e 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/WorkflowActionMatcher.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/WorkflowActionMatcher.java @@ -25,7 +25,7 @@ public class WorkflowActionMatcher { private static final String WORKFLOW_ACTIONS_ENDPOINT - = "/api/" + WorkflowActionRest.CATEGORY + "/" + WorkflowActionRest.NAME_PLURAL + "/"; + = "/api/" + WorkflowActionRest.CATEGORY + "/" + WorkflowActionRest.PLURAL_NAME + "/"; private WorkflowActionMatcher() { diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/WorkflowDefinitionMatcher.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/WorkflowDefinitionMatcher.java index f3d6890bbd86..cd933abcb43e 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/WorkflowDefinitionMatcher.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/WorkflowDefinitionMatcher.java @@ -30,7 +30,7 @@ public class WorkflowDefinitionMatcher { private static XmlWorkflowFactory xmlWorkflowFactory = XmlWorkflowServiceFactory.getInstance().getWorkflowFactory(); private static final String WORKFLOW_DEFINITIONS_ENDPOINT - = "/api/" + WorkflowDefinitionRest.CATEGORY + "/" + WorkflowDefinitionRest.NAME_PLURAL + "/"; + = "/api/" + WorkflowDefinitionRest.CATEGORY + "/" + WorkflowDefinitionRest.PLURAL_NAME + "/"; private WorkflowDefinitionMatcher() { } diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/WorkflowStepMatcher.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/WorkflowStepMatcher.java index 2dc37d35864d..72277cf87d89 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/WorkflowStepMatcher.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/WorkflowStepMatcher.java @@ -25,7 +25,7 @@ public class WorkflowStepMatcher { private static final String WORKFLOW_ACTIONS_ENDPOINT - = "/api/" + WorkflowStepRest.CATEGORY + "/" + WorkflowStepRest.NAME_PLURAL + "/";; + = "/api/" + WorkflowStepRest.CATEGORY + "/" + WorkflowStepRest.PLURAL_NAME + "/";; private WorkflowStepMatcher() {} diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/model/MockObjectRest.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/model/MockObjectRest.java index 039e94ab4097..8586bf16bfcd 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/model/MockObjectRest.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/model/MockObjectRest.java @@ -28,6 +28,7 @@ public class MockObjectRest extends BaseObjectRest { public static final String CATEGORY = "test"; public static final String NAME = "testobject"; + public static final String PLURAL_NAME = "testobjects"; public static final String O_CHILDREN = "optionallyEmbeddedChildren"; diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/repository/MockObjectNeverEmbedChildLinkRepository.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/repository/MockObjectNeverEmbedChildLinkRepository.java index 7d82938ae8da..1442eac66c71 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/repository/MockObjectNeverEmbedChildLinkRepository.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/repository/MockObjectNeverEmbedChildLinkRepository.java @@ -13,7 +13,7 @@ /** * Link repository used by {@link MockObjectRest} to test that never-embedded subresources work correctly. */ -@Component(MockObjectRest.CATEGORY + "." + MockObjectRest.NAME + "." + MockObjectRest.N_CHILDREN) +@Component(MockObjectRest.CATEGORY + "." + MockObjectRest.PLURAL_NAME + "." + MockObjectRest.N_CHILDREN) public class MockObjectNeverEmbedChildLinkRepository extends AbstractMockObjectChildLinkRepository { @Override public boolean isEmbeddableRelation(Object data, String name) { diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/repository/MockObjectOptionallyEmbedChildLinkRepository.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/repository/MockObjectOptionallyEmbedChildLinkRepository.java index e75351a78edf..a81eceb5b2a2 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/repository/MockObjectOptionallyEmbedChildLinkRepository.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/repository/MockObjectOptionallyEmbedChildLinkRepository.java @@ -13,6 +13,6 @@ /** * Link repository used by {@link MockObjectRest} to test that optionally-embedded subresources work correctly. */ -@Component(MockObjectRest.CATEGORY + "." + MockObjectRest.NAME + "." + MockObjectRest.O_CHILDREN) +@Component(MockObjectRest.CATEGORY + "." + MockObjectRest.PLURAL_NAME + "." + MockObjectRest.O_CHILDREN) public class MockObjectOptionallyEmbedChildLinkRepository extends AbstractMockObjectChildLinkRepository { } From ad8809f38769152dad639279d43a52f13fe6dc8d Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Thu, 30 Nov 2023 16:22:37 +0100 Subject: [PATCH 02/23] 108915: Moved the plural/singular logic to the Rest classes --- .../org/dspace/app/rest/model/AccessStatusRest.java | 8 +++++--- .../app/rest/model/AuthenticationTokenRest.java | 6 ++++++ .../java/org/dspace/app/rest/model/AuthnRest.java | 9 +++++++++ .../app/rest/model/AuthorizationFeatureRest.java | 5 +++++ .../dspace/app/rest/model/AuthorizationRest.java | 8 ++++++++ .../dspace/app/rest/model/BitstreamFormatRest.java | 5 +++++ .../org/dspace/app/rest/model/BitstreamRest.java | 5 +++++ .../org/dspace/app/rest/model/BrowseEntryRest.java | 6 ++++++ .../org/dspace/app/rest/model/BrowseIndexRest.java | 5 +++++ .../app/rest/model/BulkAccessConditionRest.java | 5 +++++ .../java/org/dspace/app/rest/model/BundleRest.java | 5 +++++ .../org/dspace/app/rest/model/ClaimedTaskRest.java | 5 +++++ .../org/dspace/app/rest/model/CollectionRest.java | 5 +++++ .../org/dspace/app/rest/model/CommunityRest.java | 5 +++++ .../dspace/app/rest/model/DiscoveryResultsRest.java | 10 +++++++++- .../java/org/dspace/app/rest/model/EPersonRest.java | 5 +++++ .../org/dspace/app/rest/model/EntityTypeRest.java | 7 ++++++- .../app/rest/model/ExternalSourceEntryRest.java | 5 +++++ .../dspace/app/rest/model/ExternalSourceRest.java | 5 +++++ .../app/rest/model/FacetConfigurationRest.java | 9 +++++++++ .../org/dspace/app/rest/model/FeedbackRest.java | 5 +++++ .../java/org/dspace/app/rest/model/GroupRest.java | 5 +++++ .../app/rest/model/HarvestedCollectionRest.java | 8 +++++++- .../app/rest/model/HarvesterMetadataRest.java | 11 ++++++++++- .../org/dspace/app/rest/model/IdentifierRest.java | 2 +- .../org/dspace/app/rest/model/IdentifiersRest.java | 7 +++++++ .../java/org/dspace/app/rest/model/ItemRest.java | 5 +++++ .../java/org/dspace/app/rest/model/LicenseRest.java | 7 +++++++ .../dspace/app/rest/model/MetadataFieldRest.java | 5 +++++ .../dspace/app/rest/model/MetadataSchemaRest.java | 5 +++++ .../org/dspace/app/rest/model/OrcidHistoryRest.java | 5 +++++ .../org/dspace/app/rest/model/OrcidQueueRest.java | 5 +++++ .../org/dspace/app/rest/model/PoolTaskRest.java | 5 +++++ .../dspace/app/rest/model/ProcessFileTypesRest.java | 5 +++++ .../java/org/dspace/app/rest/model/ProcessRest.java | 5 +++++ .../org/dspace/app/rest/model/PropertyRest.java | 5 +++++ .../org/dspace/app/rest/model/RegistrationRest.java | 5 +++++ .../org/dspace/app/rest/model/RelationshipRest.java | 7 ++++++- .../dspace/app/rest/model/RelationshipTypeRest.java | 7 ++++++- .../org/dspace/app/rest/model/RequestItemRest.java | 9 ++++----- .../app/rest/model/ResearcherProfileRest.java | 5 +++++ .../dspace/app/rest/model/ResourcePolicyRest.java | 5 +++++ .../java/org/dspace/app/rest/model/RestModel.java | 6 ++---- .../java/org/dspace/app/rest/model/RootRest.java | 9 +++++++++ .../java/org/dspace/app/rest/model/ScriptRest.java | 5 +++++ .../app/rest/model/SearchConfigurationRest.java | 9 +++++++++ .../org/dspace/app/rest/model/SearchEventRest.java | 5 +++++ .../dspace/app/rest/model/SearchFacetEntryRest.java | 9 +++++++++ .../dspace/app/rest/model/SearchFacetValueRest.java | 9 +++++++++ .../app/rest/model/SearchResultEntryRest.java | 9 +++++++++ .../dspace/app/rest/model/SearchSupportRest.java | 9 +++++++++ .../java/org/dspace/app/rest/model/SiteRest.java | 5 +++++ .../app/rest/model/StatisticsSupportRest.java | 6 ++++++ .../app/rest/model/SubmissionAccessOptionRest.java | 5 +++++ .../app/rest/model/SubmissionCCLicenseRest.java | 5 +++++ .../app/rest/model/SubmissionCCLicenseUrlRest.java | 5 +++++ .../app/rest/model/SubmissionDefinitionRest.java | 5 +++++ .../dspace/app/rest/model/SubmissionFormRest.java | 5 +++++ .../app/rest/model/SubmissionSectionRest.java | 5 +++++ .../dspace/app/rest/model/SubmissionUploadRest.java | 5 +++++ .../org/dspace/app/rest/model/SubscriptionRest.java | 7 ++++++- .../dspace/app/rest/model/SupervisionOrderRest.java | 5 +++++ .../dspace/app/rest/model/SystemWideAlertRest.java | 5 +++++ .../org/dspace/app/rest/model/TemplateItemRest.java | 5 +++++ .../app/rest/model/UsageReportPointCityRest.java | 6 ++++++ .../app/rest/model/UsageReportPointCountryRest.java | 6 ++++++ .../app/rest/model/UsageReportPointDateRest.java | 6 ++++++ .../model/UsageReportPointDsoTotalVisitsRest.java | 7 +++++++ .../dspace/app/rest/model/UsageReportPointRest.java | 13 ++++++++++++- .../org/dspace/app/rest/model/UsageReportRest.java | 5 +++++ .../dspace/app/rest/model/VersionHistoryRest.java | 5 +++++ .../java/org/dspace/app/rest/model/VersionRest.java | 5 +++++ .../org/dspace/app/rest/model/ViewEventRest.java | 5 +++++ .../app/rest/model/VocabularyEntryDetailsRest.java | 5 +++++ .../dspace/app/rest/model/VocabularyEntryRest.java | 6 ++++++ .../org/dspace/app/rest/model/VocabularyRest.java | 5 +++++ .../dspace/app/rest/model/WorkflowActionRest.java | 7 ++++++- .../app/rest/model/WorkflowDefinitionRest.java | 7 ++++++- .../org/dspace/app/rest/model/WorkflowItemRest.java | 5 +++++ .../org/dspace/app/rest/model/WorkflowStepRest.java | 7 ++++++- .../dspace/app/rest/model/WorkspaceItemRest.java | 5 +++++ .../app/rest/signposting/model/LinksetRest.java | 5 +++++ .../app/rest/signposting/model/TypedLinkRest.java | 5 +++++ .../app/rest/converter/ConverterServiceIT.java | 5 +++++ .../org/dspace/app/rest/model/MockObjectRest.java | 5 +++++ 85 files changed, 490 insertions(+), 24 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AccessStatusRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AccessStatusRest.java index c7dc2d11985d..85993f9a9213 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AccessStatusRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AccessStatusRest.java @@ -7,7 +7,6 @@ */ package org.dspace.app.rest.model; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty.Access; @@ -16,6 +15,7 @@ */ public class AccessStatusRest implements RestModel { public static final String NAME = "accessStatus"; + public static final String PLURAL_NAME = NAME; String status; @@ -25,10 +25,12 @@ public String getType() { return NAME; } + /** + * The plural name is the same as the singular name + */ @Override - @JsonIgnore public String getTypePlural() { - return getType(); + return PLURAL_NAME; } public AccessStatusRest() { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthenticationTokenRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthenticationTokenRest.java index 0599e095657a..6fbeeb219ac5 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthenticationTokenRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthenticationTokenRest.java @@ -15,6 +15,7 @@ */ public class AuthenticationTokenRest extends RestAddressableModel { public static final String NAME = "shortlivedtoken"; + public static final String PLURAL_NAME = "shortlivedtokens"; public static final String CATEGORY = RestAddressableModel.AUTHENTICATION; private String token; @@ -34,6 +35,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public String getToken() { return token; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthnRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthnRest.java index fade90fe4da7..8c873ccc1256 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthnRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthnRest.java @@ -18,6 +18,7 @@ public class AuthnRest extends BaseObjectRest { public static final String NAME = "authn"; + public static final String PLURAL_NAME = NAME; public static final String CATEGORY = RestAddressableModel.AUTHENTICATION; public String getCategory() { @@ -28,6 +29,14 @@ public String getType() { return NAME; } + /** + * The plural name is the same as the singular name + */ + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public Class getController() { return AuthenticationRestController.class; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationFeatureRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationFeatureRest.java index 1eae76352442..775b10d619c6 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationFeatureRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationFeatureRest.java @@ -35,6 +35,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return CATEGORY; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationRest.java index 300f45c111a8..fa463a7c3968 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationRest.java @@ -37,6 +37,14 @@ public String getType() { return NAME; } + /** + * The plural name is the same as the singular name + */ + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return CATEGORY; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BitstreamFormatRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BitstreamFormatRest.java index 96d7ebf3d6c0..486eb02cad09 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BitstreamFormatRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BitstreamFormatRest.java @@ -97,6 +97,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override @JsonIgnore public Class getController() { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BitstreamRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BitstreamRest.java index 8e9efc2680b7..d2c2268b3f35 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BitstreamRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BitstreamRest.java @@ -88,4 +88,9 @@ public String getCategory() { public String getType() { return NAME; } + + @Override + public String getTypePlural() { + return PLURAL_NAME; + } } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BrowseEntryRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BrowseEntryRest.java index 6a569bd4c9f9..57f20d7c3105 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BrowseEntryRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BrowseEntryRest.java @@ -17,6 +17,7 @@ public class BrowseEntryRest implements RestModel { private static final long serialVersionUID = -3415049466402327251L; public static final String NAME = "browseEntry"; + public static final String PLURAL_NAME = "browseEntries"; private String authority; private String value; private String valueLang; @@ -69,4 +70,9 @@ public void setBrowseIndex(BrowseIndexRest browseIndex) { public String getType() { return NAME; } + + @Override + public String getTypePlural() { + return PLURAL_NAME; + } } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BrowseIndexRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BrowseIndexRest.java index 4b5517643f76..a3c0b37ba576 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BrowseIndexRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BrowseIndexRest.java @@ -80,6 +80,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public List getMetadataList() { return metadataList; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BulkAccessConditionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BulkAccessConditionRest.java index 32d38173e7fa..18ed4e71aa62 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BulkAccessConditionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BulkAccessConditionRest.java @@ -69,6 +69,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return CATEGORY; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BundleRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BundleRest.java index dd4a80d488a8..1ec9f448dde4 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BundleRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BundleRest.java @@ -52,4 +52,9 @@ public String getCategory() { public String getType() { return NAME; } + + @Override + public String getTypePlural() { + return PLURAL_NAME; + } } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ClaimedTaskRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ClaimedTaskRest.java index dd97fef44d0b..0973fac987d2 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ClaimedTaskRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ClaimedTaskRest.java @@ -47,6 +47,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public Class getController() { return RestResourceController.class; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/CollectionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/CollectionRest.java index 3f5ae3bb34c2..f00bb883959c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/CollectionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/CollectionRest.java @@ -75,6 +75,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + private int archivedItemsCount; public int getArchivedItemsCount() { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/CommunityRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/CommunityRest.java index 86dc4b2c3900..0004e0b91ca4 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/CommunityRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/CommunityRest.java @@ -59,6 +59,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + private int archivedItemsCount; public int getArchivedItemsCount() { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/DiscoveryResultsRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/DiscoveryResultsRest.java index a6db2e58a10a..e63c94edc3c3 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/DiscoveryResultsRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/DiscoveryResultsRest.java @@ -21,7 +21,7 @@ public abstract class DiscoveryResultsRest extends BaseObjectRest { @JsonIgnore public static final String NAME = "discover"; - public static final String PLURAL_NAME = "discovers"; + public static final String PLURAL_NAME = NAME; public static final String CATEGORY = RestModel.DISCOVER; private String scope; private String query; @@ -41,6 +41,14 @@ public String getType() { return NAME; } + /** + * The plural name is the same as the singular name + */ + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public Class getController() { return DiscoveryRestController.class; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EPersonRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EPersonRest.java index 6fb211b8307c..c06ed0e3fe1f 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EPersonRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EPersonRest.java @@ -53,6 +53,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public String getNetid() { return netid; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EntityTypeRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EntityTypeRest.java index 7600ad838370..9d4a729ded93 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EntityTypeRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EntityTypeRest.java @@ -26,7 +26,7 @@ public class EntityTypeRest extends BaseObjectRest { public static final String NAME = "entitytype"; public static final String PLURAL_NAME = "entitytypes"; - public static final String CATEGORY = "core"; + public static final String CATEGORY = RestModel.CORE; public static final String RELATION_SHIP_TYPES = "relationshiptypes"; public String getCategory() { @@ -41,6 +41,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + private String label; public String getLabel() { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ExternalSourceEntryRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ExternalSourceEntryRest.java index 06af7e222713..34253d538a56 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ExternalSourceEntryRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ExternalSourceEntryRest.java @@ -33,6 +33,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + private String id; private String display; private String value; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ExternalSourceRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ExternalSourceRest.java index 639c2cf72e2e..58402954e8db 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ExternalSourceRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ExternalSourceRest.java @@ -42,6 +42,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + private String id; private String name; private boolean hierarchical; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/FacetConfigurationRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/FacetConfigurationRest.java index 4b8244eba2db..06068b34e022 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/FacetConfigurationRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/FacetConfigurationRest.java @@ -21,6 +21,7 @@ public class FacetConfigurationRest extends BaseObjectRest { public static final String NAME = "discover"; + public static final String PLURAL_NAME = NAME; public static final String CATEGORY = RestModel.DISCOVER; private String scope; @@ -38,6 +39,14 @@ public String getType() { return NAME; } + /** + * The plural name is the same as the singular name + */ + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public Class getController() { return DiscoveryRestController.class; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/FeedbackRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/FeedbackRest.java index 9a7fee568e88..434f5755e8f4 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/FeedbackRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/FeedbackRest.java @@ -62,6 +62,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return CATEGORY; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/GroupRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/GroupRest.java index a50aa6384746..7d56af2e7204 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/GroupRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/GroupRest.java @@ -53,6 +53,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public String getName() { return name; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/HarvestedCollectionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/HarvestedCollectionRest.java index a4a0aac0131f..3cbd98b9d4bc 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/HarvestedCollectionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/HarvestedCollectionRest.java @@ -21,7 +21,8 @@ public class HarvestedCollectionRest extends BaseObjectRest { public static final String NAME = "collections"; - public static final String CATEGORY = "core"; + public static final String PLURAL_NAME = NAME; + public static final String CATEGORY = RestModel.CORE; @JsonProperty("harvest_type") private HarvestTypeEnum harvestType; @@ -70,6 +71,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @JsonIgnore public CollectionRest getCollectionRest() { return this.collectionRest; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/HarvesterMetadataRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/HarvesterMetadataRest.java index a32e901d74c5..f130f4a8198d 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/HarvesterMetadataRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/HarvesterMetadataRest.java @@ -21,8 +21,9 @@ */ public class HarvesterMetadataRest extends BaseObjectRest { - public static final String CATEGORY = "config"; + public static final String CATEGORY = RestModel.CONFIGURATION; public static final String NAME = "harvesterMetadata"; + public static final String PLURAL_NAME = NAME; private List> configs; @@ -42,6 +43,14 @@ public String getType() { return NAME; } + /** + * The plural name is the same as the singular name + */ + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public Class getController() { return HarvesterMetadataController.class; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/IdentifierRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/IdentifierRest.java index 68a12f3166cd..cf16184acc99 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/IdentifierRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/IdentifierRest.java @@ -21,7 +21,7 @@ public class IdentifierRest extends BaseObjectRest implements RestModel // Set names used in component wiring public static final String NAME = "identifier"; public static final String PLURAL_NAME = "identifiers"; - public static final String CATEGORY = "pid"; + public static final String CATEGORY = RestModel.PID; private String value; private String identifierType; private String identifierStatus; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/IdentifiersRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/IdentifiersRest.java index 169e40979c98..5414ac10b643 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/IdentifiersRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/IdentifiersRest.java @@ -22,6 +22,8 @@ public class IdentifiersRest extends BaseObjectRest { // Set names used in component wiring public static final String NAME = "identifiers"; + public static final String PLURAL_NAME = "identifiers"; + private List identifiers; // Empty constructor @@ -37,6 +39,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public List getIdentifiers() { return identifiers; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ItemRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ItemRest.java index 1254ef8f9372..b2f540c0ac4a 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ItemRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ItemRest.java @@ -87,6 +87,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public boolean getInArchive() { return inArchive; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/LicenseRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/LicenseRest.java index 8f8ea51086cf..863335ee882e 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/LicenseRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/LicenseRest.java @@ -14,6 +14,8 @@ */ public class LicenseRest implements RestModel { public static final String NAME = "license"; + public static final String PLURAL_NAME = "licenses"; + private boolean custom = false; private String text; @@ -37,4 +39,9 @@ public void setText(String text) { public String getType() { return NAME; } + + @Override + public String getTypePlural() { + return PLURAL_NAME; + } } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/MetadataFieldRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/MetadataFieldRest.java index 2e17f986449c..f73e51cb7e27 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/MetadataFieldRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/MetadataFieldRest.java @@ -68,6 +68,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public Class getController() { return RestResourceController.class; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/MetadataSchemaRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/MetadataSchemaRest.java index fd4ada665179..c762ccc65bd0 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/MetadataSchemaRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/MetadataSchemaRest.java @@ -46,6 +46,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public Class getController() { return RestResourceController.class; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/OrcidHistoryRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/OrcidHistoryRest.java index a793006a2387..2c4c7cbe6043 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/OrcidHistoryRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/OrcidHistoryRest.java @@ -47,6 +47,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return CATEGORY; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/OrcidQueueRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/OrcidQueueRest.java index ba7c30062803..13a0b474b6c1 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/OrcidQueueRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/OrcidQueueRest.java @@ -35,6 +35,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return CATEGORY; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/PoolTaskRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/PoolTaskRest.java index c32c2c95783a..0b66f0604b2e 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/PoolTaskRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/PoolTaskRest.java @@ -50,6 +50,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public Class getController() { return RestResourceController.class; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ProcessFileTypesRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ProcessFileTypesRest.java index ecceea107e43..eec9390388f5 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ProcessFileTypesRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ProcessFileTypesRest.java @@ -65,4 +65,9 @@ public Class getController() { public String getType() { return NAME; } + + @Override + public String getTypePlural() { + return PLURAL_NAME; + } } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ProcessRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ProcessRest.java index 8216e1617195..8793d37f0dd8 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ProcessRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ProcessRest.java @@ -55,6 +55,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + private String scriptName; private UUID userId; private Integer processId; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/PropertyRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/PropertyRest.java index d51f0f6fcca2..c0e846fbb14e 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/PropertyRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/PropertyRest.java @@ -60,4 +60,9 @@ public Class getController() { public String getType() { return NAME; } + + @Override + public String getTypePlural() { + return PLURAL_NAME; + } } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RegistrationRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RegistrationRest.java index 9e525470e39f..eb7c58a18cba 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RegistrationRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RegistrationRest.java @@ -74,4 +74,9 @@ public Class getController() { public String getType() { return NAME; } + + @Override + public String getTypePlural() { + return PLURAL_NAME; + } } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipRest.java index a4ea16282991..76a7a4348682 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipRest.java @@ -27,7 +27,7 @@ public class RelationshipRest extends BaseObjectRest { public static final String NAME = "relationship"; public static final String PLURAL_NAME = "relationships"; - public static final String CATEGORY = "core"; + public static final String CATEGORY = RestModel.CORE; public static final String RELATIONSHIP_TYPE = "relationshipType"; @@ -48,6 +48,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public String getCategory() { return CATEGORY; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipTypeRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipTypeRest.java index 6bfc75621d4b..48a9cf499afc 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipTypeRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipTypeRest.java @@ -19,7 +19,7 @@ public class RelationshipTypeRest extends BaseObjectRest { public static final String NAME = "relationshiptype"; public static final String PLURAL_NAME = "relationshiptypes"; - public static final String CATEGORY = "core"; + public static final String CATEGORY = RestModel.CORE; private String leftwardType; private String rightwardType; @@ -36,6 +36,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public String getCategory() { return CATEGORY; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RequestItemRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RequestItemRest.java index 616a2d631d65..677405bda0e5 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RequestItemRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RequestItemRest.java @@ -21,11 +21,10 @@ @LinksRest(links = { @LinkRest(name = "bitstream", method = "getUuid"), @LinkRest(name = "item", method = "getUuid") - }) -public class RequestItemRest - extends BaseObjectRest { +}) +public class RequestItemRest extends BaseObjectRest { public static final String NAME = "itemrequest"; - public static final String PLURAL_NAME = NAME + "s"; + public static final String PLURAL_NAME = "itemrequests"; public static final String CATEGORY = RestAddressableModel.TOOLS; @@ -230,6 +229,6 @@ public String getType() { @Override public String getTypePlural() { - return super.getTypePlural(); + return PLURAL_NAME; } } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ResearcherProfileRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ResearcherProfileRest.java index d6a717a922ae..13faa2e2bbdf 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ResearcherProfileRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ResearcherProfileRest.java @@ -70,6 +70,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return CATEGORY; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ResourcePolicyRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ResourcePolicyRest.java index a75c17b13655..564782c251ef 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ResourcePolicyRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ResourcePolicyRest.java @@ -63,6 +63,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return CATEGORY; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RestModel.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RestModel.java index 5bc85a58b2d1..5775a4388e72 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RestModel.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RestModel.java @@ -10,7 +10,6 @@ import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonIgnore; -import org.atteo.evo.inflector.English; /** * A REST resource directly or indirectly (in a collection) exposed must have at @@ -34,11 +33,10 @@ public interface RestModel extends Serializable { public static final String VERSIONING = "versioning"; public static final String AUTHENTICATION = "authn"; public static final String TOOLS = "tools"; + public static final String PID = "pid"; public String getType(); @JsonIgnore - default public String getTypePlural() { - return English.plural(getType()); - } + String getTypePlural(); } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RootRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RootRest.java index cef8965601ca..a4ca592cd52a 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RootRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RootRest.java @@ -16,6 +16,7 @@ */ public class RootRest extends RestAddressableModel { public static final String NAME = "root"; + public static final String PLURAL_NAME = NAME; public static final String CATEGORY = RestModel.ROOT; private String dspaceUI; private String dspaceName; @@ -30,6 +31,14 @@ public String getType() { return NAME; } + /** + * The plural name is the same as the singular name + */ + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public Class getController() { return RootRestResourceController.class; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ScriptRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ScriptRest.java index e9c0eb420334..58c68b37bd9a 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ScriptRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ScriptRest.java @@ -39,6 +39,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public String getName() { return name; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchConfigurationRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchConfigurationRest.java index b25d827e75c1..f8a6e698d17b 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchConfigurationRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchConfigurationRest.java @@ -22,6 +22,7 @@ public class SearchConfigurationRest extends BaseObjectRest { public static final String NAME = "discover"; + public static final String PLURAL_NAME = NAME; public static final String CATEGORY = RestModel.DISCOVER; @JsonIgnore private String scope; @@ -41,6 +42,14 @@ public String getType() { return NAME; } + /** + * The plural name is the same as the singular name + */ + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public Class getController() { return DiscoveryRestController.class; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchEventRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchEventRest.java index 42061626387d..d2a61ef8c074 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchEventRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchEventRest.java @@ -44,6 +44,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public String getQuery() { return query; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchFacetEntryRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchFacetEntryRest.java index 513b4ad54a94..aafa3a110836 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchFacetEntryRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchFacetEntryRest.java @@ -21,6 +21,7 @@ public class SearchFacetEntryRest extends RestAddressableModel { public static final String NAME = "discover"; + public static final String PLURAL_NAME = NAME; public static final String CATEGORY = RestModel.DISCOVER; private String name; @@ -54,6 +55,14 @@ public String getType() { return NAME; } + /** + * The plural name is the same as the singular name + */ + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public Class getController() { return DiscoveryRestController.class; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchFacetValueRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchFacetValueRest.java index 3f5be08712ab..97860eff4ce2 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchFacetValueRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchFacetValueRest.java @@ -16,6 +16,7 @@ public class SearchFacetValueRest extends RestAddressableModel { public static final String NAME = "discover"; + public static final String PLURAL_NAME = NAME; public static final String CATEGORY = RestModel.DISCOVER; private String label; @@ -36,6 +37,14 @@ public String getType() { return NAME; } + /** + * The plural name is the same as the singular name + */ + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public Class getController() { return DiscoveryRestController.class; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchResultEntryRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchResultEntryRest.java index ac1d94f5f556..ac4918833cb3 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchResultEntryRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchResultEntryRest.java @@ -20,6 +20,7 @@ public class SearchResultEntryRest extends RestAddressableModel { public static final String NAME = "discover"; + public static final String PLURAL_NAME = NAME; public static final String CATEGORY = RestModel.DISCOVER; private Map> hitHighlights; @@ -35,6 +36,14 @@ public String getType() { return NAME; } + /** + * The plural name is the same as the singular name + */ + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @JsonIgnore public Class getController() { return DiscoveryRestController.class; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchSupportRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchSupportRest.java index 52c07ab13a98..a0743b8cbbc6 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchSupportRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SearchSupportRest.java @@ -16,6 +16,7 @@ */ public class SearchSupportRest extends BaseObjectRest { public static final String NAME = "discover"; + public static final String PLURAL_NAME = NAME; public static final String CATEGORY = RestModel.DISCOVER; public String getCategory() { @@ -26,6 +27,14 @@ public String getType() { return NAME; } + /** + * The plural name is the same as the singular name + */ + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public Class getController() { return DiscoveryRestController.class; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SiteRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SiteRest.java index c45c1004f9f8..6217505edbe1 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SiteRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SiteRest.java @@ -30,6 +30,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public boolean equals(Object object) { return (object instanceof SiteRest && diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/StatisticsSupportRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/StatisticsSupportRest.java index 55df71e8e68d..e2d42c60a9c2 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/StatisticsSupportRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/StatisticsSupportRest.java @@ -12,6 +12,7 @@ public class StatisticsSupportRest extends BaseObjectRest { public static final String NAME = "statistics"; + public static final String PLURAL_NAME = "statistics"; public static final String CATEGORY = RestModel.STATISTICS; public String getCategory() { @@ -25,4 +26,9 @@ public Class getController() { public String getType() { return NAME; } + + @Override + public String getTypePlural() { + return null; + } } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionAccessOptionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionAccessOptionRest.java index 407a39fca5bb..ad8fa68cdb28 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionAccessOptionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionAccessOptionRest.java @@ -64,6 +64,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return CATEGORY; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionCCLicenseRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionCCLicenseRest.java index 57315cd1a57b..7cc3c124d52c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionCCLicenseRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionCCLicenseRest.java @@ -66,6 +66,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override @JsonIgnore public Class getController() { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionCCLicenseUrlRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionCCLicenseUrlRest.java index 870fe0297247..409cad5f52d6 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionCCLicenseUrlRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionCCLicenseUrlRest.java @@ -47,6 +47,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return SubmissionCCLicenseUrlRest.CATEGORY; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionDefinitionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionDefinitionRest.java index 1316e3b91b6f..958701b5d6a1 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionDefinitionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionDefinitionRest.java @@ -60,6 +60,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public void setDefaultConf(boolean isDefault) { this.defaultConf = isDefault; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionFormRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionFormRest.java index fdc6b53e2351..5ef3c87fb358 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionFormRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionFormRest.java @@ -62,6 +62,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public Class getController() { return RestResourceController.class; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionSectionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionSectionRest.java index 5a827554c522..9c5a1c862976 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionSectionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionSectionRest.java @@ -52,6 +52,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public ScopeEnum getScope() { return scope; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionUploadRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionUploadRest.java index 4d0cedc9fecc..48d01a86d7c2 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionUploadRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubmissionUploadRest.java @@ -54,6 +54,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public Class getController() { return RestResourceController.class; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubscriptionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubscriptionRest.java index dd94cc60514b..bec1be5fc06b 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubscriptionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SubscriptionRest.java @@ -22,7 +22,7 @@ public class SubscriptionRest extends BaseObjectRest { public static final String NAME = "subscription"; public static final String PLURAL_NAME = "subscriptions"; - public static final String CATEGORY = "core"; + public static final String CATEGORY = RestModel.CORE; public static final String DSPACE_OBJECT = "resource"; public static final String EPERSON = "eperson"; @@ -45,6 +45,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public void setSubscriptionType(String type) { this.subscriptionType = type; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SupervisionOrderRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SupervisionOrderRest.java index 75a391c9e4dd..f5e75f1751e2 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SupervisionOrderRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SupervisionOrderRest.java @@ -70,4 +70,9 @@ public Class getController() { public String getType() { return NAME; } + + @Override + public String getTypePlural() { + return PLURAL_NAME; + } } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SystemWideAlertRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SystemWideAlertRest.java index 1fde31d45aab..b0f3e9da4ec3 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SystemWideAlertRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SystemWideAlertRest.java @@ -35,6 +35,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + private Integer alertId; private String message; private String allowSessions; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/TemplateItemRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/TemplateItemRest.java index 48aa30ba1605..d48c713d649e 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/TemplateItemRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/TemplateItemRest.java @@ -68,6 +68,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public UUID getId() { return uuid; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointCityRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointCityRest.java index 369bcce4d135..0198aaf0cc8c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointCityRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointCityRest.java @@ -15,12 +15,18 @@ */ public class UsageReportPointCityRest extends UsageReportPointRest { public static final String NAME = "city"; + public static final String PLURAL_NAME = "cities"; @Override public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public void setId(String id) { super.id = id; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointCountryRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointCountryRest.java index 1d6723503e61..fbfe9b9ee698 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointCountryRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointCountryRest.java @@ -19,6 +19,7 @@ */ public class UsageReportPointCountryRest extends UsageReportPointRest { public static final String NAME = "country"; + public static final String PLURAL_NAME = "countries"; @Override public void setLabel(String label) { @@ -36,4 +37,9 @@ public void setId(String id) { public String getType() { return NAME; } + + @Override + public String getTypePlural() { + return PLURAL_NAME; + } } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointDateRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointDateRest.java index e9b4ddea1568..d3ccb0163d9c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointDateRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointDateRest.java @@ -15,12 +15,18 @@ */ public class UsageReportPointDateRest extends UsageReportPointRest { public static final String NAME = "date"; + public static final String PLURAL_NAME = "dates"; @Override public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public void setId(String id) { super.id = id; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointDsoTotalVisitsRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointDsoTotalVisitsRest.java index fd8d33478666..721d0b8dc2a4 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointDsoTotalVisitsRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointDsoTotalVisitsRest.java @@ -7,6 +7,8 @@ */ package org.dspace.app.rest.model; +import org.atteo.evo.inflector.English; + /** * This class serves as a REST representation of a TotalVisit data Point of a DSO's {@link UsageReportRest} from the * DSpace statistics @@ -25,6 +27,11 @@ public String getType() { return this.type; } + @Override + public String getTypePlural() { + return English.plural(getType()); + } + /** * Sets the type of this {@link UsageReportPointRest} object, should be type of dso concerned (e.g. item, bitstream, ...) * diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointRest.java index feb006486fb0..50a8fc46bafc 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportPointRest.java @@ -17,8 +17,9 @@ * * @author Maria Verdonck (Atmire) on 08/06/2020 */ -public class UsageReportPointRest extends BaseObjectRest { +public abstract class UsageReportPointRest extends BaseObjectRest { public static final String NAME = "point"; + public static final String PLURAL_NAME = "points"; public static final String CATEGORY = RestModel.STATISTICS; protected String id; protected String label; @@ -54,6 +55,16 @@ public String getType() { return NAME; } + /** + * Returns the plural type of this {@link UsageReportPointRest} object + * + * @return Plural type of this {@link UsageReportPointRest} object + */ + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + /** * Returns the values of this {@link UsageReportPointRest} object, containing the amount of views * diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportRest.java index 1be1a352637b..a8b267daaf82 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/UsageReportRest.java @@ -57,6 +57,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + /** * Returns the report type of this UsageReport, options listed in * {@link org.dspace.app.rest.utils.UsageReportUtils}, e.g. diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionHistoryRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionHistoryRest.java index cb6294dd7449..5aab7028a8c6 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionHistoryRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionHistoryRest.java @@ -52,6 +52,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + /** * Generic getter for the id * @return the id value of this VersionHistoryRest diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionRest.java index 1ad98067795c..21bf82804dd2 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionRest.java @@ -138,4 +138,9 @@ public Class getController() { public String getType() { return NAME; } + + @Override + public String getTypePlural() { + return PLURAL_NAME; + } } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ViewEventRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ViewEventRest.java index 50163339cea8..2806f7ed8747 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ViewEventRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ViewEventRest.java @@ -68,4 +68,9 @@ public Class getController() { public String getType() { return NAME; } + + @Override + public String getTypePlural() { + return PLURAL_NAME; + } } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyEntryDetailsRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyEntryDetailsRest.java index 30e5eb71cbff..e5869a852521 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyEntryDetailsRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyEntryDetailsRest.java @@ -82,6 +82,11 @@ public String getType() { return VocabularyEntryDetailsRest.NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public Class getController() { return RestResourceController.class; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyEntryRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyEntryRest.java index 713d4c520972..3977026efafb 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyEntryRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyEntryRest.java @@ -20,6 +20,7 @@ */ public class VocabularyEntryRest implements RestModel { public static final String NAME = "vocabularyEntry"; + public static final String PLURAL_NAME = "vocabularyEntries"; @JsonInclude(Include.NON_NULL) private String authority; @@ -77,4 +78,9 @@ public VocabularyEntryDetailsRest getVocabularyEntryDetailsRest() { public String getType() { return VocabularyEntryRest.NAME; } + + @Override + public String getTypePlural() { + return PLURAL_NAME; + } } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyRest.java index b4a62ae383f7..f119059c2bb7 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyRest.java @@ -76,6 +76,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public Class getController() { return RestResourceController.class; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowActionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowActionRest.java index cdfcfa1ee4e5..c240bee2fb24 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowActionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowActionRest.java @@ -21,7 +21,7 @@ */ public class WorkflowActionRest extends BaseObjectRest { - public static final String CATEGORY = "config"; + public static final String CATEGORY = RestModel.CONFIGURATION; public static final String NAME = "workflowaction"; public static final String PLURAL_NAME = "workflowactions"; @@ -44,6 +44,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public List getOptions() { return options; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowDefinitionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowDefinitionRest.java index c31ca5be5beb..0ec967d09876 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowDefinitionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowDefinitionRest.java @@ -29,7 +29,7 @@ }) public class WorkflowDefinitionRest extends BaseObjectRest { - public static final String CATEGORY = "config"; + public static final String CATEGORY = RestModel.CONFIGURATION; public static final String NAME = "workflowdefinition"; public static final String PLURAL_NAME = "workflowdefinitions"; @@ -55,6 +55,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override @JsonIgnore public String getId() { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowItemRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowItemRest.java index 226ee0eeceb5..278d5de85d3f 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowItemRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowItemRest.java @@ -37,6 +37,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public Class getController() { return RestResourceController.class; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowStepRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowStepRest.java index 3a0491b95c4a..b3397721c117 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowStepRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowStepRest.java @@ -25,7 +25,7 @@ }) public class WorkflowStepRest extends BaseObjectRest { - public static final String CATEGORY = "config"; + public static final String CATEGORY = RestModel.CONFIGURATION; public static final String NAME = "workflowstep"; public static final String PLURAL_NAME = "workflowsteps"; @@ -48,6 +48,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @JsonIgnore public List getWorkflowactions() { return workflowactions; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkspaceItemRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkspaceItemRest.java index 688f4c7496f8..f0ba0981dab4 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkspaceItemRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkspaceItemRest.java @@ -37,6 +37,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public Class getController() { return RestResourceController.class; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/signposting/model/LinksetRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/signposting/model/LinksetRest.java index df80cd5c2d50..d1123f50f3de 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/signposting/model/LinksetRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/signposting/model/LinksetRest.java @@ -49,6 +49,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return CATEGORY; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/signposting/model/TypedLinkRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/signposting/model/TypedLinkRest.java index 3ba09bf1094c..ce6668920a9c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/signposting/model/TypedLinkRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/signposting/model/TypedLinkRest.java @@ -62,6 +62,11 @@ public String getType() { return type; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return CATEGORY; diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/converter/ConverterServiceIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/converter/ConverterServiceIT.java index 685bd5dbfdbe..d9bcf60468cb 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/converter/ConverterServiceIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/converter/ConverterServiceIT.java @@ -296,6 +296,11 @@ public Class getController() { public String getType() { return null; } + + @Override + public String getTypePlural() { + return null; + } } class MockHalResource extends HALResource { diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/model/MockObjectRest.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/model/MockObjectRest.java index 8586bf16bfcd..377705ad5f03 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/model/MockObjectRest.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/model/MockObjectRest.java @@ -67,6 +67,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + public String getValue() { return value; } From 4e598a833de3dabf065e91f5316b0d275bac0d2c Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Thu, 30 Nov 2023 16:23:19 +0100 Subject: [PATCH 03/23] 108915: Retrieve the link repositories using the plural model name --- .../src/main/java/org/dspace/app/rest/utils/Utils.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/Utils.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/Utils.java index ed6e26ed0fb7..76710d1c3441 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/Utils.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/Utils.java @@ -343,11 +343,10 @@ public static String makeSingular(String modelPlural) { * @return */ public LinkRestRepository getLinkResourceRepository(String apiCategory, String modelPlural, String rel) { - String model = makeSingular(modelPlural); try { - return applicationContext.getBean(apiCategory + "." + model + "." + rel, LinkRestRepository.class); + return applicationContext.getBean(apiCategory + "." + modelPlural + "." + rel, LinkRestRepository.class); } catch (NoSuchBeanDefinitionException e) { - throw new RepositoryNotFoundException(apiCategory, model); + throw new RepositoryNotFoundException(apiCategory, modelPlural); } } @@ -742,7 +741,7 @@ void embedRelFromRepository(HALResource resource } Projection projection = resource.getContent().getProjection(); LinkRestRepository linkRepository = getLinkResourceRepository(resource.getContent().getCategory(), - resource.getContent().getType(), rel); + resource.getContent().getTypePlural(), rel); if (linkRepository.isEmbeddableRelation(resource.getContent(), rel)) { Method method = requireMethod(linkRepository.getClass(), linkRest.method()); Object contentId = getContentIdForLinkMethod(resource.getContent(), method); From 052766ad9d76b6c89cdb79159be53757bc617ce5 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Fri, 1 Dec 2023 12:05:42 +0100 Subject: [PATCH 04/23] 108915: Refactored all regular repositories to use the plural model name instead of the singular --- .../app/rest/SubmissionCCLicenseUrlRepository.java | 2 +- .../app/rest/model/HarvestedCollectionRest.java | 4 ++-- .../AuthorizationFeatureRestRepository.java | 2 +- .../rest/repository/AuthorizationRestRepository.java | 2 +- .../repository/BitstreamFormatRestRepository.java | 2 +- .../app/rest/repository/BitstreamRestRepository.java | 2 +- .../rest/repository/BrowseIndexRestRepository.java | 2 +- .../BulkAccessConditionRestRepository.java | 4 ++-- .../rest/repository/ClaimedTaskRestRepository.java | 2 +- .../rest/repository/CollectionRestRepository.java | 2 +- .../app/rest/repository/CommunityRestRepository.java | 2 +- .../rest/repository/ConfigurationRestRepository.java | 2 +- .../app/rest/repository/DiscoveryRestRepository.java | 2 +- .../app/rest/repository/EPersonRestRepository.java | 2 +- .../rest/repository/EntityTypeRestRepository.java | 2 +- .../repository/ExternalSourceRestRepository.java | 2 +- .../app/rest/repository/FeedbackRestRepository.java | 4 ++-- .../app/rest/repository/GroupRestRepository.java | 2 +- .../HarvestedCollectionRestRepository.java | 2 +- .../rest/repository/IdentifierRestRepository.java | 12 ++++-------- .../app/rest/repository/ItemRestRepository.java | 2 +- .../rest/repository/MetadataFieldRestRepository.java | 2 +- .../repository/MetadataSchemaRestRepository.java | 2 +- .../rest/repository/OrcidHistoryRestRepository.java | 2 +- .../rest/repository/OrcidQueueRestRepository.java | 2 +- .../app/rest/repository/PoolTaskRestRepository.java | 2 +- .../app/rest/repository/ProcessRestRepository.java | 2 +- .../rest/repository/RegistrationRestRepository.java | 2 +- .../rest/repository/RelationshipRestRepository.java | 2 +- .../repository/RelationshipTypeRestRepository.java | 2 +- .../app/rest/repository/RequestItemRepository.java | 2 +- .../repository/ResearcherProfileRestRepository.java | 2 +- .../repository/ResourcePolicyRestRepository.java | 2 +- .../app/rest/repository/ScriptRestRepository.java | 2 +- .../rest/repository/SearchEventRestRepository.java | 2 +- .../app/rest/repository/SiteRestRepository.java | 2 +- .../rest/repository/StatisticsRestRepository.java | 2 +- .../SubmissionAccessOptionRestRepository.java | 4 ++-- .../SubmissionCCLicenseRestRepository.java | 2 +- .../SubmissionDefinitionRestRepository.java | 2 +- .../repository/SubmissionFormRestRepository.java | 2 +- .../repository/SubmissionPanelRestRepository.java | 2 +- .../repository/SubmissionUploadRestRepository.java | 2 +- .../rest/repository/SubscriptionRestRepository.java | 2 +- .../repository/SupervisionOrderRestRepository.java | 2 +- .../repository/SystemWideAlertRestRepository.java | 2 +- .../rest/repository/TemplateItemRestRepository.java | 2 +- .../repository/VersionHistoryRestRepository.java | 2 +- .../app/rest/repository/VersionRestRepository.java | 2 +- .../app/rest/repository/ViewEventRestRepository.java | 2 +- .../VocabularyEntryDetailsRestRepository.java | 2 +- .../rest/repository/VocabularyRestRepository.java | 2 +- .../repository/WorkflowActionRestRepository.java | 2 +- .../repository/WorkflowDefinitionRestRepository.java | 2 +- .../rest/repository/WorkflowItemRestRepository.java | 2 +- .../rest/repository/WorkflowStepRestRepository.java | 2 +- .../rest/repository/WorkspaceItemRestRepository.java | 2 +- .../rest/repository/MockObjectRestRepository.java | 2 +- 58 files changed, 65 insertions(+), 69 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/SubmissionCCLicenseUrlRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/SubmissionCCLicenseUrlRepository.java index 7e30413d8d59..d65e569c80e8 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/SubmissionCCLicenseUrlRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/SubmissionCCLicenseUrlRepository.java @@ -38,7 +38,7 @@ * It only supports a search method */ -@Component(SubmissionCCLicenseUrlRest.CATEGORY + "." + SubmissionCCLicenseUrlRest.NAME) +@Component(SubmissionCCLicenseUrlRest.CATEGORY + "." + SubmissionCCLicenseUrlRest.PLURAL_NAME) public class SubmissionCCLicenseUrlRepository extends DSpaceRestRepository implements InitializingBean { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/HarvestedCollectionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/HarvestedCollectionRest.java index 3cbd98b9d4bc..ae3711b95010 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/HarvestedCollectionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/HarvestedCollectionRest.java @@ -20,8 +20,8 @@ */ public class HarvestedCollectionRest extends BaseObjectRest { - public static final String NAME = "collections"; - public static final String PLURAL_NAME = NAME; + public static final String NAME = "harvestedcollection"; + public static final String PLURAL_NAME = "harvestedcollections"; public static final String CATEGORY = RestModel.CORE; @JsonProperty("harvest_type") diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationFeatureRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationFeatureRestRepository.java index 62781fe8e891..e161b07ed078 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationFeatureRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationFeatureRestRepository.java @@ -28,7 +28,7 @@ * * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(AuthorizationFeatureRest.CATEGORY + "." + AuthorizationFeatureRest.NAME) +@Component(AuthorizationFeatureRest.CATEGORY + "." + AuthorizationFeatureRest.PLURAL_NAME) public class AuthorizationFeatureRestRepository extends DSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationRestRepository.java index 137952866959..c5e09757306e 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationRestRepository.java @@ -49,7 +49,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(AuthorizationRest.CATEGORY + "." + AuthorizationRest.NAME) +@Component(AuthorizationRest.CATEGORY + "." + AuthorizationRest.PLURAL_NAME) public class AuthorizationRestRepository extends DSpaceRestRepository { private static final Logger log = LoggerFactory.getLogger(AuthorizationRestRepository.class); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamFormatRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamFormatRestRepository.java index 49585ee9db5a..c4c1981f9d78 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamFormatRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamFormatRestRepository.java @@ -35,7 +35,7 @@ * * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(BitstreamFormatRest.CATEGORY + "." + BitstreamFormatRest.NAME) +@Component(BitstreamFormatRest.CATEGORY + "." + BitstreamFormatRest.PLURAL_NAME) public class BitstreamFormatRestRepository extends DSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamRestRepository.java index 12e27dccacf2..57a9a03adde6 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BitstreamRestRepository.java @@ -56,7 +56,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(BitstreamRest.CATEGORY + "." + BitstreamRest.NAME) +@Component(BitstreamRest.CATEGORY + "." + BitstreamRest.PLURAL_NAME) public class BitstreamRestRepository extends DSpaceObjectRestRepository { private final BitstreamService bs; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BrowseIndexRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BrowseIndexRestRepository.java index 6aedcee6c0e7..315ea8dbe23c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BrowseIndexRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BrowseIndexRestRepository.java @@ -32,7 +32,7 @@ * * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(BrowseIndexRest.CATEGORY + "." + BrowseIndexRest.NAME) +@Component(BrowseIndexRest.CATEGORY + "." + BrowseIndexRest.PLURAL_NAME) public class BrowseIndexRestRepository extends DSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BulkAccessConditionRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BulkAccessConditionRestRepository.java index 2bf25978efc4..7d46031134ea 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BulkAccessConditionRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/BulkAccessConditionRestRepository.java @@ -27,7 +27,7 @@ * * @author Mohamed Eskander (mohamed.eskander at 4science.it) */ -@Component(BulkAccessConditionRest.CATEGORY + "." + BulkAccessConditionRest.NAME) +@Component(BulkAccessConditionRest.CATEGORY + "." + BulkAccessConditionRest.PLURAL_NAME) public class BulkAccessConditionRestRepository extends DSpaceRestRepository { @Autowired @@ -82,4 +82,4 @@ private boolean isAuthorized(Context context) { } } -} \ No newline at end of file +} diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ClaimedTaskRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ClaimedTaskRestRepository.java index dbd37093a9fc..a5934833a629 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ClaimedTaskRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ClaimedTaskRestRepository.java @@ -64,7 +64,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(PoolTaskRest.CATEGORY + "." + ClaimedTaskRest.NAME) +@Component(PoolTaskRest.CATEGORY + "." + ClaimedTaskRest.PLURAL_NAME) public class ClaimedTaskRestRepository extends DSpaceRestRepository implements InitializingBean { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionRestRepository.java index ba3163a4447c..6fcae23453ed 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionRestRepository.java @@ -81,7 +81,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(CollectionRest.CATEGORY + "." + CollectionRest.NAME) +@Component(CollectionRest.CATEGORY + "." + CollectionRest.PLURAL_NAME) public class CollectionRestRepository extends DSpaceObjectRestRepository { public static Logger log = org.apache.logging.log4j.LogManager.getLogger(CollectionRestRepository.class); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityRestRepository.java index 927b6a0b98f5..7d060319d911 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityRestRepository.java @@ -61,7 +61,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(CommunityRest.CATEGORY + "." + CommunityRest.NAME) +@Component(CommunityRest.CATEGORY + "." + CommunityRest.PLURAL_NAME) public class CommunityRestRepository extends DSpaceObjectRestRepository { private static final Logger log = org.apache.logging.log4j.LogManager diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ConfigurationRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ConfigurationRestRepository.java index caadb9f6f34e..b524ca776df2 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ConfigurationRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ConfigurationRestRepository.java @@ -24,7 +24,7 @@ /** * This is the repository responsible of exposing configuration properties */ -@Component(PropertyRest.CATEGORY + "." + PropertyRest.NAME) +@Component(PropertyRest.CATEGORY + "." + PropertyRest.PLURAL_NAME) public class ConfigurationRestRepository extends DSpaceRestRepository { private ConfigurationService configurationService; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/DiscoveryRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/DiscoveryRestRepository.java index 4b9b7d764478..fb2bff8e55d9 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/DiscoveryRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/DiscoveryRestRepository.java @@ -44,7 +44,7 @@ * information lookup * that has to be done for the endpoint */ -@Component(SearchResultsRest.CATEGORY + "." + SearchResultsRest.NAME) +@Component(SearchResultsRest.CATEGORY + "." + SearchResultsRest.PLURAL_NAME) public class DiscoveryRestRepository extends AbstractDSpaceRestRepository { private static final Logger log = LogManager.getLogger(); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EPersonRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EPersonRestRepository.java index 062f7b7a9482..4657064dc4d3 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EPersonRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EPersonRestRepository.java @@ -58,7 +58,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(EPersonRest.CATEGORY + "." + EPersonRest.NAME) +@Component(EPersonRest.CATEGORY + "." + EPersonRest.PLURAL_NAME) public class EPersonRestRepository extends DSpaceObjectRestRepository implements InitializingBean { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EntityTypeRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EntityTypeRestRepository.java index eec67b6fc93b..4ad7aa092c1e 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EntityTypeRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EntityTypeRestRepository.java @@ -31,7 +31,7 @@ /** * This is the repository that is responsible to manage EntityType Rest objects */ -@Component(EntityTypeRest.CATEGORY + "." + EntityTypeRest.NAME) +@Component(EntityTypeRest.CATEGORY + "." + EntityTypeRest.PLURAL_NAME) public class EntityTypeRestRepository extends DSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ExternalSourceRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ExternalSourceRestRepository.java index 7888603f1967..736261cd263b 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ExternalSourceRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ExternalSourceRestRepository.java @@ -31,7 +31,7 @@ * This is the Repository that is responsible for the functionality and implementations coming from * {@link org.dspace.app.rest.ExternalSourcesRestController} */ -@Component(ExternalSourceRest.CATEGORY + "." + ExternalSourceRest.NAME) +@Component(ExternalSourceRest.CATEGORY + "." + ExternalSourceRest.PLURAL_NAME) public class ExternalSourceRestRepository extends DSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/FeedbackRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/FeedbackRestRepository.java index 8fd28bbe94b8..aee8cf60054a 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/FeedbackRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/FeedbackRestRepository.java @@ -33,7 +33,7 @@ * * @author Mykhaylo Boychuk (mykhaylo.boychuk@4science.com) */ -@Component(FeedbackRest.CATEGORY + "." + FeedbackRest.NAME) +@Component(FeedbackRest.CATEGORY + "." + FeedbackRest.PLURAL_NAME) public class FeedbackRestRepository extends DSpaceRestRepository { @Autowired @@ -100,4 +100,4 @@ public void setFeedbackService(FeedbackService feedbackService) { this.feedbackService = feedbackService; } -} \ No newline at end of file +} diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/GroupRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/GroupRestRepository.java index 103abdcae645..39c2c2c66d89 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/GroupRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/GroupRestRepository.java @@ -42,7 +42,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(GroupRest.CATEGORY + "." + GroupRest.NAME) +@Component(GroupRest.CATEGORY + "." + GroupRest.PLURAL_NAME) public class GroupRestRepository extends DSpaceObjectRestRepository { @Autowired GroupService gs; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/HarvestedCollectionRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/HarvestedCollectionRestRepository.java index ccacc24418fd..d7f12a1813bd 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/HarvestedCollectionRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/HarvestedCollectionRestRepository.java @@ -35,7 +35,7 @@ * * @author Jelle Pelgrims (jelle.pelgrims at atmire.com) */ -@Component(HarvestedCollectionRest.CATEGORY + "." + HarvestedCollectionRest.NAME) +@Component(HarvestedCollectionRest.CATEGORY + "." + HarvestedCollectionRest.PLURAL_NAME) public class HarvestedCollectionRestRepository extends AbstractDSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/IdentifierRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/IdentifierRestRepository.java index 1be569d18e5d..75b19b8449ad 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/IdentifierRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/IdentifierRestRepository.java @@ -73,8 +73,8 @@ * @author Kim Shepherd */ @RestController -@RequestMapping("/api/" + IdentifierRestRepository.CATEGORY) -@Component(IdentifierRestRepository.CATEGORY + "." + IdentifierRestRepository.NAME) +@RequestMapping("/api/" + IdentifierRest.CATEGORY) +@Component(IdentifierRest.CATEGORY + "." + IdentifierRest.PLURAL_NAME) public class IdentifierRestRepository extends DSpaceRestRepository implements InitializingBean { @Autowired private DiscoverableEndpointsService discoverableEndpointsService; @@ -87,10 +87,6 @@ public class IdentifierRestRepository extends DSpaceRestRepository findByItem(@Parameter(value = "uuid", required = tru results.add(new IdentifierRest(handleUrl, "handle", null)); } } catch (SQLException | IdentifierException e) { - throw new LinkNotFoundException(IdentifierRestRepository.CATEGORY, IdentifierRest.NAME, uuid); + throw new LinkNotFoundException(IdentifierRest.CATEGORY, IdentifierRest.NAME, uuid); } // Return list of identifiers for this DSpaceObject return new PageImpl<>(results, pageable, results.size()); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemRestRepository.java index 16ce8629d17d..a1659c58d38c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemRestRepository.java @@ -59,7 +59,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(ItemRest.CATEGORY + "." + ItemRest.NAME) +@Component(ItemRest.CATEGORY + "." + ItemRest.PLURAL_NAME) public class ItemRestRepository extends DSpaceObjectRestRepository { private static final Logger log = LogManager.getLogger(ItemRestRepository.class); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/MetadataFieldRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/MetadataFieldRestRepository.java index 5152f11902f5..a6e6bd34edd2 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/MetadataFieldRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/MetadataFieldRestRepository.java @@ -55,7 +55,7 @@ * * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(MetadataFieldRest.CATEGORY + "." + MetadataFieldRest.NAME) +@Component(MetadataFieldRest.CATEGORY + "." + MetadataFieldRest.PLURAL_NAME) public class MetadataFieldRestRepository extends DSpaceRestRepository { /** * log4j logger diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/MetadataSchemaRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/MetadataSchemaRestRepository.java index d9c148b71c0d..c57d33b1504d 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/MetadataSchemaRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/MetadataSchemaRestRepository.java @@ -38,7 +38,7 @@ * * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(MetadataSchemaRest.CATEGORY + "." + MetadataSchemaRest.NAME) +@Component(MetadataSchemaRest.CATEGORY + "." + MetadataSchemaRest.PLURAL_NAME) public class MetadataSchemaRestRepository extends DSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/OrcidHistoryRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/OrcidHistoryRestRepository.java index 0c44baaf0dbd..e804654907d6 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/OrcidHistoryRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/OrcidHistoryRestRepository.java @@ -32,7 +32,7 @@ * @author Mykhaylo Boychuk (mykhaylo.boychuk at 4science.it) * */ -@Component(OrcidHistoryRest.CATEGORY + "." + OrcidHistoryRest.NAME) +@Component(OrcidHistoryRest.CATEGORY + "." + OrcidHistoryRest.PLURAL_NAME) @ConditionalOnProperty("orcid.synchronization-enabled") public class OrcidHistoryRestRepository extends DSpaceRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/OrcidQueueRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/OrcidQueueRestRepository.java index 0a1614cded94..9334103fb60c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/OrcidQueueRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/OrcidQueueRestRepository.java @@ -35,7 +35,7 @@ * @author Luca Giamminonni (luca.giamminonni at 4science.it) * */ -@Component(OrcidQueueRest.CATEGORY + "." + OrcidQueueRest.NAME) +@Component(OrcidQueueRest.CATEGORY + "." + OrcidQueueRest.PLURAL_NAME) @ConditionalOnProperty("orcid.synchronization-enabled") public class OrcidQueueRestRepository extends DSpaceRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/PoolTaskRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/PoolTaskRestRepository.java index da5253608e65..18995b4a026c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/PoolTaskRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/PoolTaskRestRepository.java @@ -48,7 +48,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(PoolTaskRest.CATEGORY + "." + PoolTaskRest.NAME) +@Component(PoolTaskRest.CATEGORY + "." + PoolTaskRest.PLURAL_NAME) public class PoolTaskRestRepository extends DSpaceRestRepository implements InitializingBean { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ProcessRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ProcessRestRepository.java index 2479eeda97f5..0e5a7e4e9340 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ProcessRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ProcessRestRepository.java @@ -47,7 +47,7 @@ /** * The repository for the Process workload */ -@Component(ProcessRest.CATEGORY + "." + ProcessRest.NAME) +@Component(ProcessRest.CATEGORY + "." + ProcessRest.PLURAL_NAME) public class ProcessRestRepository extends DSpaceRestRepository { private static final Logger log = LogManager.getLogger(); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java index be28170d8a07..6d99e9439972 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java @@ -48,7 +48,7 @@ /** * This is the repository that is responsible for managing Registration Rest objects */ -@Component(RegistrationRest.CATEGORY + "." + RegistrationRest.NAME) +@Component(RegistrationRest.CATEGORY + "." + RegistrationRest.PLURAL_NAME) public class RegistrationRestRepository extends DSpaceRestRepository { private static Logger log = LogManager.getLogger(RegistrationRestRepository.class); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RelationshipRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RelationshipRestRepository.java index 21f43ddacd63..38b9b3545c2c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RelationshipRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RelationshipRestRepository.java @@ -50,7 +50,7 @@ /** * This is the repository that is responsible to manage Relationship Rest objects */ -@Component(RelationshipRest.CATEGORY + "." + RelationshipRest.NAME) +@Component(RelationshipRest.CATEGORY + "." + RelationshipRest.PLURAL_NAME) public class RelationshipRestRepository extends DSpaceRestRepository { private static final Logger log = LogManager.getLogger(); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RelationshipTypeRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RelationshipTypeRestRepository.java index a4e65d75a390..31a1e091686c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RelationshipTypeRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RelationshipTypeRestRepository.java @@ -29,7 +29,7 @@ /** * This is the repository that is responsible to manage RelationshipType Rest objects */ -@Component(RelationshipTypeRest.CATEGORY + "." + RelationshipTypeRest.NAME) +@Component(RelationshipTypeRest.CATEGORY + "." + RelationshipTypeRest.PLURAL_NAME) public class RelationshipTypeRestRepository extends DSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java index 7c0694c52f26..18ec1e6fe2ca 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java @@ -54,7 +54,7 @@ * * @author Mark H. Wood */ -@Component(RequestItemRest.CATEGORY + '.' + RequestItemRest.NAME) +@Component(RequestItemRest.CATEGORY + '.' + RequestItemRest.PLURAL_NAME) public class RequestItemRepository extends DSpaceRestRepository { private static final Logger LOG = LogManager.getLogger(); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ResearcherProfileRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ResearcherProfileRestRepository.java index 37717f6268d8..a2fc2f01beab 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ResearcherProfileRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ResearcherProfileRestRepository.java @@ -45,7 +45,7 @@ * @author Luca Giamminonni (luca.giamminonni at 4science.it) * */ -@Component(ResearcherProfileRest.CATEGORY + "." + ResearcherProfileRest.NAME) +@Component(ResearcherProfileRest.CATEGORY + "." + ResearcherProfileRest.PLURAL_NAME) @ConditionalOnProperty(value = "researcher-profile.entity-type") public class ResearcherProfileRestRepository extends DSpaceRestRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ResourcePolicyRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ResourcePolicyRestRepository.java index 0b77f96b9b5f..31b43331033a 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ResourcePolicyRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ResourcePolicyRestRepository.java @@ -51,7 +51,7 @@ * * @author Luigi Andrea Pascarelli (luigiandrea.pascarelli at 4science.it) */ -@Component(ResourcePolicyRest.CATEGORY + "." + ResourcePolicyRest.NAME) +@Component(ResourcePolicyRest.CATEGORY + "." + ResourcePolicyRest.PLURAL_NAME) public class ResourcePolicyRestRepository extends DSpaceRestRepository implements InitializingBean { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ScriptRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ScriptRestRepository.java index 1eea06a4ee8d..e26f91c88981 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ScriptRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ScriptRestRepository.java @@ -46,7 +46,7 @@ /** * This is the REST repository dealing with the Script logic */ -@Component(ScriptRest.CATEGORY + "." + ScriptRest.NAME) +@Component(ScriptRest.CATEGORY + "." + ScriptRest.PLURAL_NAME) public class ScriptRestRepository extends DSpaceRestRepository { private static final Logger log = LogManager.getLogger(); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SearchEventRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SearchEventRestRepository.java index b55536d75edd..9bbc2b4c26c0 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SearchEventRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SearchEventRestRepository.java @@ -25,7 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -@Component(SearchEventRest.CATEGORY + "." + SearchEventRest.NAME) +@Component(SearchEventRest.CATEGORY + "." + SearchEventRest.PLURAL_NAME) public class SearchEventRestRepository extends AbstractDSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SiteRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SiteRestRepository.java index bf13700078ab..d4ca14f6da5c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SiteRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SiteRestRepository.java @@ -31,7 +31,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(SiteRest.CATEGORY + "." + SiteRest.NAME) +@Component(SiteRest.CATEGORY + "." + SiteRest.PLURAL_NAME) public class SiteRestRepository extends DSpaceObjectRestRepository { private final SiteService sitesv; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/StatisticsRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/StatisticsRestRepository.java index 09588a60453b..d1336e5d8aa2 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/StatisticsRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/StatisticsRestRepository.java @@ -31,7 +31,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.stereotype.Component; -@Component(StatisticsSupportRest.CATEGORY + "." + UsageReportRest.NAME) +@Component(StatisticsSupportRest.CATEGORY + "." + UsageReportRest.PLURAL_NAME) public class StatisticsRestRepository extends DSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionAccessOptionRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionAccessOptionRestRepository.java index a4117a617683..85893dd16105 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionAccessOptionRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionAccessOptionRestRepository.java @@ -25,7 +25,7 @@ * * @author Mykhaylo Boychuk (mykhaylo.boychuk at 4science.com) */ -@Component(SubmissionAccessOptionRest.CATEGORY + "." + SubmissionAccessOptionRest.NAME) +@Component(SubmissionAccessOptionRest.CATEGORY + "." + SubmissionAccessOptionRest.PLURAL_NAME) public class SubmissionAccessOptionRestRepository extends DSpaceRestRepository { @Autowired @@ -48,4 +48,4 @@ public Class getDomainClass() { return SubmissionAccessOptionRest.class; } -} \ No newline at end of file +} diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionCCLicenseRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionCCLicenseRestRepository.java index 356b3f22bfc4..40a9bc622d50 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionCCLicenseRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionCCLicenseRestRepository.java @@ -26,7 +26,7 @@ /** * This is the repository that is responsible to manage CCLicense Rest objects */ -@Component(SubmissionCCLicenseRest.CATEGORY + "." + SubmissionCCLicenseRest.NAME) +@Component(SubmissionCCLicenseRest.CATEGORY + "." + SubmissionCCLicenseRest.PLURAL_NAME) public class SubmissionCCLicenseRestRepository extends DSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionDefinitionRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionDefinitionRestRepository.java index b358b9684743..2a4b28af52be 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionDefinitionRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionDefinitionRestRepository.java @@ -31,7 +31,7 @@ * * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(SubmissionDefinitionRest.CATEGORY + "." + SubmissionDefinitionRest.NAME) +@Component(SubmissionDefinitionRest.CATEGORY + "." + SubmissionDefinitionRest.PLURAL_NAME) public class SubmissionDefinitionRestRepository extends DSpaceRestRepository { private SubmissionConfigReader submissionConfigReader; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionFormRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionFormRestRepository.java index 76d680cf276d..a5b9592aa096 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionFormRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionFormRestRepository.java @@ -28,7 +28,7 @@ * * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(SubmissionFormRest.CATEGORY + "." + SubmissionFormRest.NAME) +@Component(SubmissionFormRest.CATEGORY + "." + SubmissionFormRest.PLURAL_NAME) public class SubmissionFormRestRepository extends DSpaceRestRepository { private Map inputReaders; private DCInputsReader defaultInputReader; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionPanelRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionPanelRestRepository.java index 2046a816eb0a..2b8e1b60a018 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionPanelRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionPanelRestRepository.java @@ -27,7 +27,7 @@ * * @author Luigi Andrea Pascarelli (luigiandrea.pascarelli at 4science.it) */ -@Component(SubmissionDefinitionRest.CATEGORY + "." + SubmissionSectionRest.NAME) +@Component(SubmissionDefinitionRest.CATEGORY + "." + SubmissionSectionRest.PLURAL_NAME) public class SubmissionPanelRestRepository extends DSpaceRestRepository { private SubmissionConfigReader submissionConfigReader; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionUploadRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionUploadRestRepository.java index 24b6b969611b..9b5bed759e98 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionUploadRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionUploadRestRepository.java @@ -36,7 +36,7 @@ * * @author Luigi Andrea Pascarelli (luigiandrea.pascarelli at 4science.it) */ -@Component(SubmissionUploadRest.CATEGORY + "." + SubmissionUploadRest.NAME) +@Component(SubmissionUploadRest.CATEGORY + "." + SubmissionUploadRest.PLURAL_NAME) public class SubmissionUploadRestRepository extends DSpaceRestRepository { private static final Logger log = org.apache.logging.log4j.LogManager diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionRestRepository.java index e6ee87b36878..7f536d1126ac 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionRestRepository.java @@ -61,7 +61,7 @@ * * @author Mykhaylo Boychuk (mykhaylo.boychuk at 4science.com) */ -@Component(SubscriptionRest.CATEGORY + "." + SubscriptionRest.NAME) +@Component(SubscriptionRest.CATEGORY + "." + SubscriptionRest.PLURAL_NAME) public class SubscriptionRestRepository extends DSpaceRestRepository implements InitializingBean { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SupervisionOrderRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SupervisionOrderRestRepository.java index fb2f589dbc2a..56cdecdd4669 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SupervisionOrderRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SupervisionOrderRestRepository.java @@ -52,7 +52,7 @@ * * @author Mohamed Eskander (mohamed.eskander at 4science dot it) */ -@Component(SupervisionOrderRest.CATEGORY + "." + SupervisionOrderRest.NAME) +@Component(SupervisionOrderRest.CATEGORY + "." + SupervisionOrderRest.PLURAL_NAME) public class SupervisionOrderRestRepository extends DSpaceRestRepository { private static final Logger log = diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SystemWideAlertRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SystemWideAlertRestRepository.java index 73544145b20f..a5b0dfc0fc34 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SystemWideAlertRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SystemWideAlertRestRepository.java @@ -40,7 +40,7 @@ /** * The repository for the SystemWideAlert workload */ -@Component(SystemWideAlertRest.CATEGORY + "." + SystemWideAlertRest.NAME) +@Component(SystemWideAlertRest.CATEGORY + "." + SystemWideAlertRest.PLURAL_NAME) public class SystemWideAlertRestRepository extends DSpaceRestRepository { private static final Logger log = LogManager.getLogger(); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/TemplateItemRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/TemplateItemRestRepository.java index ad801404819b..1bacaa4ddb1f 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/TemplateItemRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/TemplateItemRestRepository.java @@ -34,7 +34,7 @@ /** * This is the repository class that is responsible for handling {@link TemplateItemRest} objects */ -@Component(TemplateItemRest.CATEGORY + "." + TemplateItemRest.NAME) +@Component(TemplateItemRest.CATEGORY + "." + TemplateItemRest.PLURAL_NAME) public class TemplateItemRestRepository extends DSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionHistoryRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionHistoryRestRepository.java index f41003d17dbd..9207add5f756 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionHistoryRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionHistoryRestRepository.java @@ -26,7 +26,7 @@ /** * Repository for the operations on the {@link VersionHistoryRest} endpoints */ -@Component(VersionHistoryRest.CATEGORY + "." + VersionHistoryRest.NAME) +@Component(VersionHistoryRest.CATEGORY + "." + VersionHistoryRest.PLURAL_NAME) public class VersionHistoryRestRepository extends DSpaceRestRepository { private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(VersionHistoryRestRepository.class); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionRestRepository.java index 585fc1de9f0b..665e8637cdea 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionRestRepository.java @@ -48,7 +48,7 @@ * * @author Mykhaylo Boychuk (mykhaylo.boychuk at 4science.it) */ -@Component(VersionRest.CATEGORY + "." + VersionRest.NAME) +@Component(VersionRest.CATEGORY + "." + VersionRest.PLURAL_NAME) public class VersionRestRepository extends DSpaceRestRepository implements ReloadableEntityObjectRepository { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ViewEventRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ViewEventRestRepository.java index d49f07d4392a..5dc032d4d614 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ViewEventRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ViewEventRestRepository.java @@ -31,7 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -@Component(ViewEventRest.CATEGORY + "." + ViewEventRest.NAME) +@Component(ViewEventRest.CATEGORY + "." + ViewEventRest.PLURAL_NAME) public class ViewEventRestRepository extends AbstractDSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyEntryDetailsRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyEntryDetailsRestRepository.java index 3e4d600b1213..cf74dd76f417 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyEntryDetailsRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyEntryDetailsRestRepository.java @@ -40,7 +40,7 @@ * * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(VocabularyRest.CATEGORY + "." + VocabularyEntryDetailsRest.NAME) +@Component(VocabularyRest.CATEGORY + "." + VocabularyEntryDetailsRest.PLURAL_NAME) public class VocabularyEntryDetailsRestRepository extends DSpaceRestRepository implements InitializingBean { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyRestRepository.java index fcc37d13160d..dbc4647a2c6d 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VocabularyRestRepository.java @@ -38,7 +38,7 @@ * @author Luigi Andrea Pascarelli (luigiandrea.pascarelli at 4science.it) * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(VocabularyRest.CATEGORY + "." + VocabularyRest.NAME) +@Component(VocabularyRest.CATEGORY + "." + VocabularyRest.PLURAL_NAME) public class VocabularyRestRepository extends DSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowActionRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowActionRestRepository.java index 75c2e5c1405b..92efe9849420 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowActionRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowActionRestRepository.java @@ -24,7 +24,7 @@ * * @author Maria Verdonck (Atmire) on 06/01/2020 */ -@Component(WorkflowActionRest.CATEGORY + "." + WorkflowActionRest.NAME) +@Component(WorkflowActionRest.CATEGORY + "." + WorkflowActionRest.PLURAL_NAME) public class WorkflowActionRestRepository extends DSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowDefinitionRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowDefinitionRestRepository.java index 7aa6d7d28048..8c4836a23d4c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowDefinitionRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowDefinitionRestRepository.java @@ -32,7 +32,7 @@ * * @author Maria Verdonck (Atmire) on 11/12/2019 */ -@Component(WorkflowDefinitionRest.CATEGORY + "." + WorkflowDefinitionRest.NAME) +@Component(WorkflowDefinitionRest.CATEGORY + "." + WorkflowDefinitionRest.PLURAL_NAME) public class WorkflowDefinitionRestRepository extends DSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowItemRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowItemRestRepository.java index ee8dc12e7354..983713ff7bbb 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowItemRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowItemRestRepository.java @@ -66,7 +66,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(WorkflowItemRest.CATEGORY + "." + WorkflowItemRest.NAME) +@Component(WorkflowItemRest.CATEGORY + "." + WorkflowItemRest.PLURAL_NAME) public class WorkflowItemRestRepository extends DSpaceRestRepository { public static final String OPERATION_PATH_SECTIONS = "sections"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowStepRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowStepRestRepository.java index 798c352b2291..2102bab71050 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowStepRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkflowStepRestRepository.java @@ -24,7 +24,7 @@ * * @author Maria Verdonck (Atmire) on 10/01/2020 */ -@Component(WorkflowStepRest.CATEGORY + "." + WorkflowStepRest.NAME) +@Component(WorkflowStepRest.CATEGORY + "." + WorkflowStepRest.PLURAL_NAME) public class WorkflowStepRestRepository extends DSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkspaceItemRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkspaceItemRestRepository.java index b43cdb7a0b1a..edf7d62b95af 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkspaceItemRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkspaceItemRestRepository.java @@ -72,7 +72,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) * @author Pasquale Cavallo (pasquale.cavallo at 4science.it) */ -@Component(WorkspaceItemRest.CATEGORY + "." + WorkspaceItemRest.NAME) +@Component(WorkspaceItemRest.CATEGORY + "." + WorkspaceItemRest.PLURAL_NAME) public class WorkspaceItemRestRepository extends DSpaceRestRepository implements ReloadableEntityObjectRepository { diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/repository/MockObjectRestRepository.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/repository/MockObjectRestRepository.java index 0c5481124924..596f846f13ad 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/repository/MockObjectRestRepository.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/repository/MockObjectRestRepository.java @@ -18,7 +18,7 @@ * This class has been added to allow the MockObjectRest to act as an actual BaseObjectRest since they're * expected to have a RestRepository */ -@Component(MockObjectRest.CATEGORY + "." + MockObjectRest.NAME) +@Component(MockObjectRest.CATEGORY + "." + MockObjectRest.PLURAL_NAME) public class MockObjectRestRepository extends DSpaceRestRepository { // Added a permitAll preAuthorize annotation to allow the object to be used in tests by every user From 7d657c86b1f5eb30b7f249c1b9f45047e4756956 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Fri, 1 Dec 2023 13:23:23 +0100 Subject: [PATCH 05/23] 108915: Removed usages of org.atteo.evo.inflector.English#plural() --- .../dspace/app/rest/RestResourceController.java | 3 +-- .../app/rest/link/BrowseEntryHalLinkFactory.java | 3 +-- .../app/rest/link/OrcidQueueHalLinkFactory.java | 5 ++--- .../rest/link/SubmissionSectionHalLinkFactory.java | 14 ++++++++------ .../link/relation/RelationshipHalLinkFactory.java | 5 ++--- .../rest/model/hateoas/BrowseIndexResource.java | 11 +++++------ .../rest/repository/IdentifierRestRepository.java | 4 +--- .../dspace/app/rest/submit/SubmissionService.java | 5 ++--- 8 files changed, 22 insertions(+), 28 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/RestResourceController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/RestResourceController.java index b82b4830753c..74afa55470e0 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/RestResourceController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/RestResourceController.java @@ -31,7 +31,6 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.Logger; -import org.atteo.evo.inflector.English; import org.dspace.app.rest.converter.ConverterService; import org.dspace.app.rest.converter.JsonPatchConverter; import org.dspace.app.rest.exception.DSpaceBadRequestException; @@ -126,7 +125,7 @@ public void afterPropertiesSet() { // see https://github.com/spring-projects/spring-hateoas/issues/408 // Link l = linkTo(this.getClass(), r).withRel(r); String[] split = r.split("\\.", 2); - String plural = English.plural(split[1]); + String plural = split[1]; Link l = Link.of("/api/" + split[0] + "/" + plural, plural); links.add(l); log.debug(l.getRel().value() + " " + l.getHref()); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/BrowseEntryHalLinkFactory.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/BrowseEntryHalLinkFactory.java index 9e515984fe03..9928efb73519 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/BrowseEntryHalLinkFactory.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/BrowseEntryHalLinkFactory.java @@ -9,7 +9,6 @@ import java.util.LinkedList; -import org.atteo.evo.inflector.English; import org.dspace.app.rest.RestResourceController; import org.dspace.app.rest.model.BrowseEntryRest; import org.dspace.app.rest.model.BrowseIndexRest; @@ -36,7 +35,7 @@ protected void addLinks(final BrowseEntryResource halResource, final Pageable pa UriComponentsBuilder baseLink = uriBuilder( getMethodOn(bix.getCategory(), bix.getType()).findRel(null, null, bix.getCategory(), - English.plural(bix.getType()), bix.getId(), + bix.getTypePlural(), bix.getId(), BrowseIndexRest.LINK_ITEMS, null, null)); addFilterParams(baseLink, data); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/OrcidQueueHalLinkFactory.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/OrcidQueueHalLinkFactory.java index 813ddf58db9d..9e679bb0a2be 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/OrcidQueueHalLinkFactory.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/OrcidQueueHalLinkFactory.java @@ -11,7 +11,6 @@ import java.util.LinkedList; -import org.atteo.evo.inflector.English; import org.dspace.app.rest.RestResourceController; import org.dspace.app.rest.model.ItemRest; import org.dspace.app.rest.model.OrcidQueueRest; @@ -37,7 +36,7 @@ protected void addLinks(OrcidQueueResource halResource, Pageable pageable, Linke OrcidQueueRest orcidQueueRest = halResource.getContent(); if (orcidQueueRest.getProfileItemId() != null) { UriComponentsBuilder uriComponentsBuilder = linkTo(getMethodOn(ItemRest.CATEGORY, ItemRest.NAME) - .findRel(null, null, ItemRest.CATEGORY, English.plural(ItemRest.NAME), + .findRel(null, null, ItemRest.CATEGORY, ItemRest.PLURAL_NAME, orcidQueueRest.getProfileItemId(), "", null, null)).toUriComponentsBuilder(); String uribuilder = uriComponentsBuilder.build().toString(); list.add(buildLink("profileItem", uribuilder.substring(0, uribuilder.lastIndexOf("/")))); @@ -45,7 +44,7 @@ protected void addLinks(OrcidQueueResource halResource, Pageable pageable, Linke if (orcidQueueRest.getEntityId() != null) { UriComponentsBuilder uriComponentsBuilder = linkTo(getMethodOn(ItemRest.CATEGORY, ItemRest.NAME) - .findRel(null, null, ItemRest.CATEGORY, English.plural(ItemRest.NAME), + .findRel(null, null, ItemRest.CATEGORY, ItemRest.PLURAL_NAME, orcidQueueRest.getEntityId(), "", null, null)).toUriComponentsBuilder(); String uribuilder = uriComponentsBuilder.build().toString(); list.add(buildLink("entity", uribuilder.substring(0, uribuilder.lastIndexOf("/")))); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/SubmissionSectionHalLinkFactory.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/SubmissionSectionHalLinkFactory.java index 4cce63ed698b..e66f01d4014b 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/SubmissionSectionHalLinkFactory.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/SubmissionSectionHalLinkFactory.java @@ -11,7 +11,6 @@ import java.util.LinkedList; -import org.atteo.evo.inflector.English; import org.dspace.app.rest.RestResourceController; import org.dspace.app.rest.model.SubmissionAccessOptionRest; import org.dspace.app.rest.model.SubmissionFormRest; @@ -37,19 +36,22 @@ protected void addLinks(final SubmissionSectionResource halResource, final Pagea SubmissionSectionRest sd = halResource.getContent(); if (SubmissionStepConfig.INPUT_FORM_STEP_NAME.equals(sd.getSectionType())) { - buildLink(list, sd, SubmissionFormRest.CATEGORY, SubmissionFormRest.NAME); + buildLink(list, sd, SubmissionFormRest.CATEGORY, SubmissionFormRest.NAME, SubmissionFormRest.PLURAL_NAME); } if (SubmissionStepConfig.UPLOAD_STEP_NAME.equals(sd.getSectionType())) { - buildLink(list, sd, SubmissionUploadRest.CATEGORY, SubmissionUploadRest.NAME); + buildLink(list, sd, SubmissionUploadRest.CATEGORY, SubmissionUploadRest.NAME, + SubmissionUploadRest.PLURAL_NAME); } if (SubmissionStepConfig.ACCESS_CONDITION_STEP_NAME.equals(sd.getSectionType())) { - buildLink(list, sd, SubmissionAccessOptionRest.CATEGORY, SubmissionAccessOptionRest.NAME); + buildLink(list, sd, SubmissionAccessOptionRest.CATEGORY, SubmissionAccessOptionRest.NAME, + SubmissionAccessOptionRest.PLURAL_NAME); } } - private void buildLink(final LinkedList list, SubmissionSectionRest sd, String category, String name) { + private void buildLink(final LinkedList list, SubmissionSectionRest sd, String category, String name, + String plural) { UriComponentsBuilder uriComponentsBuilder = linkTo(getMethodOn(category, name) - .findRel(null, null, category, English.plural(name), sd.getId(), "", null, null)) + .findRel(null, null, category, plural, sd.getId(), "", null, null)) .toUriComponentsBuilder(); String uribuilder = uriComponentsBuilder.build().toString(); list.add(buildLink(NAME_LINK_ON_PANEL, uribuilder.substring(0, uribuilder.lastIndexOf("/")))); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/relation/RelationshipHalLinkFactory.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/relation/RelationshipHalLinkFactory.java index 9d4e4291f5ae..e319428f0e8a 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/relation/RelationshipHalLinkFactory.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/link/relation/RelationshipHalLinkFactory.java @@ -9,7 +9,6 @@ import java.util.LinkedList; -import org.atteo.evo.inflector.English; import org.dspace.app.rest.RestResourceController; import org.dspace.app.rest.link.HalLinkFactory; import org.dspace.app.rest.model.ItemRest; @@ -29,10 +28,10 @@ protected void addLinks(RelationshipResource halResource, Pageable pageable, Lin throws Exception { list.add(buildLink("leftItem", getMethodOn() - .findOne(ItemRest.CATEGORY, English.plural(ItemRest.NAME), halResource.getContent().getLeftId()))); + .findOne(ItemRest.CATEGORY, ItemRest.PLURAL_NAME, halResource.getContent().getLeftId()))); list.add(buildLink("rightItem", getMethodOn() - .findOne(ItemRest.CATEGORY, English.plural(ItemRest.NAME), halResource.getContent().getRightId()))); + .findOne(ItemRest.CATEGORY, ItemRest.PLURAL_NAME, halResource.getContent().getRightId()))); } @Override diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/hateoas/BrowseIndexResource.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/hateoas/BrowseIndexResource.java index 61158704ea5a..de3c605139ea 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/hateoas/BrowseIndexResource.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/hateoas/BrowseIndexResource.java @@ -10,7 +10,6 @@ import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; -import org.atteo.evo.inflector.English; import org.dspace.app.rest.RestResourceController; import org.dspace.app.rest.model.BrowseIndexRest; import org.dspace.app.rest.model.VocabularyRest; @@ -47,13 +46,13 @@ public BrowseIndexResource(BrowseIndexRest bix, Utils utils) { } if (bix.getBrowseType().equals(BrowseIndexRest.BROWSE_TYPE_HIERARCHICAL)) { ChoiceAuthorityService choiceAuthorityService = - ContentAuthorityServiceFactory.getInstance().getChoiceAuthorityService(); + ContentAuthorityServiceFactory.getInstance().getChoiceAuthorityService(); ChoiceAuthority source = choiceAuthorityService.getChoiceAuthorityByAuthorityName(bix.getVocabulary()); UriComponentsBuilder baseLink = linkTo( - methodOn(RestResourceController.class, VocabularyRest.AUTHENTICATION).findRel(null, - null, VocabularyRest.CATEGORY, - English.plural(VocabularyRest.NAME), source.getPluginInstanceName(), - "", null, null)).toUriComponentsBuilder(); + methodOn(RestResourceController.class, VocabularyRest.AUTHENTICATION).findRel( + null, null, VocabularyRest.CATEGORY, VocabularyRest.PLURAL_NAME, + source.getPluginInstanceName(), "", null, null) + ).toUriComponentsBuilder(); add(Link.of(baseLink.build().encode().toUriString(), BrowseIndexRest.LINK_VOCABULARY)); } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/IdentifierRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/IdentifierRestRepository.java index 75b19b8449ad..204401d69a8c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/IdentifierRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/IdentifierRestRepository.java @@ -20,7 +20,6 @@ import javax.servlet.http.HttpServletResponse; import javax.ws.rs.NotSupportedException; -import org.atteo.evo.inflector.English; import org.dspace.app.rest.DiscoverableEndpointsService; import org.dspace.app.rest.Parameter; import org.dspace.app.rest.SearchRestMethod; @@ -277,8 +276,7 @@ public void getDSObyIdentifier(HttpServletRequest request, if (dso != null) { // Convert and respond with a redirect to the object itself DSpaceObjectRest dsor = converter.toRest(dso, utils.obtainProjection()); - URI link = linkTo(dsor.getController(), dsor.getCategory(), - English.plural(dsor.getType())) + URI link = linkTo(dsor.getController(), dsor.getCategory(), dsor.getTypePlural()) .slash(dsor.getId()).toUri(); response.setStatus(HttpServletResponse.SC_FOUND); response.sendRedirect(link.toString()); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/SubmissionService.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/SubmissionService.java index 76de36dde65b..8c6dc989bfa1 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/SubmissionService.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/SubmissionService.java @@ -16,7 +16,6 @@ import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.Logger; -import org.atteo.evo.inflector.English; import org.dspace.app.rest.converter.ConverterService; import org.dspace.app.rest.exception.DSpaceBadRequestException; import org.dspace.app.rest.exception.RESTAuthorizationException; @@ -218,7 +217,7 @@ public UploadBitstreamRest buildUploadBitstream(ConfigurationService configurati data.setCheckSum(checksum); data.setSizeBytes(source.getSizeBytes()); data.setUrl(configurationService.getProperty("dspace.server.url") + "/api/" + BitstreamRest.CATEGORY + "/" + - English.plural(BitstreamRest.NAME) + "/" + source.getID() + "/content"); + BitstreamRest.PLURAL_NAME + "/" + source.getID() + "/content"); return data; } @@ -240,7 +239,7 @@ public XmlWorkflowItem createWorkflowItem(Context context, String requestUriList if (StringUtils.isBlank(requestUriListString)) { throw new UnprocessableEntityException("Malformed body..." + requestUriListString); } - String regex = "\\/api\\/" + WorkspaceItemRest.CATEGORY + "\\/" + English.plural(WorkspaceItemRest.NAME) + String regex = "\\/api\\/" + WorkspaceItemRest.CATEGORY + "\\/" + WorkspaceItemRest.PLURAL_NAME + "\\/"; String[] split = requestUriListString.split(regex, 2); if (split.length != 2) { From 59d34e77923dc8f2d5dd86f6386400fb675be6e9 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Fri, 1 Dec 2023 15:00:58 +0100 Subject: [PATCH 06/23] 108915: Refactored the code to retrieve the regular repositories using their plural --- .../org/dspace/app/rest/RestResourceController.java | 2 +- .../rest/authorization/AuthorizationRestUtil.java | 4 +++- .../dspace/app/rest/converter/ConverterService.java | 2 +- .../main/java/org/dspace/app/rest/utils/Utils.java | 13 ++++++------- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/RestResourceController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/RestResourceController.java index 74afa55470e0..3e5ef90850cd 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/RestResourceController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/RestResourceController.java @@ -890,7 +890,7 @@ private RepresentationModel findRelInternal(HttpServle int start = Math.toIntExact(page.getOffset()); int end = (start + page.getPageSize()) > fullList.size() ? fullList.size() : (start + page.getPageSize()); DSpaceRestRepository resourceRepository = utils - .getResourceRepository(fullList.get(0).getCategory(), fullList.get(0).getType()); + .getResourceRepository(fullList.get(0).getCategory(), fullList.get(0).getTypePlural()); PageImpl pageResult = new PageImpl(fullList.subList(start, end), page, fullList.size()); return assembler.toModel(pageResult.map(converter::toResource)); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/authorization/AuthorizationRestUtil.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/authorization/AuthorizationRestUtil.java index c8a9d2435bb5..c3249be01165 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/authorization/AuthorizationRestUtil.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/authorization/AuthorizationRestUtil.java @@ -12,6 +12,7 @@ import java.util.UUID; import org.apache.commons.lang3.StringUtils; +import org.atteo.evo.inflector.English; import org.dspace.app.rest.model.BaseObjectRest; import org.dspace.app.rest.repository.DSpaceRestRepository; import org.dspace.app.rest.repository.ReloadableEntityObjectRepository; @@ -66,7 +67,8 @@ public BaseObjectRest getObject(Context context, String id) throws SQLException String[] objType; try { objType = parts[2].split("\\."); - DSpaceRestRepository repository = utils.getResourceRepositoryByCategoryAndModel(objType[0], objType[1]); + DSpaceRestRepository repository = utils + .getResourceRepositoryByCategoryAndModel(objType[0], English.plural(objType[1])); Serializable pk = utils.castToPKClass((ReloadableEntityObjectRepository) repository, objIdStr); try { // disable the security as we only need to retrieve the object to further process the authorization diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/converter/ConverterService.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/converter/ConverterService.java index e83790495146..55ae7b9595a9 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/converter/ConverterService.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/converter/ConverterService.java @@ -151,7 +151,7 @@ private String parseAnnotation(Annotation preAuthorize) { private Annotation getAnnotationForRestObject(BaseObjectRest restObject) { BaseObjectRest baseObjectRest = restObject; DSpaceRestRepository repositoryToUse = utils - .getResourceRepositoryByCategoryAndModel(baseObjectRest.getCategory(), baseObjectRest.getType()); + .getResourceRepositoryByCategoryAndModel(baseObjectRest.getCategory(), baseObjectRest.getTypePlural()); Annotation preAuthorize = null; int maxDepth = 0; // DS-4530 exclude the AOP Proxy from determining the annotations diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/Utils.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/Utils.java index 76710d1c3441..c08d5a04a781 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/Utils.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/Utils.java @@ -267,8 +267,7 @@ private Serializable getIdentifierForLink(RestAddressableModel data) { */ public DSpaceRestRepository getResourceRepository(String apiCategory, String modelPlural) throws RepositoryNotFoundException { - String model = makeSingular(modelPlural); - return getResourceRepositoryByCategoryAndModel(apiCategory, model); + return getResourceRepositoryByCategoryAndModel(apiCategory, modelPlural); } /** @@ -276,16 +275,16 @@ public DSpaceRestRepository getResourceRepository(String apiCategory, String mod * as returned by the {@link RestAddressableModel#getType()} method * * @param apiCategory - * @param modelSingular + * @param modelPlural * @return the requested repository. * @throws RepositoryNotFoundException if no such repository can be found. */ - public DSpaceRestRepository getResourceRepositoryByCategoryAndModel(String apiCategory, String modelSingular) + public DSpaceRestRepository getResourceRepositoryByCategoryAndModel(String apiCategory, String modelPlural) throws RepositoryNotFoundException { try { - return applicationContext.getBean(apiCategory + "." + modelSingular, DSpaceRestRepository.class); + return applicationContext.getBean(apiCategory + "." + modelPlural, DSpaceRestRepository.class); } catch (NoSuchBeanDefinitionException e) { - throw new RepositoryNotFoundException(apiCategory, modelSingular); + throw new RepositoryNotFoundException(apiCategory, modelPlural); } } @@ -972,7 +971,7 @@ public Serializable castToPKClass(ReloadableEntityObjectRepository repository, S public Object getDSpaceAPIObjectFromRest(Context context, BaseObjectRest restObj) throws IllegalArgumentException, SQLException { DSpaceRestRepository repository = getResourceRepositoryByCategoryAndModel(restObj.getCategory(), - restObj.getType()); + restObj.getTypePlural()); Serializable pk = castToPKClass((ReloadableEntityObjectRepository) repository, restObj.getId().toString()); return ((ReloadableEntityObjectRepository) repository).findDomainObjectByPk(context, pk); } From 1eab2c0e14a2098decbc58b319f17fff1315daab Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Fri, 1 Dec 2023 16:53:11 +0100 Subject: [PATCH 07/23] 108915: Minor controller/repository improvements --- .../org/dspace/app/rest/CollectionLogoController.java | 10 +++------- .../org/dspace/app/rest/CommunityLogoController.java | 10 +++------- .../CommunityParentCommunityLinkRepository.java | 2 +- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/CollectionLogoController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/CollectionLogoController.java index c3243d8887e1..9c69043bb983 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/CollectionLogoController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/CollectionLogoController.java @@ -7,6 +7,8 @@ */ package org.dspace.app.rest; +import static org.dspace.app.rest.utils.RegexUtils.REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID; + import java.io.IOException; import java.sql.SQLException; import java.util.UUID; @@ -44,15 +46,9 @@ */ @RestController @RequestMapping("/api/" + CollectionRest.CATEGORY + "/" + CollectionRest.PLURAL_NAME - + CollectionLogoController.REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID + "/logo") + + REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID + "/logo") public class CollectionLogoController { - /** - * Regular expression in the request mapping to accept UUID as identifier - */ - protected static final String REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID = - "/{uuid:[0-9a-fxA-FX]{8}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{12}}"; - @Autowired protected Utils utils; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/CommunityLogoController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/CommunityLogoController.java index 52c0f000b6c6..e1efffb19030 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/CommunityLogoController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/CommunityLogoController.java @@ -7,6 +7,8 @@ */ package org.dspace.app.rest; +import static org.dspace.app.rest.utils.RegexUtils.REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID; + import java.io.IOException; import java.sql.SQLException; import java.util.UUID; @@ -44,15 +46,9 @@ */ @RestController @RequestMapping("/api/" + CommunityRest.CATEGORY + "/" + CommunityRest.PLURAL_NAME - + CommunityLogoController.REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID + "/logo") + + REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID + "/" + CommunityRest.LOGO) public class CommunityLogoController { - /** - * Regular expression in the request mapping to accept UUID as identifier - */ - protected static final String REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID = - "/{uuid:[0-9a-fxA-FX]{8}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{12}}"; - @Autowired protected Utils utils; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityParentCommunityLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityParentCommunityLinkRepository.java index be58f7d26794..7c14c944c26a 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityParentCommunityLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityParentCommunityLinkRepository.java @@ -51,7 +51,7 @@ public CommunityRest getParentCommunity(@Nullable HttpServletRequest httpServlet Context context = obtainContext(); Community community = communityService.find(context, communityId); if (community == null) { - throw new ResourceNotFoundException("No such community: " + community); + throw new ResourceNotFoundException("No such community: " + communityId); } Community parentCommunity = (Community) communityService.getParentObject(context, community); if (parentCommunity == null) { From 71d56794673a3e4587b8d5f5482736a2c3e0bebd Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Sat, 2 Dec 2023 12:46:40 +0100 Subject: [PATCH 08/23] 108915: Fixed tests using incorrect route to access the sites endpoint --- .../CollectionAdminFeatureIT.java | 30 ++--- .../authorization/ComColAdminFeatureIT.java | 30 ++--- .../CommunityAdminFeatureIT.java | 30 ++--- .../authorization/ManageGroupsFeatureIT.java | 120 +++++++++--------- 4 files changed, 105 insertions(+), 105 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/authorization/CollectionAdminFeatureIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/authorization/CollectionAdminFeatureIT.java index 15539d2a9d33..b305c23a5b95 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/authorization/CollectionAdminFeatureIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/authorization/CollectionAdminFeatureIT.java @@ -103,7 +103,7 @@ public void testAdmin() throws Exception { // Verify the general admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCollectionAdmin')]") @@ -116,7 +116,7 @@ public void testCommunityAdmin() throws Exception { // Verify the community admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCollectionAdmin')]") @@ -129,7 +129,7 @@ public void testSubCommunityAdmin() throws Exception { // Verify the subcommunity admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCollectionAdmin')]") @@ -142,7 +142,7 @@ public void testCollectionAdmin() throws Exception { // Verify the collection admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCollectionAdmin')]") @@ -155,7 +155,7 @@ public void testSubmitter() throws Exception { // Verify a submitter doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCollectionAdmin')]") @@ -176,7 +176,7 @@ public void testSubGroupOfAdminGroup() throws Exception { // Verify an ePerson in a subgroup of the site administrators has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCollectionAdmin')]") @@ -197,7 +197,7 @@ public void testSubGroupOfCommunityAdminGroup() throws Exception { // Verify an ePerson in a subgroup of a community admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCollectionAdmin')]") @@ -218,7 +218,7 @@ public void testSubGroupOfSubCommunityAdminGroup() throws Exception { // Verify an ePerson in a subgroup of a subcommunity admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCollectionAdmin')]") @@ -239,7 +239,7 @@ public void testSubGroupOfCollectionAdminGroup() throws Exception { // Verify an ePerson in a subgroup of a collection admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCollectionAdmin')]") @@ -260,7 +260,7 @@ public void testSubGroupOfSubmitterGroup() throws Exception { // Verify an ePerson in a subgroup of submitter group doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCollectionAdmin')]") @@ -285,7 +285,7 @@ public void testSubSubGroupOfAdminGroup() throws Exception { // Verify an ePerson in a sub-subgroup of the site administrators has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCollectionAdmin')]") @@ -310,7 +310,7 @@ public void testSubSubGroupOfCommunityAdminGroup() throws Exception { // Verify an ePerson in a sub-subgroup of a community admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCollectionAdmin')]") @@ -335,7 +335,7 @@ public void testSubSubGroupOfSubCommunityAdminGroup() throws Exception { // Verify an ePerson in a sub-subgroup of a subcommunity admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCollectionAdmin')]") @@ -360,7 +360,7 @@ public void testSubSubGroupOfCollectionAdminGroup() throws Exception { // Verify an ePerson in a sub-subgroup of a collection admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCollectionAdmin')]") @@ -385,7 +385,7 @@ public void testSubSubGroupOfSubmitterGroup() throws Exception { // Verify an ePerson in a sub-subgroup of submitter group doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCollectionAdmin')]") diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/authorization/ComColAdminFeatureIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/authorization/ComColAdminFeatureIT.java index df386a0c7985..a3b73717937c 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/authorization/ComColAdminFeatureIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/authorization/ComColAdminFeatureIT.java @@ -103,7 +103,7 @@ public void testAdmin() throws Exception { // Verify the general admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isComColAdmin')]") @@ -116,7 +116,7 @@ public void testCommunityAdmin() throws Exception { // Verify the community admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isComColAdmin')]") @@ -129,7 +129,7 @@ public void testSubCommunityAdmin() throws Exception { // Verify the subcommunity admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isComColAdmin')]") @@ -142,7 +142,7 @@ public void testCollectionAdmin() throws Exception { // Verify the collection admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isComColAdmin')]") @@ -155,7 +155,7 @@ public void testSubmitter() throws Exception { // Verify a submitter doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isComColAdmin')]") @@ -176,7 +176,7 @@ public void testSubGroupOfAdminGroup() throws Exception { // Verify an ePerson in a subgroup of the site administrators has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isComColAdmin')]") @@ -197,7 +197,7 @@ public void testSubGroupOfCommunityAdminGroup() throws Exception { // Verify an ePerson in a subgroup of a community admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isComColAdmin')]") @@ -218,7 +218,7 @@ public void testSubGroupOfSubCommunityAdminGroup() throws Exception { // Verify an ePerson in a subgroup of a subcommunity admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isComColAdmin')]") @@ -239,7 +239,7 @@ public void testSubGroupOfCollectionAdminGroup() throws Exception { // Verify an ePerson in a subgroup of a collection admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isComColAdmin')]") @@ -260,7 +260,7 @@ public void testSubGroupOfSubmitterGroup() throws Exception { // Verify an ePerson in a subgroup of submitter group doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isComColAdmin')]") @@ -285,7 +285,7 @@ public void testSubSubGroupOfAdminGroup() throws Exception { // Verify an ePerson in a sub-subgroup of the site administrators has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isComColAdmin')]") @@ -310,7 +310,7 @@ public void testSubSubGroupOfCommunityAdminGroup() throws Exception { // Verify an ePerson in a sub-subgroup of a community admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isComColAdmin')]") @@ -335,7 +335,7 @@ public void testSubSubGroupOfSubCommunityAdminGroup() throws Exception { // Verify an ePerson in a sub-subgroup of a subcommunity admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isComColAdmin')]") @@ -360,7 +360,7 @@ public void testSubSubGroupOfCollectionAdminGroup() throws Exception { // Verify an ePerson in a sub-subgroup of a collection admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isComColAdmin')]") @@ -385,7 +385,7 @@ public void testSubSubGroupOfSubmitterGroup() throws Exception { // Verify an ePerson in a sub-subgroup of submitter group doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isComColAdmin')]") diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/authorization/CommunityAdminFeatureIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/authorization/CommunityAdminFeatureIT.java index 7aabb447e973..6720cf1dcfad 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/authorization/CommunityAdminFeatureIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/authorization/CommunityAdminFeatureIT.java @@ -103,7 +103,7 @@ public void testAdmin() throws Exception { // Verify the general admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCommunityAdmin')]") @@ -116,7 +116,7 @@ public void testCommunityAdmin() throws Exception { // Verify the community admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCommunityAdmin')]") @@ -129,7 +129,7 @@ public void testSubCommunityAdmin() throws Exception { // Verify the subcommunity admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCommunityAdmin')]") @@ -142,7 +142,7 @@ public void testCollectionAdmin() throws Exception { // Verify the collection admin doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCommunityAdmin')]") @@ -155,7 +155,7 @@ public void testSubmitter() throws Exception { // Verify a submitter doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCommunityAdmin')]") @@ -176,7 +176,7 @@ public void testSubGroupOfAdminGroup() throws Exception { // Verify an ePerson in a subgroup of the site administrators has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCommunityAdmin')]") @@ -197,7 +197,7 @@ public void testSubGroupOfCommunityAdminGroup() throws Exception { // Verify an ePerson in a subgroup of a community admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCommunityAdmin')]") @@ -218,7 +218,7 @@ public void testSubGroupOfSubCommunityAdminGroup() throws Exception { // Verify an ePerson in a subgroup of a subcommunity admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCommunityAdmin')]") @@ -239,7 +239,7 @@ public void testSubGroupOfCollectionAdminGroup() throws Exception { // Verify an ePerson in a subgroup of a collection admin group doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCommunityAdmin')]") @@ -260,7 +260,7 @@ public void testSubGroupOfSubmitterGroup() throws Exception { // Verify an ePerson in a subgroup of submitter group doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCommunityAdmin')]") @@ -285,7 +285,7 @@ public void testSubSubGroupOfAdminGroup() throws Exception { // Verify an ePerson in a sub-subgroup of the site administrators has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCommunityAdmin')]") @@ -310,7 +310,7 @@ public void testSubSubGroupOfCommunityAdminGroup() throws Exception { // Verify an ePerson in a sub-subgroup of a community admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCommunityAdmin')]") @@ -335,7 +335,7 @@ public void testSubSubGroupOfSubCommunityAdminGroup() throws Exception { // Verify an ePerson in a sub-subgroup of a subcommunity admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCommunityAdmin')]") @@ -360,7 +360,7 @@ public void testSubSubGroupOfCollectionAdminGroup() throws Exception { // Verify an ePerson in a sub-subgroup of a collection admin group doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCommunityAdmin')]") @@ -385,7 +385,7 @@ public void testSubSubGroupOfSubmitterGroup() throws Exception { // Verify an ePerson in a sub-subgroup of submitter group doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='isCommunityAdmin')]") diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/authorization/ManageGroupsFeatureIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/authorization/ManageGroupsFeatureIT.java index a42f219909aa..a6d4108fbb1f 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/authorization/ManageGroupsFeatureIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/authorization/ManageGroupsFeatureIT.java @@ -103,7 +103,7 @@ public void testAdmin() throws Exception { // Verify the general admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -116,7 +116,7 @@ public void testCommunityAdmin() throws Exception { // Verify the community admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -129,7 +129,7 @@ public void testSubCommunityAdmin() throws Exception { // Verify the subcommunity admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -142,7 +142,7 @@ public void testCollectionAdmin() throws Exception { // Verify the collection admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -155,7 +155,7 @@ public void testSubmitter() throws Exception { // Verify a submitter doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -176,7 +176,7 @@ public void testSubGroupOfAdminGroup() throws Exception { // Verify an ePerson in a subgroup of the site administrators has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -197,7 +197,7 @@ public void testSubGroupOfCommunityAdminGroup() throws Exception { // Verify an ePerson in a subgroup of a community admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -218,7 +218,7 @@ public void testSubGroupOfSubCommunityAdminGroup() throws Exception { // Verify an ePerson in a subgroup of a subcommunity admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -239,7 +239,7 @@ public void testSubGroupOfCollectionAdminGroup() throws Exception { // Verify an ePerson in a subgroup of a collection admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -260,7 +260,7 @@ public void testSubGroupOfSubmitterGroup() throws Exception { // Verify an ePerson in a subgroup of submitter group doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -285,7 +285,7 @@ public void testSubSubGroupOfAdminGroup() throws Exception { // Verify an ePerson in a sub-subgroup of the site administrators has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -310,7 +310,7 @@ public void testSubSubGroupOfCommunityAdminGroup() throws Exception { // Verify an ePerson in a sub-subgroup of a community admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -335,7 +335,7 @@ public void testSubSubGroupOfSubCommunityAdminGroup() throws Exception { // Verify an ePerson in a sub-subgroup of a subcommunity admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -360,7 +360,7 @@ public void testSubSubGroupOfCollectionAdminGroup() throws Exception { // Verify an ePerson in a sub-subgroup of a collection admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -385,7 +385,7 @@ public void testSubSubGroupOfSubmitterGroup() throws Exception { // Verify an ePerson in a sub-subgroup of submitter group doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -404,7 +404,7 @@ public void testAdminNoCommunityGroupPermission() throws Exception { // Verify the general admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -422,7 +422,7 @@ public void testCommunityAdminNoCommunityGroupPermission() throws Exception { // Verify the community admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -440,7 +440,7 @@ public void testSubCommunityAdminNoCommunityGroupPermission() throws Exception { // Verify the subcommunity admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -458,7 +458,7 @@ public void testCollectionAdminNoCommunityGroupPermission() throws Exception { // Verify the collection admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -476,7 +476,7 @@ public void testSubmitterNoCommunityGroupPermission() throws Exception { // Verify a submitter doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -502,7 +502,7 @@ public void testSubGroupOfAdminGroupNoCommunityGroupPermission() throws Exceptio // Verify an ePerson in a subgroup of the site administrators has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -528,7 +528,7 @@ public void testSubGroupOfCommunityAdminGroupNoCommunityGroupPermission() throws // Verify an ePerson in a subgroup of a community admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -554,7 +554,7 @@ public void testSubGroupOfSubCommunityAdminGroupNoCommunityGroupPermission() thr // Verify an ePerson in a subgroup of a subcommunity admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -580,7 +580,7 @@ public void testSubGroupOfCollectionAdminGroupNoCommunityGroupPermission() throw // Verify an ePerson in a subgroup of a collection admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -606,7 +606,7 @@ public void testSubGroupOfSubmitterGroupNoCommunityGroupPermission() throws Exce // Verify an ePerson in a subgroup of submitter group doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -636,7 +636,7 @@ public void testSubSubGroupOfAdminGroupNoCommunityGroupPermission() throws Excep // Verify an ePerson in a sub-subgroup of the site administrators has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -666,7 +666,7 @@ public void testSubSubGroupOfCommunityAdminGroupNoCommunityGroupPermission() thr // Verify an ePerson in a sub-subgroup of a community admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -696,7 +696,7 @@ public void testSubSubGroupOfSubCommunityAdminGroupNoCommunityGroupPermission() // Verify an ePerson in a sub-subgroup of a subcommunity admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -726,7 +726,7 @@ public void testSubSubGroupOfCollectionAdminGroupNoCommunityGroupPermission() th // Verify an ePerson in a sub-subgroup of a collection admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -756,7 +756,7 @@ public void testSubSubGroupOfSubmitterGroupNoCommunityGroupPermission() throws E // Verify an ePerson in a sub-subgroup of submitter group doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -779,7 +779,7 @@ public void testAdminNoCollectionGroupPermission() throws Exception { // Verify the general admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -801,7 +801,7 @@ public void testCommunityAdminNoCollectionGroupPermission() throws Exception { // Verify the community admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -823,7 +823,7 @@ public void testSubCommunityAdminNoCollectionGroupPermission() throws Exception // Verify the subcommunity admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -845,7 +845,7 @@ public void testCollectionAdminNoCollectionGroupPermission() throws Exception { // Verify the collection admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -867,7 +867,7 @@ public void testSubmitterNoCollectionGroupPermission() throws Exception { // Verify a submitter doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -897,7 +897,7 @@ public void testSubGroupOfAdminGroupNoCollectionGroupPermission() throws Excepti // Verify an ePerson in a subgroup of the site administrators has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -927,7 +927,7 @@ public void testSubGroupOfCommunityAdminGroupNoCollectionGroupPermission() throw // Verify an ePerson in a subgroup of a community admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -957,7 +957,7 @@ public void testSubGroupOfSubCommunityAdminGroupNoCollectionGroupPermission() th // Verify an ePerson in a subgroup of a subcommunity admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -987,7 +987,7 @@ public void testSubGroupOfCollectionAdminGroupNoCollectionGroupPermission() thro // Verify an ePerson in a subgroup of a collection admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1017,7 +1017,7 @@ public void testSubGroupOfSubmitterGroupNoCollectionGroupPermission() throws Exc // Verify an ePerson in a subgroup of submitter group doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1051,7 +1051,7 @@ public void testSubSubGroupOfAdminGroupNoCollectionGroupPermission() throws Exce // Verify an ePerson in a sub-subgroup of the site administrators has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1085,7 +1085,7 @@ public void testSubSubGroupOfCommunityAdminGroupNoCollectionGroupPermission() th // Verify an ePerson in a sub-subgroup of a community admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1119,7 +1119,7 @@ public void testSubSubGroupOfSubCommunityAdminGroupNoCollectionGroupPermission() // Verify an ePerson in a sub-subgroup of a subcommunity admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1153,7 +1153,7 @@ public void testSubSubGroupOfCollectionAdminGroupNoCollectionGroupPermission() t // Verify an ePerson in a sub-subgroup of a collection admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1187,7 +1187,7 @@ public void testSubSubGroupOfSubmitterGroupNoCollectionGroupPermission() throws // Verify an ePerson in a sub-subgroup of submitter group doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1214,7 +1214,7 @@ public void testAdminNoComColGroupPermission() throws Exception { // Verify the general admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1240,7 +1240,7 @@ public void testCommunityAdminNoComColGroupPermission() throws Exception { // Verify the community admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1266,7 +1266,7 @@ public void testSubCommunityAdminNoComColGroupPermission() throws Exception { // Verify the subcommunity admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1292,7 +1292,7 @@ public void testCollectionAdminNoComColGroupPermission() throws Exception { // Verify the collection admin has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1318,7 +1318,7 @@ public void testSubmitterNoComColGroupPermission() throws Exception { // Verify a submitter doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1352,7 +1352,7 @@ public void testSubGroupOfAdminGroupNoComColGroupPermission() throws Exception { // Verify an ePerson in a subgroup of the site administrators has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1386,7 +1386,7 @@ public void testSubGroupOfCommunityAdminGroupNoComColGroupPermission() throws Ex // Verify an ePerson in a subgroup of a community admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1420,7 +1420,7 @@ public void testSubGroupOfSubCommunityAdminGroupNoComColGroupPermission() throws // Verify an ePerson in a subgroup of a subcommunity admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1454,7 +1454,7 @@ public void testSubGroupOfCollectionAdminGroupNoComColGroupPermission() throws E // Verify an ePerson in a subgroup of a collection admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1488,7 +1488,7 @@ public void testSubGroupOfSubmitterGroupNoComColGroupPermission() throws Excepti // Verify an ePerson in a subgroup of submitter group doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1526,7 +1526,7 @@ public void testSubSubGroupOfAdminGroupNoComColGroupPermission() throws Exceptio // Verify an ePerson in a sub-subgroup of the site administrators has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1564,7 +1564,7 @@ public void testSubSubGroupOfCommunityAdminGroupNoComColGroupPermission() throws // Verify an ePerson in a sub-subgroup of a community admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1602,7 +1602,7 @@ public void testSubSubGroupOfSubCommunityAdminGroupNoComColGroupPermission() thr // Verify an ePerson in a sub-subgroup of a subcommunity admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1640,7 +1640,7 @@ public void testSubSubGroupOfCollectionAdminGroupNoComColGroupPermission() throw // Verify an ePerson in a sub-subgroup of a collection admin group has this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") @@ -1678,7 +1678,7 @@ public void testSubSubGroupOfSubmitterGroupNoComColGroupPermission() throws Exce // Verify an ePerson in a sub-subgroup of submitter group doesn't have this feature getClient(token).perform(get("/api/authz/authorizations/search/object?embed=feature&uri=" - + "http://localhost/api/core/site/" + siteService.findSite(context).getID())) + + "http://localhost/api/core/sites/" + siteService.findSite(context).getID())) .andExpect(status().isOk()) .andExpect( jsonPath("$._embedded.authorizations[?(@._embedded.feature.id=='canManageGroups')]") From 98de84d8ed398dd68aff2b4e48abb75fe086a858 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Sat, 2 Dec 2023 17:39:21 +0100 Subject: [PATCH 09/23] 108915: Fixed tests using incorrect route to access the orcidqueues endpoint --- .../app/rest/orcid/OrcidQueueRestRepositoryIT.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/orcid/OrcidQueueRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/orcid/OrcidQueueRestRepositoryIT.java index 14dc4e95dcce..007814aeaa8b 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/orcid/OrcidQueueRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/orcid/OrcidQueueRestRepositoryIT.java @@ -122,7 +122,7 @@ public void findByProfileItemTest() throws Exception { String tokenResearcher = getAuthToken(researcher.getEmail(), password); String tokenResearcher2 = getAuthToken(researcher2.getEmail(), password); - getClient(tokenResearcher).perform(get("/api/eperson/orcidqueue/search/findByProfileItem") + getClient(tokenResearcher).perform(get("/api/eperson/orcidqueues/search/findByProfileItem") .param("profileItemId", itemPerson.getID().toString())) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.orcidqueues", Matchers.containsInAnyOrder( @@ -131,7 +131,7 @@ public void findByProfileItemTest() throws Exception { ))) .andExpect(jsonPath("$.page.totalElements", is(2))); - getClient(tokenResearcher2).perform(get("/api/eperson/orcidqueue/search/findByProfileItem") + getClient(tokenResearcher2).perform(get("/api/eperson/orcidqueues/search/findByProfileItem") .param("profileItemId", itemPerson2.getID().toString())) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.orcidqueues", Matchers.contains( @@ -139,9 +139,9 @@ public void findByProfileItemTest() throws Exception { ))) .andExpect(jsonPath("$.page.totalElements", is(1))) .andExpect(jsonPath("$._links.self.href", Matchers - .containsString("/api/eperson/orcidqueue/search/findByProfileItem"))); + .containsString("/api/eperson/orcidqueues/search/findByProfileItem"))); - getClient(tokenAdmin).perform(get("/api/eperson/orcidqueue/search/findByProfileItem") + getClient(tokenAdmin).perform(get("/api/eperson/orcidqueues/search/findByProfileItem") .param("profileItemId", itemPerson.getID().toString())) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.orcidqueues", Matchers.containsInAnyOrder( @@ -213,7 +213,7 @@ public void findByProfileItemForbiddenTest() throws Exception { context.restoreAuthSystemState(); String tokenResearcher2 = getAuthToken(researcher2.getEmail(), password); - getClient(tokenResearcher2).perform(get("/api/eperson/orcidqueue/search/findByProfileItem") + getClient(tokenResearcher2).perform(get("/api/eperson/orcidqueues/search/findByProfileItem") .param("profileItemId", itemPerson.getID().toString())) .andExpect(status().isForbidden()); } @@ -259,7 +259,7 @@ public void findByProfileItemUnauthorizedTest() throws Exception { context.restoreAuthSystemState(); - getClient().perform(get("/api/eperson/orcidqueue/search/findByProfileItem") + getClient().perform(get("/api/eperson/orcidqueues/search/findByProfileItem") .param("profileItemId", itemPerson.getID().toString())) .andExpect(status().isUnauthorized()); } @@ -461,7 +461,7 @@ public void findOneUnauthorizedTest() throws Exception { context.restoreAuthSystemState(); - getClient().perform(get("/api/eperson/orcidqueue/" + orcidQueue.getID().toString())) + getClient().perform(get("/api/eperson/orcidqueues/" + orcidQueue.getID().toString())) .andExpect(status().isUnauthorized()); } From e4d5dee8983605f90f66aeb7f49543b8848484fd Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Sat, 2 Dec 2023 18:18:43 +0100 Subject: [PATCH 10/23] 108915: Fixed tests using incorrect route to access the claimedtasks endpoint --- .../app/rest/TaskRestRepositoriesIT.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/TaskRestRepositoriesIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/TaskRestRepositoriesIT.java index a9b5c6a582b6..3a8480a2a7b2 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/TaskRestRepositoriesIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/TaskRestRepositoriesIT.java @@ -3854,7 +3854,7 @@ public void findClaimedTaskByItemTest() throws Exception { String reviewer1Token = getAuthToken(reviewer1.getEmail(), password); String reviewer2Token = getAuthToken(reviewer2.getEmail(), password); - getClient(reviewer1Token).perform(get("/api/workflow/claimedtask/search/findByItem") + getClient(reviewer1Token).perform(get("/api/workflow/claimedtasks/search/findByItem") .param("uuid", claimedTask1.getWorkflowItem().getItem().getID().toString())) .andExpect(status().isOk()) .andExpect(jsonPath("$.id", is(claimedTask1.getID()))) @@ -3864,7 +3864,7 @@ public void findClaimedTaskByItemTest() throws Exception { Matchers.is(WorkflowItemMatcher.matchItemWithTitleAndDateIssuedAndSubject( claimedTask1.getWorkflowItem(), "Workflow Item 1", "2017-10-17", "ExtraEntry")))); - getClient(reviewer2Token).perform(get("/api/workflow/claimedtask/search/findByItem") + getClient(reviewer2Token).perform(get("/api/workflow/claimedtasks/search/findByItem") .param("uuid", claimedTask2.getWorkflowItem().getItem().getID().toString())) .andExpect(status().isOk()) .andExpect(jsonPath("$.id", is(claimedTask2.getID()))) @@ -3929,27 +3929,27 @@ public void findClaimedTaskByItemNoContentTest() throws Exception { String reviewer1Token = getAuthToken(reviewer1.getEmail(), password); String reviewer2Token = getAuthToken(reviewer2.getEmail(), password); - getClient(reviewer2Token).perform(get("/api/workflow/claimedtask/search/findByItem") + getClient(reviewer2Token).perform(get("/api/workflow/claimedtasks/search/findByItem") .param("uuid", claimedTask1.getWorkflowItem().getItem().getID().toString())) .andExpect(status().isNoContent()); - getClient(reviewer1Token).perform(get("/api/workflow/claimedtask/search/findByItem") + getClient(reviewer1Token).perform(get("/api/workflow/claimedtasks/search/findByItem") .param("uuid", claimedTask2.getWorkflowItem().getItem().getID().toString())) .andExpect(status().isNoContent()); - getClient(adminToken).perform(get("/api/workflow/claimedtask/search/findByItem") + getClient(adminToken).perform(get("/api/workflow/claimedtasks/search/findByItem") .param("uuid", claimedTask1.getWorkflowItem().getItem().getID().toString())) .andExpect(status().isNoContent()); - getClient(adminToken).perform(get("/api/workflow/claimedtask/search/findByItem") + getClient(adminToken).perform(get("/api/workflow/claimedtasks/search/findByItem") .param("uuid", claimedTask2.getWorkflowItem().getItem().getID().toString())) .andExpect(status().isNoContent()); - getClient(submitterToken).perform(get("/api/workflow/claimedtask/search/findByItem") + getClient(submitterToken).perform(get("/api/workflow/claimedtasks/search/findByItem") .param("uuid", claimedTask1.getWorkflowItem().getItem().getID().toString())) .andExpect(status().isNoContent()); - getClient(submitterToken).perform(get("/api/workflow/claimedtask/search/findByItem") + getClient(submitterToken).perform(get("/api/workflow/claimedtasks/search/findByItem") .param("uuid", claimedTask2.getWorkflowItem().getItem().getID().toString())) .andExpect(status().isNoContent()); @@ -3987,7 +3987,7 @@ public void findClaimedTaskByItemUnauthorizedTest() throws Exception { context.restoreAuthSystemState(); - getClient().perform(get("/api/workflow/claimedtask/search/findByItem") + getClient().perform(get("/api/workflow/claimedtasks/search/findByItem") .param("uuid", claimedTask.getWorkflowItem().getItem().getID().toString())) .andExpect(status().isUnauthorized()); } @@ -4025,7 +4025,7 @@ public void findClaimedTaskByItemWrongUuidTest() throws Exception { context.restoreAuthSystemState(); String reviewer1Token = getAuthToken(reviewer1.getEmail(), password); - getClient(reviewer1Token).perform(get("/api/workflow/claimedtask/search/findByItem") + getClient(reviewer1Token).perform(get("/api/workflow/claimedtasks/search/findByItem") .param("uuid", UUID.randomUUID().toString())) .andExpect(status().isUnprocessableEntity()); } @@ -4063,12 +4063,12 @@ public void findClaimedTaskByItemBadRequestTest() throws Exception { context.restoreAuthSystemState(); String reviewer1Token = getAuthToken(reviewer1.getEmail(), password); - getClient(reviewer1Token).perform(get("/api/workflow/claimedtask/search/findByItem") + getClient(reviewer1Token).perform(get("/api/workflow/claimedtasks/search/findByItem") .param("uuid", "wrongID")) .andExpect(status().isBadRequest()); // the required param is no provided - getClient(reviewer1Token).perform(get("/api/workflow/claimedtask/search/findByItem")) + getClient(reviewer1Token).perform(get("/api/workflow/claimedtasks/search/findByItem")) .andExpect(status().isBadRequest()); } @@ -4100,7 +4100,7 @@ public void findClaimedTaskByItemArchivedTest() throws Exception { String reviewer1Token = getAuthToken(reviewer1.getEmail(), password); - getClient(reviewer1Token).perform(get("/api/workflow/claimedtask/search/findByItem") + getClient(reviewer1Token).perform(get("/api/workflow/claimedtasks/search/findByItem") .param("uuid", publicItem.getID().toString())) .andExpect(status().isNoContent()); From 2e17204152b035984474f71d9bef6ec059a17970 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Sat, 2 Dec 2023 18:25:12 +0100 Subject: [PATCH 11/23] 108915: Fixed tests using incorrect route to access the communities endpoint --- .../dspace/app/rest/SubResourcePermissionsIT.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubResourcePermissionsIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubResourcePermissionsIT.java index c5f2ed9a13a8..d6b4b52d173e 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubResourcePermissionsIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubResourcePermissionsIT.java @@ -331,21 +331,21 @@ public void parentCommunityOfPrivateCollectionPermissionTest() throws Exception // Calling public parentCommunity as an admin user // Should succeed - getClient(adminToken).perform(get("/api/core/community/" + parentCommunity.getID())) + getClient(adminToken).perform(get("/api/core/communities/" + parentCommunity.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$", CommunityMatcher .matchCommunityEntry(parentCommunity.getID(), parentCommunity.getHandle()))); // Calling public parentCommunity as a normal EPerson // Should succeed - getClient(epersonToken).perform(get("/api/core/community/" + parentCommunity.getID())) + getClient(epersonToken).perform(get("/api/core/communities/" + parentCommunity.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$", CommunityMatcher .matchCommunityEntry(parentCommunity.getID(), parentCommunity.getHandle()))); // Calling public parentCommunity as an anon user // Should succeed - getClient().perform(get("/api/core/community/" + parentCommunity.getID())) + getClient().perform(get("/api/core/communities/" + parentCommunity.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$", CommunityMatcher .matchCommunityEntry(parentCommunity.getID(), parentCommunity.getHandle()))); @@ -404,19 +404,19 @@ public void privateParentCommunityOfCollectionPermissionTest() throws Exception // Calling private parentCommunity as an admin user // Should succeed - getClient(adminToken).perform(get("/api/core/community/" + parentCommunity.getID())) + getClient(adminToken).perform(get("/api/core/communities/" + parentCommunity.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$", CommunityMatcher .matchCommunityEntry(parentCommunity.getID(), parentCommunity.getHandle()))); // Calling private parentCommunity as a normal EPerson // Shouldn't succeed - getClient(epersonToken).perform(get("/api/core/community/" + parentCommunity.getID())) + getClient(epersonToken).perform(get("/api/core/communities/" + parentCommunity.getID())) .andExpect(status().isForbidden()); // Calling private parentCommunity as an anon user // Shouldn't succeed - getClient().perform(get("/api/core/community/" + parentCommunity.getID())) + getClient().perform(get("/api/core/communities/" + parentCommunity.getID())) .andExpect(status().isUnauthorized()); // Calling fullProjection, as an admin user, of a private Collection should contain the parentCommunity From 1ec3caa033bb9f991d7207c4999e382d27806741 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Sat, 2 Dec 2023 18:28:22 +0100 Subject: [PATCH 12/23] 108915: Fixed tests using incorrect route to access the epersons endpoint --- .../java/org/dspace/app/rest/EPersonRestRepositoryIT.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/EPersonRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/EPersonRestRepositoryIT.java index 1f09779ab0e9..a5b1336bc181 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/EPersonRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/EPersonRestRepositoryIT.java @@ -244,7 +244,7 @@ public void findAllTest() throws Exception { context.restoreAuthSystemState(); String authToken = getAuthToken(admin.getEmail(), password); - getClient(authToken).perform(get("/api/eperson/eperson")) + getClient(authToken).perform(get("/api/eperson/epersons")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$._embedded.epersons", Matchers.containsInAnyOrder( @@ -264,7 +264,7 @@ public void findAllTest() throws Exception { @Test public void findAllUnauthorizedTest() throws Exception { // Access endpoint without being authenticated - getClient().perform(get("/api/eperson/eperson")) + getClient().perform(get("/api/eperson/epersons")) .andExpect(status().isUnauthorized()); } @@ -272,7 +272,7 @@ public void findAllUnauthorizedTest() throws Exception { public void findAllForbiddenTest() throws Exception { String authToken = getAuthToken(eperson.getEmail(), password); // Access endpoint logged in as an unprivileged user - getClient(authToken).perform(get("/api/eperson/eperson")) + getClient(authToken).perform(get("/api/eperson/epersons")) .andExpect(status().isForbidden()); } From a02baee7f43a8bb5257bcd5b02ca9eb0c3d8dc34 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Sat, 2 Dec 2023 19:55:17 +0100 Subject: [PATCH 13/23] 108915: Fixed tests using incorrect endpoint routes These routes are also not used in their singular form in Angular, and since these modifications they are not supported anymore --- .../rest/AuthorizationRestRepositoryIT.java | 88 +++++++++---------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationRestRepositoryIT.java index c334d110b112..2efa565b5981 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationRestRepositoryIT.java @@ -1554,7 +1554,7 @@ public void findByMultipleObjectsAndFeaturesTest() throws Exception { Supplier baseFeatureRequest = () -> get("/api/authz/authorizations/search/objects") - .param("type", "core.community") + .param("type", "core.communities") .param("uuid", comId) .param("uuid", secondComId) .param("projection", "level") @@ -1927,7 +1927,7 @@ public void findByMultipleObjectsAndFeaturesPaginationTest() throws Exception { Supplier baseFeatureRequest = () -> get("/api/authz/authorizations/search/objects") - .param("type", "core.community") + .param("type", "core.communities") .param("uuid", comId) .param("uuid", secondComId) .param("projection", "level") @@ -2123,7 +2123,7 @@ public void findByMultipleObjectsAndFeatureNotGrantedTest() throws Exception { // verify that it works for administrators - with eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.item") + .param("type", "core.items") .param("uuid", itemId) .param("uuid", secondItemId) .param("feature", alwaysFalse.getName()) @@ -2132,7 +2132,7 @@ public void findByMultipleObjectsAndFeatureNotGrantedTest() throws Exception { // verify that it works for administrators - without eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.item") + .param("type", "core.items") .param("uuid", itemId) .param("uuid", secondItemId) .param("feature", alwaysFalse.getName()) @@ -2143,7 +2143,7 @@ public void findByMultipleObjectsAndFeatureNotGrantedTest() throws Exception { // verify that it works for normal loggedin users - with eperson parameter getClient(epersonToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.item") + .param("type", "core.items") .param("uuid", itemId) .param("uuid", secondItemId) .param("feature", alwaysFalse.getName()) @@ -2153,7 +2153,7 @@ public void findByMultipleObjectsAndFeatureNotGrantedTest() throws Exception { // verify that it works for normal loggedin users - without eperson parameter getClient(epersonToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.item") + .param("type", "core.items") .param("uuid", itemId) .param("uuid", secondItemId) .param("feature", alwaysFalse.getName()) @@ -2162,7 +2162,7 @@ public void findByMultipleObjectsAndFeatureNotGrantedTest() throws Exception { // verify that it works for administators inspecting other users - by using the eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.item") + .param("type", "core.items") .param("uuid", itemId) .param("uuid", secondItemId) .param("feature", alwaysFalse.getName()) @@ -2172,7 +2172,7 @@ public void findByMultipleObjectsAndFeatureNotGrantedTest() throws Exception { // verify that it works for administators inspecting other users - by assuming login getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.item") + .param("type", "core.items") .param("uuid", itemId) .param("uuid", secondItemId) .param("feature", alwaysFalse.getName()) @@ -2182,7 +2182,7 @@ public void findByMultipleObjectsAndFeatureNotGrantedTest() throws Exception { // verify that it works for anonymous users getClient().perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.item") + .param("type", "core.items") .param("uuid", itemId) .param("uuid", secondItemId) .param("feature", alwaysFalse.getName()) @@ -2210,7 +2210,7 @@ public void findByNotExistingMultipleObjectsAndFeatureTest() throws Exception { // verify that it works for administrators, no result - with eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", wrongSiteId) .param("feature", alwaysTrue.getName()) .param("eperson", admin.getID().toString())) @@ -2218,7 +2218,7 @@ public void findByNotExistingMultipleObjectsAndFeatureTest() throws Exception { .andExpect(jsonPath("$.page.totalElements", is(0))); getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", wrongSiteId) .param("feature", "not-existing-feature") .param("eperson", admin.getID().toString())) @@ -2226,13 +2226,13 @@ public void findByNotExistingMultipleObjectsAndFeatureTest() throws Exception { // verify that it works for administrators, no result - without eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", wrongSiteId) .param("feature", alwaysTrue.getName())) .andExpect(jsonPath("$.page.totalElements", is(0))); getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", wrongSiteId) .param("feature", "not-existing-one") .param("feature", "not-existing-feature")) @@ -2242,7 +2242,7 @@ public void findByNotExistingMultipleObjectsAndFeatureTest() throws Exception { // verify that it works for normal loggedin users - with eperson parameter getClient(epersonToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", wrongSiteId) .param("feature", "not-existing-one") .param("feature", alwaysTrue.getName()) @@ -2250,7 +2250,7 @@ public void findByNotExistingMultipleObjectsAndFeatureTest() throws Exception { .andExpect(jsonPath("$.page.totalElements", is(0))); getClient(epersonToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", wrongSiteId) .param("feature", "not-existing-one") .param("feature", "not-existing-feature") @@ -2259,14 +2259,14 @@ public void findByNotExistingMultipleObjectsAndFeatureTest() throws Exception { // verify that it works for normal loggedin users - without eperson parameter getClient(epersonToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", wrongSiteId) .param("feature", "not-existing-one") .param("feature", alwaysTrue.getName())) .andExpect(jsonPath("$.page.totalElements", is(0))); getClient(epersonToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", wrongSiteId) .param("feature", "not-existing-one") .param("feature", "not-existing-feature")) @@ -2274,7 +2274,7 @@ public void findByNotExistingMultipleObjectsAndFeatureTest() throws Exception { // verify that it works for administators inspecting other users - by using the eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", wrongSiteId) .param("feature", "not-existing-one") .param("feature", alwaysTrue.getName()) @@ -2282,7 +2282,7 @@ public void findByNotExistingMultipleObjectsAndFeatureTest() throws Exception { .andExpect(jsonPath("$.page.totalElements", is(0))); getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", wrongSiteId) .param("feature", "not-existing-one") .param("feature", "not-existing-feature") @@ -2291,7 +2291,7 @@ public void findByNotExistingMultipleObjectsAndFeatureTest() throws Exception { // verify that it works for administators inspecting other users - by assuming login getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", wrongSiteId) .param("feature", "not-existing-one") .param("feature", alwaysTrue.getName()) @@ -2299,7 +2299,7 @@ public void findByNotExistingMultipleObjectsAndFeatureTest() throws Exception { .andExpect(jsonPath("$.page.totalElements", is(0))); getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", wrongSiteId) .param("feature", "not-existing-one") .param("feature", "not-existing-feature") @@ -2308,14 +2308,14 @@ public void findByNotExistingMultipleObjectsAndFeatureTest() throws Exception { // verify that it works for anonymous users getClient().perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", wrongSiteId) .param("feature", "not-existing-one") .param("feature", alwaysTrue.getName())) .andExpect(jsonPath("$.page.totalElements", is(0))); getClient().perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", wrongSiteId) .param("feature", "not-existing-one") .param("feature", "not-existing-feature")) @@ -2344,7 +2344,7 @@ public void findByMultipleObjectsAndFeatureBadRequestTest() throws Exception { // verify that it works for administrators with an invalid or missing uuid - with eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.item") + .param("type", "core.items") .param("uuid", "foo") .param("uuid", "") .param("uuid", "invalid") @@ -2355,7 +2355,7 @@ public void findByMultipleObjectsAndFeatureBadRequestTest() throws Exception { // verify that it works for administrators with an invalid or missing uuid - without eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.item") + .param("type", "core.items") .param("uuid", "foo") .param("uuid", "") .param("uuid", "invalid") @@ -2365,7 +2365,7 @@ public void findByMultipleObjectsAndFeatureBadRequestTest() throws Exception { // verify that it works for normal loggedin users with an invalid or missing uuid - with eperson parameter getClient(epersonToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.item") + .param("type", "core.items") .param("uuid", "foo") .param("uuid", "") .param("uuid", "invalid") @@ -2377,7 +2377,7 @@ public void findByMultipleObjectsAndFeatureBadRequestTest() throws Exception { // verify that it works for normal loggedin users with an invalid or missing // uuid - without eperson parameter getClient(epersonToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.item") + .param("type", "core.items") .param("uuid", "foo") .param("uuid", "") .param("uuid", "invalid") @@ -2388,7 +2388,7 @@ public void findByMultipleObjectsAndFeatureBadRequestTest() throws Exception { // verify that it works for administators inspecting other users with an invalid or missing uri - by // using the eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.item") + .param("type", "core.items") .param("uuid", "foo") .param("uuid", "") .param("uuid", "invalid") @@ -2400,7 +2400,7 @@ public void findByMultipleObjectsAndFeatureBadRequestTest() throws Exception { // verify that it works for administators inspecting other users with an invalid or missing uri - by // assuming login getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.item") + .param("type", "core.items") .param("uuid", "foo") .param("uuid", "") .param("uuid", "invalid") @@ -2411,7 +2411,7 @@ public void findByMultipleObjectsAndFeatureBadRequestTest() throws Exception { // verify that it works for anonymous users with an invalid or missing uri getClient().perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.item") + .param("type", "core.items") .param("uuid", "foo") .param("uuid", "") .param("uuid", "invalid") @@ -2436,7 +2436,7 @@ public void findByMultipleObjectsAndFeatureBadRequestTest() throws Exception { // verify that returns bad request for missing uuid getClient().perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.item") + .param("type", "core.items") .param("feature", alwaysTrue.getName())) .andExpect(status().isBadRequest()); } @@ -2457,7 +2457,7 @@ public void findByMultipleObjectsAndFeatureUnauthorizedTest() throws Exception { // verify that it works for an anonymous user inspecting an admin user - by using the eperson parameter getClient().perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", siteId) .param("feature", alwaysTrue.getName()) .param("eperson", admin.getID().toString())) @@ -2465,7 +2465,7 @@ public void findByMultipleObjectsAndFeatureUnauthorizedTest() throws Exception { // verify that it works for an anonymous user inspecting an admin user - by assuming login getClient().perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", siteId) .param("feature", alwaysTrue.getName()) .header("X-On-Behalf-Of", admin.getID())) @@ -2473,7 +2473,7 @@ public void findByMultipleObjectsAndFeatureUnauthorizedTest() throws Exception { // verify that it works for an anonymous user inspecting a normal user - by using the eperson parameter getClient().perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", siteId) .param("feature", alwaysTrue.getName()) .param("eperson", eperson.getID().toString())) @@ -2481,7 +2481,7 @@ public void findByMultipleObjectsAndFeatureUnauthorizedTest() throws Exception { // verify that it works for an anonymous user inspecting a normal user - by assuming login getClient().perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", siteId) .param("feature", alwaysTrue.getName()) .header("X-On-Behalf-Of", eperson.getID())) @@ -2510,7 +2510,7 @@ public void findByMultipleObjectsAndFeatureForbiddenTest() throws Exception { // verify that admin cannot search the admin authorizations - by using the eperson parameter getClient(anotherToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", siteId) .param("feature", alwaysFalse.getName()) .param("feature", alwaysTrue.getName()) @@ -2519,7 +2519,7 @@ public void findByMultipleObjectsAndFeatureForbiddenTest() throws Exception { // verify that admin cannot search the admin authorizations - by assuming login getClient(anotherToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", siteId) .param("feature", alwaysFalse.getName()) .param("feature", alwaysTrue.getName()) @@ -2528,7 +2528,7 @@ public void findByMultipleObjectsAndFeatureForbiddenTest() throws Exception { // verify that eperson cannot search the authorizations of another "normal" eperson - by using the parameter getClient(anotherToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", siteId) .param("feature", alwaysFalse.getName()) .param("feature", alwaysTrue.getName()) @@ -2537,7 +2537,7 @@ public void findByMultipleObjectsAndFeatureForbiddenTest() throws Exception { // verify that eperson cannot search the authorizations of another "normal" eperson - by assuming login getClient(anotherToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", siteId) .param("feature", alwaysFalse.getName()) .param("feature", alwaysTrue.getName()) @@ -2558,7 +2558,7 @@ public void findByMultipleObjectsAndFeatureInternalServerErrorTest() throws Exce // verify that it works for administrators - with eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", siteId) .param("feature", alwaysException.getName()) .param("eperson", admin.getID().toString())) @@ -2566,7 +2566,7 @@ public void findByMultipleObjectsAndFeatureInternalServerErrorTest() throws Exce // verify that it works for administrators - without eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", siteId) .param("feature", alwaysException.getName())) .andExpect(status().isInternalServerError()); @@ -2575,7 +2575,7 @@ public void findByMultipleObjectsAndFeatureInternalServerErrorTest() throws Exce // verify that it works for normal loggedin users - with eperson parameter getClient(epersonToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", siteId) .param("feature", alwaysException.getName()) .param("eperson", eperson.getID().toString())) @@ -2583,14 +2583,14 @@ public void findByMultipleObjectsAndFeatureInternalServerErrorTest() throws Exce // verify that it works for normal loggedin users - without eperson parameter getClient(epersonToken).perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", siteId) .param("feature", alwaysException.getName())) .andExpect(status().isInternalServerError()); // verify that it works for anonymous users getClient().perform(get("/api/authz/authorizations/search/objects") - .param("type", "core.site") + .param("type", "core.sites") .param("uuid", siteId) .param("feature", alwaysException.getName())) .andExpect(status().isInternalServerError()); From 72ae612db09be87ba9e3eef83edcbe8a639c3bfe Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Fri, 22 Dec 2023 21:49:09 +0100 Subject: [PATCH 14/23] 108915: Added missing plural name to QA rest objects & updated endpoints bean declarations --- .../org/dspace/app/rest/QAEventRelatedRestController.java | 4 ++-- .../main/java/org/dspace/app/rest/model/QAEventRest.java | 6 ++++++ .../main/java/org/dspace/app/rest/model/QASourceRest.java | 6 ++++++ .../main/java/org/dspace/app/rest/model/QATopicRest.java | 6 ++++++ .../app/rest/repository/QAEventRelatedLinkRepository.java | 2 +- .../dspace/app/rest/repository/QAEventRestRepository.java | 2 +- .../app/rest/repository/QAEventTargetLinkRepository.java | 2 +- .../app/rest/repository/QAEventTopicLinkRepository.java | 2 +- .../dspace/app/rest/repository/QASourceRestRepository.java | 2 +- .../dspace/app/rest/repository/QATopicRestRepository.java | 2 +- 10 files changed, 26 insertions(+), 8 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/QAEventRelatedRestController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/QAEventRelatedRestController.java index 538d99b3ceb5..99e91e6998ea 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/QAEventRelatedRestController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/QAEventRelatedRestController.java @@ -47,8 +47,8 @@ * "/api/integration/qualityassuranceevents/{qaeventid}/related" */ @RestController -@RequestMapping("/api/" + QAEventRest.CATEGORY + "/qualityassuranceevents" - + REGEX_REQUESTMAPPING_IDENTIFIER_AS_STRING_VERSION_STRONG + "/related") +@RequestMapping("/api/" + QAEventRest.CATEGORY + "/" + QAEventRest.PLURAL_NAME + + REGEX_REQUESTMAPPING_IDENTIFIER_AS_STRING_VERSION_STRONG + "/" + QAEventRest.RELATED) public class QAEventRelatedRestController { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/QAEventRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/QAEventRest.java index 7a12ade61d80..5ce25c8f9d69 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/QAEventRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/QAEventRest.java @@ -27,6 +27,7 @@ public class QAEventRest extends BaseObjectRest { private static final long serialVersionUID = -5001130073350654793L; public static final String NAME = "qualityassuranceevent"; + public static final String PLURAL_NAME = "qualityassuranceevents"; public static final String CATEGORY = RestAddressableModel.INTEGRATION; public static final String TOPIC = "topic"; @@ -46,6 +47,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return CATEGORY; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/QASourceRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/QASourceRest.java index a1480f409cd7..f3e99d0aa45f 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/QASourceRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/QASourceRest.java @@ -22,6 +22,7 @@ public class QASourceRest extends BaseObjectRest { private static final long serialVersionUID = -7455358581579629244L; public static final String NAME = "qualityassurancesource"; + public static final String PLURAL_NAME = "qualityassurancesources"; public static final String CATEGORY = RestAddressableModel.INTEGRATION; private String id; @@ -33,6 +34,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return CATEGORY; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/QATopicRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/QATopicRest.java index 05820b919482..54bf3c814142 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/QATopicRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/QATopicRest.java @@ -22,6 +22,7 @@ public class QATopicRest extends BaseObjectRest { private static final long serialVersionUID = -7455358581579629244L; public static final String NAME = "qualityassurancetopic"; + public static final String PLURAL_NAME = "qualityassurancetopics"; public static final String CATEGORY = RestAddressableModel.INTEGRATION; private String id; @@ -34,6 +35,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return CATEGORY; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QAEventRelatedLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QAEventRelatedLinkRepository.java index c711d2ec376a..cc287b19bec3 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QAEventRelatedLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QAEventRelatedLinkRepository.java @@ -32,7 +32,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) * */ -@Component(QAEventRest.CATEGORY + "." + QAEventRest.NAME + "." + QAEventRest.RELATED) +@Component(QAEventRest.CATEGORY + "." + QAEventRest.PLURAL_NAME + "." + QAEventRest.RELATED) public class QAEventRelatedLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QAEventRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QAEventRestRepository.java index dc0654ee494a..0da8a56c9307 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QAEventRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QAEventRestRepository.java @@ -39,7 +39,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) * */ -@Component(QAEventRest.CATEGORY + "." + QAEventRest.NAME) +@Component(QAEventRest.CATEGORY + "." + QAEventRest.PLURAL_NAME) public class QAEventRestRepository extends DSpaceRestRepository { final static String ORDER_FIELD = "trust"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QAEventTargetLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QAEventTargetLinkRepository.java index 2df3836b9bdf..a5f7051c5499 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QAEventTargetLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QAEventTargetLinkRepository.java @@ -32,7 +32,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) * */ -@Component(QAEventRest.CATEGORY + "." + QAEventRest.NAME + "." + QAEventRest.TARGET) +@Component(QAEventRest.CATEGORY + "." + QAEventRest.PLURAL_NAME + "." + QAEventRest.TARGET) public class QAEventTargetLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QAEventTopicLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QAEventTopicLinkRepository.java index f9ed48442872..489f27bd92a0 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QAEventTopicLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QAEventTopicLinkRepository.java @@ -29,7 +29,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) * */ -@Component(QAEventRest.CATEGORY + "." + QAEventRest.NAME + "." + QAEventRest.TOPIC) +@Component(QAEventRest.CATEGORY + "." + QAEventRest.PLURAL_NAME + "." + QAEventRest.TOPIC) public class QAEventTopicLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QASourceRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QASourceRestRepository.java index dad2310a77c0..3ad7345d459a 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QASourceRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QASourceRestRepository.java @@ -25,7 +25,7 @@ * @author Luca Giamminonni (luca.giamminonni at 4science.it) * */ -@Component(QASourceRest.CATEGORY + "." + QASourceRest.NAME) +@Component(QASourceRest.CATEGORY + "." + QASourceRest.PLURAL_NAME) public class QASourceRestRepository extends DSpaceRestRepository { @Autowired diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QATopicRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QATopicRestRepository.java index 97a0ee978123..8b1e49218682 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QATopicRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/QATopicRestRepository.java @@ -28,7 +28,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) * */ -@Component(QATopicRest.CATEGORY + "." + QATopicRest.NAME) +@Component(QATopicRest.CATEGORY + "." + QATopicRest.PLURAL_NAME) public class QATopicRestRepository extends DSpaceRestRepository { final static String ORDER_FIELD = "topic"; From d1812866a6593c9efea88d555d64b057f7db3cad Mon Sep 17 00:00:00 2001 From: eskander Date: Fri, 9 Feb 2024 18:27:43 +0200 Subject: [PATCH 15/23] [DURACOM-232] solved Community/Collection admins can't edit logo for communities/collections --- .../java/org/dspace/content/Bitstream.java | 8 +++ .../java/org/dspace/content/Collection.java | 3 + .../java/org/dspace/content/Community.java | 3 + .../app/rest/CollectionLogoControllerIT.java | 67 +++++++++++++++++++ .../app/rest/CommunityLogoControllerIT.java | 58 ++++++++++++++++ 5 files changed, 139 insertions(+) diff --git a/dspace-api/src/main/java/org/dspace/content/Bitstream.java b/dspace-api/src/main/java/org/dspace/content/Bitstream.java index 451a3b75784d..5485735a2816 100644 --- a/dspace-api/src/main/java/org/dspace/content/Bitstream.java +++ b/dspace-api/src/main/java/org/dspace/content/Bitstream.java @@ -307,10 +307,18 @@ public Collection getCollection() { return collection; } + public void setCollection(Collection collection) { + this.collection = collection; + } + public Community getCommunity() { return community; } + public void setCommunity(Community community) { + this.community = community; + } + /** * Get the asset store number where this bitstream is stored * diff --git a/dspace-api/src/main/java/org/dspace/content/Collection.java b/dspace-api/src/main/java/org/dspace/content/Collection.java index 53b63dbef1fa..a13c19d46cf8 100644 --- a/dspace-api/src/main/java/org/dspace/content/Collection.java +++ b/dspace-api/src/main/java/org/dspace/content/Collection.java @@ -135,6 +135,9 @@ public Bitstream getLogo() { protected void setLogo(Bitstream logo) { this.logo = logo; + if (logo != null) { + logo.setCollection(this); + } setModified(); } diff --git a/dspace-api/src/main/java/org/dspace/content/Community.java b/dspace-api/src/main/java/org/dspace/content/Community.java index dd6d978936df..d82e08bab72e 100644 --- a/dspace-api/src/main/java/org/dspace/content/Community.java +++ b/dspace-api/src/main/java/org/dspace/content/Community.java @@ -123,6 +123,9 @@ public Bitstream getLogo() { void setLogo(Bitstream logo) { this.logo = logo; + if (logo != null) { + logo.setCommunity(this); + } setModified(); } diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionLogoControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionLogoControllerIT.java index fa0732f6b774..8fd7f58d9cd6 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionLogoControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionLogoControllerIT.java @@ -17,7 +17,10 @@ import org.dspace.app.rest.test.AbstractControllerIntegrationTest; import org.dspace.builder.CollectionBuilder; import org.dspace.builder.CommunityBuilder; +import org.dspace.builder.EPersonBuilder; import org.dspace.content.Collection; +import org.dspace.content.Community; +import org.dspace.eperson.EPerson; import org.junit.Before; import org.junit.Test; import org.springframework.http.MediaType; @@ -93,6 +96,34 @@ public void createLogoNoRights() throws Exception { .andExpect(status().isForbidden()); } + @Test + public void createLogoByCollectionAdmin() throws Exception { + context.turnOffAuthorisationSystem(); + + EPerson collectionAdmin = EPersonBuilder.createEPerson(context) + .withEmail("test4@mail.com") + .withPassword(password) + .withCanLogin(true) + .build(); + + Community community = CommunityBuilder.createCommunity(context) + .withName("New Community") + .build(); + + childCollection = CollectionBuilder.createCollection(context, community) + .withName("name of collection") + .withAdminGroup(collectionAdmin) + .build(); + + context.restoreAuthSystemState(); + + String userToken = getAuthToken(collectionAdmin.getEmail(), password); + getClient(userToken).perform( + MockMvcRequestBuilders.multipart(getLogoUrlTemplate(childCollection.getID().toString())) + .file(bitstreamFile)) + .andExpect(status().isCreated()); + } + @Test public void createDuplicateLogo() throws Exception { getClient(adminAuthToken).perform( @@ -142,6 +173,42 @@ public void deleteLogoNoRights() throws Exception { .andExpect(status().isForbidden()); } + @Test + public void deleteLogoByCollectionAdmin() throws Exception { + context.turnOffAuthorisationSystem(); + + EPerson collectionAdmin = EPersonBuilder.createEPerson(context) + .withEmail("test4@mail.com") + .withPassword(password) + .withCanLogin(true) + .build(); + + Community community = CommunityBuilder.createCommunity(context) + .withName("New Community") + .build(); + + childCollection = CollectionBuilder.createCollection(context, community) + .withName("name of collection") + .withAdminGroup(collectionAdmin) + .build(); + + context.restoreAuthSystemState(); + + String userToken = getAuthToken(collectionAdmin.getEmail(), password); + MvcResult mvcPostResult = getClient(userToken).perform( + MockMvcRequestBuilders.multipart(getLogoUrlTemplate(childCollection.getID().toString())) + .file(bitstreamFile)) + .andExpect(status().isCreated()) + .andReturn(); + + String postContent = mvcPostResult.getResponse().getContentAsString(); + Map mapPostResult = mapper.readValue(postContent, Map.class); + + getClient(userToken) + .perform(delete(getBitstreamUrlTemplate(String.valueOf(mapPostResult.get("uuid"))))) + .andExpect(status().isNoContent()); + } + private String getLogoUrlTemplate(String uuid) { return "/api/core/collections/" + uuid + "/logo"; } diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityLogoControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityLogoControllerIT.java index 3a0edc931049..f03e27b67749 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityLogoControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityLogoControllerIT.java @@ -16,6 +16,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.dspace.app.rest.test.AbstractControllerIntegrationTest; import org.dspace.builder.CommunityBuilder; +import org.dspace.builder.EPersonBuilder; +import org.dspace.content.Community; +import org.dspace.eperson.EPerson; import org.junit.Before; import org.junit.Test; import org.springframework.http.MediaType; @@ -88,6 +91,29 @@ public void createLogoNoRights() throws Exception { .andExpect(status().isForbidden()); } + @Test + public void createLogoBYCommunityAdmin() throws Exception { + context.turnOffAuthorisationSystem(); + + EPerson communityAdmin = EPersonBuilder.createEPerson(context) + .withEmail("test4@mail.com") + .withPassword(password) + .withCanLogin(true) + .build(); + + Community community = CommunityBuilder.createCommunity(context) + .withName("New Community") + .withAdminGroup(communityAdmin) + .build(); + + context.restoreAuthSystemState(); + String userToken = getAuthToken(communityAdmin.getEmail(), password); + getClient(userToken).perform( + MockMvcRequestBuilders.multipart(getLogoUrlTemplate(community.getID().toString())) + .file(bitstreamFile)) + .andExpect(status().isCreated()); + } + @Test public void createDuplicateLogo() throws Exception { getClient(adminAuthToken).perform( @@ -137,6 +163,38 @@ public void deleteLogoNoRights() throws Exception { .andExpect(status().isForbidden()); } + @Test + public void deleteLogoByCommunityAdmin() throws Exception { + context.turnOffAuthorisationSystem(); + + EPerson communityAdmin = EPersonBuilder.createEPerson(context) + .withEmail("test4@mail.com") + .withPassword(password) + .withCanLogin(true) + .build(); + + Community community = CommunityBuilder.createCommunity(context) + .withName("New Community") + .withAdminGroup(communityAdmin) + .build(); + + context.restoreAuthSystemState(); + + String userToken = getAuthToken(communityAdmin.getEmail(), password); + MvcResult mvcPostResult = getClient(userToken).perform( + MockMvcRequestBuilders.multipart(getLogoUrlTemplate(community.getID().toString())) + .file(bitstreamFile)) + .andExpect(status().isCreated()) + .andReturn(); + + String postContent = mvcPostResult.getResponse().getContentAsString(); + Map mapPostResult = mapper.readValue(postContent, Map.class); + + getClient(userToken) + .perform(delete(getBitstreamUrlTemplate(String.valueOf(mapPostResult.get("uuid"))))) + .andExpect(status().isNoContent()); + } + private String getLogoUrlTemplate(String uuid) { return "/api/core/communities/" + uuid + "/logo"; } From 956f1688c93daf35403bb2b3ea16bf6598a29368 Mon Sep 17 00:00:00 2001 From: Toni Prieto Date: Mon, 12 Feb 2024 09:29:22 +0100 Subject: [PATCH 16/23] Avoid index virtual metadata in Solr Authority --- .../authority/indexer/DSpaceAuthorityIndexer.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/authority/indexer/DSpaceAuthorityIndexer.java b/dspace-api/src/main/java/org/dspace/authority/indexer/DSpaceAuthorityIndexer.java index 20baef8f9c01..b42bd130b7bd 100644 --- a/dspace-api/src/main/java/org/dspace/authority/indexer/DSpaceAuthorityIndexer.java +++ b/dspace-api/src/main/java/org/dspace/authority/indexer/DSpaceAuthorityIndexer.java @@ -80,7 +80,15 @@ public List getAuthorityValues(Context context, Item item, Map values = new ArrayList<>(); for (String metadataField : metadataFields) { - List metadataValues = itemService.getMetadataByMetadataString(item, metadataField); + + String[] fieldParts = metadataField.split("\\."); + String schema = (fieldParts.length > 0 ? fieldParts[0] : null); + String element = (fieldParts.length > 1 ? fieldParts[1] : null); + String qualifier = (fieldParts.length > 2 ? fieldParts[2] : null); + + // Get metadata values without virtual metadata + List metadataValues = itemService.getMetadata(item, schema, element, qualifier, Item.ANY, + false); for (MetadataValue metadataValue : metadataValues) { String content = metadataValue.getValue(); String authorityKey = metadataValue.getAuthority(); From cbef294c8f304ab64e2cb8c55ac23334c605d5dd Mon Sep 17 00:00:00 2001 From: Toni Prieto Date: Mon, 12 Feb 2024 20:54:43 +0100 Subject: [PATCH 17/23] Improve implementation of getBestMatch of SHERPARoMEO authorities --- .../authority/SHERPARoMEOJournalTitle.java | 32 +++++++++++++++++- .../authority/SHERPARoMEOPublisher.java | 33 ++++++++++++++++++- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOJournalTitle.java b/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOJournalTitle.java index da5c743c5b07..418000e51e2a 100644 --- a/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOJournalTitle.java +++ b/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOJournalTitle.java @@ -59,7 +59,37 @@ public Choices getMatches(String text, int start, int limit, String locale) { @Override public Choices getBestMatch(String text, String locale) { - return getMatches(text, 0, 1, locale); + // punt if there is no query text + if (text == null || text.trim().length() == 0) { + return new Choices(true); + } + int limit = 10; + SHERPAService sherpaService = new DSpace().getSingletonService(SHERPAService.class); + SHERPAResponse sherpaResponse = sherpaService.performRequest("publication", "title", + "equals", text, 0, limit); + Choices result; + if (CollectionUtils.isNotEmpty(sherpaResponse.getJournals())) { + List list = sherpaResponse + .getJournals().stream() + .map(sherpaJournal -> new Choice(sherpaJournal.getIssns().get(0), + sherpaJournal.getTitles().get(0), sherpaJournal.getTitles().get(0))) + .collect(Collectors.toList()); + int total = sherpaResponse.getJournals().size(); + + int confidence; + if (list.isEmpty()) { + confidence = Choices.CF_NOTFOUND; + } else if (list.size() == 1) { + confidence = Choices.CF_UNCERTAIN; + } else { + confidence = Choices.CF_AMBIGUOUS; + } + result = new Choices(list.toArray(new Choice[list.size()]), 0, total, confidence, + total > limit); + } else { + result = new Choices(false); + } + return result; } @Override diff --git a/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOPublisher.java b/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOPublisher.java index 0f93dff49879..d1001ce5dba8 100644 --- a/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOPublisher.java +++ b/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOPublisher.java @@ -60,7 +60,38 @@ public Choices getMatches(String text, int start, int limit, String locale) { @Override public Choices getBestMatch(String text, String locale) { - return getMatches(text, 0, 1, locale); + // punt if there is no query text + if (text == null || text.trim().length() == 0) { + return new Choices(true); + } + int limit = 10; + SHERPAService sherpaService = new DSpace().getSingletonService(SHERPAService.class); + SHERPAPublisherResponse sherpaResponse = sherpaService.performPublisherRequest("publisher", "name", + "equals", text, 0, limit); + Choices result; + if (CollectionUtils.isNotEmpty(sherpaResponse.getPublishers())) { + List list = sherpaResponse + .getPublishers().stream() + .map(sherpaPublisher -> + new Choice(sherpaPublisher.getIdentifier(), + sherpaPublisher.getName(), sherpaPublisher.getName())) + .collect(Collectors.toList()); + int total = sherpaResponse.getPublishers().size(); + + int confidence; + if (list.isEmpty()) { + confidence = Choices.CF_NOTFOUND; + } else if (list.size() == 1) { + confidence = Choices.CF_UNCERTAIN; + } else { + confidence = Choices.CF_AMBIGUOUS; + } + result = new Choices(list.toArray(new Choice[list.size()]), 0, total, confidence, + total > limit); + } else { + result = new Choices(false); + } + return result; } @Override From 5db110a19f30f49a2e22c48d0a19044adfc008e1 Mon Sep 17 00:00:00 2001 From: Yannick Paulsen Date: Fri, 16 Feb 2024 12:08:00 +0100 Subject: [PATCH 18/23] Update of DataCite crosswalk to metadata schema 4.5 --- dspace/config/crosswalks/DIM2DataCite.xsl | 111 ++++++++++++++-------- dspace/config/dspace.cfg | 6 +- 2 files changed, 75 insertions(+), 42 deletions(-) diff --git a/dspace/config/crosswalks/DIM2DataCite.xsl b/dspace/config/crosswalks/DIM2DataCite.xsl index e92c371d6a77..5cc3eecdda77 100644 --- a/dspace/config/crosswalks/DIM2DataCite.xsl +++ b/dspace/config/crosswalks/DIM2DataCite.xsl @@ -3,15 +3,14 @@ @@ -46,9 +45,9 @@ properties are in the metadata of the item to export. The classe named above respects this. --> - + - + - + + + + + + + + Other + Other + + + - + - + + + @@ -246,7 +264,7 @@ - @@ -255,6 +273,13 @@ + + - + + @@ -295,9 +328,14 @@ company as well. We have to ensure to use URIs of our prefix as primary identifiers only. --> - + - + + + + + + @@ -313,16 +351,20 @@ + + AlternativeTitle + Subtitle + TranslatedTitle @@ -341,6 +383,7 @@ --> + @@ -436,7 +479,7 @@ dissertations. DataCite uses submitted for the "date the creator submits the resource to the publisher". --> - Issued + Submitted Updated @@ -473,9 +516,9 @@ Audiovisual - Text - Text - Text + JournalArticle + Book + BookChapter Dataset InteractiveResource Image @@ -483,14 +526,14 @@ Model Other Model - Text - Text + Preprint + Other Sound Sound Sound Software - Text - Text + Report + Dissertation Audiovisual Text Other @@ -512,7 +555,7 @@ resolveUrlToHandle(context, altId) until one is recognized or all have been tested. --> - + @@ -561,20 +604,9 @@ Adds Rights information --> - - - - - - - - - - - - - - + + + + Abstract diff --git a/dspace/config/dspace.cfg b/dspace/config/dspace.cfg index d768ee0c2fe6..1575ff65036b 100644 --- a/dspace/config/dspace.cfg +++ b/dspace/config/dspace.cfg @@ -603,13 +603,13 @@ crosswalk.dissemination.DataCite.stylesheet = crosswalks/DIM2DataCite.xsl ## For DataCite via EZID, comment above and uncomment this: #crosswalk.dissemination.DataCite.stylesheet = crosswalks/DIM2EZID.xsl crosswalk.dissemination.DataCite.schemaLocation = \ - http://datacite.org/schema/kernel-3 \ - http://schema.datacite.org/meta/kernel-3/metadata.xsd + http://datacite.org/schema/kernel-4 \ + http://schema.datacite.org/meta/kernel-4/metadata.xsd crosswalk.dissemination.DataCite.preferList = false crosswalk.dissemination.DataCite.publisher = My University #crosswalk.dissemination.DataCite.dataManager = # defaults to publisher #crosswalk.dissemination.DataCite.hostingInstitution = # defaults to publisher -crosswalk.dissemination.DataCite.namespace = http://datacite.org/schema/kernel-3 +crosswalk.dissemination.DataCite.namespace = http://datacite.org/schema/kernel-4 # Crosswalk Plugin Configuration: # The purpose of Crosswalks is to translate an external metadata format to/from From f9424654106f288e2f965dbdf7969e748d84ae2e Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Sun, 18 Feb 2024 14:44:13 +0100 Subject: [PATCH 19/23] 110889: Added community & collection discovery configuration --- dspace/config/spring/api/discovery.xml | 39 ++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dspace/config/spring/api/discovery.xml b/dspace/config/spring/api/discovery.xml index fb25f11598fa..ca478c8fee4f 100644 --- a/dspace/config/spring/api/discovery.xml +++ b/dspace/config/spring/api/discovery.xml @@ -73,6 +73,11 @@ + + + + + @@ -306,6 +311,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 1a567827df61cff9931d84e8732886457304a7d5 Mon Sep 17 00:00:00 2001 From: Pascal-Nicolas Becker Date: Tue, 20 Feb 2024 12:38:08 +0100 Subject: [PATCH 20/23] Changing a comment on DIM2DataCite.xsl --- dspace/config/crosswalks/DIM2DataCite.xsl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dspace/config/crosswalks/DIM2DataCite.xsl b/dspace/config/crosswalks/DIM2DataCite.xsl index 5cc3eecdda77..a97d127694ef 100644 --- a/dspace/config/crosswalks/DIM2DataCite.xsl +++ b/dspace/config/crosswalks/DIM2DataCite.xsl @@ -16,10 +16,15 @@ - + 10.5072/dspace- From d09d6319f61726447ed4a0f048266c774e29c48b Mon Sep 17 00:00:00 2001 From: Philipp Rumpf Date: Tue, 20 Feb 2024 14:39:50 +0000 Subject: [PATCH 21/23] MultipleParallelImportMetadataSourceServiceImpl.java This is what the University of Bamberg uses (https://fis.uni-bamberg.de) to look up DOIs specified by the user for import in both the Crossref registry and the DataCite registry, in parallel. This source can be specified just once, replacing the Crossref and DataCite sources by a single entry. --- ...rallelImportMetadataSourceServiceImpl.java | 186 ++++++++++++++++++ .../spring-dspace-addon-import-services.xml | 14 ++ .../config/spring/api/external-services.xml | 12 ++ 3 files changed, 212 insertions(+) create mode 100644 dspace-api/src/main/java/org/dspace/importer/external/MultipleParallelImportMetadataSourceServiceImpl.java diff --git a/dspace-api/src/main/java/org/dspace/importer/external/MultipleParallelImportMetadataSourceServiceImpl.java b/dspace-api/src/main/java/org/dspace/importer/external/MultipleParallelImportMetadataSourceServiceImpl.java new file mode 100644 index 000000000000..4c253b0502f7 --- /dev/null +++ b/dspace-api/src/main/java/org/dspace/importer/external/MultipleParallelImportMetadataSourceServiceImpl.java @@ -0,0 +1,186 @@ +/** + * The contents of this file are subject to the license and copyright + * detailed in the LICENSE and NOTICE files at the root of the source + * tree and available online at + * + * http://www.dspace.org/license/ + */ +package org.dspace.importer.external; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import javax.el.MethodNotFoundException; + +import org.dspace.content.Item; +import org.dspace.importer.external.datamodel.ImportRecord; +import org.dspace.importer.external.datamodel.Query; +import org.dspace.importer.external.exception.MetadataSourceException; +import org.dspace.importer.external.service.components.QuerySource; + +/** + * Implements a data source for querying multiple external data sources in parallel + * + * optional Affiliation informations are not part of the API request. + * + * @author Johanna Staudinger (johanna.staudinger@uni-bamberg.de) + * + */ +public class MultipleParallelImportMetadataSourceServiceImpl implements QuerySource { + private final List innerProviders; + private final ExecutorService executorService; + + private final String sourceName; + public MultipleParallelImportMetadataSourceServiceImpl(List innerProviders, String sourceName) { + super(); + this.innerProviders = innerProviders; + this.executorService = Executors.newFixedThreadPool(innerProviders.size()); + this.sourceName = sourceName; + } + + @Override + public String getImportSource() { + return sourceName; + } + + @Override + public ImportRecord getRecord(String recordId) throws MetadataSourceException { + List> futureList = new ArrayList<>(); + ImportRecord result = null; + for (QuerySource innerProvider : innerProviders) { + futureList.add(executorService.submit(() -> innerProvider.getRecord(recordId))); + } + for (Future future: futureList) { + try { + ImportRecord importRecord = future.get(); + if (!Objects.isNull(importRecord)) { + result = importRecord; + } + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + } + return result; + } + + @Override + public int getRecordsCount(String query) throws MetadataSourceException { + List> futureList = new ArrayList<>(); + int result = 0; + for (QuerySource innerProvider : innerProviders) { + futureList.add(executorService.submit(() -> innerProvider.getRecordsCount(query))); + } + for (Future future: futureList) { + try { + Integer count = future.get(); + result += Objects.isNull(count) ? 0 : count; + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + } + return result; + } + + @Override + public int getRecordsCount(Query query) throws MetadataSourceException { + List> futureList = new ArrayList<>(); + int result = 0; + for (QuerySource innerProvider : innerProviders) { + futureList.add(executorService.submit(() -> innerProvider.getRecordsCount(query))); + } + for (Future future: futureList) { + try { + Integer count = future.get(); + result += Objects.isNull(count) ? 0 : count; + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + } + return result; + } + + + @Override + public Collection getRecords(String query, int start, int count) throws MetadataSourceException { + List>> futureList = new ArrayList<>(); + List result = new ArrayList<>(); + for (QuerySource innerProvider : innerProviders) { + futureList.add(executorService.submit(() -> innerProvider.getRecords(query, start, count))); + } + for (Future> future: futureList) { + try { + Collection importRecords = future.get(); + result.addAll(Objects.isNull(importRecords) ? Collections.emptyList() : importRecords); + } catch (InterruptedException | ExecutionException e) { + // + } + } + return result; + } + + @Override + public Collection getRecords(Query query) throws MetadataSourceException { + List>> futureList = new ArrayList<>(); + List result = new ArrayList<>(); + for (QuerySource innerProvider : innerProviders) { + futureList.add(executorService.submit(() -> innerProvider.getRecords(query))); + } + for (Future> future: futureList) { + try { + Collection importRecords = future.get(); + result.addAll(Objects.isNull(importRecords) ? Collections.emptyList() : importRecords); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + } + return result; + } + + @Override + public ImportRecord getRecord(Query query) throws MetadataSourceException { + throw new MethodNotFoundException("This method is not implemented for multiple external data sources"); + } + + @Override + public Collection findMatchingRecords(Query query) throws MetadataSourceException { + List>> futureList = new ArrayList<>(); + List result = new ArrayList<>(); + for (QuerySource innerProvider : innerProviders) { + futureList.add(executorService.submit(() -> innerProvider.findMatchingRecords(query))); + } + for (Future> future: futureList) { + try { + Collection importRecords = future.get(); + result.addAll(Objects.isNull(importRecords) ? Collections.emptyList() : importRecords); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + } + return result; + } + + + @Override + public Collection findMatchingRecords(Item item) throws MetadataSourceException { + List>> futureList = new ArrayList<>(); + List result = new ArrayList<>(); + for (QuerySource innerProvider : innerProviders) { + futureList.add(executorService.submit(() -> innerProvider.findMatchingRecords(item))); + } + for (Future> future: futureList) { + try { + Collection importRecords = future.get(); + result.addAll(Objects.isNull(importRecords) ? Collections.emptyList() : importRecords); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + } + return result; + } +} diff --git a/dspace-api/src/main/resources/spring/spring-dspace-addon-import-services.xml b/dspace-api/src/main/resources/spring/spring-dspace-addon-import-services.xml index 7f6f872ce064..f7943fb2320c 100644 --- a/dspace-api/src/main/resources/spring/spring-dspace-addon-import-services.xml +++ b/dspace-api/src/main/resources/spring/spring-dspace-addon-import-services.xml @@ -30,10 +30,24 @@ + + + + + + + + + + doi + + + diff --git a/dspace/config/spring/api/external-services.xml b/dspace/config/spring/api/external-services.xml index ba39d23298c1..129602d7e5ef 100644 --- a/dspace/config/spring/api/external-services.xml +++ b/dspace/config/spring/api/external-services.xml @@ -176,6 +176,18 @@ + + + + + + + Publication + none + + + + From 081aba85d1e3d36c099835ee2ee308a9c120215a Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Wed, 21 Feb 2024 22:03:32 +0100 Subject: [PATCH 22/23] 108915: Refactored new repositories to also use the new plural format --- .../java/org/dspace/app/rest/model/SuggestionRest.java | 8 +++++++- .../org/dspace/app/rest/model/SuggestionSourceRest.java | 6 ++++++ .../org/dspace/app/rest/model/SuggestionTargetRest.java | 6 ++++++ .../app/rest/repository/SuggestionRestRepository.java | 2 +- .../rest/repository/SuggestionSourceRestRepository.java | 2 +- .../rest/repository/SuggestionTargetRestRepository.java | 2 +- .../repository/SuggestionTargetTargetLinkRepository.java | 2 +- 7 files changed, 23 insertions(+), 5 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionRest.java index b3f67fc2bede..c7210e892558 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionRest.java @@ -25,6 +25,7 @@ public class SuggestionRest extends BaseObjectRest { private static final long serialVersionUID = 1L; public static final String NAME = "suggestion"; + public static final String PLURAL_NAME = "suggestions"; public static final String TARGET = "target"; public static final String CATEGORY = RestAddressableModel.INTEGRATION; @@ -41,6 +42,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return CATEGORY; @@ -111,4 +117,4 @@ public EvidenceRest(String score, String notes) { this.notes = notes; } } -} \ No newline at end of file +} diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionSourceRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionSourceRest.java index 9c2aa80e82e5..f8cc0e603f1d 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionSourceRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionSourceRest.java @@ -22,6 +22,7 @@ public class SuggestionSourceRest extends BaseObjectRest { private static final long serialVersionUID = 1L; public static final String CATEGORY = RestAddressableModel.INTEGRATION; public static final String NAME = "suggestionsource"; + public static final String PLURAL_NAME = "suggestionsources"; private int total; @@ -31,6 +32,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return CATEGORY; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionTargetRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionTargetRest.java index ba93ab4e52b7..65764507e247 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionTargetRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionTargetRest.java @@ -24,6 +24,7 @@ public class SuggestionTargetRest extends BaseObjectRest { private static final long serialVersionUID = 1L; public static final String NAME = "suggestiontarget"; + public static final String PLURAL_NAME = "suggestiontargets"; public static final String TARGET = "target"; public static final String CATEGORY = RestAddressableModel.INTEGRATION; @@ -37,6 +38,11 @@ public String getType() { return NAME; } + @Override + public String getTypePlural() { + return PLURAL_NAME; + } + @Override public String getCategory() { return CATEGORY; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SuggestionRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SuggestionRestRepository.java index e2e1c3ce7ccb..d8af5d78d452 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SuggestionRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SuggestionRestRepository.java @@ -33,7 +33,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(SuggestionRest.CATEGORY + "." + SuggestionRest.NAME) +@Component(SuggestionRest.CATEGORY + "." + SuggestionRest.PLURAL_NAME) public class SuggestionRestRepository extends DSpaceRestRepository { private final static String ORDER_FIELD = "trust"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SuggestionSourceRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SuggestionSourceRestRepository.java index 6bc251749bce..30663e5cd557 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SuggestionSourceRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SuggestionSourceRestRepository.java @@ -26,7 +26,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(SuggestionSourceRest.CATEGORY + "." + SuggestionSourceRest.NAME) +@Component(SuggestionSourceRest.CATEGORY + "." + SuggestionSourceRest.PLURAL_NAME) public class SuggestionSourceRestRepository extends DSpaceRestRepository { private static final Logger log = org.apache.logging.log4j.LogManager diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SuggestionTargetRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SuggestionTargetRestRepository.java index e8498cb68c2b..4691ea3600a7 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SuggestionTargetRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SuggestionTargetRestRepository.java @@ -30,7 +30,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@Component(SuggestionTargetRest.CATEGORY + "." + SuggestionTargetRest.NAME) +@Component(SuggestionTargetRest.CATEGORY + "." + SuggestionTargetRest.PLURAL_NAME) public class SuggestionTargetRestRepository extends DSpaceRestRepository { private static final Logger log = org.apache.logging.log4j.LogManager diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SuggestionTargetTargetLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SuggestionTargetTargetLinkRepository.java index 50c6e4d48e27..e9b0fb6aa766 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SuggestionTargetTargetLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SuggestionTargetTargetLinkRepository.java @@ -31,7 +31,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) * */ -@Component(SuggestionTargetRest.CATEGORY + "." + SuggestionTargetRest.NAME + "." + SuggestionTargetRest.TARGET) +@Component(SuggestionTargetRest.CATEGORY + "." + SuggestionTargetRest.PLURAL_NAME + "." + SuggestionTargetRest.TARGET) public class SuggestionTargetTargetLinkRepository extends AbstractDSpaceRestRepository implements LinkRestRepository { @Autowired From a55d14722907025e3412df570a3faeff05a511a6 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Wed, 21 Feb 2024 22:17:50 +0100 Subject: [PATCH 23/23] 108915: Added additional tests to prevent incorrect endpoints from being reintroduced again --- .../org/dspace/app/rest/CommunityRestRepositoryIT.java | 6 ++++++ .../java/org/dspace/app/rest/EPersonRestRepositoryIT.java | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityRestRepositoryIT.java index 30614e6125f2..910dee3bec74 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityRestRepositoryIT.java @@ -109,6 +109,12 @@ public class CommunityRestRepositoryIT extends AbstractControllerIntegrationTest private EPerson collectionAdmin; private EPerson submitter; + @Test + public void singularEndpointShouldNotExist() throws Exception { + getClient().perform(get("/api/core/community")) + .andExpect(status().isNotFound()); + } + @Test public void createTest() throws Exception { ObjectMapper mapper = new ObjectMapper(); diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/EPersonRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/EPersonRestRepositoryIT.java index 8c5ffbb1187c..091c932ad793 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/EPersonRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/EPersonRestRepositoryIT.java @@ -265,6 +265,13 @@ public void findAllTest() throws Exception { ; } + @Test + public void singularEndpointShouldNotExist() throws Exception { + String authToken = getAuthToken(admin.getEmail(), password); + getClient(authToken).perform(get("/api/eperson/eperson")) + .andExpect(status().isNotFound()); + } + @Test public void findAllUnauthorizedTest() throws Exception { // Access endpoint without being authenticated