3 Replies Latest reply on Jun 25, 2010 3:42 AM by Trong Tran

    How to overwrite a class methods (UserACL) in my portal extension

    Andre Winkler Newbie

      I want to overwrite some methods from the clas UserACL, how can I do that?

        • 1. Re: How to overwrite a class methods (UserACL) in my portal extension
          Trong Tran Master

          Create a sub java class org.gatein.ExtendedUserACL for instance which extends from UserACL. The class would contains what you want to overwrite from the original UserACL.

           

          Then re-configure the implementation of the UserACL component service in your portal extension like :

           

          <component>
              <key>org.exoplatform.portal.config.UserACL</key>
              <type>org.gatein.ExtendedUserACL</type>   
              <init-params>         
                <value-param>
                  <name>super.user</name>
                  <description>administrator</description>
                  <value>root</value>        
                </value-param>
                
                <value-param>
                  <name>portal.administrator.groups</name>
                  <description>administrator</description>
                  <value>/platform/administrators</value>
                </value-param>
                ...
              </init-params>
          </component>
          

           

          Make sure that your portal extension has been defined in the last of dependencies list of the your portal definition configuration

          • 2. Re: How to overwrite a class methods (UserACL) in my portal extension
            Andre Winkler Newbie

            Thank you for your great answer, but a few detail questions.

             

            Can I create the subclass in my portal extension war or it is needed to create this class in a separate jar that I have to put in the tomcat lib directory?

             

            In which configuration file of my portal extension can I add the component reconfiguration?

             

            My portal extension is the last in the dependency list.

            • 3. Re: How to overwrite a class methods (UserACL) in my portal extension
              Trong Tran Master

              Can I create the subclass in my portal extension war or it is needed  to create this class in a separate jar that I have to put in the tomcat  lib directory?

               

              I suggest to use a separated jar file

              In which configuration file of my portal extension can I add the  component reconfiguration?

              it should be in YourPortalExtenstion.war/WEB-INF/conf/configuration.xml