1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package com.hack23.cia.web.impl.ui.application.views.user.country.pagemode;
20
21 import org.apache.commons.lang3.StringUtils;
22 import org.springframework.security.access.annotation.Secured;
23 import org.springframework.stereotype.Component;
24
25 import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup;
26 import com.hack23.cia.web.impl.ui.application.action.ViewAction;
27 import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode;
28 import com.vaadin.ui.Label;
29 import com.vaadin.ui.Layout;
30 import com.vaadin.ui.MenuBar;
31 import com.vaadin.ui.Panel;
32 import com.vaadin.ui.VerticalLayout;
33
34
35
36
37 @Component
38 public final class CountryRankingOverviewPageModContentFactoryImpl extends AbstractCountryPageModContentFactoryImpl {
39
40
41 private static final String OVERVIEW = "overview";
42
43
44
45
46
47 public CountryRankingOverviewPageModContentFactoryImpl() {
48 super();
49 }
50
51 @Override
52 public boolean matches(final String page, final String parameters) {
53 final String pageId = getPageId(parameters);
54 return NAME.equals(page) && (StringUtils.isEmpty(parameters) || parameters.equals(pageId)
55 || parameters.contains(PageMode.OVERVIEW.toString()));
56 }
57
58 @Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
59 @Override
60 public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
61 final VerticalLayout panelContent = createPanelContent();
62 getCountryMenuItemFactory().createCountryTopicMenu(menuBar);
63
64 final String pageId = getPageId(parameters);
65
66 panelContent.addComponent(new Label(OVERVIEW));
67
68 getCountryMenuItemFactory().createOverviewPage(panelContent);
69
70 getPageActionEventHelper().createPageEvent(ViewAction.VISIT_TEST_CHART_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
71 panel.setCaption(OVERVIEW);
72
73 return panelContent;
74
75 }
76
77 }