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;
}
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;
}
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);
}
}
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;
}
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;
}
Aggregations