Search in sources :

Example 1 with ViewRiksdagenPoliticianDocument

use of com.hack23.cia.model.internal.application.data.document.impl.ViewRiksdagenPoliticianDocument in project cia by Hack23.

the class CommitteeDocumentHistoryPageModContentFactoryImpl 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, DOCUMENT_HISTORY);
        final DataContainer<ViewRiksdagenPoliticianDocument, String> politicianDocumentDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenPoliticianDocument.class);
        getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenPoliticianDocument.class, politicianDocumentDataContainer.findOrderedListByProperty(ViewRiksdagenPoliticianDocument_.org, viewRiksdagenCommittee.getEmbeddedId().getOrgCode().replace(" ", "").replace("_", "").trim(), ViewRiksdagenPoliticianDocument_.madePublicDate), DOCUMENTS, 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;
}
Also used : ViewRiksdagenPoliticianDocument(com.hack23.cia.model.internal.application.data.document.impl.ViewRiksdagenPoliticianDocument) VerticalLayout(com.vaadin.ui.VerticalLayout) ViewRiksdagenCommittee(com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommittee) Secured(org.springframework.security.access.annotation.Secured)

Example 2 with ViewRiksdagenPoliticianDocument

use of com.hack23.cia.model.internal.application.data.document.impl.ViewRiksdagenPoliticianDocument 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 3 with ViewRiksdagenPoliticianDocument

use of com.hack23.cia.model.internal.application.data.document.impl.ViewRiksdagenPoliticianDocument in project cia by Hack23.

the class PoliticianDocumentHistoryPageModContentFactoryImpl 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<PersonData, String> dataContainer = getApplicationManager().getDataContainer(PersonData.class);
    final PersonData personData = dataContainer.load(pageId);
    if (personData != null) {
        final DataContainer<ViewRiksdagenPolitician, String> politicianDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenPolitician.class);
        final ViewRiksdagenPolitician viewRiksdagenPolitician = politicianDataContainer.load(personData.getId());
        getPoliticianMenuItemFactory().createPoliticianMenuBar(menuBar, pageId);
        LabelFactory.createHeader2Label(panelContent, PoliticianPageMode.DOCUMENTHISTORY.toString());
        final DataContainer<ViewRiksdagenPoliticianDocument, String> politicianDocumentDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenPoliticianDocument.class);
        getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenPoliticianDocument.class, politicianDocumentDataContainer.findOrderedListByProperty(ViewRiksdagenPoliticianDocument_.personReferenceId, personData.getId(), ViewRiksdagenPoliticianDocument_.madePublicDate), DOCUMENTS, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);
        pageCompleted(parameters, panel, pageId, viewRiksdagenPolitician);
    }
    return panelContent;
}
Also used : PersonData(com.hack23.cia.model.external.riksdagen.person.impl.PersonData) ViewRiksdagenPoliticianDocument(com.hack23.cia.model.internal.application.data.document.impl.ViewRiksdagenPoliticianDocument) VerticalLayout(com.vaadin.ui.VerticalLayout) ViewRiksdagenPolitician(com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician) Secured(org.springframework.security.access.annotation.Secured)

Example 4 with ViewRiksdagenPoliticianDocument

use of com.hack23.cia.model.internal.application.data.document.impl.ViewRiksdagenPoliticianDocument in project cia by Hack23.

the class PartyDocumentHistoryPageModContentFactoryImpl 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<ViewRiksdagenParty, String> dataContainer = getApplicationManager().getDataContainer(ViewRiksdagenParty.class);
    final ViewRiksdagenParty viewRiksdagenParty = dataContainer.load(pageId);
    if (viewRiksdagenParty != null) {
        getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId);
        LabelFactory.createHeader2Label(panelContent, DOCUMENT_HISTORY);
        final DataContainer<ViewRiksdagenPoliticianDocument, String> politicianDocumentDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenPoliticianDocument.class);
        getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenPoliticianDocument.class, politicianDocumentDataContainer.findOrderedListByProperty(ViewRiksdagenPoliticianDocument_.partyShortCode, pageId, ViewRiksdagenPoliticianDocument_.madePublicDate), MEMBER_DOCUMENT_HISTORY, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);
        pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
    }
    return panelContent;
}
Also used : ViewRiksdagenPoliticianDocument(com.hack23.cia.model.internal.application.data.document.impl.ViewRiksdagenPoliticianDocument) ViewRiksdagenParty(com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty) VerticalLayout(com.vaadin.ui.VerticalLayout) Secured(org.springframework.security.access.annotation.Secured)

Aggregations

ViewRiksdagenPoliticianDocument (com.hack23.cia.model.internal.application.data.document.impl.ViewRiksdagenPoliticianDocument)4 VerticalLayout (com.vaadin.ui.VerticalLayout)4 Secured (org.springframework.security.access.annotation.Secured)4 PersonData (com.hack23.cia.model.external.riksdagen.person.impl.PersonData)1 ViewRiksdagenCommittee (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommittee)1 ViewRiksdagenMinistry (com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenMinistry)1 ViewRiksdagenParty (com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty)1 ViewRiksdagenPolitician (com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician)1