1 |
26600
|
sandro.lab
|
package eu.dnetlib.msro.openaireplus.workflows.nodes;
|
2 |
|
|
|
3 |
45335
|
claudio.at
|
import java.util.List;
|
4 |
26600
|
sandro.lab
|
|
5 |
|
|
import com.googlecode.sarasvati.Arc;
|
6 |
|
|
import com.googlecode.sarasvati.NodeToken;
|
7 |
|
|
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
|
8 |
32798
|
michele.ar
|
import eu.dnetlib.enabling.locators.UniqueServiceLocator;
|
9 |
26600
|
sandro.lab
|
import eu.dnetlib.msro.workflows.nodes.SimpleJobNode;
|
10 |
45335
|
claudio.at
|
import org.apache.commons.io.IOUtils;
|
11 |
|
|
import org.springframework.beans.factory.annotation.Required;
|
12 |
|
|
import org.springframework.core.io.Resource;
|
13 |
26600
|
sandro.lab
|
|
14 |
|
|
public class FindVocabularyEntriesJobNode extends SimpleJobNode {
|
15 |
|
|
|
16 |
|
|
private String outputEprParam = "epr";
|
17 |
|
|
|
18 |
32798
|
michele.ar
|
@javax.annotation.Resource
|
19 |
|
|
private UniqueServiceLocator serviceLocator;
|
20 |
26600
|
sandro.lab
|
|
21 |
|
|
private Resource xquery;
|
22 |
|
|
|
23 |
|
|
@Override
|
24 |
|
|
protected String execute(final NodeToken token) throws Exception {
|
25 |
|
|
final String query = IOUtils.toString(xquery.getInputStream());
|
26 |
45335
|
claudio.at
|
final List<String> list = serviceLocator.getService(ISLookUpService.class).quickSearchProfile(query);
|
27 |
|
|
token.getEnv().setTransientAttribute(getOutputEprParam(), list);
|
28 |
26600
|
sandro.lab
|
|
29 |
|
|
return Arc.DEFAULT_ARC;
|
30 |
|
|
}
|
31 |
|
|
|
32 |
|
|
public String getOutputEprParam() {
|
33 |
|
|
return outputEprParam;
|
34 |
|
|
}
|
35 |
|
|
|
36 |
|
|
public void setOutputEprParam(final String outputEprParam) {
|
37 |
|
|
this.outputEprParam = outputEprParam;
|
38 |
|
|
}
|
39 |
|
|
|
40 |
|
|
public Resource getXquery() {
|
41 |
|
|
return xquery;
|
42 |
|
|
}
|
43 |
|
|
|
44 |
|
|
@Required
|
45 |
|
|
public void setXquery(final Resource xquery) {
|
46 |
|
|
this.xquery = xquery;
|
47 |
|
|
}
|
48 |
|
|
|
49 |
|
|
}
|