Search in sources :

Example 1 with Indicator_

use of com.hack23.cia.model.external.worldbank.data.impl.Indicator_ in project cia by Hack23.

the class WorldIndicatorsPageModContentFactoryImpl method createDataIndicatorSummaryChartPanel.

/**
 * Creates the data indicator summary chart panel.
 *
 * @param verticalLayout
 *            the vertical layout
 * @param indicator
 *            the indicator
 */
private void createDataIndicatorSummaryChartPanel(final VerticalLayout verticalLayout, final String indicator) {
    final DataContainer<ViewWorldbankIndicatorDataCountrySummary, WorldbankIndicatorDataCountrySummaryEmbeddedId> indicatorDataCountrSummaryDailyDataContainer = getApplicationManager().getDataContainer(ViewWorldbankIndicatorDataCountrySummary.class);
    final Optional<ViewWorldbankIndicatorDataCountrySummary> indicatorSummary = indicatorDataCountrSummaryDailyDataContainer.getAll().parallelStream().filter(t -> t != null && t.getEmbeddedId().getIndicatorId().equals(indicator)).findFirst();
    ViewWorldbankIndicatorDataCountrySummary indicatorSummaryValue = null;
    if (indicatorSummary.isPresent()) {
        indicatorSummaryValue = indicatorSummary.get();
        getFormFactory().addFormPanelTextFields(verticalLayout, indicatorSummaryValue, ViewWorldbankIndicatorDataCountrySummary.class, AS_LIST);
    }
    final DataContainer<WorldBankData, Serializable> dataContainer = getApplicationManager().getDataContainer(WorldBankData.class);
    final List<WorldBankData> dataList = dataContainer.findListByEmbeddedProperty(WorldBankData.class, WorldBankData_.indicator, Indicator.class, Indicator_.id, indicator);
    chartDataManager.createIndicatorChart(verticalLayout, dataList, indicatorSummaryValue);
}
Also used : PageMode(com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode) Panel(com.vaadin.ui.Panel) Arrays(java.util.Arrays) MenuBar(com.vaadin.ui.MenuBar) ApplicationEventGroup(com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup) VerticalLayout(com.vaadin.ui.VerticalLayout) WorldBankData_(com.hack23.cia.model.external.worldbank.data.impl.WorldBankData_) Autowired(org.springframework.beans.factory.annotation.Autowired) Indicator_(com.hack23.cia.model.external.worldbank.data.impl.Indicator_) Serializable(java.io.Serializable) Secured(org.springframework.security.access.annotation.Secured) DataContainer(com.hack23.cia.service.api.DataContainer) List(java.util.List) Component(org.springframework.stereotype.Component) WorldBankData(com.hack23.cia.model.external.worldbank.data.impl.WorldBankData) Layout(com.vaadin.ui.Layout) ViewAction(com.hack23.cia.web.impl.ui.application.action.ViewAction) Indicator(com.hack23.cia.model.external.worldbank.data.impl.Indicator) WorldbankIndicatorDataCountrySummaryEmbeddedId(com.hack23.cia.model.internal.application.data.impl.WorldbankIndicatorDataCountrySummaryEmbeddedId) ViewWorldbankIndicatorDataCountrySummary(com.hack23.cia.model.internal.application.data.impl.ViewWorldbankIndicatorDataCountrySummary) Optional(java.util.Optional) WorldIndicatorChartDataManager(com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.WorldIndicatorChartDataManager) WorldbankIndicatorDataCountrySummaryEmbeddedId(com.hack23.cia.model.internal.application.data.impl.WorldbankIndicatorDataCountrySummaryEmbeddedId) ViewWorldbankIndicatorDataCountrySummary(com.hack23.cia.model.internal.application.data.impl.ViewWorldbankIndicatorDataCountrySummary) Serializable(java.io.Serializable) WorldBankData(com.hack23.cia.model.external.worldbank.data.impl.WorldBankData)

Aggregations

Indicator (com.hack23.cia.model.external.worldbank.data.impl.Indicator)1 Indicator_ (com.hack23.cia.model.external.worldbank.data.impl.Indicator_)1 WorldBankData (com.hack23.cia.model.external.worldbank.data.impl.WorldBankData)1 WorldBankData_ (com.hack23.cia.model.external.worldbank.data.impl.WorldBankData_)1 ViewWorldbankIndicatorDataCountrySummary (com.hack23.cia.model.internal.application.data.impl.ViewWorldbankIndicatorDataCountrySummary)1 WorldbankIndicatorDataCountrySummaryEmbeddedId (com.hack23.cia.model.internal.application.data.impl.WorldbankIndicatorDataCountrySummaryEmbeddedId)1 ApplicationEventGroup (com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup)1 DataContainer (com.hack23.cia.service.api.DataContainer)1 ViewAction (com.hack23.cia.web.impl.ui.application.action.ViewAction)1 WorldIndicatorChartDataManager (com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.WorldIndicatorChartDataManager)1 PageMode (com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode)1 Layout (com.vaadin.ui.Layout)1 MenuBar (com.vaadin.ui.MenuBar)1 Panel (com.vaadin.ui.Panel)1 VerticalLayout (com.vaadin.ui.VerticalLayout)1 Serializable (java.io.Serializable)1 Arrays (java.util.Arrays)1 List (java.util.List)1 Optional (java.util.Optional)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1