Search in sources :

Example 1 with SubcontinentCriteria

use of de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentCriteria in project SORMAS-Project by hzi-braunschweig.

the class LocationEditForm method setContinentFieldsVisibility.

public void setContinentFieldsVisibility() {
    if (FacadeProvider.getContinentFacade().count(new ContinentCriteria().relevanceStatus(EntityRelevanceStatus.ACTIVE)) == 0) {
        continent.setVisible(false);
        continent.clear();
    } else {
        continent.setVisible(true);
    }
    if (FacadeProvider.getSubcontinentFacade().count(new SubcontinentCriteria().relevanceStatus(EntityRelevanceStatus.ACTIVE)) == 0) {
        subcontinent.setVisible(false);
        subcontinent.clear();
    } else {
        subcontinent.setVisible(true);
    }
}
Also used : SubcontinentCriteria(de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentCriteria) ContinentCriteria(de.symeda.sormas.api.infrastructure.continent.ContinentCriteria)

Example 2 with SubcontinentCriteria

use of de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentCriteria in project SORMAS-Project by hzi-braunschweig.

the class ContinentFacadeEjbTest method testSubcontinent.

@Test
public void testSubcontinent() {
    final Continent continent = creator.createContinent("EUROPE");
    final SubcontinentDto subcontinentDto = new SubcontinentDto();
    subcontinentDto.setDefaultName("CENTRAL_EUROPE");
    subcontinentDto.setContinent(continent.toReference());
    getSubcontinentFacade().save(subcontinentDto);
    final List<SubcontinentReferenceDto> subcontinents = getSubcontinentFacade().getByDefaultName("CENTRAL_EUROPE", false);
    assertEquals(1, subcontinents.size());
    final SubcontinentDto savedSubcontinentDto = getSubcontinentFacade().getByUuid(subcontinents.get(0).getUuid());
    assertEquals("CENTRAL_EUROPE", savedSubcontinentDto.getDefaultName());
    assertEquals(I18nProperties.getContinentName("EUROPE"), savedSubcontinentDto.getContinent().getCaption());
    final List<SubcontinentIndexDto> indexList = getSubcontinentFacade().getIndexList(new SubcontinentCriteria().continent(continent.toReference()), null, null, null);
    assertEquals(1, indexList.size());
    final SubcontinentIndexDto subcontinentIndexDto = indexList.get(0);
    assertEquals("CENTRAL_EUROPE", subcontinentIndexDto.getDefaultName());
    assertEquals(I18nProperties.getContinentName("EUROPE"), subcontinentIndexDto.getContinent().getCaption());
    assertEquals("Central Europe", subcontinentIndexDto.getDisplayName());
}
Also used : Continent(de.symeda.sormas.backend.infrastructure.continent.Continent) SubcontinentIndexDto(de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentIndexDto) SubcontinentReferenceDto(de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentReferenceDto) SubcontinentDto(de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentDto) SubcontinentCriteria(de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentCriteria) Test(org.junit.Test) AbstractBeanTest(de.symeda.sormas.backend.AbstractBeanTest)

Aggregations

SubcontinentCriteria (de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentCriteria)2 ContinentCriteria (de.symeda.sormas.api.infrastructure.continent.ContinentCriteria)1 SubcontinentDto (de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentDto)1 SubcontinentIndexDto (de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentIndexDto)1 SubcontinentReferenceDto (de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentReferenceDto)1 AbstractBeanTest (de.symeda.sormas.backend.AbstractBeanTest)1 Continent (de.symeda.sormas.backend.infrastructure.continent.Continent)1 Test (org.junit.Test)1