TestDataView.java
1.57 KB
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
57
58
59
60
61
62
63
64
65
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.view;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.RequestScoped;
import fi.insomnia.bortal.beans.TestDataBeanLocal;
import fi.insomnia.bortal.beans.UserBeanLocal;
import fi.insomnia.bortal.handler.SessionHandler;
import fi.insomnia.bortal.model.Event;
import fi.insomnia.bortal.model.EventMap;
import fi.insomnia.bortal.model.User;
/**
*
* @author tuukka
*/
@ManagedBean(name = "TestDataView")
@RequestScoped
public class TestDataView {
@EJB
private TestDataBeanLocal testdatabean;
@EJB
private UserBeanLocal userbean;
@ManagedProperty("#{sessionHandler}")
private SessionHandler sessionhandler;
public void generateData() {
Event event = getSessionhandler().getCurrentEvent();
User user = testdatabean.createUser();
testdatabean.createBill(event, user);
EventMap map = testdatabean.generateTestMap(event);
testdatabean.generateTestPlaces(map);
// testdatabean.generateTestCompos(event);
}
/** Creates a new instance of TestDataView */
public TestDataView() {
}
public void setSessionhandler(SessionHandler sessionhandler) {
this.sessionhandler = sessionhandler;
}
public SessionHandler getSessionhandler() {
return sessionhandler;
}
public String printPlacesInfo() {
testdatabean.printPlacesInfo();
return null;
}
}