cancel
Showing results for 
Search instead for 
Did you mean: 

Custom fields in User Profile

a_thakur
Champ in-the-making
Champ in-the-making
Hi,

Currently I am trying to customize some things in Share. We are using community edition right now, despite the fact that we have access to enterprise edition, as at the moment it is a little more user friendly.

In the user profiles, I would like to add a couple of fields. Like facebook link and LinkedIn link, besides the skype and IM fields. I only came across the post of renaming the fields, but not adding new ones. Could anyone with some experience indicate what files need to be configured in order to do so?

Thanks in advance,
A. Thakur
8 REPLIES 8

a_thakur
Champ in-the-making
Champ in-the-making
Am I asking a question here which has already been answered?
Regards,
A.Thakur

mikeh
Star Contributor
Star Contributor
It's definitely not pretty at the moment. You'll have to apply edits across a number of projects:

Repository: cmSmiley Tongueerson in contentModel.xml (and ContentModel.java for completeness)
Slingshot: slingshot.properties, my-profile.get.html.ftl, user-profile.get.html.ftl, SlingshotUserFactory.java
Web-Framework: ScriptUser.java , AlfrescoUserFactory.java
Webscript-Framework: User.java

Search for "skype" to copy/paste existing code from that property.

As to your next question: No, I don't know when this will be made easier.  :wink:

Thanks,
Mike

a_thakur
Champ in-the-making
Champ in-the-making
Hi Mike,

Thanks a lot! I am going to experiment right away!

Regards,
A.Thakur

EDIT

Besides the first 3 files, the java files and the last ftl file cannot be found through the search function (That would be user-profile.get…. and the java files)
Could that be because of v3.2? Or should they be there anyway?

mikeh
Star Contributor
Star Contributor
They've all been there since v3.0 I believe.

Thanks,
Mike

jriker1
Champ in-the-making
Champ in-the-making
Besides the first 3 files, the java files and the last ftl file cannot be found through the search function (That would be user-profile.get…. and the java files)
Could that be because of v3.2? Or should they be there anyway?

They are all there, the only one of issue is user-profile.  Do userprofile without the dash.   See my path info below for 3.2/3.3 HEAD pathing.  That said, the odd part is I personally have three custom fields I wanted to add.  I removed the skype and  IM values physically from the display screens only, and then proceeded to add my own.  Cloned the original skype format in each of the following files:

  • repository/config/alfresco/model/contentModel.xml
  • repository/source/java/org/alfresco/model/ContentModel.java
  • slingshot/config/alfresco/messages/slingshot.properties
  • slingshot/config/alfresco/site-webscripts/org/alfresco/components/dashlets/my-profile.get.html.ftl
  • slingshot/config/alfresco/site-webscripts/org/alfresco/components/profile/userprofile.get.html.ftl
  • slingshot/source/java/org/alfresco/web/site/SlingshotUserFactory.java
  • web-framework/source/java/org/alfresco/web/scripts/ScriptUser.java
  • web-framework/source/java/org/alfresco/web/site/AlfrescoUserFactory.java
  • webscript-framework/source/java/org/alfresco/connector/User.java
  • slingshot/source/web/components/console/users.js

  • So for the first one I added it showed up and I did an LDAP Sync with the attribute and the value showed up on the main user's profile, on the detailed profile, and on the edit screen.  I could edit the attribute and it would save.  Of course LDAP Sync overwrote it again but not the point. 

    I then went on to add two more attributes under this one.  In the user's home page profile "slingshot/config/alfresco/site-webscripts/org/alfresco/components/dashlets/my-profile.get.html.ftl" the attributes show up and so do the values synced from LDAP.  On the full profile they do not show at all.  If I edit the profile the lines show to edit those fields are there, but have no value.  If I populate the values and update they do not do anything.  Any idea what's going on?  The set is essentially identical to my first one entered.  I can provide physical code examples, just didn't want to clutter up the thread if the answer was obvious.

    Thanks.

    JR

    jriker1
    Champ in-the-making
    Champ in-the-making
    OK, I figured out my problem however not sure why it's the solution.  The issue was I had in my userprofile.get.html.ftl file the profile. values all in lowercase.  Changing it to say profile.employeeNumber with the capital N fixed it.  Now what is this value?  The only place that I have a capital N in employeenumber is in the LDAP directory which I didn't think mattered since the ldap-context.xml file reads  in this value and passes it on so didn't think the original case in LDAP mattered.  Any clarification on case and how to truely implement this propertly would be appreciated.  Seems there are nuances to added a field that remains a mistery.  Although I have it working, am left uncomfortable not knowing truely which it works due to one upper case letter.

    Also, when adding attributes, should the contentModel.xml file be directly edited or the person contents only copied to the extensions folder and modified there?  If copied, should I just copy the entire file or only the person context?

    Thanks.

    JR

    udaya
    Champ in-the-making
    Champ in-the-making
    hi,

    i am also want to add custom field in user profile. can anyone tell me the step in doing this?

    thanks,
    Udaya.R

    jpotts
    World-Class Innovator
    World-Class Innovator
    I'm posting a blog on this subject next week, but if you want to look at the source code that goes with the blog post, check out:
    http://ecmarchitect.com/images/articles/alfresco-people/someco-people.zip

    Jeff