Revision 54121
Added by Sandro La Bruzzo over 4 years ago
modules/dnet-msro-service/trunk/src/main/java/eu/dnetlib/msro/workflows/nodes/collect/DateRangeCollectRecordsJobNode.java | ||
---|---|---|
5 | 5 |
import javax.annotation.Resource; |
6 | 6 |
import javax.xml.ws.wsaddressing.W3CEndpointReference; |
7 | 7 |
|
8 |
import org.apache.commons.lang3.StringUtils; |
|
8 | 9 |
import org.dom4j.Document; |
9 | 10 |
import org.dom4j.Node; |
10 | 11 |
import org.dom4j.io.SAXReader; |
... | ... | |
28 | 29 |
private String eprParam; |
29 | 30 |
private String fromDateParam; |
30 | 31 |
private String untilDateParam; |
32 |
private String from; |
|
33 |
private String until; |
|
31 | 34 |
|
32 | 35 |
@Override |
33 | 36 |
protected String execute(final NodeToken token) throws Exception { |
34 | 37 |
final String profile = serviceLocator.getService(ISLookUpService.class).getResourceProfile(datasourceId); |
35 | 38 |
final Document doc = new SAXReader().read(new StringReader(profile)); |
36 | 39 |
final Node ifcNode = doc.selectSingleNode("//INTERFACE[@id='" + datasourceInterface + "']"); |
37 |
final String fromDate = token.getEnv().getAttribute(getFromDateParam()); |
|
38 |
final String untilDate = token.getEnv().getAttribute(getUntilDateParam()); |
|
40 |
final String fromDate = StringUtils.isNoneBlank(from) ? from : token.getEnv().getAttribute(getFromDateParam());
|
|
41 |
final String untilDate = StringUtils.isNoneBlank(until) ? until :token.getEnv().getAttribute(getUntilDateParam());
|
|
39 | 42 |
|
40 | 43 |
final InterfaceDescriptor interfaceDescriptor = InterfaceDescriptor.newInstance(ifcNode); |
41 | 44 |
|
... | ... | |
86 | 89 |
this.eprParam = eprParam; |
87 | 90 |
} |
88 | 91 |
|
92 |
public String getFrom() { |
|
93 |
return from; |
|
94 |
} |
|
95 |
|
|
96 |
public void setFrom(String from) { |
|
97 |
this.from = from; |
|
98 |
} |
|
99 |
|
|
100 |
public String getUntil() { |
|
101 |
return until; |
|
102 |
} |
|
103 |
|
|
104 |
public void setUntil(String until) { |
|
105 |
this.until = until; |
|
106 |
} |
|
89 | 107 |
} |
Also available in: Unified diff
updated DateRangeCollectNode to be forced to use from_date if present in parameter date