Revision 61892
Added by Michele Artini over 2 years ago
modules/dnet-openaireplus-workflows/branches/dismiss_repo_profiles/src/main/java/eu/dnetlib/msro/openaireplus/workflows/nodes/repobye/DeleteOpenaireMetaWfJobNode.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.msro.openaireplus.workflows.nodes.repobye; |
2 | 2 |
|
3 |
import org.springframework.beans.factory.annotation.Autowired; |
|
4 |
|
|
3 | 5 |
import eu.dnetlib.enabling.datasources.common.LocalDatasourceManager; |
4 |
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService; |
|
5 |
import eu.dnetlib.enabling.locators.UniqueServiceLocator; |
|
6 | 6 |
import eu.dnetlib.msro.workflows.nodes.repobye.DeleteMetaWfJobNode; |
7 |
import org.springframework.beans.factory.annotation.Autowired; |
|
8 | 7 |
|
9 | 8 |
public class DeleteOpenaireMetaWfJobNode extends DeleteMetaWfJobNode { |
10 | 9 |
|
11 | 10 |
@Autowired |
12 |
private UniqueServiceLocator serviceLocator;
|
|
11 |
private LocalDatasourceManager<?, ?> dsManager;
|
|
13 | 12 |
|
14 |
@Autowired |
|
15 |
private LocalDatasourceManager dsManager; |
|
16 |
|
|
17 | 13 |
@Override |
18 | 14 |
protected void setActivationStatus(final String dsId, final String ifaceId, final boolean active) throws Exception { |
19 |
|
|
20 |
final String openaireDsId = serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery( |
|
21 |
"/*[.//RESOURCE_IDENTIFIER/@value = '" + dsId + "']//FIELD/value[../key='OpenAireDataSourceId']/text()"); |
|
22 |
|
|
23 |
if (openaireDsId.equals("openaire____::bootstrap")) { |
|
24 |
dsManager.setActive(dsId, ifaceId, active); |
|
25 |
} else { |
|
26 |
dsManager.setActive(openaireDsId, ifaceId, active); |
|
27 |
} |
|
15 |
dsManager.setActive(dsId, ifaceId, active); |
|
28 | 16 |
} |
29 | 17 |
} |
Also available in: Unified diff