3 Replies Latest reply on Jan 23, 2013 9:33 AM by steele_ag

    Hybris Integration: Extending ImportHandler



      I have a need to change some of the behaviors of com.adobe.cq.commerce.hybris.importer.DefaultImportHandler. Per the documentation I have defined a service ranking to be 100, which is presumably higher than the default of 0. In my example below, I'm using the scr plugin annotation:



      * @scr.component immediate="true" enabled="true" label="CQ/Commerce/Hybris Extended Import Handler"

      * @scr.service interface="com.adobe.cq.commerce.hybris.importer.ImportHandler"

      * @scr.property name="service.description" value="Product Importer from Hybris to CQ"

      * @scr.property name="service.ranking" value="100"


      public class ExtendedImportHandler extends DefaultImportHandler implements ImportHandler { ... }


      DefaultImportHandler is still preferred over my customized ImportHandler by the HybrisImporter, despite the service.ranking property. What else is necessary to ensure my extension is given precedence?

        • 1. Re: Hybris Integration: Extending ImportHandler
          Sham HC Level 7

          Hi davidsteele,


          Could you please try with adding a property pipeline.mode with value equal to global.




          • 2. Re: Hybris Integration: Extending ImportHandler
            steele_ag Level 1

            I'm sorry but that did not work. Here is the felix components view of my bundle; I notice also unsatisifed references.

            Bundlecom.obfuscated.wcm.web.hybris-extension (377)
            Implementation Classcom.obfuscated.wcm.hybris.importer.ExtendedImportHandler
            Default Stateenabled
            Configuration Policyoptional
            Service Typeservice
            Reference connection["Satisfied","Service Name: com.adobe.cq.commerce.hybris.connection.HybrisConnection","Multiple: single","Optional: mandatory","Policy: static","No Services bound"]
            Reference pageManagerFactory["Satisfied","Service Name: com.day.cq.wcm.api.PageManagerFactory","Multiple: single","Optional: mandatory","Policy: static","No Services bound"]


            I've also attempted adding DefaultImportHandler as an interface. I've created local protected member vars for HybrisConnection and decorated it with @scr.reference; I've also since specified that service.ranking is type="Integer". Still no dice.

            • 3. Re: Hybris Integration: Extending ImportHandler
              steele_ag Level 1

              A brief update. HybrisImporter binds ImportHandler with a static policy so ordering is significant. service.ranking alone seems insufficient in determining implementation binding.


              Regarding service ranking: -- giving the service.ranking a type may or may not have helped but seems to be the right thing to do.

              @Property(name = "service.ranking", intValue = 100)