1 Reply Latest reply on Sep 30, 2010 9:29 AM by hanspeter

    How can add information extra for a user in the registry portlet?

    willojavier

      I just want to add more information when a user want to register on my site.


      I have read the reference guide and a section of chapter 6 says:

       

      http://docs.jboss.com/gatein/portal/3.1.0-FINAL/reference-guide/en-US/html/chap-Reference_Guide-Authentication_And_Identity.html#sect-Reference_Guide-Accessing_User_Profile


      "...

      The User Profile component contains extra information about a user, such as user's personal information, and business information. You can also add additional information about a user if your application requires it.

       

      "


      My question is how I can do this?, As I can add more fields for other data, and how I can save this data in the database?


      Thank you all for your valuable answers.

        • 1. Re: How can add information extra for a user in the registry portlet?
          hanspeter

          Hi Wilson,

           

          the info from the docu ist correct, but the info is not really deep.

           

          To enter some more fields to a user profile you have to extend the registration

          portlet (or write a new one). Not really nice compared to the old version!

           

          1) download the src

           

          2) search for the UIRegisterInputSet

           

          3) extend the form with fields you need like that:

           

          addUIFormInput(new UIFormStringInput(EXTRA_NAME, EXTRA_NAME, null)
                      .addValidator(StringLengthValidator.class, 3,45)
                      .addValidator(MandatoryValidator.class)
                      .addValidator(ExpressionValidator.class, "^[\\p{L}][\\p{ASCII}]+$","FirstCharacterNameValidator.msg")
                      .addValidator(ExpressionValidator.class, "^[\\p{L}][\\p{L}._\\- \\d]+$", "ResourceValidator.msg.Invalid-char")
                  );

           

          4) build this part and deploy it, drop your database and restart your server

           

          You can find further information about the exo WebUI here:

          http://wiki.exoplatform.org/xwiki/bin/view/Portal/WebUI+Tutorial

           

           

          hope that helps!