Project

General

Profile

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

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

    
6
import org.springframework.beans.factory.annotation.Required;
7

    
8
import com.google.gson.Gson;
9
import com.googlecode.sarasvati.Arc;
10
import com.googlecode.sarasvati.NodeToken;
11

    
12
@Deprecated
13
public class PrepareIISMainParamsJobNode extends PrepareIISParams {
14

    
15
	private String xqueryObjectStores;
16

    
17
	private String objectStoreParam = "import_content_objectstores_csv";
18

    
19
	// Enable/Disable inference modules
20

    
21
	@Override
22
	protected String execute(final NodeToken token) throws Exception {
23

    
24
		super.prepare(token);
25

    
26
		token.getEnv().setAttribute(getObjectStoreParam(), getFilteredObjectStoreCSV(getXqueryObjectStores()));
27

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

    
34
		return Arc.DEFAULT_ARC;
35
	}
36

    
37
	public String getXqueryObjectStores() {
38
		return xqueryObjectStores;
39
	}
40

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

    
46
	public String getObjectStoreParam() {
47
		return objectStoreParam;
48
	}
49

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

    
54
}
(10-10/21)