Search in sources :

Example 1 with IdmCodeListItemFilter

use of eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmCodeListItemFilter in project CzechIdMng by bcvsolutions.

the class DefaultIdmCodeListService method deleteInternal.

@Override
@Transactional
public void deleteInternal(IdmCodeListDto dto) {
    Assert.notNull(dto, "DTO is required.");
    Assert.notNull(dto.getId(), "DTO identifier is required.");
    // 
    // delete code list items
    IdmCodeListItemFilter filter = new IdmCodeListItemFilter();
    filter.setCodeListId(dto.getId());
    codeListItemService.find(filter, null).forEach(codeListItem -> {
        codeListItemService.delete(codeListItem);
    });
    // 
    super.deleteInternal(dto);
    // 
    // delete form definition
    // previous delete of code list items will delete associated form values.
    formDefinitionService.deleteById(dto.getFormDefinition());
}
Also used : IdmCodeListItemFilter(eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmCodeListItemFilter) Transactional(org.springframework.transaction.annotation.Transactional)

Example 2 with IdmCodeListItemFilter

use of eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmCodeListItemFilter 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();
}
Also used : IdmCodeListDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmCodeListDto) IdmCodeListItemFilter(eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmCodeListItemFilter)

Example 3 with IdmCodeListItemFilter

use of eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmCodeListItemFilter in project CzechIdMng by bcvsolutions.

the class IdmCodeListItemController method toFilter.

@Override
protected IdmCodeListItemFilter toFilter(MultiValueMap<String, Object> parameters) {
    IdmCodeListItemFilter filter = new IdmCodeListItemFilter(parameters);
    // 
    filter.setCodeListId(getParameterConverter().toEntityUuid(parameters, IdmCodeListItemFilter.PARAMETER_CODE_LIST_ID, IdmCodeListDto.class));
    // 
    return filter;
}
Also used : IdmCodeListDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmCodeListDto) IdmCodeListItemFilter(eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmCodeListItemFilter)

Aggregations

IdmCodeListItemFilter (eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmCodeListItemFilter)3 IdmCodeListDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmCodeListDto)2 Transactional (org.springframework.transaction.annotation.Transactional)1