Task #2270
closedAdd option to ImportRolesFromCSVExecutor to specify column for MemberOf attribute value
100%
Description
Now if you specify MemberOf attribute if you want to import role with some system and role attribute, this LRT will set name of the role as return value for the attribute.
This behavior is not very useful and universal, because in a lot of cases this value is different from role name in IdM.
Add new parameter into LRT config to specify which column in .csv contains values for this attribute.
Related issues
Updated by Roman Kučera over 4 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 80
Implementation in branch https://github.com/bcvsolutions/czechidm-extras/tree/2270-value-of-memberOf-import
This feature is backward compatible. If you don't specify the new parameter this LRT will behave as before.
Added test for new feature.
Doc updated, I'll add new screenshot later to.
Updated by Tomáš Doischer over 4 years ago
I checked the code and tried the feature, it works great.
As for the code, on line 472 there is
long count = roleSystemService.count(roleSystemFilter, null);
the null is not needed there (it shows warning for me).
Please update the documentation: replace the screenshot and maybe add the new column to the detail of the data at the beginning of the tutorial. Also, there is a "warning" in the documentation "This LRT can be used to update existing values but it does not remove old values. The only overwritten values during update are role criticality and description.". Since this feature works in the same way as description, it should be mentioned there.
Otherwise, it's great. Thank you.
Updated by Roman Kučera over 4 years ago
- % Done changed from 80 to 90
Thx for review.
I removed the null parameter.
Documentation now contains new screenshot with setting which is up to date. I added new column into example csv and edited the warning box.
Updated by Peter Štrunc over 4 years ago
- Target version changed from 2.3.0 to 2.4.0
Updated by Peter Štrunc over 4 years ago
- Blocks Task #2274: Refactor ImportRolesFromCSVExecutor and CSVToIdM added
Updated by Peter Štrunc over 4 years ago
It looks good. @kucerar could you please refactor
if(hasMemberOf) { String transformationScript; if (hasMemberOfValue) { transformationScript = MessageFormat.format("\"{0}\"", memberOfValues.get(roleName)); } else { transformationScript = MessageFormat.format("\"{0}\"", roleName); } roleSystemAttributeService.addRoleMappingAttribute(system.getId(), role.getId(), memberOfAttribute, transformationScript, OBJECT_CLASSNAME);
this block of code, which is used twice, into one method? Then i will merge it to develop. Thanks
Updated by Roman Kučera over 4 years ago
- Assignee changed from Roman Kučera to Peter Štrunc
I did refactor as you advised.
Please check the changes https://github.com/bcvsolutions/czechidm-extras/commit/b915b5fcc5a53f5869ddc6b27e39f5865198f47c
Thx for feedback and merge.
Updated by Peter Štrunc over 4 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100