1 |
47707
|
michele.ar
|
package eu.dnetlib.msro.workflows.nodes.mdstore;
|
2 |
47345
|
michele.ar
|
|
3 |
|
|
import org.apache.commons.logging.Log;
|
4 |
|
|
import org.apache.commons.logging.LogFactory;
|
5 |
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
6 |
|
|
import org.springframework.context.annotation.Scope;
|
7 |
|
|
import org.springframework.stereotype.Component;
|
8 |
|
|
|
9 |
|
|
import eu.dnetlib.data.mdstore.MDStoreService;
|
10 |
|
|
import eu.dnetlib.msro.annotations.ProcessNode;
|
11 |
|
|
import eu.dnetlib.msro.workflows.Arc;
|
12 |
47491
|
michele.ar
|
import eu.dnetlib.msro.workflows.nodes.SimpleParallelProcessNode;
|
13 |
47345
|
michele.ar
|
|
14 |
|
|
@Component
|
15 |
|
|
@Scope("prototype")
|
16 |
|
|
@ProcessNode("CreateMDStore")
|
17 |
47491
|
michele.ar
|
public class CreateMDStoreJobNode extends SimpleParallelProcessNode {
|
18 |
47345
|
michele.ar
|
|
19 |
|
|
private static final Log log = LogFactory.getLog(CreateMDStoreJobNode.class);
|
20 |
|
|
|
21 |
|
|
@Autowired
|
22 |
|
|
private MDStoreService mdstoreService;
|
23 |
|
|
|
24 |
|
|
private String format;
|
25 |
|
|
|
26 |
|
|
private String layout;
|
27 |
|
|
|
28 |
|
|
private String interpretation;
|
29 |
|
|
|
30 |
47494
|
michele.ar
|
private String resultMdId;
|
31 |
47345
|
michele.ar
|
|
32 |
|
|
@Override
|
33 |
|
|
protected String execute() throws Exception {
|
34 |
47494
|
michele.ar
|
resultMdId = mdstoreService.create(format, layout, interpretation);
|
35 |
|
|
log.info("New mdstore " + resultMdId);
|
36 |
47345
|
michele.ar
|
return Arc.DEFAULT_ARC;
|
37 |
|
|
}
|
38 |
|
|
|
39 |
|
|
public String getFormat() {
|
40 |
|
|
return format;
|
41 |
|
|
}
|
42 |
|
|
|
43 |
|
|
public void setFormat(final String format) {
|
44 |
|
|
this.format = format;
|
45 |
|
|
}
|
46 |
|
|
|
47 |
|
|
public String getLayout() {
|
48 |
|
|
return layout;
|
49 |
|
|
}
|
50 |
|
|
|
51 |
|
|
public void setLayout(final String layout) {
|
52 |
|
|
this.layout = layout;
|
53 |
|
|
}
|
54 |
|
|
|
55 |
|
|
public String getInterpretation() {
|
56 |
|
|
return interpretation;
|
57 |
|
|
}
|
58 |
|
|
|
59 |
|
|
public void setInterpretation(final String interpretation) {
|
60 |
|
|
this.interpretation = interpretation;
|
61 |
|
|
}
|
62 |
|
|
|
63 |
47494
|
michele.ar
|
public String getResultMdId() {
|
64 |
|
|
return resultMdId;
|
65 |
47345
|
michele.ar
|
}
|
66 |
|
|
|
67 |
47494
|
michele.ar
|
public void setResultMdId(final String resultMdId) {
|
68 |
|
|
this.resultMdId = resultMdId;
|
69 |
47345
|
michele.ar
|
}
|
70 |
47494
|
michele.ar
|
|
71 |
47345
|
michele.ar
|
}
|