Project

General

Profile

1 27368 claudio.at
package eu.dnetlib.msro.openaireplus.workflows.nodes;
2
3 32863 claudio.at
import java.util.List;
4
import java.util.Map;
5
6
import com.google.gson.Gson;
7 27368 claudio.at
import com.googlecode.sarasvati.Arc;
8
import com.googlecode.sarasvati.NodeToken;
9 48139 alessia.ba
import org.springframework.beans.factory.annotation.Required;
10 27368 claudio.at
11 43593 claudio.at
@Deprecated
12 27525 claudio.at
public class PrepareIISMainParamsJobNode extends PrepareIISParams {
13 27368 claudio.at
14
	private String xqueryObjectStores;
15
16
	private String objectStoreParam = "import_content_objectstores_csv";
17
18
	// Enable/Disable inference modules
19
20
	@Override
21
	protected String execute(final NodeToken token) throws Exception {
22
23 27525 claudio.at
		super.prepare(token);
24
25 31423 claudio.at
		token.getEnv().setAttribute(getObjectStoreParam(), getFilteredObjectStoreCSV(getXqueryObjectStores()));
26 27368 claudio.at
27 48139 alessia.ba
		@SuppressWarnings("unchecked")		final List<Map<String, String>> sets = new Gson().fromJson(token.getEnv().getAttribute("sets"), List.class);
28 32863 claudio.at
		for (Map<String, String> set : sets) {
29
			token.getEnv().setAttribute(set.get("enablingProperty"), set.get("enabled"));
30
		}
31 27368 claudio.at
32
		return Arc.DEFAULT_ARC;
33
	}
34
35
	public String getXqueryObjectStores() {
36
		return xqueryObjectStores;
37
	}
38
39
	@Required
40 28824 claudio.at
	public void setXqueryObjectStores(final String xqueryObjectStores) {
41 27368 claudio.at
		this.xqueryObjectStores = xqueryObjectStores;
42
	}
43
44
	public String getObjectStoreParam() {
45
		return objectStoreParam;
46
	}
47
48 28824 claudio.at
	public void setObjectStoreParam(final String objectStoreParam) {
49 27368 claudio.at
		this.objectStoreParam = objectStoreParam;
50
	}
51
52
}