Skip to content

Commit

Permalink
Merged in task/dspace-cris-2023_02_x/DSC-1771 (pull request DSpace#2654)
Browse files Browse the repository at this point in the history
[DSC-1771] Internal handles do not resolve on 4Science instances

Approved-by: Stefano Maffei
  • Loading branch information
eskander17 authored and steph-ieffam committed Sep 10, 2024
2 parents 79e494b + 449b20e commit 57d4c8d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
*/
package org.dspace.identifier.factory;

import java.util.Set;

import org.dspace.identifier.generators.DoiGenerationStrategy;
import org.dspace.identifier.service.DOIService;
import org.dspace.identifier.service.IdentifierService;
import org.dspace.services.factory.DSpaceServicesFactory;
Expand All @@ -26,8 +23,6 @@ public abstract class IdentifierServiceFactory {

public abstract DOIService getDOIService();

public abstract Set<DoiGenerationStrategy> getDoiGenerationStrategies();

public static IdentifierServiceFactory getInstance() {
return DSpaceServicesFactory.getInstance().getServiceManager()
.getServiceByName("identifierServiceFactory", IdentifierServiceFactory.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
*/
package org.dspace.identifier.factory;

import java.util.Set;

import org.dspace.identifier.generators.DoiGenerationStrategy;
import org.dspace.identifier.service.DOIService;
import org.dspace.identifier.service.IdentifierService;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -26,8 +23,6 @@ public class IdentifierServiceFactoryImpl extends IdentifierServiceFactory {
private IdentifierService identifierService;
@Autowired(required = true)
private DOIService doiService;
@Autowired(required = true)
private Set<DoiGenerationStrategy> doiGenerationStrategies;

@Override
public IdentifierService getIdentifierService() {
Expand All @@ -38,8 +33,4 @@ public IdentifierService getIdentifierService() {
public DOIService getDOIService() {
return doiService;
}

public Set<DoiGenerationStrategy> getDoiGenerationStrategies() {
return doiGenerationStrategies;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
import java.util.Set;

import org.apache.commons.lang3.ObjectUtils;
import org.apache.logging.log4j.LogManager;
Expand Down Expand Up @@ -52,6 +52,7 @@
import org.dspace.identifier.service.DOIService;
import org.dspace.services.ConfigurationService;
import org.dspace.services.factory.DSpaceServicesFactory;
import org.dspace.utils.DSpace;
import org.dspace.workflow.WorkflowException;
import org.dspace.workflow.WorkflowItem;
import org.dspace.workflow.factory.WorkflowServiceFactory;
Expand Down Expand Up @@ -84,8 +85,8 @@ public class DOIIdentifierProviderTest
protected CollectionService collectionService = ContentServiceFactory.getInstance().getCollectionService();
protected ItemService itemService = ContentServiceFactory.getInstance().getItemService();
protected WorkspaceItemService workspaceItemService = ContentServiceFactory.getInstance().getWorkspaceItemService();
protected Set<DoiGenerationStrategy> doiGenerationStrategies =
IdentifierServiceFactory.getInstance().getDoiGenerationStrategies();
protected List<DoiGenerationStrategy> doiGenerationStrategies = new DSpace().getServiceManager()
.getServicesByType(DoiGenerationStrategy.class);

private static Community community;
private static Collection collection;
Expand Down Expand Up @@ -137,7 +138,7 @@ public void init() {
provider.setConfigurationService(config);
provider.setDOIConnector(connector);
provider.setFilter(null);
provider.setDoiGenerationStrategies(doiGenerationStrategies);
provider.setDoiGenerationStrategies(new HashSet<>(doiGenerationStrategies));
} catch (AuthorizeException ex) {
log.error("Authorization Error in init", ex);
fail("Authorization Error in init: " + ex.getMessage());
Expand Down
4 changes: 1 addition & 3 deletions dspace/config/spring/api/identifier-service.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
autowire="byType"
scope="singleton">
<!-- ADDITIONAL PROVIDERS -->
<!--
<property name="providers">
<list>
<ref bean="org.dspace.identifier.HandleIdentifierProvider"/>
<ref bean="org.dspace.identifier.DOIIdentifierProvider"/>
<!-- <ref bean="org.dspace.identifier.DOIIdentifierProvider"/>-->
</list>
</property>
-->
<!-- ADDITIONAL PROVIDERS -->
</bean>

Expand Down

0 comments on commit 57d4c8d

Please sign in to comment.