Unable to get display names on a custom property storing usernames with the REST API
Description
Summary
When using a custom content type with a custom property to store a username, it is not possible to display the person's display name in an ADF application using the REST API.
Although the REST API would perform a person lookup on known properties storing usernames such as cm:creator, cm:modifier or cm:owner, it is not possible to have custom person properties do the same and display a user-friendly name in an ADF application.
Supporting evidence
Define a custom model with a custom property to store a username using a people picker in ADF, e.g. acme:supervisor of type d:text.
The check for username storing properties is done in NodesImpl.java#1208 if the property of the node is part of the list "PROPS_USERLOOKUP".
In NodesImpl.java#338, the attribute "PROPS_USERLOOKUP" is 'public static' but 'final' and moreover populated using Arrays.asList(), therefore the list cannot be replaced and values cannot be added to it.
This list is also used to retrieve person information on search results in PersonPropertyLookup.java#L68.
Expected Behaviour
It is possible to configure a list of custom properties that would output the person's display name.
Observed Behaviour
It is not possible to specify custom properties that would retrieve the person's information based on the username stored.
Workaround
It is only possible to override the defined values of the list "PROPS_USERLOOKUP", e.g. NodesImpl.PROPS_USERLOOKUP.set(3, PROP_ACME_SUPERVISOR);
Environment
Testcase ID
Activity
Yes, exactly! So that it’s possible to override the bean "nodes.personLookupProperties” and add the custom properties that contain usernames.
looking at your PR…and to make sure I am clear on what I am seeing you are moving the hardcoded list to a configurable spring bean to allow for the customization you need to display custom display names. Is that correct?
cc: