Project

General

Profile

Task #1267

Support save EAV with Entity

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

Status:
Closed
Priority:
Normal
Category:
Eav
Target version:
Start date:
09/24/2018
Due date:
% Done:

100%


Description

Please add new attribute "_eav"? for abstract dto. The attribute will be stored eav values. This eav values will be saved after entity save. This behavior is needed by generator.


Related issues

Related to CzechIdM - Task #1259: Generate values during create entity Closed 09/18/2018

History

#1 Updated by Ondřej Kopr 10 months ago

  • Related to Task #1259: Generate values during create entity added

#2 Updated by Radek Tomiška 10 months ago

  • Status changed from New to In Progress

#3 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 0 to 90

It's possible to save extended attributes together with entity, which owns them in one request. Configured authorization policies are checked for given eav values.
Events was added for saving extended attributes (~ form instances UPDATE) - it's possible to listen, when some extended attributes is changed (by form instance ~ definition).

Doc:
https://wiki.czechidm.com/devel/documentation/architecture/dev/events#event_types
https://wiki.czechidm.com/devel/documentation/architecture/dev/events#formablesaveprocessor

Commit:
https://github.com/bcvsolutions/CzechIdMng/commit/66c05424ba3716e81edfdfe9d20d45dc3427f2bf

Could you do a review please? I'll create some tutorial, how to use it on FE after review, here is the snippet for PATCH identity:

{
   "id": "5436926f-69fd-4e67-981a-a4c2d952f457",
   "_eav": [
       {
           "formDefinition": {
               "code": "myform" 
           },
           "values": [
               {
                   "formAttribute": "2890dc09-d2ba-4c13-ac0c-d4308f1d7d19",
                   "stringValue": "phoneOness" 
               }
           ]
       }
   ]
}

Note: I'll try to simplify "formAttribute" in future - code can be given instead (the same as for "formDefinition" - default is used, if no definition is given).

#4 Updated by Ondřej Kopr 10 months ago

  • Status changed from Needs feedback to Resolved
  • Assignee changed from Ondřej Kopr to Radek Tomiška
  • % Done changed from 90 to 100

Nice, I use this feature in generated values and works as I except. When I created identity by REST is checked permissions - this right behavior. When I setup generator for adding default values, is not checked permissions. I will add information about this into documentation for generated values.

Now is possible create identity with eavs. Thank you for implement this feature.

#5 Updated by Radek Tomiška 10 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF