use of com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommittee in project cia by Hack23.
the class DecisionFlowChartManagerImpl method createCommitteeDecisionFlow.
@Override
public SankeyChart createCommitteeDecisionFlow(final ViewRiksdagenCommittee viewRiksdagenCommittee, final Map<String, List<ViewRiksdagenCommittee>> committeeMap, final String rm) {
final List<ProposalCommitteeeSummary> createCommitteeSummary = decisionDataFactory.createCommitteeSummary(rm);
final SankeyChart chart = new SankeyChart();
final Map<String, List<ProposalCommitteeeSummary>> orgProposalMap = createCommitteeSummary.stream().collect(Collectors.groupingBy(ProposalCommitteeeSummary::getOrg));
for (final Entry<String, List<ProposalCommitteeeSummary>> entry : orgProposalMap.entrySet()) {
if (committeeMap.containsKey(entry.getKey()) && viewRiksdagenCommittee.getEmbeddedId().getOrgCode().equals(entry.getKey())) {
addDocTypeDecisionDataRows(chart, entry);
}
}
chart.drawChart();
return chart;
}
use of com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommittee in project cia by Hack23.
the class DecisionFlowChartManagerImpl method createAllDecisionFlow.
@Override
public SankeyChart createAllDecisionFlow(final Map<String, List<ViewRiksdagenCommittee>> committeeMap, final String rm) {
final List<ProposalCommitteeeSummary> createCommitteeSummary = decisionDataFactory.createCommitteeSummary(rm);
final SankeyChart chart = new SankeyChart();
final Map<String, List<ProposalCommitteeeSummary>> orgProposalMap = createCommitteeSummary.stream().collect(Collectors.groupingBy(ProposalCommitteeeSummary::getOrg));
for (final Entry<String, List<ProposalCommitteeeSummary>> entry : orgProposalMap.entrySet()) {
if (committeeMap.containsKey(entry.getKey())) {
final Optional<ViewRiksdagenCommittee> vewRiksdagenCommittee = committeeMap.get(entry.getKey()).stream().findFirst();
if (vewRiksdagenCommittee.isPresent()) {
addDocTypeDataRows(chart, entry, vewRiksdagenCommittee.get());
addDecisionDataRows(chart, entry, vewRiksdagenCommittee.get());
}
}
}
chart.drawChart();
return chart;
}
use of com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommittee in project cia by Hack23.
the class CommitteeDataSeriesFactoryImpl method createCommitteeChartTimeSeriesAll.
@Override
public DataSeries createCommitteeChartTimeSeriesAll() {
DataSeries dataSeries = new DataSeries();
final DataContainer<ViewRiksdagenCommittee, String> dataContainer = applicationManager.getDataContainer(ViewRiksdagenCommittee.class);
for (final ViewRiksdagenCommittee data : dataContainer.getAll()) {
dataSeries = dataSeries.newSeries().add(data.getEmbeddedId().getDetail(), data.getTotalAssignments());
}
return dataSeries;
}
use of com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommittee in project cia by Hack23.
the class DataViewerITest method viewRiksdagenCommittee.
/**
* View riksdagen committee.
*
* @throws Exception
* the exception
*/
@Test
public void viewRiksdagenCommittee() throws Exception {
final List<ViewRiksdagenCommittee> committees = dataViewer.getAll(ViewRiksdagenCommittee.class);
assertNotNull(EXPECT_VALUE_IN_DATABASE, committees);
if (committees.size() > 0) {
final ViewRiksdagenCommittee viewRiksdagenCommittee = committees.get(0);
final ViewRiksdagenCommittee viewRiksdagenCommitteeLoaded = dataViewer.load(ViewRiksdagenCommittee.class, viewRiksdagenCommittee.getEmbeddedId());
assertNotNull(EXPECT_VALUE_IN_DATABASE, viewRiksdagenCommitteeLoaded);
final ViewRiksdagenCommittee viewRiksdagenCommitteeFound = dataViewer.findFirstByProperty(ViewRiksdagenCommittee.class, ViewRiksdagenCommittee_.embeddedId, viewRiksdagenCommitteeLoaded.getEmbeddedId());
assertEquals(EXPECT_SAME_OBJECT_LOADED, viewRiksdagenCommitteeLoaded, viewRiksdagenCommitteeFound);
}
}
use of com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommittee in project cia by Hack23.
the class CommitteeCurrentMembersHistoryPageModContentFactoryImpl 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<ViewRiksdagenCommittee, String> dataContainer = getApplicationManager().getDataContainer(ViewRiksdagenCommittee.class);
final ViewRiksdagenCommittee viewRiksdagenCommittee = dataContainer.load(pageId);
if (viewRiksdagenCommittee != null) {
getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId);
LabelFactory.createHeader2Label(panelContent, CURRENT_MEMBERS);
final DataContainer<ViewRiksdagenCommitteeRoleMember, String> committeeRoleMemberDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenCommitteeRoleMember.class);
getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenCommitteeRoleMember.class, committeeRoleMemberDataContainer.findListByProperty(new Object[] { viewRiksdagenCommittee.getEmbeddedId().getDetail(), Boolean.TRUE }, ViewRiksdagenCommitteeRoleMember_.detail, ViewRiksdagenCommitteeRoleMember_.active), CURRENT_MEMBERS, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);
panel.setCaption(NAME + "::" + COMMITTEE + viewRiksdagenCommittee.getEmbeddedId().getDetail());
getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
}
return panelContent;
}
Aggregations