My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package nl.gridshore.samples.training.web.controllers.employee;

import org.springframework.stereotype.Controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import nl.gridshore.samples.training.business.EmployeeService;
import nl.gridshore.samples.training.business.TrainingService;
import nl.gridshore.samples.training.domain.Employee;

/**
* Created by IntelliJ IDEA.
* User: jettro
* Date: Jan 30, 2008
* Time: 8:44:13 AM
* Controller class that handles all incoming request that do not have to deal with changing data
*/
@Controller
public class EmployeeController {
private EmployeeService employeeService;
private TrainingService trainingService;

@Autowired
public EmployeeController(EmployeeService employeeService, TrainingService trainingService) {
this.employeeService = employeeService;
this.trainingService = trainingService;
}

@RequestMapping("/employees.view")
public ModelMap employeesHandler() {
return new ModelMap("employeesList",employeeService.obtainAllEmployees());
}

@RequestMapping("/employee.view")
public ModelMap employeeHandler(@RequestParam("employeeId") Long employeeId) {
return new ModelMap(employeeService.obtainEmployeeById(employeeId));
}

// @RequestMapping("/showplannedtraining.view,/showwishedtraining.view")
@RequestMapping(value = {"/showplannedtraining.view","/showwishedtraining.view"})
public ModelMap showTrainingPlanForEmployeeHandler(@RequestParam("employeeId") Long employeeId) {
ModelMap map = new ModelMap(employeeService.obtainEmployeeById(employeeId));
map.addAttribute("trainingList",trainingService.obtainAllTrainings());
return map;
}

// @RequestMapping("/showwishedtraining.view")
// public ModelMap showTrainingWishesForEmployeeHandler(@RequestParam("employeeId") Long employeeId) {
// ModelMap map = new ModelMap(employeeService.obtainEmployeeById(employeeId));
// map.addAttribute("trainingList",trainingService.obtainAllTrainings());
// return map;
// }

}

Change log

r98 by jettro.coenradie on Feb 4, 2008   Diff
basic stuff is now available, you can
enrol employees for a training session,
and you can mark an employee interested in
a training
Go to: 
Project members, sign in to write a code review

Older revisions

r97 by jettro.coenradie on Feb 1, 2008   Diff
Added a lot of stuff based on
employees. I also started doing more
with the ajax capabilities of jquery.
Now you can select a training session
for an employee.
All revisions of this file

File info

Size: 2309 bytes, 56 lines
Powered by Google Project Hosting