Search in sources :

Example 26 with AttributeMapping

use of eu.bcvsolutions.idm.acc.domain.AttributeMapping in project CzechIdMng by bcvsolutions.

the class DefaultSysSystemAttributeMappingService method getValueByMappedAttribute.

@Override
public Object getValueByMappedAttribute(AttributeMapping attribute, List<IcAttribute> icAttributes) {
    Object icValue = null;
    Optional<IcAttribute> optionalIcAttribute = icAttributes.stream().filter(icAttribute -> {
        SysSchemaAttributeDto schemaAttributeDto = getSchemaAttribute(attribute);
        return schemaAttributeDto.getName().equals(icAttribute.getName());
    }).findFirst();
    if (optionalIcAttribute.isPresent()) {
        IcAttribute icAttribute = optionalIcAttribute.get();
        if (icAttribute.isMultiValue()) {
            icValue = icAttribute.getValues();
        } else {
            icValue = icAttribute.getValue();
        }
    }
    return this.transformValueFromResource(icValue, attribute, icAttributes);
}
Also used : IdmScriptCategory(eu.bcvsolutions.idm.core.api.domain.IdmScriptCategory) DtoUtils(eu.bcvsolutions.idm.core.api.utils.DtoUtils) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) PluginRegistry(org.springframework.plugin.core.PluginRegistry) Autowired(org.springframework.beans.factory.annotation.Autowired) FormService(eu.bcvsolutions.idm.core.eav.api.service.FormService) SysSystemAttributeMapping_(eu.bcvsolutions.idm.acc.entity.SysSystemAttributeMapping_) GroovyScriptService(eu.bcvsolutions.idm.core.api.service.GroovyScriptService) SysSchemaAttribute(eu.bcvsolutions.idm.acc.entity.SysSchemaAttribute) Predicate(javax.persistence.criteria.Predicate) Map(java.util.Map) CriteriaBuilder(javax.persistence.criteria.CriteriaBuilder) AbstractSysSyncConfigDto(eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto) SysSystemAttributeMapping(eu.bcvsolutions.idm.acc.entity.SysSystemAttributeMapping) CriteriaQuery(javax.persistence.criteria.CriteriaQuery) AbstractEntity_(eu.bcvsolutions.idm.core.api.entity.AbstractEntity_) SystemOperationType(eu.bcvsolutions.idm.acc.domain.SystemOperationType) IntrospectionException(java.beans.IntrospectionException) Serializable(java.io.Serializable) InvocationTargetException(java.lang.reflect.InvocationTargetException) IOUtils(org.apache.commons.io.IOUtils) AttributeMapping(eu.bcvsolutions.idm.acc.domain.AttributeMapping) SysSyncConfigRepository(eu.bcvsolutions.idm.acc.repository.SysSyncConfigRepository) SysRoleSystemAttributeFilter(eu.bcvsolutions.idm.acc.dto.filter.SysRoleSystemAttributeFilter) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) AccResultCode(eu.bcvsolutions.idm.acc.domain.AccResultCode) MappingContext(eu.bcvsolutions.idm.acc.domain.MappingContext) IcConnectorFacade(eu.bcvsolutions.idm.ic.service.api.IcConnectorFacade) SysSystemMapping_(eu.bcvsolutions.idm.acc.entity.SysSystemMapping_) SysSystemGroupSystemFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemGroupSystemFilter) IdmAttachmentDto(eu.bcvsolutions.idm.core.ecm.api.dto.IdmAttachmentDto) SysAttributeControlledValueDto(eu.bcvsolutions.idm.acc.dto.SysAttributeControlledValueDto) BooleanUtils(org.apache.commons.lang3.BooleanUtils) SysAttributeControlledValueFilter(eu.bcvsolutions.idm.acc.dto.filter.SysAttributeControlledValueFilter) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) AbstractDto(eu.bcvsolutions.idm.core.api.dto.AbstractDto) Lists(com.google.common.collect.Lists) Service(org.springframework.stereotype.Service) Root(javax.persistence.criteria.Root) SysRoleSystemAttributeService(eu.bcvsolutions.idm.acc.service.api.SysRoleSystemAttributeService) SysSchemaObjectClass_(eu.bcvsolutions.idm.acc.entity.SysSchemaObjectClass_) CoreException(eu.bcvsolutions.idm.core.api.exception.CoreException) Throwables(com.google.common.base.Throwables) IOException(java.io.IOException) IcAttribute(eu.bcvsolutions.idm.ic.api.IcAttribute) AbstractScriptEvaluator(eu.bcvsolutions.idm.core.script.evaluator.AbstractScriptEvaluator) IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) CoreResultCode(eu.bcvsolutions.idm.core.api.domain.CoreResultCode) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) Subquery(javax.persistence.criteria.Subquery) AuthorizableType(eu.bcvsolutions.idm.core.security.api.dto.AuthorizableType) SysSystemAttributeMappingRepository(eu.bcvsolutions.idm.acc.repository.SysSystemAttributeMappingRepository) FormPropertyManager(eu.bcvsolutions.idm.acc.service.api.FormPropertyManager) SysSchemaAttributeDto(eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto) ProvisioningException(eu.bcvsolutions.idm.acc.exception.ProvisioningException) IdmFormValueDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormValueDto) SysSchemaAttribute_(eu.bcvsolutions.idm.acc.entity.SysSchemaAttribute_) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) BasePermission(eu.bcvsolutions.idm.core.security.api.domain.BasePermission) SysSchemaObjectClass(eu.bcvsolutions.idm.acc.entity.SysSchemaObjectClass) IdmFormAttributeService(eu.bcvsolutions.idm.core.eav.api.service.IdmFormAttributeService) SysSyncConfigService(eu.bcvsolutions.idm.acc.service.api.SysSyncConfigService) ImmutableMap(com.google.common.collect.ImmutableMap) SysSchemaObjectClassDto(eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) List(java.util.List) SysRoleSystemAttributeRepository(eu.bcvsolutions.idm.acc.repository.SysRoleSystemAttributeRepository) ExceptionUtils(eu.bcvsolutions.idm.core.api.utils.ExceptionUtils) Optional(java.util.Optional) Identifiable(eu.bcvsolutions.idm.core.api.domain.Identifiable) SysRoleSystemDto(eu.bcvsolutions.idm.acc.dto.SysRoleSystemDto) SysSchemaObjectClassService(eu.bcvsolutions.idm.acc.service.api.SysSchemaObjectClassService) OrderAwarePluginRegistry(org.springframework.plugin.core.OrderAwarePluginRegistry) AttributeMappingStrategyType(eu.bcvsolutions.idm.acc.domain.AttributeMappingStrategyType) SysRoleSystem_(eu.bcvsolutions.idm.acc.entity.SysRoleSystem_) IcPasswordAttributeImpl(eu.bcvsolutions.idm.ic.impl.IcPasswordAttributeImpl) HashMap(java.util.HashMap) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) SysRoleSystemAttribute_(eu.bcvsolutions.idm.acc.entity.SysRoleSystemAttribute_) IdmAttachmentWithDataDto(eu.bcvsolutions.idm.acc.domain.IdmAttachmentWithDataDto) MessageFormat(java.text.MessageFormat) PersistentType(eu.bcvsolutions.idm.core.eav.api.domain.PersistentType) SysSystemMappingService(eu.bcvsolutions.idm.acc.service.api.SysSystemMappingService) ConfidentialStorage(eu.bcvsolutions.idm.core.api.service.ConfidentialStorage) SystemEntityType(eu.bcvsolutions.idm.acc.domain.SystemEntityType) EntityUtils(eu.bcvsolutions.idm.core.api.utils.EntityUtils) SysSystemMapping(eu.bcvsolutions.idm.acc.entity.SysSystemMapping) AbstractReadWriteDtoService(eu.bcvsolutions.idm.core.api.service.AbstractReadWriteDtoService) IdmExportImportDto(eu.bcvsolutions.idm.core.api.dto.IdmExportImportDto) IcAttributeImpl(eu.bcvsolutions.idm.ic.impl.IcAttributeImpl) SysSystemGroupSystemService(eu.bcvsolutions.idm.acc.service.api.SysSystemGroupSystemService) AttachmentManager(eu.bcvsolutions.idm.core.ecm.api.service.AttachmentManager) SysAttributeControlledValueService(eu.bcvsolutions.idm.acc.service.api.SysAttributeControlledValueService) SysSyncRoleConfig_(eu.bcvsolutions.idm.acc.entity.SysSyncRoleConfig_) SysRoleSystemAttributeDto(eu.bcvsolutions.idm.acc.dto.SysRoleSystemAttributeDto) SysSchemaAttributeService(eu.bcvsolutions.idm.acc.service.api.SysSchemaAttributeService) SysSystemAttributeMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter) IdmFormDefinitionService(eu.bcvsolutions.idm.core.eav.api.service.IdmFormDefinitionService) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) SysSystemAttributeMappingService(eu.bcvsolutions.idm.acc.service.api.SysSystemAttributeMappingService) InputStream(java.io.InputStream) Transactional(org.springframework.transaction.annotation.Transactional) Assert(org.springframework.util.Assert) StringUtils(org.springframework.util.StringUtils) IcAttribute(eu.bcvsolutions.idm.ic.api.IcAttribute) SysSchemaAttributeDto(eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto)

Aggregations

AttributeMapping (eu.bcvsolutions.idm.acc.domain.AttributeMapping)26 SystemEntityType (eu.bcvsolutions.idm.acc.domain.SystemEntityType)20 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)20 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)20 ArrayList (java.util.ArrayList)20 SysRoleSystemAttributeDto (eu.bcvsolutions.idm.acc.dto.SysRoleSystemAttributeDto)18 SysSystemAttributeMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto)17 SysSystemMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto)17 ProvisioningException (eu.bcvsolutions.idm.acc.exception.ProvisioningException)17 SysSchemaAttributeDto (eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto)16 SysSchemaObjectClassDto (eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto)16 SysSystemAttributeMappingFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter)16 AttributeMappingStrategyType (eu.bcvsolutions.idm.acc.domain.AttributeMappingStrategyType)15 SystemOperationType (eu.bcvsolutions.idm.acc.domain.SystemOperationType)15 SysRoleSystemDto (eu.bcvsolutions.idm.acc.dto.SysRoleSystemDto)15 SysSchemaAttributeService (eu.bcvsolutions.idm.acc.service.api.SysSchemaAttributeService)15 SysSystemAttributeMappingService (eu.bcvsolutions.idm.acc.service.api.SysSystemAttributeMappingService)15 SysSystemMappingService (eu.bcvsolutions.idm.acc.service.api.SysSystemMappingService)15 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)15 DtoUtils (eu.bcvsolutions.idm.core.api.utils.DtoUtils)15