Search in sources :

Example 51 with Secured

use of org.springframework.security.access.annotation.Secured in project cia by Hack23.

the class ParliamentChartsPartyAgePageModContentFactoryImpl method createContent.

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();
    getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar);
    final String pageId = getPageId(parameters);
    partyChartDataManager.createPartyAgeChart(panelContent);
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_PARLIAMENT_RANKING_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
    panel.setCaption(NAME + "::" + PARTY_AGE_DAILY_AVERAGE_FOR_ALL_BALLOTS);
    return panelContent;
}
Also used : VerticalLayout(com.vaadin.ui.VerticalLayout) Secured(org.springframework.security.access.annotation.Secured)

Example 52 with Secured

use of org.springframework.security.access.annotation.Secured in project cia by Hack23.

the class ParliamentChartsPartyGenderPageModContentFactoryImpl method createContent.

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();
    getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar);
    final String pageId = getPageId(parameters);
    partyChartDataManager.createPartyGenderChart(panelContent);
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_PARLIAMENT_RANKING_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
    panel.setCaption(NAME + "::" + PARTY_GENDER_DAILY_AVERAGE_FOR_ALL_BALLOTS);
    return panelContent;
}
Also used : VerticalLayout(com.vaadin.ui.VerticalLayout) Secured(org.springframework.security.access.annotation.Secured)

Example 53 with Secured

use of org.springframework.security.access.annotation.Secured in project cia by Hack23.

the class ParliamentChartsPartyWinnerPageModContentFactoryImpl method createContent.

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();
    getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar);
    final String pageId = getPageId(parameters);
    partyChartDataManager.createPartyWinnerChart(panelContent);
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_PARLIAMENT_RANKING_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
    panel.setCaption(NAME + "::" + PARTY_WINNER_DAILY_AVERAGE_FOR_ALL_BALLOTS);
    return panelContent;
}
Also used : VerticalLayout(com.vaadin.ui.VerticalLayout) Secured(org.springframework.security.access.annotation.Secured)

Example 54 with Secured

use of org.springframework.security.access.annotation.Secured in project cia by Hack23.

the class ParliamentOverviewPageModContentFactoryImpl method createContent.

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();
    getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar);
    final String pageId = getPageId(parameters);
    panelContent.addComponent(new Label(OVERVIEW));
    getParliamentMenuItemFactory().createOverviewPage(panelContent);
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_PARLIAMENT_RANKING_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
    panel.setCaption(NAME + "::" + OVERVIEW);
    return panelContent;
}
Also used : Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout) Secured(org.springframework.security.access.annotation.Secured)

Example 55 with Secured

use of org.springframework.security.access.annotation.Secured in project cia by Hack23.

the class ParliamentRiskPageModContentFactoryImpl method createContent.

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();
    getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar);
    final String pageId = getPageId(parameters);
    final ComplianceCheckRequest serviceRequest = new ComplianceCheckRequest();
    serviceRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
    final ComplianceCheckResponse serviceResponse = (ComplianceCheckResponse) getApplicationManager().service(serviceRequest);
    final HorizontalLayout horizontalLayout = new HorizontalLayout();
    for (final Entry<Status, List<RuleViolation>> statusEntry : serviceResponse.getStatusMap().entrySet()) {
        horizontalLayout.addComponent(new CounterStatisticsCard(VaadinIcons.WARNING, new CounterStatisticModel("ALL:" + statusEntry.getKey(), statusEntry.getValue().size()).withShow(StatisticShow.Sum).withIconHidden().withShowOnlyStatistic(true), "ALL:" + statusEntry.getKey()));
    }
    for (final Entry<ResourceType, List<RuleViolation>> statusEntry : serviceResponse.getResourceTypeMap().entrySet()) {
        horizontalLayout.addComponent(new CounterStatisticsCard(VaadinIcons.WARNING, new CounterStatisticModel("ALL:" + statusEntry.getKey(), statusEntry.getValue().size()).withShow(StatisticShow.Sum).withIconHidden().withShowOnlyStatistic(true), "ALL:" + statusEntry.getKey()));
    }
    panelContent.addComponent(horizontalLayout);
    getGridFactory().createBasicBeanItemGrid(panelContent, ComplianceCheck.class, serviceResponse.getList(), "Risk", new String[] { "name", "resourceType", "numberRuleViolations", "ruleSummary" }, new String[] { "id", "ruleViolations" }, CLICK_LISTENER, null, null);
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_PARLIAMENT_RANKING_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
    panel.setCaption(new StringBuilder().append(NAME).append("::").append(PARLIAMENT_RISK_SUMMARY).toString());
    return panelContent;
}
Also used : Status(com.hack23.cia.service.api.action.kpi.Status) CounterStatisticsCard(com.github.markash.ui.component.card.CounterStatisticsCard) ComplianceCheckResponse(com.hack23.cia.service.api.action.kpi.ComplianceCheckResponse) ResourceType(com.hack23.cia.service.api.action.kpi.ResourceType) HorizontalLayout(com.vaadin.ui.HorizontalLayout) VerticalLayout(com.vaadin.ui.VerticalLayout) List(java.util.List) CounterStatisticModel(com.github.markash.ui.component.card.CounterStatisticModel) ComplianceCheckRequest(com.hack23.cia.service.api.action.kpi.ComplianceCheckRequest) Secured(org.springframework.security.access.annotation.Secured)

Aggregations

Secured (org.springframework.security.access.annotation.Secured)260 VerticalLayout (com.vaadin.ui.VerticalLayout)117 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)52 ForbiddenUserException (org.asqatasun.webapp.exception.ForbiddenUserException)23 HorizontalLayout (com.vaadin.ui.HorizontalLayout)20 CollectSurvey (org.openforis.collect.model.CollectSurvey)20 UserAccount (com.hack23.cia.model.internal.application.user.impl.UserAccount)18 Contract (org.asqatasun.entity.contract.Contract)17 ForbiddenPageException (org.asqatasun.webapp.exception.ForbiddenPageException)16 Timed (com.codahale.metrics.annotation.Timed)14 ViewRiksdagenParty (com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty)14 CreateApplicationEventRequest (com.hack23.cia.service.api.action.application.CreateApplicationEventRequest)14 URI (java.net.URI)14 User (org.asqatasun.entity.user.User)14 ViewRiksdagenCommittee (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommittee)13 ViewRiksdagenPolitician (com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician)13 SessionState (org.openforis.collect.web.session.SessionState)13 CollectRecord (org.openforis.collect.model.CollectRecord)12 DocumentElement (com.hack23.cia.model.external.riksdagen.dokumentlista.impl.DocumentElement)11 ArrayList (java.util.ArrayList)11