From 5f63dcd4aeaee9fffcc5c3510f1a000a1182f9fa Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Mon, 16 Dec 2024 07:56:01 +0100 Subject: [PATCH] The ProvenanceService wasn't initialized in the BundleAccessControl --- .../dspace/app/bulkaccesscontrol/BulkAccessControl.java | 6 ++---- .../dspace/content/factory/ContentServiceFactory.java | 9 +++++++++ .../content/factory/ContentServiceFactoryImpl.java | 9 +++++++++ .../org/dspace/app/rest/ItemAddBundleController.java | 4 ++-- .../rest/ItemOwningCollectionUpdateRestController.java | 4 ++-- .../dspace/app/rest/MappedCollectionRestController.java | 4 ++-- .../dspace/app/rest/repository/BundleRestRepository.java | 4 ++-- 7 files changed, 28 insertions(+), 12 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/app/bulkaccesscontrol/BulkAccessControl.java b/dspace-api/src/main/java/org/dspace/app/bulkaccesscontrol/BulkAccessControl.java index b2a5015666ab..aaf652f2da11 100644 --- a/dspace-api/src/main/java/org/dspace/app/bulkaccesscontrol/BulkAccessControl.java +++ b/dspace-api/src/main/java/org/dspace/app/bulkaccesscontrol/BulkAccessControl.java @@ -56,7 +56,7 @@ import org.dspace.content.service.ItemService; import org.dspace.core.Constants; import org.dspace.core.Context; -import org.dspace.core.ProvenanceServiceImpl; +import org.dspace.core.ProvenanceService; import org.dspace.discovery.DiscoverQuery; import org.dspace.discovery.SearchService; import org.dspace.discovery.SearchServiceException; @@ -70,7 +70,6 @@ import org.dspace.services.factory.DSpaceServicesFactory; import org.dspace.submit.model.AccessConditionOption; import org.dspace.utils.DSpace; -import org.springframework.beans.factory.annotation.Autowired; /** * Implementation of {@link DSpaceRunnable} to perform a bulk access control via json file. @@ -114,8 +113,7 @@ public class BulkAccessControl extends DSpaceRunnable> getDSpaceObjectServices() { return dSpaceObjectServices; @@ -173,6 +177,11 @@ public PreviewContentService getPreviewContentService() { return previewContentService; } + @Override + public ProvenanceService getProvenanceService() { + return provenanceService; + } + @Override public RelationshipTypeService getRelationshipTypeService() { return relationshipTypeService; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/ItemAddBundleController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/ItemAddBundleController.java index c9bf0f719866..89a2ad104ebf 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/ItemAddBundleController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/ItemAddBundleController.java @@ -38,7 +38,7 @@ import org.dspace.content.service.clarin.ClarinLicenseService; import org.dspace.core.Constants; import org.dspace.core.Context; -import org.dspace.core.ProvenanceServiceImpl; +import org.dspace.core.ProvenanceService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -100,7 +100,7 @@ public class ItemAddBundleController { ClarinLicenseResourceMappingService clarinLicenseResourceMappingService; @Autowired - ProvenanceServiceImpl provenanceService; + ProvenanceService provenanceService; /** * Method to add a Bundle to an Item with the given UUID in the URL. This will create a Bundle with the diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/ItemOwningCollectionUpdateRestController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/ItemOwningCollectionUpdateRestController.java index 6108f81b0168..ca467c91630e 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/ItemOwningCollectionUpdateRestController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/ItemOwningCollectionUpdateRestController.java @@ -32,7 +32,7 @@ import org.dspace.content.service.ItemService; import org.dspace.core.Constants; import org.dspace.core.Context; -import org.dspace.core.ProvenanceServiceImpl; +import org.dspace.core.ProvenanceService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.rest.webmvc.ResourceNotFoundException; import org.springframework.security.access.prepost.PostAuthorize; @@ -67,7 +67,7 @@ public class ItemOwningCollectionUpdateRestController { Utils utils; @Autowired - ProvenanceServiceImpl provenanceService; + ProvenanceService provenanceService; /** * This method will update the owning collection of the item that correspond to the provided item uuid, effectively diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/MappedCollectionRestController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/MappedCollectionRestController.java index 65966b100ada..09581f5e2998 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/MappedCollectionRestController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/MappedCollectionRestController.java @@ -30,7 +30,7 @@ import org.dspace.content.service.CollectionService; import org.dspace.content.service.ItemService; import org.dspace.core.Context; -import org.dspace.core.ProvenanceServiceImpl; +import org.dspace.core.ProvenanceService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.PathVariable; @@ -59,7 +59,7 @@ public class MappedCollectionRestController { Utils utils; @Autowired - ProvenanceServiceImpl provenanceService; + ProvenanceService provenanceService; /** * This method will add an Item to a Collection. The Collection object is encapsulated in the request due to the 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 b9da0dc34dca..7f800ea81813 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 @@ -35,7 +35,7 @@ import org.dspace.content.service.ItemService; import org.dspace.core.Constants; import org.dspace.core.Context; -import org.dspace.core.ProvenanceServiceImpl; +import org.dspace.core.ProvenanceService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -71,7 +71,7 @@ public class BundleRestRepository extends DSpaceObjectRestRepository