MID-8802 Added displayName and preferredName to UserType#621
Conversation
1azyman
left a comment
There was a problem hiding this comment.
- Release notes need a bit better description, mainly in:
** Upgrade From MidPoint 4.9 (to be renamed to 4.10), removed content that's not relevant for upgrade 4.10->4.11.
** Changes In Initial Objects Since 4.10, again remove content that's not relevant - Initial object template for person (380-something.xml) is missing display name mapping, which will take value from
preferredName(if it has value) or fromfullName. - I see few replacements in GUI from
fullName->displayName.
Customers will not have users withdisplayNamepopulated right after upgrade, wouldn't it be better to useWebComponentUtil.getDisplayNameOrName()or something similar new that will return something more gracefully likedisplayName/fullName/name(in this order)?
Or more probably inObjectTypeUtil.getDisplayName(ObjectType)return displayName or fullName...
I'm not sure, just to make it less painful for customers. I was looking atSidebarMenuItemPanel,UserSummaryPanel,AccessRequestMixin. Something that later can be "switched of" and to use onlydisplayNamein next versions.
I think this graceful handling is not relevant for reports and backend code. - More notes will be added as didn't have time to go through all the code yet.
| <previousColumn>activationColumn</previousColumn> | ||
| </column> | ||
| <column id="10"> | ||
| <column id="11"> |
There was a problem hiding this comment.
Please revert container ids changes and only create new id for new container (display name column). They don't have to be ordered. If we leave it shifted like this, diff during upgrade will display more "fake" changes since container with id=8 is now different then in previous version. If just displayName(id=12) is added, only that one will be picked up when object is used during diff operation. There's also "natural keys" for some containers defined, but it's not everywhere, so we want to stay on safe side.
| WHERE connectorHostRefTargetOid IS NOT NULL; | ||
| $aa$); | ||
|
|
||
| call apply_change(58, $aa$ |
There was a problem hiding this comment.
Don't forget to add annotations for schema generator :)
| partialProcessingOptions::getFocusCredentials, | ||
| Projector.class, context, now, task, result); | ||
|
|
||
| // Maintain UserType.displayName (computed from preferredName/fullName) |
There was a problem hiding this comment.
This must not be here. This is done via configuration, by default in person object template (initial objects). Customer can put in whatever is needed, not necessarily values from preferred/full name.
| LensUtil.checkContextSanity(context, "focus processing"); | ||
| } | ||
|
|
||
| @ProcessorMethod |
There was a problem hiding this comment.
same as above. this is not a correct approach. "Maintaining" state of attribute (any and all) is done via mappings placed in different configuration objects in customer deployment.
| public static final String FOCUS_LIFECYCLE = "focusLifecycle"; | ||
| public static final String OBJECT_TEMPLATE_AFTER_ASSIGNMENTS = "objectTemplateAfterAssignments"; | ||
| public static final String FOCUS_CREDENTIALS = "focusCredentials"; | ||
| public static final String FOCUS_DISPLAY_NAME = "focusDisplayName"; |
There was a problem hiding this comment.
Obsolete, see AssignmentHolderProcessor comments
| if (focusDelta.findItemDelta(FocusType.F_ITERATION_TOKEN) != null) { | ||
| expectedModifications++; | ||
| } | ||
| if (focusDelta.findItemDelta(UserType.F_DISPLAY_NAME) != null) { |
There was a problem hiding this comment.
This probably should not be here?I'd expect it's related to that assignment holder processor stuff?
| if (focusDelta.findItemDelta(FocusType.F_ITERATION_TOKEN) != null) { | ||
| expectedModifications++; | ||
| } | ||
| if (focusDelta.findItemDelta(UserType.F_DISPLAY_NAME) != null) { |
| String oid = focusContext.getOid(); | ||
|
|
||
| String fullName = emptyIfNull(getFullName(focus)); | ||
| String displayName = emptyIfNull(getDisplayName(focus)); |
There was a problem hiding this comment.
As mentioned in previous review/comments. Wouldn't it be more "safe" it there's some Util method used all over the midpoint code for similar scenarios. Previously it obtained full name from UserType/prism object. now it would first try to obtain displayName and if that's null let's get fullName and if not then null? and we can get rid of that a bit later - and best part would be, changed would happend only in one place. This displayName->fullName->null can't probably be used everywhere but on many places it would make sense (simplify admin life by displaying most meaningful presentation of UserType). what do you think?
08a77b2 to
bbe2813
Compare
3ccb129 to
fbc0d61
Compare
Remove hardcoded displayName maintenance from the projector and configure it through the person object template, using preferredName with fullName fallback. Add coverage for person and non-person users. Add display-name fallback in GUI and notifications for users without displayName. Preserve report column ids while adding the displayName column, and update release notes.
fbc0d61 to
d408643
Compare
|
Summary
This PR introduces UserType.displayName and preferredName, and updates selected presentation paths to use displayName instead of fullName.
The goal is to separate:
Core behavior
displayName is now model-maintained:
Scope of changes
1. Schema & Repository
2. Model
3. Presentation (GUI)
Switched selected user-facing labels from fullName → displayName:
4. Search / Reporting
Added displayName to:
5. Notifications
What was intentionally NOT changed
This is a targeted presentation-layer shift, not a global rename.
Notes / impact
Detailed Impact (by area)
Result