use of com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartySummary in project cia by Hack23.
the class CommitteeDataSeriesFactoryImpl method createChartTimeSeriesTotalDaysServedCommitteeByParty.
@Override
public DataSeries createChartTimeSeriesTotalDaysServedCommitteeByParty() {
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.getTotalDaysServedCommittee());
}
}
return dataSeries;
}
use of com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartySummary in project cia by Hack23.
the class PartyDataSeriesFactoryImpl method createChartTimeSeriesCurrentGovernmentByParty.
@Override
public DataSeries createChartTimeSeriesCurrentGovernmentByParty() {
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.getTotalActiveGovernment());
}
}
return dataSeries;
}
use of com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartySummary in project cia by Hack23.
the class PartyDataSeriesFactoryImpl method createPartyChartTimeSeriesCurrent.
@Override
public DataSeries createPartyChartTimeSeriesCurrent() {
DataSeries dataSeries = new DataSeries();
final DataContainer<ViewRiksdagenPartySummary, String> dataContainer = applicationManager.getDataContainer(ViewRiksdagenPartySummary.class);
for (final ViewRiksdagenPartySummary data : dataContainer.getAllOrderBy(ViewRiksdagenPartySummary_.currentAssignments)) {
if (data != null && data.isActiveParliament()) {
dataSeries = dataSeries.newSeries().add(getPartyName(data.getParty()), data.getTotalActiveParliament());
}
}
return dataSeries;
}
use of com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartySummary in project cia by Hack23.
the class PartyOverviewPageModContentFactoryImpl 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 DataContainer<ViewRiksdagenPartySummary, String> partySummarydataContainer = getApplicationManager().getDataContainer(ViewRiksdagenPartySummary.class);
final ViewRiksdagenParty viewRiksdagenParty = dataContainer.load(pageId);
if (viewRiksdagenParty != null) {
getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId);
LabelFactory.createHeader2Label(panelContent, OVERVIEW);
final Link addPartyPageLink = getPageLinkFactory().addPartyPageLink(viewRiksdagenParty);
panelContent.addComponent(addPartyPageLink);
panelContent.setExpandRatio(addPartyPageLink, ContentRatio.SMALL);
getFormFactory().addFormPanelTextFields(panelContent, viewRiksdagenParty, ViewRiksdagenParty.class, AS_LIST);
final ViewRiksdagenPartySummary viewRiksdagenPartySummary = partySummarydataContainer.load(pageId);
if (viewRiksdagenPartySummary != null) {
getFormFactory().addFormPanelTextFields(panelContent, viewRiksdagenPartySummary, ViewRiksdagenPartySummary.class, AS_LIST2);
}
final VerticalLayout overviewLayout = new VerticalLayout();
overviewLayout.setSizeFull();
panelContent.addComponent(overviewLayout);
panelContent.setExpandRatio(overviewLayout, ContentRatio.LARGE_FORM);
getPartyMenuItemFactory().createOverviewPage(overviewLayout, pageId);
pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
}
return panelContent;
}
use of com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartySummary 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;
}
Aggregations