Search in sources :

Example 6 with ViewRiksdagenMinistry

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

the class MinistryDataSeriesFactoryImpl method createMinistryChartTimeSeriesCurrent.

@Override
public DataSeries createMinistryChartTimeSeriesCurrent() {
    DataSeries dataSeries = new DataSeries();
    final DataContainer<ViewRiksdagenMinistry, String> dataContainer = applicationManager.getDataContainer(ViewRiksdagenMinistry.class);
    for (final ViewRiksdagenMinistry data : dataContainer.getAll()) {
        if (data.isActive()) {
            dataSeries = dataSeries.newSeries().add(data.getNameId(), data.getCurrentMemberSize());
        }
    }
    return dataSeries;
}
Also used : ViewRiksdagenMinistry(com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenMinistry) DataSeries(org.dussan.vaadin.dcharts.data.DataSeries)

Example 7 with ViewRiksdagenMinistry

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

the class MinistryDataSeriesFactoryImpl method createMinistryChartTimeSeriesAll.

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

Example 8 with ViewRiksdagenMinistry

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

the class DataViewerITest method viewRiksdagenMinistry.

/**
 * View riksdagen ministry.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void viewRiksdagenMinistry() throws Exception {
    final List<ViewRiksdagenMinistry> ministries = dataViewer.getAll(ViewRiksdagenMinistry.class);
    assertNotNull(EXPECT_VALUE_IN_DATABASE, ministries);
    if (ministries.size() > 0) {
        final ViewRiksdagenMinistry viewRiksdagenMinistry = ministries.get(0);
        final ViewRiksdagenMinistry viewRiksdagenMinistryLoaded = dataViewer.load(ViewRiksdagenMinistry.class, viewRiksdagenMinistry.getNameId());
        assertNotNull(EXPECT_VALUE_IN_DATABASE, viewRiksdagenMinistryLoaded);
        final ViewRiksdagenMinistry viewRiksdagenMinistryFound = dataViewer.findFirstByProperty(ViewRiksdagenMinistry.class, ViewRiksdagenMinistry_.nameId, viewRiksdagenMinistryLoaded.getNameId());
        assertEquals(EXPECT_SAME_OBJECT_LOADED, viewRiksdagenMinistryLoaded, viewRiksdagenMinistryFound);
    }
}
Also used : ViewRiksdagenMinistry(com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenMinistry) Test(org.junit.Test)

Example 9 with ViewRiksdagenMinistry

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

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

the class MinistryDocumentActivityPageModContentFactoryImpl 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, DOCUMENT_ACTIVITY);
        chartDataManager.createDocumentHistoryChartByOrg(panelContent, viewRiksdagenMinistry.getNameId());
        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) VerticalLayout(com.vaadin.ui.VerticalLayout) Secured(org.springframework.security.access.annotation.Secured)

Aggregations

ViewRiksdagenMinistry (com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenMinistry)12 VerticalLayout (com.vaadin.ui.VerticalLayout)9 Secured (org.springframework.security.access.annotation.Secured)9 ViewRiksdagenGovermentRoleMember (com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenGovermentRoleMember)3 DataSeries (org.dussan.vaadin.dcharts.data.DataSeries)2 ViewRiksdagenPoliticianDocument (com.hack23.cia.model.internal.application.data.document.impl.ViewRiksdagenPoliticianDocument)1 Link (com.vaadin.ui.Link)1 Test (org.junit.Test)1