Search in sources :

Example 1 with ViewRiksdagenMinistry

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

the class MinistryPageVisitHistoryPageModContentFactoryImpl 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);
        createPageVisitHistory(NAME, pageId, panelContent);
        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)

Example 2 with ViewRiksdagenMinistry

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

the class MinistryRankingDataGridPageModContentFactoryImpl 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();
    getMinistryRankingMenuItemFactory().createMinistryRankingMenuBar(menuBar);
    final String pageId = getPageId(parameters);
    final DataContainer<ViewRiksdagenMinistry, String> dataContainer = getApplicationManager().getDataContainer(ViewRiksdagenMinistry.class);
    getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenMinistry.class, dataContainer.getAllOrderBy(ViewRiksdagenMinistry_.currentMemberSize), MINISTRIES, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);
    panel.setCaption(NAME + "::" + DATAGRID);
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_RANKING_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)

Example 3 with ViewRiksdagenMinistry

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

the class MinistryDocumentHistoryPageModContentFactoryImpl 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_HISTORY);
        final DataContainer<ViewRiksdagenPoliticianDocument, String> politicianDocumentDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenPoliticianDocument.class);
        getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenPoliticianDocument.class, politicianDocumentDataContainer.findOrderedListByProperty(ViewRiksdagenPoliticianDocument_.org, viewRiksdagenMinistry.getNameId(), ViewRiksdagenPoliticianDocument_.madePublicDate), DOCUMENTS, 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) ViewRiksdagenPoliticianDocument(com.hack23.cia.model.internal.application.data.document.impl.ViewRiksdagenPoliticianDocument) VerticalLayout(com.vaadin.ui.VerticalLayout) Secured(org.springframework.security.access.annotation.Secured)

Example 4 with ViewRiksdagenMinistry

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

the class MinistryMemberHistoryPageModContentFactoryImpl 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, MEMBER_HISTORY);
        final DataContainer<ViewRiksdagenGovermentRoleMember, String> govermentRoleMemberDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenGovermentRoleMember.class);
        getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenGovermentRoleMember.class, govermentRoleMemberDataContainer.getAllBy(ViewRiksdagenGovermentRoleMember_.detail, viewRiksdagenMinistry.getNameId()), MEMBER_HISTORY, 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 5 with ViewRiksdagenMinistry

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

the class MinistryOverviewPageModContentFactoryImpl 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, OVERVIEW);
        final Link addMinistryPageLink = getPageLinkFactory().addMinistryPageLink(viewRiksdagenMinistry);
        panelContent.addComponent(addMinistryPageLink);
        getFormFactory().addFormPanelTextFields(panelContent, viewRiksdagenMinistry, ViewRiksdagenMinistry.class, AS_LIST);
        panelContent.setExpandRatio(addMinistryPageLink, ContentRatio.SMALL);
        panel.setCaption(NAME + "::" + MINISTRY + viewRiksdagenMinistry.getNameId());
        final VerticalLayout overviewLayout = new VerticalLayout();
        overviewLayout.setSizeFull();
        panelContent.addComponent(overviewLayout);
        panelContent.setExpandRatio(overviewLayout, ContentRatio.LARGE_FORM);
        getMinistryMenuItemFactory().createOverviewPage(overviewLayout, pageId);
        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) Link(com.vaadin.ui.Link) 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