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

None

Testcase ID

None

Activity

Show:
Nicolas Barithel
December 16, 2020, 4:34 PM
Edited

Yes, exactly! So that it’s possible to override the bean "nodes.personLookupProperties” and add the custom properties that contain usernames.

Jared Ottley
December 16, 2020, 4:24 PM

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:

Done

Assignee

Unassigned

Reporter

Nicolas Barithel

Labels

None

Escalated By

None

Security Issue

None

ACT Numbers

01016856

Premier Customer

Yes

Code Branch

None

Build Location

None

Regression Since

None

Work Funnel End

None

Patch Attached

None

Dependent Version/s

None

Cloud or Enterprise

None

Prioritization Score

None

Delivery Team

None

Bug Priority

Category 2

Components

Fix versions

Affects versions