Search in sources :

Example 16 with ExportDescriptorDto

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);
}
Also used : ExportDescriptorDto(eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto)

Example 17 with ExportDescriptorDto

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());
        }
    });
}
Also used : ExportDescriptorDto(eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto) IdmFormAttributeFilter(eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmFormAttributeFilter) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto)

Example 18 with ExportDescriptorDto

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);
    }
}
Also used : ExportDescriptorDto(eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto)

Example 19 with 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());
}
Also used : ExportDescriptorDto(eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto)

Example 20 with ExportDescriptorDto

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());
}
Also used : ExportDescriptorDto(eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto) SysRoleSystemAttributeFilter(eu.bcvsolutions.idm.acc.dto.filter.SysRoleSystemAttributeFilter) SysRoleSystemAttributeDto(eu.bcvsolutions.idm.acc.dto.SysRoleSystemAttributeDto)

Aggregations

ExportDescriptorDto (eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto)20 BaseDto (eu.bcvsolutions.idm.core.api.dto.BaseDto)4 ResultCodeException (eu.bcvsolutions.idm.core.api.exception.ResultCodeException)4 IdmFormAttributeDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto)4 IdmFormDefinitionDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto)4 UUID (java.util.UUID)4 JsonNode (com.fasterxml.jackson.databind.JsonNode)3 ImmutableMap (com.google.common.collect.ImmutableMap)3 Lists (com.google.common.collect.Lists)3 Codeable (eu.bcvsolutions.idm.core.api.domain.Codeable)3 CoreResultCode (eu.bcvsolutions.idm.core.api.domain.CoreResultCode)3 AbstractDto (eu.bcvsolutions.idm.core.api.dto.AbstractDto)3 EmbeddedDto (eu.bcvsolutions.idm.core.api.dto.EmbeddedDto)3 IdmExportImportDto (eu.bcvsolutions.idm.core.api.dto.IdmExportImportDto)3 CoreEvent (eu.bcvsolutions.idm.core.api.event.CoreEvent)3 CoreEventType (eu.bcvsolutions.idm.core.api.event.CoreEvent.CoreEventType)3 IntrospectionException (java.beans.IntrospectionException)3 PropertyDescriptor (java.beans.PropertyDescriptor)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)3 JsonParseException (com.fasterxml.jackson.core.JsonParseException)2