Search in sources :

Example 1 with PersonData

use of com.hack23.cia.model.external.riksdagen.person.impl.PersonData in project cia by Hack23.

the class RiksdagenPersonApiImplITest method getPersonMixedTest.

/**
 * Gets the person mixed test.
 *
 * @return the person mixed test
 * @throws Exception
 *             the exception
 */
@Test
public void getPersonMixedTest() throws Exception {
    final PersonContainerElement personList = riksdagenApi.getPersonList();
    assertNotNull(personList);
    assertTrue(personList.getPerson().size() >= 1291);
    final PersonElement person = personList.getPerson().get(0);
    assertNotNull("Missing id : " + person.getLastName(), person.getId());
    final PersonData personDetail = riksdagenApi.getPerson(person.getId());
    assertNotNull("Missing personDetail : " + person.getLastName(), personDetail);
    assertNotNull("Missing personDetail.person : " + person.getLastName(), personDetail.getLastName());
    assertNotNull("Missing personDetail.person.id : " + person.getLastName(), personDetail.getId());
    assertNotNull(personDetail.getFirstName());
    assertNotNull(personDetail.getLastName());
}
Also used : PersonElement(com.hack23.cia.model.external.riksdagen.personlista.impl.PersonElement) PersonData(com.hack23.cia.model.external.riksdagen.person.impl.PersonData) PersonContainerElement(com.hack23.cia.model.external.riksdagen.personlista.impl.PersonContainerElement) Test(org.junit.Test)

Example 2 with PersonData

use of com.hack23.cia.model.external.riksdagen.person.impl.PersonData in project cia by Hack23.

the class PoliticianRoleGhantPageModContentFactoryImpl 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.ROLEGHANT.toString());
        final List<AssignmentData> assignmentList = personData.getPersonAssignmentData().getAssignmentList();
        politicianGhantChartManager.createRoleGhant(panelContent, assignmentList);
        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) AssignmentData(com.hack23.cia.model.external.riksdagen.person.impl.AssignmentData) Secured(org.springframework.security.access.annotation.Secured)

Example 3 with PersonData

use of com.hack23.cia.model.external.riksdagen.person.impl.PersonData in project cia by Hack23.

the class PoliticianVotesHistoryPageModContentFactoryImpl 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.VOTEHISTORY.toString());
        getGridFactory().createBasicBeanItemNestedPropertiesGrid(panelContent, ViewRiksdagenVoteDataBallotPoliticianSummary.class, viewRiksdagenVoteDataBallotPoliticianSummaryChartDataManager.findByValue(personData.getId()), BALLOTS, NESTED_PROPERTIES, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, EMBEDDED_ID_BALLOT_ID, null);
        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 4 with PersonData

use of com.hack23.cia.model.external.riksdagen.person.impl.PersonData 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 5 with PersonData

use of com.hack23.cia.model.external.riksdagen.person.impl.PersonData 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)

Aggregations

PersonData (com.hack23.cia.model.external.riksdagen.person.impl.PersonData)12 ViewRiksdagenPolitician (com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician)10 VerticalLayout (com.vaadin.ui.VerticalLayout)10 Secured (org.springframework.security.access.annotation.Secured)10 AssignmentData (com.hack23.cia.model.external.riksdagen.person.impl.AssignmentData)3 Test (org.junit.Test)2 PersonContainerElement (com.hack23.cia.model.external.riksdagen.personlista.impl.PersonContainerElement)1 PersonElement (com.hack23.cia.model.external.riksdagen.personlista.impl.PersonElement)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 ViewRiksdagenPoliticianDocument (com.hack23.cia.model.internal.application.data.document.impl.ViewRiksdagenPoliticianDocument)1