Project

General

Profile

Task #1259

Generate values during create entity

Added by Ondřej Kopr 10 months ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Generating values
Target version:
Start date:
09/18/2018
Due date:
% Done:

100%


Description

Its required generate some values for entities during create. For example username, eav's etc.

  • create new entity,
  • create new agenda,
  • create process generate value/s,
  • generators are registered for entity and attribute - this information is saved in DB

Related issues

Related to CzechIdM - Feature #1261: Supports AbstractDto as entity type in processors Closed 09/20/2018
Related to CzechIdM - Task #1267: Support save EAV with Entity Closed 09/24/2018
Related to CzechIdM - Task #1272: Eav attribute - default value as placeholder Closed 09/26/2018
Related to CzechIdM - Feature #890: Generate login when saving a user Closed 01/04/2018

History

#1 Updated by Ondřej Kopr 10 months ago

  • Subject changed from Generate values during create identity to Generate values during create entity

#3 Updated by Ondřej Kopr 10 months ago

  • Status changed from New to In Progress

#4 Updated by Ondřej Kopr 10 months ago

  • Related to Feature #1261: Supports AbstractDto as entity type in processors added

#5 Updated by Ondřej Kopr 10 months ago

  • % Done changed from 0 to 10

New entity IdmGeneratedAttributes was create - service, controller, repository, dto, ....
New manager that supports generating and get supported types was created.
New interface and abstract class for generators - ValueGenerator, was created.

Now I start with implement frontend agenda.

#6 Updated by Ondřej Kopr 10 months ago

  • % Done changed from 10 to 30

Frontend agenda was implemented. Now is possible made CRUD operation from frontend.

#7 Updated by Ondřej Kopr 10 months ago

  • Related to Task #1267: Support save EAV with Entity added

#8 Updated by Radek Tomiška 10 months ago

  • Related to Task #1272: Eav attribute - default value as placeholder added

#9 Updated by Ondřej Kopr 10 months ago

  • % Done changed from 30 to 60

Basic implementations with 3 generators and tests for it are complete. Now I start with implement generator for EAV values (EAV constant and EAV default values)

#12 Updated by Ondřej Kopr 10 months ago

Basic implementations with defaults generators and tests for it are complete. I made some changes after colleague's feedback:

  • I remove generator for EAV constant, second EAV generator 'default values' still exists,
  • add settings for username generator - use first firstname or lastname,
  • email generator now extends username generator and works with same behavior,
  • generators with order 0 - 10 can be set only by system from admin interface its not possible, check was added into controller,
  • localization was fixed,
  • some default values for generator settings was changed

#13 Updated by Ondřej Kopr 10 months ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Ondřej Kopr to Radek Tomiška
  • % Done changed from 60 to 80

Tests was updated. Please Radek could you made a part of review? Works:

  • generators behavior and agenda works,
  • tests,
  • er diagram,
  • changelog.
thinks to be done:
  • Documentation - now exists only some introduce,
  • create new default EAV value generator when IdM init,
  • check if email exists - now isn't possible check this, because filtering by email doesn't exist. I haven't time to implement this filtering.

Branch: https://github.com/bcvsolutions/CzechIdMng/tree/okopr/1259-generated-values
compare: https://github.com/bcvsolutions/CzechIdMng/compare/okopr/1259-generated-values

Thank you :-) And please don't merge the branch, I have some feedback for discuss with you guys. Thank you.

#14 Updated by Radek Tomiška 10 months ago

  • Status changed from Needs feedback to In Progress
  • Assignee changed from Radek Tomiška to Ondřej Kopr

I did test and review. Feature works, thx!

I fixed / changed + notes:
  • i fixed change script for postgresql (binary, datetime type not exist, generator_properties missing in audit table) and used actual script number (V9_02_003)
  • index on entity was missing (just in change script)
  • i removed interface 'Generable' - supported dto types are loaded by registered generators. Dto is used for supported types => entities are not used for generators. All services was refactored.
  • after discussion we decide to rename some dtos and entities.
  • i don't understand, why cleverness with system seq was added:
    • i don't see a reason, why administrator should be limited this way?
    • and initialization of system generators is not implemented.
    • or why 'unmodifiable' flag wasn't used as on other places (e.g. eav attributes)?
  • check seq for system generator moved to standard validation method
  • some result codes missing in localization (e.g. GENERATOR_RETURN_NULL ..)
  • enabled evaluator used instead module service (and it's used on right place in manager) - maybe all vs. available generator method can be added (e.g. when module is disabled, then previously configured generators are not shown properly)
  • some nice name can be used for generators (used in localization)
  • generateItem vs generate - remove please generateItem method (Assert.notNull(...) can be defined - if needed - in implementations).
  • parameter dtoType is not used in controller getAvailableGenerators method - remove it please for now (i don't know, if path parametr is suitable for it so we can add it in future)
  • filter on FE uses duplicate ref - move filter to standalone component (see notification filter)

Commit:
https://github.com/bcvsolutions/CzechIdMng/commit/d57ea5f701f8f70807405d5ea79c08533cd30ee3

#15 Updated by Ondřej Kopr 10 months ago

  • Assignee changed from Ondřej Kopr to Radek Tomiška

Thank you for fixing the issues with generates values. Please could you reimplement/implement the last issues, then I add documentation and it will be possible, close the ticket. Thank you Radek.

#16 Updated by Radek Tomiška 10 months ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Radek Tomiška to Ondřej Kopr
  • % Done changed from 80 to 90

I've implemented all notes and merge feature into develop.

Commit:
https://github.com/bcvsolutions/CzechIdMng/commit/4085ce46ae2148f04f55403e01e0553daa4f320d

Could you do a feedback again and add doc, pls?

#17 Updated by Ondřej Kopr 10 months ago

  • Status changed from Needs feedback to In Progress

Thank you for fix issues and clean code. Behavior with unmodifiable is better than seq. Now missing only documentation.

#18 Updated by Ondřej Kopr 10 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

#19 Updated by Ondřej Kopr 9 months ago

  • Related to Feature #890: Generate login when saving a user added

Also available in: Atom PDF