Search in sources :

Example 56 with SysSystemAttributeMappingDto

use of eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto in project CzechIdMng by bcvsolutions.

the class IdentityAccountManagementTest method initData.

private void initData() {
    // create test system
    SysSystemDto system = helper.createTestResourceSystem(true, SYSTEM_NAME);
    // 
    // Create test identity for provisioning test
    IdmIdentityDto identity = new IdmIdentityDto();
    identity.setUsername(IDENTITY_USERNAME);
    identity.setFirstName(IDENTITY_USERNAME);
    identity.setLastName(IDENTITY_USERNAME);
    identity.setEmail(IDENTITY_EMAIL);
    identity = identityService.save(identity);
    // Create mapped attributes to schema
    SysSystemMappingDto systemMapping = helper.getDefaultMapping(system);
    SysSystemAttributeMappingDto attributeHandlingLastName = schemaAttributeHandlingService.findBySystemMappingAndName(systemMapping.getId(), TestHelper.ATTRIBUTE_MAPPING_LASTNAME);
    SysSystemAttributeMappingDto attributeHandlingPassword = schemaAttributeHandlingService.findBySystemMappingAndName(systemMapping.getId(), TestHelper.ATTRIBUTE_MAPPING_PASSWORD);
    SysSystemAttributeMappingDto attributeHandlingFirstName = schemaAttributeHandlingService.findBySystemMappingAndName(systemMapping.getId(), TestHelper.ATTRIBUTE_MAPPING_FIRSTNAME);
    SysSystemAttributeMappingDto attributeHandlingUserName = schemaAttributeHandlingService.findBySystemMappingAndName(systemMapping.getId(), TestHelper.ATTRIBUTE_MAPPING_NAME);
    // username is transformed
    attributeHandlingUserName.setTransformToResourceScript("return \"" + "x" + IDENTITY_USERNAME + "\";");
    attributeHandlingUserName = schemaAttributeHandlingService.save(attributeHandlingUserName);
    /*
		 * Create role with link on system (default)
		 */
    IdmRoleDto roleDefault = new IdmRoleDto();
    roleDefault.setName(ROLE_DEFAULT);
    roleDefault = roleService.save(roleDefault);
    SysRoleSystemDto roleSystemDefault = new SysRoleSystemDto();
    roleSystemDefault.setRole(roleDefault.getId());
    roleSystemDefault.setSystem(system.getId());
    roleSystemDefault.setSystemMapping(systemMapping.getId());
    roleSystemDefault = roleSystemService.save(roleSystemDefault);
    /*
		 * Create role with link on system (overloading last name attribute)
		 */
    IdmRoleDto roleOverloadingLastName = new IdmRoleDto();
    roleOverloadingLastName.setName(ROLE_OVERLOADING_LAST_NAME);
    roleOverloadingLastName = roleService.save(roleOverloadingLastName);
    SysRoleSystemDto roleSystemLastName = new SysRoleSystemDto();
    roleSystemLastName.setRole(roleOverloadingLastName.getId());
    roleSystemLastName.setSystem(system.getId());
    roleSystemLastName.setSystemMapping(systemMapping.getId());
    roleSystemLastName = roleSystemService.save(roleSystemLastName);
    // Attribute for overloading last name attribute
    SysRoleSystemAttributeDto attributeLastName = new SysRoleSystemAttributeDto();
    attributeLastName.setEntityAttribute(true);
    attributeLastName.setIdmPropertyName("email");
    attributeLastName.setName("Overloaded lastName with email");
    attributeLastName.setRoleSystem(roleSystemLastName.getId());
    attributeLastName.setSystemAttributeMapping(attributeHandlingLastName.getId());
    attributeLastName = roleSystemAttributeService.save(attributeLastName);
    /*
		 * Create role with link on system (overloading password attribute)
		 */
    IdmRoleDto roleOverloadingPassword = new IdmRoleDto();
    roleOverloadingPassword.setName(ROLE_OVERLOADING_PASSWORD);
    roleOverloadingPassword = roleService.save(roleOverloadingPassword);
    SysRoleSystemDto roleSystemPassword = new SysRoleSystemDto();
    roleSystemPassword.setRole(roleOverloadingPassword.getId());
    roleSystemPassword.setSystem(system.getId());
    roleSystemPassword.setSystemMapping(systemMapping.getId());
    roleSystemPassword = roleSystemService.save(roleSystemPassword);
    // Attribute for overloading last name attribute
    SysRoleSystemAttributeDto attributePassword = new SysRoleSystemAttributeDto();
    attributePassword.setEntityAttribute(true);
    attributePassword.setIdmPropertyName("password");
    attributePassword.setConfidentialAttribute(true);
    attributePassword.setName("Overloaded password - add x");
    attributePassword.setRoleSystem(roleSystemPassword.getId());
    attributePassword.setSystemAttributeMapping(attributeHandlingPassword.getId());
    attributePassword.setTransformScript("return new " + GuardedString.class.getName() + "(\"x\"+attributeValue.asString());");
    attributePassword = roleSystemAttributeService.save(attributePassword);
    /*
		 * Create role with link on system (overloading (disable) first name
		 * attribute)
		 */
    IdmRoleDto roleOverloadingFirstName = new IdmRoleDto();
    roleOverloadingFirstName.setName(ROLE_OVERLOADING_FIRST_NAME);
    roleOverloadingFirstName = roleService.save(roleOverloadingFirstName);
    SysRoleSystemDto roleSystemFirstName = new SysRoleSystemDto();
    roleSystemFirstName.setRole(roleOverloadingFirstName.getId());
    roleSystemFirstName.setSystem(system.getId());
    roleSystemFirstName.setSystemMapping(systemMapping.getId());
    roleSystemFirstName = roleSystemService.save(roleSystemFirstName);
    // Attribute for overloading first name attribute (disable him)
    SysRoleSystemAttributeDto attributeFirstName = new SysRoleSystemAttributeDto();
    attributeFirstName.setDisabledDefaultAttribute(true);
    attributeFirstName.setName("Disable first name");
    attributeFirstName.setRoleSystem(roleSystemFirstName.getId());
    attributeFirstName.setSystemAttributeMapping(attributeHandlingFirstName.getId());
    attributeFirstName = roleSystemAttributeService.save(attributeFirstName);
    /*
		 * Create role with link on system (overloading name attribute ...
		 * create Y account)
		 */
    IdmRoleDto roleOverloadingName = new IdmRoleDto();
    roleOverloadingName.setName(ROLE_OVERLOADING_Y_ACCOUNT);
    roleOverloadingName = roleService.save(roleOverloadingName);
    SysRoleSystemDto roleSystemName = new SysRoleSystemDto();
    roleSystemName.setRole(roleOverloadingName.getId());
    roleSystemName.setSystem(system.getId());
    roleSystemName.setSystemMapping(systemMapping.getId());
    roleSystemName = roleSystemService.save(roleSystemName);
    // Attribute for overloading first name attribute (disable him)
    SysRoleSystemAttributeDto attributeName = new SysRoleSystemAttributeDto();
    attributeName.setUid(true);
    attributeName.setEntityAttribute(true);
    attributeName.setIdmPropertyName("username");
    attributeName.setName("Account with Y-prefix name");
    attributeName.setTransformScript("return \"y\" + attributeValue ;");
    attributeName.setRoleSystem(roleSystemName.getId());
    attributeName.setSystemAttributeMapping(attributeHandlingUserName.getId());
    attributeName = roleSystemAttributeService.save(attributeName);
}
Also used : IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) SysRoleSystemDto(eu.bcvsolutions.idm.acc.dto.SysRoleSystemDto) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) SysRoleSystemAttributeDto(eu.bcvsolutions.idm.acc.dto.SysRoleSystemAttributeDto)

Example 57 with SysSystemAttributeMappingDto

use of eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto in project CzechIdMng by bcvsolutions.

the class IdentityRoleValidRequestSchedulerTest method createAndSaveSystemWithMapping.

private SysSystemDto createAndSaveSystemWithMapping() {
    system = null;
    systemMapping = null;
    SysSystemAttributeMappingDto nameAttributeMapping = null;
    SysSystemAttributeMappingDto firstNameAttributeMapping = null;
    SysSystemAttributeMappingDto lastNameAttributeMapping = null;
    SysSystemAttributeMappingDto passwordAttributeMapping = null;
    // prepare test system
    system = helper.createSystem(TestResource.TABLE_NAME);
    // generate schema
    List<SysSchemaObjectClassDto> objectClasses = systemService.generateSchema(system);
    // create test mapping
    systemMapping = new SysSystemMappingDto();
    systemMapping.setName("default_" + System.currentTimeMillis());
    systemMapping.setEntityType(SystemEntityType.IDENTITY);
    systemMapping.setOperationType(SystemOperationType.PROVISIONING);
    systemMapping.setObjectClass(objectClasses.get(0).getId());
    systemMapping = mappingService.save(systemMapping);
    SysSchemaAttributeFilter schemaAttributeFilter = new SysSchemaAttributeFilter();
    schemaAttributeFilter.setSystemId(system.getId());
    Page<SysSchemaAttributeDto> schemaAttributesPage = schemaAttributeService.find(schemaAttributeFilter, null);
    for (SysSchemaAttributeDto schemaAttr : schemaAttributesPage) {
        if ("__NAME__".equals(schemaAttr.getName())) {
            nameAttributeMapping = new SysSystemAttributeMappingDto();
            nameAttributeMapping.setUid(true);
            nameAttributeMapping.setEntityAttribute(true);
            nameAttributeMapping.setIdmPropertyName("username");
            nameAttributeMapping.setName(schemaAttr.getName());
            nameAttributeMapping.setSchemaAttribute(schemaAttr.getId());
            nameAttributeMapping.setSystemMapping(systemMapping.getId());
            nameAttributeMapping = attributeMappingService.save(nameAttributeMapping);
        } else if ("firstname".equalsIgnoreCase(schemaAttr.getName())) {
            firstNameAttributeMapping = new SysSystemAttributeMappingDto();
            firstNameAttributeMapping.setIdmPropertyName("firstName");
            firstNameAttributeMapping.setSchemaAttribute(schemaAttr.getId());
            firstNameAttributeMapping.setName(schemaAttr.getName());
            firstNameAttributeMapping.setSystemMapping(systemMapping.getId());
            firstNameAttributeMapping = attributeMappingService.save(firstNameAttributeMapping);
        } else if ("lastname".equalsIgnoreCase(schemaAttr.getName())) {
            lastNameAttributeMapping = new SysSystemAttributeMappingDto();
            lastNameAttributeMapping.setIdmPropertyName("lastName");
            lastNameAttributeMapping.setName(schemaAttr.getName());
            lastNameAttributeMapping.setSchemaAttribute(schemaAttr.getId());
            lastNameAttributeMapping.setSystemMapping(systemMapping.getId());
            lastNameAttributeMapping = attributeMappingService.save(lastNameAttributeMapping);
        } else if (IcConnectorFacade.PASSWORD_ATTRIBUTE_NAME.equalsIgnoreCase(schemaAttr.getName())) {
            passwordAttributeMapping = new SysSystemAttributeMappingDto();
            passwordAttributeMapping.setIdmPropertyName("password");
            passwordAttributeMapping.setSchemaAttribute(schemaAttr.getId());
            passwordAttributeMapping.setName(schemaAttr.getName());
            passwordAttributeMapping.setSystemMapping(systemMapping.getId());
            passwordAttributeMapping = attributeMappingService.save(passwordAttributeMapping);
        }
    }
    assertNotNull(system);
    assertNotNull(nameAttributeMapping);
    assertNotNull(firstNameAttributeMapping);
    assertNotNull(lastNameAttributeMapping);
    assertNotNull(passwordAttributeMapping);
    return system;
}
Also used : SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) SysSchemaAttributeDto(eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto) SysSchemaAttributeFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSchemaAttributeFilter) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) SysSchemaObjectClassDto(eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto)

Example 58 with SysSystemAttributeMappingDto

use of eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto in project CzechIdMng by bcvsolutions.

the class DefaultRoleSynchronizationServiceTest method createMapping.

private void createMapping(SysSystemDto system, final SysSystemMappingDto entityHandlingResult) {
    SysSchemaAttributeFilter schemaAttributeFilter = new SysSchemaAttributeFilter();
    schemaAttributeFilter.setSystemId(system.getId());
    Page<SysSchemaAttributeDto> schemaAttributesPage = schemaAttributeService.find(schemaAttributeFilter, null);
    schemaAttributesPage.forEach(schemaAttr -> {
        if (ATTRIBUTE_NAME.equals(schemaAttr.getName())) {
            SysSystemAttributeMappingDto attributeHandlingName = new SysSystemAttributeMappingDto();
            attributeHandlingName.setUid(true);
            attributeHandlingName.setEntityAttribute(true);
            attributeHandlingName.setIdmPropertyName("name");
            attributeHandlingName.setName(schemaAttr.getName());
            attributeHandlingName.setSchemaAttribute(schemaAttr.getId());
            // For provisioning .. we need create UID
            attributeHandlingName.setTransformToResourceScript("return entity.getName();");
            attributeHandlingName.setSystemMapping(entityHandlingResult.getId());
            schemaAttributeMappingService.save(attributeHandlingName);
        } else if ("TYPE".equalsIgnoreCase(schemaAttr.getName())) {
            SysSystemAttributeMappingDto attributeHandlingName = new SysSystemAttributeMappingDto();
            attributeHandlingName.setIdmPropertyName("roleType");
            attributeHandlingName.setEntityAttribute(true);
            attributeHandlingName.setSchemaAttribute(schemaAttr.getId());
            attributeHandlingName.setName(schemaAttr.getName());
            attributeHandlingName.setSystemMapping(entityHandlingResult.getId());
            schemaAttributeMappingService.save(attributeHandlingName);
        } else if ("PRIORITY".equalsIgnoreCase(schemaAttr.getName())) {
            SysSystemAttributeMappingDto attributeHandlingName = new SysSystemAttributeMappingDto();
            attributeHandlingName.setIdmPropertyName("priority");
            attributeHandlingName.setEntityAttribute(true);
            attributeHandlingName.setSchemaAttribute(schemaAttr.getId());
            attributeHandlingName.setName(schemaAttr.getName());
            attributeHandlingName.setSystemMapping(entityHandlingResult.getId());
            schemaAttributeMappingService.save(attributeHandlingName);
        } else if ("APPROVE_REMOVE".equalsIgnoreCase(schemaAttr.getName())) {
            SysSystemAttributeMappingDto attributeHandlingName = new SysSystemAttributeMappingDto();
            attributeHandlingName.setIdmPropertyName("approveRemove");
            attributeHandlingName.setName(schemaAttr.getName());
            attributeHandlingName.setEntityAttribute(true);
            attributeHandlingName.setSchemaAttribute(schemaAttr.getId());
            attributeHandlingName.setSystemMapping(entityHandlingResult.getId());
            schemaAttributeMappingService.save(attributeHandlingName);
        } else if ("MODIFIED".equalsIgnoreCase(schemaAttr.getName())) {
            SysSystemAttributeMappingDto attributeHandlingName = new SysSystemAttributeMappingDto();
            attributeHandlingName.setIdmPropertyName("changed");
            attributeHandlingName.setName(schemaAttr.getName());
            attributeHandlingName.setEntityAttribute(false);
            attributeHandlingName.setExtendedAttribute(true);
            attributeHandlingName.setSchemaAttribute(schemaAttr.getId());
            attributeHandlingName.setSystemMapping(entityHandlingResult.getId());
            schemaAttributeMappingService.save(attributeHandlingName);
        } else if ("DESCRIPTION".equalsIgnoreCase(schemaAttr.getName())) {
            SysSystemAttributeMappingDto attributeHandlingName = new SysSystemAttributeMappingDto();
            attributeHandlingName.setIdmPropertyName("description");
            attributeHandlingName.setName(schemaAttr.getName());
            attributeHandlingName.setEntityAttribute(true);
            ;
            attributeHandlingName.setSchemaAttribute(schemaAttr.getId());
            attributeHandlingName.setSystemMapping(entityHandlingResult.getId());
            schemaAttributeMappingService.save(attributeHandlingName);
        }
    });
}
Also used : SysSchemaAttributeDto(eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) SysSchemaAttributeFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSchemaAttributeFilter)

Example 59 with SysSystemAttributeMappingDto

use of eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto in project CzechIdMng by bcvsolutions.

the class DefaultRoleSynchronizationServiceTest method doCreateSyncConfig.

@Test
@Transactional
public void doCreateSyncConfig() {
    initData();
    SysSystemMappingFilter mappingFilter = new SysSystemMappingFilter();
    mappingFilter.setEntityType(SystemEntityType.ROLE);
    mappingFilter.setSystemId(system.getId());
    mappingFilter.setOperationType(SystemOperationType.SYNCHRONIZATION);
    List<SysSystemMappingDto> mappings = systemMappingService.find(mappingFilter, null).getContent();
    Assert.assertEquals(1, mappings.size());
    SysSystemMappingDto mapping = mappings.get(0);
    SysSystemAttributeMappingFilter attributeMappingFilter = new SysSystemAttributeMappingFilter();
    attributeMappingFilter.setSystemMappingId(mapping.getId());
    List<SysSystemAttributeMappingDto> attributes = schemaAttributeMappingService.find(attributeMappingFilter, null).getContent();
    SysSystemAttributeMappingDto uidAttribute = attributes.stream().filter(attribute -> {
        return attribute.isUid();
    }).findFirst().orElse(null);
    SysSystemAttributeMappingDto tokenAttribute = attributes.stream().filter(attribute -> {
        return "changed".equals(attribute.getIdmPropertyName());
    }).findFirst().orElse(null);
    // Create default synchronization config
    AbstractSysSyncConfigDto syncConfigCustom = new SysSyncConfigDto();
    syncConfigCustom.setReconciliation(false);
    syncConfigCustom.setCustomFilter(true);
    syncConfigCustom.setSystemMapping(mapping.getId());
    syncConfigCustom.setCorrelationAttribute(uidAttribute.getId());
    syncConfigCustom.setTokenAttribute(tokenAttribute.getId());
    syncConfigCustom.setName(SYNC_CONFIG_NAME);
    syncConfigCustom.setLinkedAction(SynchronizationLinkedActionType.IGNORE);
    syncConfigCustom.setUnlinkedAction(SynchronizationUnlinkedActionType.IGNORE);
    syncConfigCustom.setMissingEntityAction(SynchronizationMissingEntityActionType.CREATE_ENTITY);
    syncConfigCustom.setMissingAccountAction(ReconciliationMissingAccountActionType.IGNORE);
    syncConfigService.save(syncConfigCustom);
    SysSyncConfigFilter configFilter = new SysSyncConfigFilter();
    configFilter.setSystemId(system.getId());
    Assert.assertEquals(1, syncConfigService.find(configFilter, null).getTotalElements());
}
Also used : AbstractSysSyncConfigDto(eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto) SysSystemAttributeMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter) SysSystemMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemMappingFilter) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) SysSyncConfigDto(eu.bcvsolutions.idm.acc.dto.SysSyncConfigDto) AbstractSysSyncConfigDto(eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto) SysSyncConfigFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncConfigFilter) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Example 60 with SysSystemAttributeMappingDto

