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.admin.system.pagemode;
20
21 import org.springframework.beans.factory.annotation.Autowired;
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.chartfactory.api.AdminChartDataManager;
28 import com.hack23.cia.web.impl.ui.application.views.common.labelfactory.LabelFactory;
29 import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews;
30 import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode;
31 import com.vaadin.ui.Layout;
32 import com.vaadin.ui.MenuBar;
33 import com.vaadin.ui.Panel;
34 import com.vaadin.ui.VerticalLayout;
35
36
37
38
39 @Component
40 public final class AdminApplicationEventsChartsPageModContentFactoryImpl
41 extends AbstractAdminSystemPageModContentFactoryImpl {
42
43
44 private static final String ADMIN_APPLICATION_ACTION_EVENT = "Admin Application Action Event chart";
45
46
47 public static final String NAME = AdminViews.ADMIN_APPLICATIONS_EVENTS_VIEW_NAME;
48
49
50 @Autowired
51 private AdminChartDataManager chartDataManager;
52
53
54
55
56
57 public AdminApplicationEventsChartsPageModContentFactoryImpl() {
58 super();
59 }
60
61 @Override
62 public boolean matches(final String page, final String parameters) {
63 return parameters != null && NAME.equals(page) && parameters.contains(PageMode.CHARTS.toString());
64 }
65
66 @Secured({ "ROLE_ADMIN" })
67 @Override
68 public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
69 final VerticalLayout content = createPanelContent();
70
71 final String pageId = getPageId(parameters);
72
73 getMenuItemFactory().createMainPageMenuBar(menuBar);
74
75 LabelFactory.createHeader2Label(content, ADMIN_APPLICATION_ACTION_EVENT);
76
77 chartDataManager.createApplicationActionEventPageDailySummaryChart(content);
78
79 getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_APPLICATION_EVENTS_VIEW,
80 ApplicationEventGroup.ADMIN, NAME, null, pageId);
81
82 return content;
83
84 }
85
86 }