Search in sources :

Example 1 with ViewRiksdagenCommitteeBallotDecisionPoliticianSummary

use of com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommitteeBallotDecisionPoliticianSummary 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)

Aggregations

PersonData (com.hack23.cia.model.external.riksdagen.person.impl.PersonData)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 ViewRiksdagenPolitician (com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician)1 VerticalLayout (com.vaadin.ui.VerticalLayout)1 Secured (org.springframework.security.access.annotation.Secured)1