Search in sources :

Example 1 with AssignmentData

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

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

the class PoliticianRoleListPageModContentFactoryImpl 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.ROLELIST.toString());
        final List<AssignmentData> assignmentList = personData.getPersonAssignmentData().getAssignmentList();
        createRoleList(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 AssignmentData

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

the class PoliticianRoleSummaryPageModContentFactoryImpl 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.ROLESUMMARY.toString());
        final List<AssignmentData> assignmentList = personData.getPersonAssignmentData().getAssignmentList();
        createRoleSummary(panelContent, assignmentList, viewRiksdagenPolitician);
        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)

Aggregations

AssignmentData (com.hack23.cia.model.external.riksdagen.person.impl.AssignmentData)3 PersonData (com.hack23.cia.model.external.riksdagen.person.impl.PersonData)3 ViewRiksdagenPolitician (com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician)3 VerticalLayout (com.vaadin.ui.VerticalLayout)3 Secured (org.springframework.security.access.annotation.Secured)3