use of com.hack23.cia.model.external.riksdagen.person.impl.PersonData 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;
}
use of com.hack23.cia.model.external.riksdagen.person.impl.PersonData 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;
}
use of com.hack23.cia.model.external.riksdagen.person.impl.PersonData in project cia by Hack23.
the class RiksdagenPersonApiImplITest method getPersonTest.
/**
* Gets the person test.
*
* @return the person test
* @throws Exception
* the exception
*/
@Test
public void getPersonTest() throws Exception {
final PersonData personElement = riksdagenApi.getPerson("0389619060499");
assertNotNull(personElement);
assertEquals("Bohman", personElement.getLastName());
}
use of com.hack23.cia.model.external.riksdagen.person.impl.PersonData 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;
}
use of com.hack23.cia.model.external.riksdagen.person.impl.PersonData 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;
}
Aggregations