Displaying custom attribute in Edit My Profile Portlet + Registration portlet

The User Registration portlet allows new user to sign up or register for the portal. On the login portlet you will see a sign up link and clicking on that link will take you to the User Registration screen

The Edit My Profile portlet allows user to edit value of one or more attributes in his user profile, Once user logs into the portal he should see the Edit My Profile link in the top right corner of the portal page. When you click on that link you will get a screen like this.

If you click on the Edit My Profile link it will take you the screen where you can edit few attributes from your user profile

Important Note Most of the companies dont allow portal to update data in the LDAP. So make sure that your LDAP binding user has right access to the LDAP server

As you can see by default it allows you to edit values for First Name, Last Name, password, Email and Preferred Language fields. You can change the fields that are displayed on the Edit Profile screen to add additional attributes by following these steps

  • I wanted to add testProperty, which is a custom attribute. So first i did add testProperty as ldap attribute by following steps described in Adding new attributes to WebSphere Portal
  • Then i logged in into the WebSPhere Portal with Administrative user and went to Edit My Profile portlet

  • Go to the Edit mode of Edit My profile by clicking on the customize button. In the Edit mode it allows us to define what all attributes you want to display on the Edit My Profile screen + User Registration portlet so check check box next to testProperty and title properties and save

  • Now when you come back to the Edit My profile portlet you should see couple of new fields there.

  • Enter some data in those two fields and click save. In my case i am using Default File based repository so that data gets saved in the wp_profile\config\cells\sunpa\fileRegistry.xml file.

    <wim:entities xsi:type="wim:PersonAccount">
    <wim:identifier externalId="c233f13f-663d-4292-baf0-989e2ef805a4" externalName="uid=wasadmin,o=defaultWIMFileBasedRealm"
    uniqueId="c233f13f-663d-4292-baf0-989e2ef805a4" uniqueName="uid=wasadmin,o=defaultWIMFileBasedRealm"/>
    <wim:identifier uniqueName="o=defaultWIMFileBasedRealm"/>
    <wim:cn>wasadmin wasadmin</wim:cn>
    <wim:testProperty>Test property value</wim:testProperty>

    In my case i changed values for wasadmin user so this is what i see in the fileRegistry.xml after saving my change in the Edit My Profile portlet

  • Now log out of the portal and go the User Registration screen and you should see a screen like this


scott said...

This is a brilliant write up, thank you very much.

I have followed:
- adding-new-attribute-to-websphere
- managing-ldap-attributes
successfully, and now am running
- displaying-custom-attribute-in-edit-my

Unfortunately i cannot view these newly created attributes in Edit My Profile > Configure. These same attributes do show up in the attributes report.

Do you have any idea why?

scott said...

Oh, to add to that, developers cannot call upon these attributes either.

I have raised this with IBM and am being told they need to be added to a lookaside database - is this correct?

Sunil Patil said...

In my case i dont have a look aside database, i am using a developer install. So when i added a new attribute it was added to the default File based registry and when i made changes to it those changes got saved in fileRegistry.xml.

Check Query Attributes to make sure that newly attribute is actually there. If you see an attribute in that list then it should appear in the Edit Profile custom mode

srjwebsolutions said...

We are leading responsive website designing and development company in Noida.
We are offering mobile friendly responsive website designing, website development, e-commerce website, seo service and sem services in Noida.

Responsive Website Designing Company in Noida
Website Designing Company in Noida
SEO Services in Noida
SMO Services in Noida

EG MEDI said...

Egmedi.com is online medical store pharmacy in laxmi nagar Delhi. You can Order prescription/OTC medicines online.
Cash on Delivery available. Free Home Delivery

Online Pharmacy in Delhi
Buy Online medicine in Delhi
Online Pharmacy in laxmi nagar
Buy Online medicine in laxmi nagar
Onine Medical Store in Delhi
Online Medical store in laxmi nagar
Online medicine store in delhi
online medicine store in laxmi nagar
Purchase Medicine Online
Online Pharmacy India
Online Medical Store