Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-21991

Unable to get display names on a custom property storing usernames with the REST API

    Details

    • Type: Service Pack Request
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 6.2, 5.2.7
    • Fix Version/s: 6.2.N
    • Component/s: ACS REST API
    • Labels:
      None
    • Bug Priority:
      Category 2
    • ACT Numbers:

      01016856

    • Premier Customer:
      Yes

      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.

      public static final List<QName> PROPS_USERLOOKUP = Arrays.asList(
              ContentModel.PROP_CREATOR,
              ContentModel.PROP_MODIFIER,
              ContentModel.PROP_OWNER,
              ContentModel.PROP_LOCK_OWNER,
              ContentModel.PROP_WORKING_COPY_OWNER);

      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);

        Attachments

          Structure

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                nbarithel Nicolas Barithel
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Structure Helper Panel