1
|
package eu.dnetlib.msro.workflows.nodes.oai;
|
2
|
|
3
|
import eu.dnetlib.enabling.tools.blackboard.BlackboardJob;
|
4
|
import eu.dnetlib.msro.workflows.procs.Env;
|
5
|
import eu.dnetlib.msro.workflows.procs.Token;
|
6
|
import org.apache.commons.lang3.StringUtils;
|
7
|
|
8
|
public class OAIDropStoreJobNode extends AbstractOAIJobNode {
|
9
|
|
10
|
private String formatParam, layoutParam, interpretationParam;
|
11
|
// name of the env attribute where you can find the set name
|
12
|
private String setSpecParam;
|
13
|
private String setSpec;
|
14
|
|
15
|
private String oai_dbName;
|
16
|
|
17
|
@Override
|
18
|
void completePrepareJob(final BlackboardJob job, final Token token) {
|
19
|
job.setAction("DROP_STORE");
|
20
|
job.getParameters().put("format", token.getEnv().getAttribute(this.formatParam, String.class));
|
21
|
job.getParameters().put("layout", token.getEnv().getAttribute(this.layoutParam, String.class));
|
22
|
job.getParameters().put("interpretation", token.getEnv().getAttribute(this.interpretationParam, String.class));
|
23
|
job.getParameters().put("oai_dbName", getOai_dbName());
|
24
|
final String set = getTheSetName(token.getEnv());
|
25
|
if (StringUtils.isNotBlank(set)) {
|
26
|
job.getParameters().put("set", set);
|
27
|
}
|
28
|
}
|
29
|
|
30
|
private String getTheSetName(final Env env) {
|
31
|
if (StringUtils.isNotBlank(this.setSpec)) {
|
32
|
return this.setSpec;
|
33
|
} else {
|
34
|
return env.getAttribute(this.setSpecParam, String.class);
|
35
|
}
|
36
|
|
37
|
}
|
38
|
|
39
|
public String getOai_dbName() {
|
40
|
|
41
|
return oai_dbName;
|
42
|
}
|
43
|
|
44
|
public void setOai_dbName(final String oai_dbName) {
|
45
|
this.oai_dbName = oai_dbName;
|
46
|
}
|
47
|
|
48
|
public String getFormatParam() {
|
49
|
return this.formatParam;
|
50
|
}
|
51
|
|
52
|
public void setFormatParam(final String formatParam) {
|
53
|
this.formatParam = formatParam;
|
54
|
}
|
55
|
|
56
|
public String getLayoutParam() {
|
57
|
return this.layoutParam;
|
58
|
}
|
59
|
|
60
|
public void setLayoutParam(final String layoutParam) {
|
61
|
this.layoutParam = layoutParam;
|
62
|
}
|
63
|
|
64
|
public String getInterpretationParam() {
|
65
|
return this.interpretationParam;
|
66
|
}
|
67
|
|
68
|
public void setInterpretationParam(final String interpretationParam) {
|
69
|
this.interpretationParam = interpretationParam;
|
70
|
}
|
71
|
|
72
|
public String getSetNameParam() {
|
73
|
return this.setSpecParam;
|
74
|
}
|
75
|
|
76
|
public void setSetNameParam(final String setNameParam) {
|
77
|
this.setSpecParam = setNameParam;
|
78
|
}
|
79
|
|
80
|
public String getSetName() {
|
81
|
return this.setSpec;
|
82
|
}
|
83
|
|
84
|
public void setSetName(final String setName) {
|
85
|
this.setSpec = setName;
|
86
|
}
|
87
|
|
88
|
}
|