Search in sources :

Example 6 with ViewRiksdagenPolitician

use of com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician in project cia by Hack23.

the class PoliticianBallotDecisionSummaryPageModContentFactoryImpl 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.BALLOTDECISIONSUMMARY.toString());
        final DataContainer<ViewRiksdagenCommitteeBallotDecisionPoliticianSummary, ViewRiksdagenCommitteeBallotDecisionPoliticianEmbeddedId> committeeBallotDecisionPartyDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenCommitteeBallotDecisionPoliticianSummary.class);
        final List<ViewRiksdagenCommitteeBallotDecisionPoliticianSummary> decisionPartySummaryList = committeeBallotDecisionPartyDataContainer.findOrderedByPropertyListByEmbeddedProperty(ViewRiksdagenCommitteeBallotDecisionPoliticianSummary.class, ViewRiksdagenCommitteeBallotDecisionPoliticianSummary_.embeddedId, ViewRiksdagenCommitteeBallotDecisionPoliticianEmbeddedId.class, ViewRiksdagenCommitteeBallotDecisionPoliticianEmbeddedId_.intressentId, pageId, ViewRiksdagenCommitteeBallotDecisionPoliticianSummary_.voteDate);
        getGridFactory().createBasicBeanItemNestedPropertiesGrid(panelContent, ViewRiksdagenCommitteeBallotDecisionPoliticianSummary.class, decisionPartySummaryList, COMMITTEE_BALLOT_DECISION_POLITICIAN_SUMMARY, NESTED_PROPERTIES, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, BALLOT_ID, null);
        pageCompleted(parameters, panel, pageId, viewRiksdagenPolitician);
    }
    return panelContent;
}
Also used : PersonData(com.hack23.cia.model.external.riksdagen.person.impl.PersonData) ViewRiksdagenCommitteeBallotDecisionPoliticianSummary(com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommitteeBallotDecisionPoliticianSummary) VerticalLayout(com.vaadin.ui.VerticalLayout) ViewRiksdagenPolitician(com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician) ViewRiksdagenCommitteeBallotDecisionPoliticianEmbeddedId(com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommitteeBallotDecisionPoliticianEmbeddedId) Secured(org.springframework.security.access.annotation.Secured)

Example 7 with ViewRiksdagenPolitician

use of com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician 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 8 with ViewRiksdagenPolitician

use of com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician in project cia by Hack23.

the class PoliticianOverviewPageModContentFactoryImpl 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);
        createOverviewContent(panelContent, personData, viewRiksdagenPolitician, pageId);
        pageCompleted(parameters, panel, pageId, viewRiksdagenPolitician);
    }
    return panelContent;
}
Also used : PersonData(com.hack23.cia.model.external.riksdagen.person.impl.PersonData) VerticalLayout(com.vaadin.ui.VerticalLayout) ViewRiksdagenPolitician(com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician) Secured(org.springframework.security.access.annotation.Secured)

Example 9 with ViewRiksdagenPolitician

use of com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician in project cia by Hack23.

the class PoliticianPageVisitHistoryPageModContentFactoryImpl 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);
        createPageVisitHistory(NAME, pageId, panelContent);
        pageCompleted(parameters, panel, pageId, viewRiksdagenPolitician);
    }
    return panelContent;
}
Also used : PersonData(com.hack23.cia.model.external.riksdagen.person.impl.PersonData) VerticalLayout(com.vaadin.ui.VerticalLayout) ViewRiksdagenPolitician(com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician) Secured(org.springframework.security.access.annotation.Secured)

Example 10 with ViewRiksdagenPolitician

use of com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician in project cia by Hack23.

the class PartyCurrentMembersPageModContentFactoryImpl 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, CURRENT_MEMBERS);
        final DataContainer<ViewRiksdagenPolitician, String> politicianDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenPolitician.class);
        getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenPolitician.class, politicianDataContainer.findListByProperty(new Object[] { viewRiksdagenParty.getPartyId(), Boolean.TRUE }, ViewRiksdagenPolitician_.party, ViewRiksdagenPolitician_.active), POLITICIANS, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);
        pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
    }
    return panelContent;
}
Also used : ViewRiksdagenParty(com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty) VerticalLayout(com.vaadin.ui.VerticalLayout) ViewRiksdagenPolitician(com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician) Secured(org.springframework.security.access.annotation.Secured)

Aggregations

ViewRiksdagenPolitician (com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician)17 VerticalLayout (com.vaadin.ui.VerticalLayout)13 Secured (org.springframework.security.access.annotation.Secured)13 PersonData (com.hack23.cia.model.external.riksdagen.person.impl.PersonData)10 AssignmentData (com.hack23.cia.model.external.riksdagen.person.impl.AssignmentData)3 Test (org.junit.Test)3 ViewRiksdagenParty (com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty)2 ViewRiksdagenPartySummary (com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartySummary)2 Iterables (com.google.common.collect.Iterables)1 ViewRiksdagenCommitteeBallotDecisionPoliticianEmbeddedId (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommitteeBallotDecisionPoliticianEmbeddedId)1 ViewRiksdagenCommitteeBallotDecisionPoliticianSummary (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommitteeBallotDecisionPoliticianSummary)1 ViewRiksdagenVoteDataBallotPartySummaryAnnual (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenVoteDataBallotPartySummaryAnnual)1 ViewRiksdagenVoteDataBallotPartySummaryDaily (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenVoteDataBallotPartySummaryDaily)1 ViewRiksdagenVoteDataBallotPartySummaryMonthly (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenVoteDataBallotPartySummaryMonthly)1 ViewRiksdagenVoteDataBallotPoliticianSummaryAnnual (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenVoteDataBallotPoliticianSummaryAnnual)1 ViewRiksdagenVoteDataBallotPoliticianSummaryDaily (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenVoteDataBallotPoliticianSummaryDaily)1 ViewRiksdagenVoteDataBallotPoliticianSummaryMonthly (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenVoteDataBallotPoliticianSummaryMonthly)1 ViewRiksdagenPoliticianDocument (com.hack23.cia.model.internal.application.data.document.impl.ViewRiksdagenPoliticianDocument)1 ComplianceCheck (com.hack23.cia.service.api.action.kpi.ComplianceCheck)1 DataViewer (com.hack23.cia.service.data.api.DataViewer)1