1
|
package eu.dnetlib.msro.openaireplus.workflows.nodes.repobye;
|
2
|
|
3
|
import eu.dnetlib.enabling.datasources.common.LocalDatasourceManager;
|
4
|
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
|
5
|
import eu.dnetlib.enabling.locators.UniqueServiceLocator;
|
6
|
import eu.dnetlib.msro.workflows.nodes.repobye.DeleteMetaWfJobNode;
|
7
|
import org.springframework.beans.factory.annotation.Autowired;
|
8
|
|
9
|
public class DeleteOpenaireMetaWfJobNode extends DeleteMetaWfJobNode {
|
10
|
|
11
|
@Autowired
|
12
|
private UniqueServiceLocator serviceLocator;
|
13
|
|
14
|
@Autowired
|
15
|
private LocalDatasourceManager dsManager;
|
16
|
|
17
|
@Override
|
18
|
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
|
}
|
28
|
}
|
29
|
}
|