Project

General

Profile

Actions

Task #978

closed

Dto mappers - new layer

Added by Radek Tomiška about 6 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
High
Assignee:
Radek Tomiška
Category:
Spring - DATA
Target version:
Start date:
02/21/2018
Due date:
% Done:

100%

Estimated time:
24.00 h
Owner:

Description

We need to build new layer, which will be responsible for converting entities to dtos (and reverse). We have this conversion defined directly in all service implementetions (AbstractReadWriteDtoService) and this brings this issues:
- our conversion isn't called for embedded entities (standard mapper conversion is used there) - this can lead to really unpredicted behavior (e.g. #969)
- we cannot call conversions manually - conversion is defined in implementation of AbstractReadWriteDtoService not in interface. We need to call transformations independently by services for diferrent entities (e.g. see workaround in DefaultIdmAutomaticRoleAttributeService#getIdentitiesForAutomaticRole).

Solution:
- dto mappers will be registered the same way as dto lookups (with same benefits)
- dto mapper manager will be created the same way as LookupService (with same benefits)
- manager will be injected into services (respectively in AbstractReadWriteDtoService) and called in current 'toDto' and 'toEntity' methods
- manager will be injected and used in ModelMapperConfig configuration.


Related issues

Related to IdStory Identity Manager - Task #1247: Info components - optimize number of request to backendClosedRadek Tomiška09/10/2018

Actions
Related to IdStory Identity Manager - Task #2763: Audit: Show info card with revision for deleted entities (uuid is show now only)ClosedRadek Tomiška04/19/2021

Actions
Related to IdStory Identity Manager - Defect #2975: Audit: Handle exception in audit, when referenced entity not found (for entities with Not Found - ignore annotation)ClosedRadek Tomiška10/06/2021

Actions
Precedes IdStory Identity Manager - Defect #969: EntityToUuidConverter failed to convert eu.bcvsolutions.idm.core.model.entity.IdmIdentity to java.util.UUID.Closed

Actions
Actions #1

Updated by Radek Tomiška about 6 years ago

  • Precedes Defect #969: EntityToUuidConverter failed to convert eu.bcvsolutions.idm.core.model.entity.IdmIdentity to java.util.UUID. added
Actions #2

Updated by Radek Tomiška over 5 years ago

  • Related to Task #1247: Info components - optimize number of request to backend added
Actions #3

Updated by Radek Tomiška almost 3 years ago

  • Target version set to 11.2.0
Actions #4

Updated by Vít Švanda almost 3 years ago

  • Estimated time set to 24.00 h
Actions #5

Updated by Radek Tomiška over 2 years ago

  • Status changed from New to In Progress
Actions #6

Updated by Radek Tomiška over 2 years ago

  • Related to Task #2763: Audit: Show info card with revision for deleted entities (uuid is show now only) added
Actions #7

Updated by Radek Tomiška over 2 years ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Radek Tomiška to Vít Švanda
  • % Done changed from 0 to 90

New layer is implemented and is used from model mapper converters, aduit and for converting owner into eav form values.

Commit:
https://github.com/bcvsolutions/CzechIdMng/commit/66c946c35215a31d6a05e0f028d3fbdabeb7e5ac
+ api improvements to implement custom dto mapper easier with context is available (and used for form values):
https://github.com/bcvsolutions/CzechIdMng/commit/2fef2f0fde842a3819f3561909a5f7fee57622a7

Could you provide me a feedback, please?

Actions #8

Updated by Vít Švanda over 2 years ago

  • Status changed from Needs feedback to Resolved
  • Assignee changed from Vít Švanda to Radek Tomiška
  • % Done changed from 90 to 100

I did review and tested it. Nice feature, that can solve many hidden problems. Thanks for that.

Actions #9

Updated by Radek Tomiška over 2 years ago

  • Status changed from Resolved to Closed
Actions #10

Updated by Radek Tomiška over 2 years ago

  • Related to Defect #2975: Audit: Handle exception in audit, when referenced entity not found (for entities with Not Found - ignore annotation) added
Actions

Also available in: Atom PDF