use of eu.bcvsolutions.idm.core.api.dto.filter.IdmGenerateValueFilter in project CzechIdMng by bcvsolutions.
the class DefaultValueGeneratorManager method getEnabledGenerateValues.
private List<IdmGenerateValueDto> getEnabledGenerateValues(Class<? extends AbstractDto> dtoType) {
Assert.notNull(dtoType, "DTO type is required.");
//
IdmGenerateValueFilter filter = new IdmGenerateValueFilter();
filter.setDisabled(Boolean.FALSE);
filter.setDtoType(dtoType.getCanonicalName());
// we must create new instance of array list, given list is unmodifiable
List<IdmGenerateValueDto> generateValues = new ArrayList<>(service.find(filter, null).getContent());
// sort by order
Collections.sort(generateValues, new Comparator<IdmGenerateValueDto>() {
@Override
public int compare(IdmGenerateValueDto o1, IdmGenerateValueDto o2) {
return Shorts.compare(o1.getSeq(), o2.getSeq());
}
});
return generateValues;
}
use of eu.bcvsolutions.idm.core.api.dto.filter.IdmGenerateValueFilter in project CzechIdMng by bcvsolutions.
the class ComplexHrProcessIntegrationTest method otherStuffClenaup.
private void otherStuffClenaup() {
// script cleanup
IdmScriptDto dto = scriptService.getByCode(stringToLocalDateScript);
scriptService.delete(dto);
dto = scriptService.getByCode(getIdentityUuidByPersonalNumScript);
scriptService.delete(dto);
// generator setting removal
IdmGenerateValueFilter generatorFilter = new IdmGenerateValueFilter();
generatorFilter.setDtoType(IdmIdentityDto.class.getCanonicalName());
generatedAttributeService.find(generatorFilter, null).getContent().stream().filter(gen -> IdentityUsernameGenerator.class.getCanonicalName().equals(gen.getGeneratorType())).forEach(gen -> {
generatedAttributeService.delete(gen);
});
generatedAttributeService.find(generatorFilter, null).getContent().stream().filter(gen -> IdentityEmailGenerator.class.getCanonicalName().equals(gen.getGeneratorType())).forEach(gen -> {
generatedAttributeService.delete(gen);
});
// identity EAV
IdmFormAttributeFilter formAttrFilt = new IdmFormAttributeFilter();
formAttrFilt.setCode(eavAutoRoleAttrName);
List<IdmFormAttributeDto> attrs = formAttrService.find(formAttrFilt, null).getContent();
attrs.forEach(attr -> {
// if deleted after identity is deleted, no value remains
formService.deleteAttribute(attr);
});
}
Aggregations