Projekt

Obecné

Profil

Stáhnout (1.54 KB) Statistiky
| Větev: | Revize:
1
package vldc.aswi.web.controller;
2

    
3
import org.springframework.beans.factory.annotation.Autowired;
4
import org.springframework.stereotype.Controller;
5
import org.springframework.ui.ModelMap;
6
import org.springframework.web.bind.annotation.GetMapping;
7
import org.springframework.web.bind.annotation.ModelAttribute;
8
import org.springframework.web.bind.annotation.PostMapping;
9
import org.springframework.web.servlet.ModelAndView;
10
import vldc.aswi.database.DatabaseInterface;
11
import vldc.aswi.domain.Assembly;
12
import vldc.aswi.model.table.TableColumn;
13
import vldc.aswi.model.table.contingencyTable.ContingencyTableRow;
14
import vldc.aswi.model.table.contingencyTable.ContingencyTableRowCell;
15
import vldc.aswi.service.AssemblyManager;
16
import vldc.aswi.service.SqlQueryManager;
17
import vldc.aswi.utils.Converter;
18

    
19
import javax.sql.DataSource;
20
import javax.validation.Valid;
21
import java.util.ArrayList;
22
import java.util.List;
23
import java.util.Map;
24

    
25
@Controller
26
public class IndexController {
27

    
28
	@Autowired
29
	private SqlQueryManager sqlQueryManager;
30

    
31
	@Autowired
32
	private AssemblyManager assemblyManager;
33

    
34
	@GetMapping("/")
35
	public ModelAndView index() {
36
		ModelAndView modelAndView = new ModelAndView("index");
37

    
38
		ModelMap modelMap = modelAndView.getModelMap();
39

    
40
		modelMap.addAttribute("assemblies", assemblyManager.getAssemblies());
41

    
42
		return modelAndView;
43
	}
44

    
45
	@PostMapping("/")
46
	public ModelAndView indexPost(@Valid @ModelAttribute("assemblyID") String id) {
47
		ModelAndView modelAndView = new ModelAndView();
48
		modelAndView.setViewName("redirect:/assembly");
49

    
50
		return modelAndView;
51
	}
52

    
53
}
(2-2/3)