Add displayName attribute to a custom field with username value.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2020 02:26 AM
I can see the custom properties in Node API response, but I want to add a custom attribute to my property (which stores username as value), with user displayName and userName, like we can see for field "cm:lockOwner" as in the screenshot below:
Could anyone please suggest a way to do this?
Thanks already!
- Labels:
-
Alfresco Content Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2020 04:44 AM
Can you post which api is this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2020 06:24 AM
Hi Sanjay,
The API is - /alfresco/api/-default-/public/alfresco/versions/1/nodes/{nodeId}/children
I see this reponse when a locked document node is loaded in the documentlist, and have posted this as just an example of how I would want my custom property to be added in the response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2020 02:10 AM
First thing you can do is override existing api.
Second way is you can create your own webscript and return required properties only.You can create custom api 2 ways.
1)Using webscript(https://docs.alfresco.com/5.2/references/dev-extension-points-webscripts.html)
2)Same as API-Explorer providing(https://github.com/covolution/quick-api)
I would suggest to create custom webscript and use that because you have control over that webscipt for modify.
if you override existing webscript then it may impact where it is already used.
