Project

General

Profile

1
package eu.dnetlib.msro.workflows.nodes.hadoop;
2

    
3
import java.util.List;
4
import java.util.Map;
5

    
6
import com.google.gson.Gson;
7
import eu.dnetlib.msro.workflows.graph.Arc;
8
import eu.dnetlib.msro.workflows.procs.Env;
9
import org.springframework.beans.factory.annotation.Required;
10

    
11
public class PrepareIISMainParamsJobNode extends PrepareIISParams {
12

    
13
	private String xqueryObjectStores;
14

    
15
	private String objectStoreParam = "import_content_objectstores_csv";
16

    
17
	// Enable/Disable inference modules
18

    
19
	@Override
20
	protected String execute(final Env env) throws Exception {
21

    
22
		super.prepare(env);
23

    
24
		env.setAttribute(getObjectStoreParam(), getFilteredObjectStoreCSV(getXqueryObjectStores()));
25

    
26
		@SuppressWarnings("unchecked")
27
		final List<Map<String, String>> sets = new Gson().fromJson(env.getAttribute("sets", String.class), List.class);
28
		for (final Map<String, String> set : sets) {
29
			env.setAttribute(set.get("enablingProperty"), set.get("enabled"));
30
		}
31

    
32
		return Arc.DEFAULT_ARC;
33
	}
34

    
35
	public String getXqueryObjectStores() {
36
		return this.xqueryObjectStores;
37
	}
38

    
39
	@Required
40
	public void setXqueryObjectStores(final String xqueryObjectStores) {
41
		this.xqueryObjectStores = xqueryObjectStores;
42
	}
43

    
44
	public String getObjectStoreParam() {
45
		return this.objectStoreParam;
46
	}
47

    
48
	public void setObjectStoreParam(final String objectStoreParam) {
49
		this.objectStoreParam = objectStoreParam;
50
	}
51

    
52
}
(14-14/22)