cancel
Showing results for 
Search instead for 
Did you mean: 

Help in adding new properties to Person object

pradeepsimha
Champ in-the-making
Champ in-the-making
Hi,

I am trying to add few more properties to Person object but till now no luck. I tried various ways and I gone through various links like:

https://forums.alfresco.com/forum/developer-discussions/alfresco-share-development/adding-custom-pro...

http://forums.alfresco.com/forum/end-user-discussions/alfresco-share/custom-fields-user-profile-0804...

I made changes in following files:

<b>contentModel.xml</b> , <b>ContentModel.java</b> , <b>Person.java</b> etc but when I build the code and re-deploy it, I am not able to see the new changes (I am using this url to see if changes are reflected: http://localhost:8080/alfresco/service/api/people). Is there any file I am missing? I don't want changes to reflect in Share because we are using custom UI. If anyone could help me in this regard, it would highly appreciated.

Also, per my research various links says that I should use Aspect to add the parameters to custom object, but I am not finding any example regarding the same. If my previous approach is wrong, can anyone kindly guide me to a sample example which shows how to add new parameter to a Person object.
3 REPLIES 3

sujaypillai
Confirmed Champ
Confirmed Champ
Hello Pradeep,

The best way to add properties to Person object would be adding it as an aspect.

The URL : http://localhost:8080/alfresco/service/api/people Gets a collection of people stored in the repository.

Did you check the file tomcat\webapps\alfresco\WEB-INF\classes\alfresco\templates\webscripts\org\alfresco\repository\person\person.lib.ftl which helps the rendering of the JSON object for above URL. I think you should add those new properties here in to get the new values reflected.


FYI.. We have TTL on the same topic today which would help you. Join here https://plus.google.com/u/0/events/ctpnpi2e9hseipcotc4saq7q710

Hi,

Thanks for your reply, I will try out the suggestions you have posted. Btw is there any tutorial regarding creating aspect for a person? Just asking.

And I will join TTL today.

kaynezhang
World-Class Innovator
World-Class Innovator
There is no difference between adding aspect to person from adding aspect to other nodes.
As how to add aspect depends on which api you are using. Since you are using alfresco as a repository and  using custom UI.I guess you are using  the webscript api you are to use is

PUT /alfresco/service/api/node/{store_type}/{store_id}/{id}
PUT /alfresco/service/api/path/{store_type}/{store_id}/{nodepath}


For example you can refer to my previous post  https://forums.alfresco.com/comment/142799#comment-142799