Add displayName attribute to a custom field with username value.

cancel
Showing results for 
Search instead for 
Did you mean: 
monikap
Member II

Add displayName attribute to a custom field with username value.

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:

cmLockOwner.png

 

 

 

 

Could anyone please suggest a way to do this?

Thanks already!

3 Replies
sanjaybandhniya
Intermediate

Re: Add displayName attribute to a custom field with username value.

Can you post which api is this?

 

monikap
Member II

Re: Add displayName attribute to a custom field with username value.

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.

sanjaybandhniya
Intermediate

Re: Add displayName attribute to a custom field with username value.

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.