use of eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto in project CzechIdMng by bcvsolutions.

the class DefaultSynchronizationServiceTest method createMapping.

private void createMapping(SysSystemDto system, final SysSystemMappingDto entityHandlingResult) {
    SysSchemaAttributeFilter schemaAttributeFilter = new SysSchemaAttributeFilter();
    schemaAttributeFilter.setSystemId(system.getId());
    Page<SysSchemaAttributeDto> schemaAttributesPage = schemaAttributeService.find(schemaAttributeFilter, null);
    schemaAttributesPage.forEach(schemaAttr -> {
        if (ATTRIBUTE_NAME.equals(schemaAttr.getName())) {
            SysSystemAttributeMappingDto attributeMapping = new SysSystemAttributeMappingDto();
            attributeMapping.setUid(true);
            attributeMapping.setEntityAttribute(true);
            attributeMapping.setIdmPropertyName("username");
            attributeMapping.setName(schemaAttr.getName());
            attributeMapping.setSchemaAttribute(schemaAttr.getId());
            attributeMapping.setSystemMapping(entityHandlingResult.getId());
            schemaAttributeMappingService.save(attributeMapping);
        } else if ("firstname".equalsIgnoreCase(schemaAttr.getName())) {
            SysSystemAttributeMappingDto attributeMapping = new SysSystemAttributeMappingDto();
            attributeMapping.setIdmPropertyName("firstName");
            attributeMapping.setSchemaAttribute(schemaAttr.getId());
            attributeMapping.setName(schemaAttr.getName());
            attributeMapping.setSystemMapping(entityHandlingResult.getId());
            schemaAttributeMappingService.save(attributeMapping);
        } else if ("lastname".equalsIgnoreCase(schemaAttr.getName())) {
            SysSystemAttributeMappingDto attributeMapping = new SysSystemAttributeMappingDto();
            attributeMapping.setIdmPropertyName("lastName");
            attributeMapping.setName(schemaAttr.getName());
            attributeMapping.setSchemaAttribute(schemaAttr.getId());
            attributeMapping.setSystemMapping(entityHandlingResult.getId());
            schemaAttributeMappingService.save(attributeMapping);
        } else if (ATTRIBUTE_EMAIL.equalsIgnoreCase(schemaAttr.getName())) {
            SysSystemAttributeMappingDto attributeMapping = new SysSystemAttributeMappingDto();
            attributeMapping.setIdmPropertyName("email");
            attributeMapping.setName(schemaAttr.getName());
            attributeMapping.setSchemaAttribute(schemaAttr.getId());
            attributeMapping.setSystemMapping(entityHandlingResult.getId());
            schemaAttributeMappingService.save(attributeMapping);
        } else if (IcConnectorFacade.PASSWORD_ATTRIBUTE_NAME.equalsIgnoreCase(schemaAttr.getName())) {
            SysSystemAttributeMappingDto attributeMapping = new SysSystemAttributeMappingDto();
            attributeMapping.setIdmPropertyName("password");
            attributeMapping.setSchemaAttribute(schemaAttr.getId());
            attributeMapping.setName(schemaAttr.getName());
            attributeMapping.setSystemMapping(entityHandlingResult.getId());
            schemaAttributeMappingService.save(attributeMapping);
        } else if (SystemOperationType.SYNCHRONIZATION == entityHandlingResult.getOperationType() && ATTRIBUTE_MODIFIED.equalsIgnoreCase(schemaAttr.getName())) {
            SysSystemAttributeMappingDto attributeMapping = new SysSystemAttributeMappingDto();
            attributeMapping.setEntityAttribute(false);
            attributeMapping.setExtendedAttribute(true);
            attributeMapping.setSchemaAttribute(schemaAttr.getId());
            attributeMapping.setIdmPropertyName(ATTRIBUTE_MODIFIED);
            attributeMapping.setName(ATTRIBUTE_MODIFIED);
            attributeMapping.setSystemMapping(entityHandlingResult.getId());
            schemaAttributeMappingService.save(attributeMapping);
        } else if (schemaAttr.getName().equals(EAV_ATTRIBUTE)) {
            SysSystemAttributeMappingDto attributeMapping = new SysSystemAttributeMappingDto();
            attributeMapping.setExtendedAttribute(true);
            attributeMapping.setEntityAttribute(false);
            attributeMapping.setSchemaAttribute(schemaAttr.getId());
            attributeMapping.setIdmPropertyName(EAV_ATTRIBUTE);
            attributeMapping.setName(EAV_ATTRIBUTE);
            attributeMapping.setSystemMapping(entityHandlingResult.getId());
            schemaAttributeMappingService.save(attributeMapping);
        }
    });
}
Also used : SysSchemaAttributeDto(eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) SysSchemaAttributeFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSchemaAttributeFilter)

Aggregations

SysSystemAttributeMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto)78 SysSystemMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto)48 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)42 SysSystemAttributeMappingFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter)37 SysSchemaAttributeDto (eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto)34 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)29 Test (org.junit.Test)29 SysSchemaObjectClassDto (eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto)26 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)26 AccAccountDto (eu.bcvsolutions.idm.acc.dto.AccAccountDto)21 SystemEntityType (eu.bcvsolutions.idm.acc.domain.SystemEntityType)20 SysSchemaAttributeFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSchemaAttributeFilter)20 AbstractSysSyncConfigDto (eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto)19 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)18 AccIdentityAccountDto (eu.bcvsolutions.idm.acc.dto.AccIdentityAccountDto)14 SysSyncLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncLogDto)14 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)14 SysSyncActionLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncActionLogDto)13 SysSyncItemLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncItemLogDto)13 AccIdentityAccountFilter (eu.bcvsolutions.idm.acc.dto.filter.AccIdentityAccountFilter)13