cancel
Showing results for 
Search instead for 
Did you mean: 

Add displayName attribute to a custom field with username value.

monikap
Champ in-the-making
Champ in-the-making

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:

image

Could anyone please suggest a way to do this?

Thanks already!

3 REPLIES 3

sanjaybandhniya
Elite Collaborator
Elite Collaborator

Can you post which api is this?

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.

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.