Search in sources :

Example 11 with ViewRiksdagenMinistry

use of com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenMinistry in project cia by Hack23.

the class MinistryGovernmentBodiesModContentFactoryImpl 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();
    final String pageId = getPageId(parameters);
    final DataContainer<ViewRiksdagenMinistry, String> dataContainer = getApplicationManager().getDataContainer(ViewRiksdagenMinistry.class);
    final ViewRiksdagenMinistry viewRiksdagenMinistry = dataContainer.load(pageId);
    if (viewRiksdagenMinistry != null) {
        getMinistryMenuItemFactory().createMinistryMenuBar(menuBar, pageId);
        LabelFactory.createHeader2Label(panelContent, GOVERNMENT_BODIES);
        governmentBodyChartDataManager.createMinistryGovernmentBodyHeadcountSummaryChart(panelContent, viewRiksdagenMinistry.getNameId());
        panel.setCaption(NAME + "::" + MINISTRY + viewRiksdagenMinistry.getNameId());
        getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
    }
    return panelContent;
}
Also used : ViewRiksdagenMinistry(com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenMinistry) VerticalLayout(com.vaadin.ui.VerticalLayout) Secured(org.springframework.security.access.annotation.Secured)

Example 12 with ViewRiksdagenMinistry

use of com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenMinistry in project cia by Hack23.

the class MinistryRoleGhantPageModContentFactoryImpl 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();
    final String pageId = getPageId(parameters);
    final DataContainer<ViewRiksdagenMinistry, String> dataContainer = getApplicationManager().getDataContainer(ViewRiksdagenMinistry.class);
    final ViewRiksdagenMinistry viewRiksdagenMinistry = dataContainer.load(pageId);
    if (viewRiksdagenMinistry != null) {
        getMinistryMenuItemFactory().createMinistryMenuBar(menuBar, pageId);
        LabelFactory.createHeader2Label(panelContent, ROLE_GHANT);
        final DataContainer<ViewRiksdagenGovermentRoleMember, String> govermentRoleMemberDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenGovermentRoleMember.class);
        final List<ViewRiksdagenGovermentRoleMember> allMembers = govermentRoleMemberDataContainer.getAllBy(ViewRiksdagenGovermentRoleMember_.detail, viewRiksdagenMinistry.getNameId());
        ministryGhantChartManager.createRoleGhant(panelContent, allMembers);
        panel.setCaption(NAME + "::" + MINISTRY + viewRiksdagenMinistry.getNameId());
        getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
    }
    return panelContent;
}
Also used : ViewRiksdagenMinistry(com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenMinistry) ViewRiksdagenGovermentRoleMember(com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenGovermentRoleMember) VerticalLayout(com.vaadin.ui.VerticalLayout) Secured(org.springframework.security.access.annotation.Secured)

Aggregations

ViewRiksdagenMinistry (com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenMinistry)12 VerticalLayout (com.vaadin.ui.VerticalLayout)9 Secured (org.springframework.security.access.annotation.Secured)9 ViewRiksdagenGovermentRoleMember (com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenGovermentRoleMember)3 DataSeries (org.dussan.vaadin.dcharts.data.DataSeries)2 ViewRiksdagenPoliticianDocument (com.hack23.cia.model.internal.application.data.document.impl.ViewRiksdagenPoliticianDocument)1 Link (com.vaadin.ui.Link)1 Test (org.junit.Test)1