Search in sources :

Example 6 with ViewRiksdagenParty

use of com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty in project cia by Hack23.

the class PartyRoleGhantPageModContentFactoryImpl 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, ROLE_GHANT);
        final DataContainer<ViewRiksdagenPartyRoleMember, String> partyRoleMemberDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenPartyRoleMember.class);
        final List<ViewRiksdagenPartyRoleMember> allMembers = partyRoleMemberDataContainer.getAllBy(ViewRiksdagenPartyRoleMember_.party, viewRiksdagenParty.getPartyId());
        partyGhantChartManager.createRoleGhant(panelContent, allMembers);
        pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
    }
    return panelContent;
}
Also used : ViewRiksdagenParty(com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty) ViewRiksdagenPartyRoleMember(com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartyRoleMember) VerticalLayout(com.vaadin.ui.VerticalLayout) Secured(org.springframework.security.access.annotation.Secured)

Example 7 with ViewRiksdagenParty

use of com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty in project cia by Hack23.

the class PartyVoteHistoryPageModContentFactoryImpl 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, VOTE_HISTORY);
        getGridFactory().createBasicBeanItemNestedPropertiesGrid(panelContent, ViewRiksdagenVoteDataBallotPartySummary.class, viewRiksdagenVoteDataBallotPartySummaryChartDataManager.findByValue(pageId), BALLOTS, NESTED_PROPERTIES, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, EMBEDDED_ID_BALLOT_ID, null);
        pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
    }
    return panelContent;
}
Also used : ViewRiksdagenParty(com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty) VerticalLayout(com.vaadin.ui.VerticalLayout) Secured(org.springframework.security.access.annotation.Secured)

Example 8 with ViewRiksdagenParty

use of com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty in project cia by Hack23.

the class MinistryDataSeriesFactoryImpl method createChartTimeSeriesTotalDaysServedGovernmentByParty.

@Override
public DataSeries createChartTimeSeriesTotalDaysServedGovernmentByParty() {
    DataSeries dataSeries = new DataSeries();
    final DataContainer<ViewRiksdagenParty, String> dataContainer = applicationManager.getDataContainer(ViewRiksdagenParty.class);
    final DataContainer<ViewRiksdagenPartySummary, String> partySummarydataContainer = applicationManager.getDataContainer(ViewRiksdagenPartySummary.class);
    partySummarydataContainer.getAll();
    for (final ViewRiksdagenParty data : dataContainer.getAll()) {
        final ViewRiksdagenPartySummary summary = partySummarydataContainer.load(data.getPartyId());
        if (summary != null && summary.isActive()) {
            dataSeries = dataSeries.newSeries().add(data.getPartyName(), summary.getTotalDaysServedGovernment());
        }
    }
    return dataSeries;
}
Also used : ViewRiksdagenParty(com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty) ViewRiksdagenPartySummary(com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartySummary) DataSeries(org.dussan.vaadin.dcharts.data.DataSeries)

Example 9 with ViewRiksdagenParty

use of com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty in project cia by Hack23.

the class PartyDataSeriesFactoryImpl method createChartTimeSeriesCurrentCommitteeByParty.

@Override
public DataSeries createChartTimeSeriesCurrentCommitteeByParty() {
    DataSeries dataSeries = new DataSeries();
    final DataContainer<ViewRiksdagenParty, String> dataContainer = applicationManager.getDataContainer(ViewRiksdagenParty.class);
    final DataContainer<ViewRiksdagenPartySummary, String> partySummarydataContainer = applicationManager.getDataContainer(ViewRiksdagenPartySummary.class);
    partySummarydataContainer.getAll();
    for (final ViewRiksdagenParty data : dataContainer.getAll()) {
        final ViewRiksdagenPartySummary summary = partySummarydataContainer.load(data.getPartyId());
        if (summary != null && summary.isActive()) {
            dataSeries = dataSeries.newSeries().add(data.getPartyName(), summary.getTotalActiveCommittee());
        }
    }
    return dataSeries;
}
Also used : ViewRiksdagenParty(com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty) ViewRiksdagenPartySummary(com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartySummary) DataSeries(org.dussan.vaadin.dcharts.data.DataSeries)

Example 10 with ViewRiksdagenParty

use of com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty in project cia by Hack23.

the class PartyDataSeriesFactoryImpl method createPartyChartTimeSeriesAll.

@Override
public DataSeries createPartyChartTimeSeriesAll() {
    DataSeries dataSeries = new DataSeries();
    final DataContainer<ViewRiksdagenParty, String> dataContainer = applicationManager.getDataContainer(ViewRiksdagenParty.class);
    for (final ViewRiksdagenParty data : dataContainer.getAll()) {
        dataSeries = dataSeries.newSeries().add(data.getPartyName(), data.getHeadCount());
    }
    return dataSeries;
}
Also used : ViewRiksdagenParty(com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty) DataSeries(org.dussan.vaadin.dcharts.data.DataSeries)

Aggregations

ViewRiksdagenParty (com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty)20 VerticalLayout (com.vaadin.ui.VerticalLayout)14 Secured (org.springframework.security.access.annotation.Secured)14 ViewRiksdagenPartySummary (com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartySummary)5 DataSeries (org.dussan.vaadin.dcharts.data.DataSeries)5 ViewRiksdagenPartyRoleMember (com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartyRoleMember)3 ViewRiksdagenPolitician (com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician)2 ViewRiksdagenCommitteeBallotDecisionPartyEmbeddedId (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommitteeBallotDecisionPartyEmbeddedId)1 ViewRiksdagenCommitteeBallotDecisionPartySummary (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommitteeBallotDecisionPartySummary)1 ViewRiksdagenCommitteeRoleMember (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommitteeRoleMember)1 ViewRiksdagenPoliticianDocument (com.hack23.cia.model.internal.application.data.document.impl.ViewRiksdagenPoliticianDocument)1 ViewRiksdagenGovermentRoleMember (com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenGovermentRoleMember)1 PageItemPropertyClickListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener)1 Link (com.vaadin.ui.Link)1 Test (org.junit.Test)1