Search in sources :

Example 1 with ViewRiksdagenGovermentRoleMember

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

the class MinistryMemberHistoryPageModContentFactoryImpl 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, MEMBER_HISTORY);
        final DataContainer<ViewRiksdagenGovermentRoleMember, String> govermentRoleMemberDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenGovermentRoleMember.class);
        getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenGovermentRoleMember.class, govermentRoleMemberDataContainer.getAllBy(ViewRiksdagenGovermentRoleMember_.detail, viewRiksdagenMinistry.getNameId()), MEMBER_HISTORY, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);
        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)

Example 2 with ViewRiksdagenGovermentRoleMember

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

the class MinistryCurrentMembersPageModContentFactoryImpl 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, CURRENT_MEMBERS);
        final DataContainer<ViewRiksdagenGovermentRoleMember, String> govermentRoleMemberDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenGovermentRoleMember.class);
        getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenGovermentRoleMember.class, govermentRoleMemberDataContainer.findListByProperty(new Object[] { viewRiksdagenMinistry.getNameId(), Boolean.TRUE }, ViewRiksdagenGovermentRoleMember_.detail, ViewRiksdagenGovermentRoleMember_.active), CURRENT_MEMBERS, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);
        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)

Example 3 with ViewRiksdagenGovermentRoleMember

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

the class PartyGovernmentRolesPageModContentFactoryImpl 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<ViewRiksdagenParty, String> dataContainer = getApplicationManager().getDataContainer(ViewRiksdagenParty.class);
    final ViewRiksdagenParty viewRiksdagenParty = dataContainer.load(pageId);
    if (viewRiksdagenParty != null) {
        getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId);
        LabelFactory.createHeader2Label(panelContent, GOVERNMENT_ROLES);
        final DataContainer<ViewRiksdagenGovermentRoleMember, String> govermentRoleMemberDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenGovermentRoleMember.class);
        getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenGovermentRoleMember.class, govermentRoleMemberDataContainer.findListByProperty(new Object[] { viewRiksdagenParty.getPartyId(), Boolean.TRUE }, ViewRiksdagenGovermentRoleMember_.party, ViewRiksdagenGovermentRoleMember_.active), GOVERNMENT_ROLES, COLUMN_ORDER, HIDE_COLUMNS, new PageItemPropertyClickListener(UserViews.POLITICIAN_VIEW_NAME, PERSON_ID), null, null);
        pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
    }
    return panelContent;
}
Also used : ViewRiksdagenGovermentRoleMember(com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenGovermentRoleMember) ViewRiksdagenParty(com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty) PageItemPropertyClickListener(com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener) VerticalLayout(com.vaadin.ui.VerticalLayout) Secured(org.springframework.security.access.annotation.Secured)

Example 4 with ViewRiksdagenGovermentRoleMember

use of com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenGovermentRoleMember 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)

Example 5 with ViewRiksdagenGovermentRoleMember

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

the class MinistryRankingAllRolesChartsPageModContentFactoryImpl 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();
    getMinistryRankingMenuItemFactory().createMinistryRankingMenuBar(menuBar);
    final String pageId = getPageId(parameters);
    final HorizontalLayout chartLayout = new HorizontalLayout();
    chartLayout.setSizeFull();
    final DataContainer<ViewRiksdagenGovermentRoleMember, String> govermentRoleMemberDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenGovermentRoleMember.class);
    final List<ViewRiksdagenGovermentRoleMember> allMembers = govermentRoleMemberDataContainer.getAll();
    ministryGhantChartManager.createRoleGhant(panelContent, allMembers);
    panel.setCaption(NAME + "::" + CHARTS + parameters);
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_RANKING_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
    return panelContent;
}
Also used : ViewRiksdagenGovermentRoleMember(com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenGovermentRoleMember) VerticalLayout(com.vaadin.ui.VerticalLayout) HorizontalLayout(com.vaadin.ui.HorizontalLayout) Secured(org.springframework.security.access.annotation.Secured)

Aggregations

ViewRiksdagenGovermentRoleMember (com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenGovermentRoleMember)5 VerticalLayout (com.vaadin.ui.VerticalLayout)5 Secured (org.springframework.security.access.annotation.Secured)5 ViewRiksdagenMinistry (com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenMinistry)3 ViewRiksdagenParty (com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty)1 PageItemPropertyClickListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener)1 HorizontalLayout (com.vaadin.ui.HorizontalLayout)1