3 Replies Latest reply on Sep 24, 2010 4:33 PM by zarathos

    How is the insertion of users in the database gateIn when creating a new user?

    willojavier

      I connected Postgress with gateIn, and let me know where in the code we put the insertion of the user to the database when we are here to create a new user.

       

      For example, an "insert into jbid_io ....."

       

      Thanks for your time.

       


        • 1. Re: How is the insertion of users in the database gateIn when creating a new user?
          zarathos

          Are you referring to how to add the new user into you own separate database? if so then you would need to look an implementing your own NewUserEventListener plugin, as configured in \gatein.ear\02portal.war\WEB-INF\conf\organization\organization-configuration.xml.

           

          Hope that helps.

           

          James..

          • 2. Re: How is the insertion of users in the database gateIn when creating a new user?
            willojavier

            hi James, and thanks for your time.

             

            I'm not sure if my problem is solved with your suggestion. I will describe with more detail I want to do.

             

            When a user enters the first time at portal, this user will want to register, then he click to register give and will leave the page to register.

             

            Will leave the portlet Register New Account, they will ask the following information for registration:

             

                 User Name

                 Password

                 Confirm Password

                 First Name

                 Last Name

                 Email-Adress

             

            when de user diligence this information appropriately, the register is done successfully. this is the normal process so that a user registers.

             

            Now, what I want, is to ask for more information on that portlet, for example, security question, the answer to that question safety, Company, office, profession, Telephone and information like that. then the portlet Register a new account would ask the following information:

             

                 User Name

                 Password

                 Confirm Password

                 First Name

                 Last Name

                 Email-Adress

                 security question

                 answer

                 Company

                 office

                 profession

                 Telephone

             

                 I would like to know how to do this, and that I should change so that this information continues be stored in the database

             

                 thank you very much for yours time and yours valuable feedback.

            • 3. Re: How is the insertion of users in the database gateIn when creating a new user?
              zarathos

              First thing that you would want to do is to create a new project to "Extend" the GateIn Portal current functionality.  Please refer to the Configuring Services and more specificly Configuring a portal in the Reference Guide.

               

              As per the Reference Guide, you would replace the sample-ext with the name of your war project that you will be using to extend the portal.

                   ...

                   <value>

                        <string>sample-ext</string>  // add with you project name here.

                   </value>

                   ...

               

              The current registration portlet (org.exoplatform.account.webui.component.UIRegisterInputSet) primary consist of User data which is managed by the User object (org.exoplatform.services.organization.User) and UserHandler (org.exoplatform.services.organization.UserHandler) . However, several of the other attributes that you have listed are actually maintained as a part of the UserProfile (org.exoplatform.services.organization.UserProfile) and is managed by the UserProfileHandler (org.exoplatform.services.organization.UserProfileHandler) and displayed on the User Profile Portlet (org.exoplatform.webui.organization.UIUserProfileInputSet).

               

              In short:

              User information is stored in the User object and is persisted using an implementation of the UserHandler.

              User Profile information is stored in the UserProfile object and is persisted using a implementation of the UserProfileHandler

               

              My recommendation would be to extend/override the registration portlet (UIRegisterInputSet) to display both User and User Profile information and allow their corresponding Handlers persist the data. User first then UserProfile.

               

              Any additional user data that cannot be found in either the User or UserProfile implementations should be added to your new UserProfile/UserHandler implementations.

               

              So where is what??

               

              • exoadmin.war
                • org.exoplatform.account.webui.component.UIRegisterInputSet
              • exo.portal.webui.eXo-5.0.0-epp-GA.jar
                • org.exoplatform.webui.organization.UIUserProfileInputSet
              • exo.core.component.organization.api-2.3.1-GA.jar
                • org.exoplatform.services.organization.User
                • org.exoplatform.services.organization.UserHandler
                • org.exoplatform.services.organization.UserProfile
                • org.exoplatform.services.organization.UserProfileHandler
                • Implementations of these objects can be found in:
                  • exo.core.component.organization.ldap-2.3.1-GA.jar
                  • exo.core.component.organization.jdbc-2.3.1-GA.jar

               

              Now remember that to display your customer Registration portlet, you will need to update the pages.xml configuration file in your extensions application. Use../deploy/gatein.ear/02portal.war/WEB-INF/conf/portal/portal/classic/pages.xml as a reference.

               

              Hope that helps..

               

              James..

              "If Knowledge is power, then the Understanding of that Knowledge is the true essence of Wisdom. For a man may know something, but that does not mean he understands it."