use of eu.bcvsolutions.idm.core.eav.api.dto.IdmCodeListDto in project CzechIdMng by bcvsolutions.
the class DefaultCodeListManagerIntegrationTest method testReferentialIntegrity.
@Test
public void testReferentialIntegrity() {
IdmCodeListDto codeList = manager.create(getHelper().createName());
IdmCodeListItemDto item = manager.createItem(codeList, getHelper().createName(), getHelper().createName());
//
Assert.assertNotNull(manager.get(codeList));
Assert.assertNotNull(manager.getItem(codeList, item.getCode()));
Assert.assertNotNull(formService.getDefinition(codeList.getFormDefinition().getId()));
//
manager.delete(codeList);
//
Assert.assertNull(manager.get(codeList));
Assert.assertNull(manager.getItem(codeList, item.getCode()));
Assert.assertNull(formService.getDefinition(codeList.getFormDefinition().getId()));
}
use of eu.bcvsolutions.idm.core.eav.api.dto.IdmCodeListDto in project CzechIdMng by bcvsolutions.
the class DefaultCodeListManagerIntegrationTest method testChangeFormDefintion.
@Test(expected = ResultCodeException.class)
public void testChangeFormDefintion() {
IdmCodeListDto codeList = manager.create(getHelper().createName());
codeList.setFormDefinition(formService.createDefinition(IdmCodeListItemDto.class, getHelper().createName(), null));
//
manager.save(codeList);
}
use of eu.bcvsolutions.idm.core.eav.api.dto.IdmCodeListDto in project CzechIdMng by bcvsolutions.
the class InitCodeListProcessor method process.
@Override
public EventResult<ModuleDescriptorDto> process(EntityEvent<ModuleDescriptorDto> event) {
// prepare system code lists
if (codeListManager.get(BaseCodeList.ENVIRONMENT) == null) {
IdmCodeListDto environment = codeListManager.create(BaseCodeList.ENVIRONMENT);
codeListManager.createItem(environment, "development", "environment.development.title");
codeListManager.createItem(environment, "test", "environment.test.title");
codeListManager.createItem(environment, "production", "environment.production.title");
}
//
return new DefaultEventResult<>(event, this);
}
use of eu.bcvsolutions.idm.core.eav.api.dto.IdmCodeListDto in project CzechIdMng by bcvsolutions.
the class CodeListDeleteProcessor method process.
@Override
public EventResult<IdmCodeListDto> process(EntityEvent<IdmCodeListDto> event) {
IdmCodeListDto codeList = event.getContent();
//
service.deleteInternal(codeList);
//
return new DefaultEventResult<>(event, this);
}
use of eu.bcvsolutions.idm.core.eav.api.dto.IdmCodeListDto in project CzechIdMng by bcvsolutions.
the class DefaultCodeListManager method getItems.
@Override
public List<IdmCodeListItemDto> getItems(Serializable codeListIdentifier, Pageable pageable, BasePermission... permission) {
Assert.notNull(codeListIdentifier, "CodeList identifier is required.");
IdmCodeListDto codeList = get(codeListIdentifier);
Assert.notNull(codeList, "CodeList is required.");
//
IdmCodeListItemFilter filter = new IdmCodeListItemFilter();
filter.setCodeListId(codeList.getId());
//
return codeListItemService.find(filter, pageable, permission).getContent();
}
Aggregations