1
2
3
4
5 package com.hack23.cia.web.viewfactory.api.user;
6
7 import java.util.List;
8
9 import com.hack23.cia.model.application.dto.common.UserSessionDTO;
10 import com.hack23.cia.model.sweden.impl.PoliticalParty;
11 import com.hack23.cia.web.action.common.ControllerAction;
12
13 /***
14 * The Class UserModelAndView.
15 */
16 public class UserModelAndView extends AbstractUserModelAndView {
17
18 /***
19 * The Enum UserViewSpecification.
20 */
21 public enum UserViewSpecification {
22
23 /*** The Login view. */
24 LoginView,
25
26 /*** The Logout view. */
27 LogoutView,
28
29 /*** The User history view. */
30 UserHistoryView,
31
32 /*** The User home view. */
33 UserHomeView,
34
35 /*** The Welcome page view. */
36 WelcomePageView
37 }
38
39 /*** The Constant serialVersionUID. */
40 private static final long serialVersionUID = 1L;
41
42 /*** The political parties. */
43 private final List<PoliticalParty> politicalParties;
44
45 /*** The user view specification. */
46 private final UserViewSpecification userViewSpecification;
47
48 /***
49 * Instantiates a new user model and view.
50 *
51 * @param userSessionDTO the user session dto
52 * @param politicalParties the political parties
53 * @param controllerAction the controller action
54 * @param userViewSpecification the user view specification
55 */
56 public UserModelAndView(final UserSessionDTO userSessionDTO,final List<PoliticalParty> politicalParties,
57 final ControllerAction controllerAction,
58 final UserViewSpecification userViewSpecification) {
59 super(userSessionDTO, controllerAction);
60 this.politicalParties = politicalParties;
61 this.userViewSpecification = userViewSpecification;
62 }
63
64 /***
65 * Gets the political parties.
66 *
67 * @return the political parties
68 */
69 public final List<PoliticalParty> getPoliticalParties() {
70 return politicalParties;
71 }
72
73 /***
74 * Gets the user view specification.
75 *
76 * @return the user view specification
77 */
78 public final UserViewSpecification getUserViewSpecification() {
79 return userViewSpecification;
80 }
81
82
83
84
85
86
87
88 @Override
89 public final String getViewSpecificationDescription() {
90 return userViewSpecification.toString();
91 }
92
93 }