Project

General

Profile

1
package eu.dnetlib.functionality.modular.ui.repositories;
2

    
3
import javax.annotation.Resource;
4
import javax.servlet.http.HttpServletRequest;
5
import javax.servlet.http.HttpServletResponse;
6

    
7
import org.springframework.beans.factory.annotation.Required;
8
import org.springframework.ui.ModelMap;
9

    
10
import com.google.gson.Gson;
11

    
12
import eu.dnetlib.functionality.modular.ui.ModuleEntryPoint;
13

    
14
public class RepoEnablerEntryPointController extends ModuleEntryPoint {
15

    
16
	private String datasourceTypeVocabulary;
17

    
18
	@Resource
19
	private RepoUIUtils repoUIUtils;
20

    
21
	@Override
22
	protected void initialize(final ModelMap map, final HttpServletRequest request, final HttpServletResponse response) throws Exception {
23
		map.addAttribute("types", new Gson().toJson(repoUIUtils.fetchVocabularyTerms(getDatasourceTypeVocabulary())));
24
	}
25

    
26
	public String getDatasourceTypeVocabulary() {
27
		return datasourceTypeVocabulary;
28
	}
29

    
30
	@Required
31
	public void setDatasourceTypeVocabulary(final String datasourceTypeVocabulary) {
32
		this.datasourceTypeVocabulary = datasourceTypeVocabulary;
33
	}
34

    
35
}
(4-4/7)