1 |
31742
|
andrea.man
|
package eu.dnetlib.msro.workflows.nodes;
|
2 |
|
|
|
3 |
|
|
import static java.lang.String.format;
|
4 |
|
|
|
5 |
|
|
import org.apache.commons.logging.Log;
|
6 |
|
|
import org.apache.commons.logging.LogFactory;
|
7 |
|
|
|
8 |
|
|
import com.googlecode.sarasvati.Arc;
|
9 |
|
|
import com.googlecode.sarasvati.NodeToken;
|
10 |
|
|
|
11 |
|
|
import eu.dnetlib.msro.workflows.nodes.SimpleJobNode;
|
12 |
|
|
|
13 |
|
|
public class SetFormatInfoJobNode extends SimpleJobNode {
|
14 |
|
|
|
15 |
|
|
/**
|
16 |
|
|
* logger.
|
17 |
|
|
*/
|
18 |
|
|
private static final Log log = LogFactory.getLog(SetFormatInfoJobNode.class); // NOPMD by marko on 11/24/08 5:02 PM
|
19 |
|
|
|
20 |
|
|
private String format;
|
21 |
|
|
private String formatParam = "format";
|
22 |
|
|
|
23 |
|
|
private String layout;
|
24 |
|
|
private String layoutParam = "layout";
|
25 |
|
|
|
26 |
|
|
private String interpretation;
|
27 |
|
|
private String interpretationParam = "interpretation";
|
28 |
|
|
|
29 |
|
|
/**
|
30 |
|
|
* {@inheritDoc}
|
31 |
|
|
*
|
32 |
|
|
* @see com.googlecode.sarasvati.mem.MemNode#execute(com.googlecode.sarasvati.Engine, com.googlecode.sarasvati.NodeToken)
|
33 |
|
|
*/
|
34 |
|
|
@Override
|
35 |
|
|
public String execute(final NodeToken token) {
|
36 |
|
|
|
37 |
|
|
log.info(format("setting mdFromat: %s, layout: %s, interpretation: %s", getFormat(), getLayout(), getInterpretation()));
|
38 |
|
|
|
39 |
|
|
token.getEnv().setAttribute(getFormatParam(), getFormat());
|
40 |
|
|
token.getEnv().setAttribute(getLayoutParam(), getLayout());
|
41 |
|
|
token.getEnv().setAttribute(getInterpretationParam(), getInterpretation());
|
42 |
|
|
|
43 |
|
|
return Arc.DEFAULT_ARC;
|
44 |
|
|
}
|
45 |
|
|
|
46 |
|
|
public String getFormat() {
|
47 |
|
|
return format;
|
48 |
|
|
}
|
49 |
|
|
|
50 |
|
|
public void setFormat(final String format) {
|
51 |
|
|
this.format = format;
|
52 |
|
|
}
|
53 |
|
|
|
54 |
|
|
public String getLayout() {
|
55 |
|
|
return layout;
|
56 |
|
|
}
|
57 |
|
|
|
58 |
|
|
public void setLayout(final String layout) {
|
59 |
|
|
this.layout = layout;
|
60 |
|
|
}
|
61 |
|
|
|
62 |
|
|
public String getInterpretation() {
|
63 |
|
|
return interpretation;
|
64 |
|
|
}
|
65 |
|
|
|
66 |
|
|
public void setInterpretation(final String interpretation) {
|
67 |
|
|
this.interpretation = interpretation;
|
68 |
|
|
}
|
69 |
|
|
|
70 |
|
|
public String getFormatParam() {
|
71 |
|
|
return formatParam;
|
72 |
|
|
}
|
73 |
|
|
|
74 |
|
|
public void setFormatParam(final String formatParam) {
|
75 |
|
|
this.formatParam = formatParam;
|
76 |
|
|
}
|
77 |
|
|
|
78 |
|
|
public String getLayoutParam() {
|
79 |
|
|
return layoutParam;
|
80 |
|
|
}
|
81 |
|
|
|
82 |
|
|
public void setLayoutParam(final String layoutParam) {
|
83 |
|
|
this.layoutParam = layoutParam;
|
84 |
|
|
}
|
85 |
|
|
|
86 |
|
|
public String getInterpretationParam() {
|
87 |
|
|
return interpretationParam;
|
88 |
|
|
}
|
89 |
|
|
|
90 |
|
|
public void setInterpretationParam(final String interpretationParam) {
|
91 |
|
|
this.interpretationParam = interpretationParam;
|
92 |
|
|
}
|
93 |
|
|
|
94 |
|
|
}
|