Revision 48701
Added by Sandro La Bruzzo over 6 years ago
DateRangeCollectRecordsJobNode.java | ||
---|---|---|
10 | 10 |
import eu.dnetlib.rmi.data.CollectorService; |
11 | 11 |
import eu.dnetlib.rmi.data.InterfaceDescriptor; |
12 | 12 |
import eu.dnetlib.rmi.enabling.ISLookUpService; |
13 |
import jdk.nashorn.api.scripting.ScriptUtils; |
|
14 |
import org.apache.commons.lang3.StringUtils; |
|
13 | 15 |
import org.dom4j.Document; |
14 | 16 |
import org.dom4j.Node; |
15 | 17 |
import org.dom4j.io.SAXReader; |
... | ... | |
25 | 27 |
private String eprParam; |
26 | 28 |
private String fromDateParam; |
27 | 29 |
private String untilDateParam; |
30 |
private String from; |
|
31 |
private String until; |
|
28 | 32 |
|
29 | 33 |
@Override |
30 | 34 |
protected String execute(final Env env) throws Exception { |
31 | 35 |
final String profile = this.serviceLocator.getService(ISLookUpService.class).getResourceProfile(this.datasourceId); |
32 | 36 |
final Document doc = new SAXReader().read(new StringReader(profile)); |
33 | 37 |
final Node ifcNode = doc.selectSingleNode("//INTERFACE[@id='" + this.datasourceInterface + "']"); |
34 |
final String fromDate = env.getAttribute(getFromDateParam(), String.class); |
|
35 |
final String untilDate = env.getAttribute(getUntilDateParam(), String.class); |
|
36 | 38 |
|
39 |
final String fromDate = StringUtils.isNoneBlank(from) ? from : env.getAttribute(getFromDateParam(), String.class); |
|
40 |
final String untilDate = StringUtils.isNoneBlank(until) ? until : env.getAttribute(getUntilDateParam(), String.class); |
|
41 |
|
|
37 | 42 |
final InterfaceDescriptor interfaceDescriptor = InterfaceDescriptor.newInstance(ifcNode); |
38 | 43 |
|
39 | 44 |
final ResultSet<String> rs = this.serviceLocator.getService(CollectorService.class).dateRangeCollect(interfaceDescriptor, fromDate, untilDate); |
... | ... | |
83 | 88 |
this.eprParam = eprParam; |
84 | 89 |
} |
85 | 90 |
|
91 |
public String getFrom() { |
|
92 |
return from; |
|
93 |
} |
|
94 |
|
|
95 |
public void setFrom(String from) { |
|
96 |
this.from = from; |
|
97 |
} |
|
98 |
|
|
99 |
public String getUntil() { |
|
100 |
return until; |
|
101 |
} |
|
102 |
|
|
103 |
public void setUntil(String until) { |
|
104 |
this.until = until; |
|
105 |
} |
|
86 | 106 |
} |
Also available in: Unified diff
Upgraded incremental harvesting and other stuff