use of eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto in project CzechIdMng by bcvsolutions.
the class DefaultIdmFormDefinitionService method exportOnlyDefinition.
@Override
public void exportOnlyDefinition(UUID id, IdmExportImportDto batch) {
IdmFormDefinitionDto definition = internalExport(id);
definition.setFormAttributes(Lists.newArrayList());
batch.getExportedDtos().add(definition);
ExportDescriptorDto exportDescriptorDto = new ExportDescriptorDto(definition.getClass());
if (!batch.getExportOrder().contains(exportDescriptorDto)) {
batch.getExportOrder().add(exportDescriptorDto);
}
// super.export(id, batch);
}
use of eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto in project CzechIdMng by bcvsolutions.
the class DefaultIdmFormDefinitionService method export.
@Override
public void export(UUID id, IdmExportImportDto batch) {
super.export(id, batch);
// Export form attributes
IdmFormAttributeFilter systemMappingFilter = new IdmFormAttributeFilter();
systemMappingFilter.setDefinitionId(id);
List<IdmFormAttributeDto> attributes = formAttributeService.find(systemMappingFilter, null).getContent();
if (attributes.isEmpty()) {
formAttributeService.export(ExportManager.BLANK_UUID, batch);
}
attributes.forEach(mapping -> {
formAttributeService.export(mapping.getId(), batch);
// Authoritative mode is not set here only parent field could be sets.
ExportDescriptorDto descriptor = getExportManager().getDescriptor(batch, mapping.getClass());
if (descriptor != null) {
descriptor.getParentFields().add(IdmFormAttribute_.formDefinition.getName());
}
});
}
use of eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto in project CzechIdMng by bcvsolutions.
the class AbstractReadDtoService method export.
@Override
public void export(UUID id, IdmExportImportDto batch) {
Assert.notNull(batch, "Export batch must exist!");
ExportDescriptorDto exportDescriptorDto = null;
// exists (no schema, no sync ...)).
if (ExportManager.BLANK_UUID.equals(id)) {
exportDescriptorDto = new ExportDescriptorDto(this.getDtoClass());
} else {
DTO export = internalExport(id);
batch.getExportedDtos().add(export);
exportDescriptorDto = new ExportDescriptorDto(export.getClass());
}
if (!batch.getExportOrder().contains(exportDescriptorDto)) {
batch.getExportOrder().add(exportDescriptorDto);
}
}
use of eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto in project CzechIdMng by bcvsolutions.
the class DefaultSysProvisioningBreakRecipientService method export.
@Override
public void export(UUID id, IdmExportImportDto batch) {
Assert.notNull(batch, "Export batch must exist!");
// Export break-recipient
super.export(id, batch);
// Advanced pairing
ExportDescriptorDto descriptorDto = getExportManager().getDescriptor(batch, this.getDtoClass());
descriptorDto.getAdvancedParingFields().add(SysProvisioningBreakRecipient_.role.getName());
descriptorDto.getAdvancedParingFields().add(SysProvisioningBreakRecipient_.identity.getName());
}
use of eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto in project CzechIdMng by bcvsolutions.
the class DefaultSysRoleSystemService method export.
@Override
public void export(UUID id, IdmExportImportDto batch) {
Assert.notNull(batch, "Export batch must exist!");
// Export role-system
super.export(id, batch);
ExportDescriptorDto descriptorDto = getExportManager().getDescriptor(batch, this.getDtoClass());
descriptorDto.setOptional(true);
descriptorDto.getAdvancedParingFields().add(SysRoleSystem_.role.getName());
// Export role systems
SysRoleSystemAttributeFilter roleSystemAttributeFilter = new SysRoleSystemAttributeFilter();
roleSystemAttributeFilter.setRoleSystemId(id);
List<SysRoleSystemAttributeDto> roleSystemAttributes = roleSystemAttributeService.find(roleSystemAttributeFilter, null).getContent();
if (roleSystemAttributes.isEmpty()) {
roleSystemAttributeService.export(ExportManager.BLANK_UUID, batch);
}
roleSystemAttributes.forEach(roleSystemAttribute -> {
roleSystemAttributeService.export(roleSystemAttribute.getId(), batch);
});
// Set parent field -> set authoritative mode for override attributes.
this.getExportManager().setAuthoritativeMode(SysRoleSystemAttribute_.roleSystem.getName(), "systemId", SysRoleSystemAttributeDto.class, batch);
// The override attribute is optional too.
ExportDescriptorDto descriptorAttributeDto = getExportManager().getDescriptor(batch, SysRoleSystemAttributeDto.class);
descriptorAttributeDto.setOptional(true);
descriptorAttributeDto.getAdvancedParingFields().add(SysRoleSystemAttribute_.roleSystem.getName());
}
Aggregations