1
|
package eu.dnetlib.functionality.modular.ui.workflows.values;
|
2
|
|
3
|
import java.util.List;
|
4
|
import java.util.Map;
|
5
|
import javax.annotation.Resource;
|
6
|
|
7
|
import com.google.common.collect.Lists;
|
8
|
import eu.dnetlib.enabling.locators.UniqueServiceLocator;
|
9
|
import eu.dnetlib.msro.workflows.util.ValidNodeValuesFetcher;
|
10
|
import eu.dnetlib.rmi.enabling.ISLookUpService;
|
11
|
|
12
|
public class ListDedupOrchestrationValues extends ValidNodeValuesFetcher {
|
13
|
|
14
|
@Resource
|
15
|
private UniqueServiceLocator serviceLocator;
|
16
|
|
17
|
@Override
|
18
|
protected List<DnetParamValue> obtainValues(final Map<String, String> params) throws Exception {
|
19
|
|
20
|
final String xquery =
|
21
|
"for $x in /RESOURCE_PROFILE[.//RESOURCE_TYPE/@value='DedupOrchestrationDSResourceType'] return $x//ACTION_SET/@id/string()";
|
22
|
|
23
|
final List<String> result = serviceLocator.getService(ISLookUpService.class).quickSearchProfile(xquery);
|
24
|
final List<DnetParamValue> values = Lists.newArrayList();
|
25
|
|
26
|
for (final String s : result) {
|
27
|
values.add(new DnetParamValue(s, s));
|
28
|
}
|
29
|
|
30
|
return values;
|
31
|
}
|
32
|
|
33
|
}
|