3 Replies Latest reply on Feb 27, 2013 2:33 AM by Davide G

    Extending a foundation class


      I need to change




      How do you go about changing these?

        • 1. Re: Extending a foundation class
          Jörg Hoh Adobe Employee

          Why do you need to change it? You can re-implement the search component or overlay it and change the reference to com.day.cq.wcm.foundation.Search to a reference to your own class.



          • 2. Re: Extending a foundation class
            omar2013 Level 1

            Thanks for you reply,


            I need to modify a couple of methods, the biggest change is to change the output to JSON.


            I'm new the CQ and I don't know what the best thing to do is to extend this class.  Is there a particular location where you would put the new class and it automatically gets registered?  or do you have to register it yourself and then it doesn't matter where it lives?.....  


            Should I extend it or is it better to copy all together and modify?

            • 3. Re: Extending a foundation class
              Davide G Adobe Employee

              The point is that the class could change with future releases and break your extension. Assuming that you find a way to extend.


              If you need a custom search you can easily implement your own one as Jörg said.