Hybris addons install / uninstall / concept [close

2020-02-24 05:02发布

问题:

Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 2 years ago.

I have some common questions to the addon concept from Hybris:

  • How is the best way to work with a default Hybris addon? There are some really nice addon features we want to use in our projects, but of course not exactly the way they are. So what is the best practice to modify them? Is it the way to copy the addon into the own project and then handle it as an own addon? (So put it under the 'custom' folder and modify it as needed)

  • What exactly happens by installing an addon on an extension? By the install command you have to setup your addons and on which extension you want to have it (in regular, the storefront). And with this install command, what exactly happens? Is it only that some FrontEnd Files will be copied to the given extension? Or is here some more logic? (For example buildcallback.xml, etc. ?)

  • When need to uninstall an addon, does it need to use the uninstall command? Or is it enough to remove the addon from the localextension.xml? When only some FrontEnd Files will be copied from some addon, normally removing the addon should be enough?

回答1:

How is the best way to work with a default addon from hybris?

Addons are used to extend Hybris platform functionalities without changing its source code, they are standard extensions, So, I think that the best way is to create your own addon, so you keep your code independent of Hybris business logic and modular for future evolution. In general SAP Hybris recommends the extension of its code without modifying it.

What exactly happens by installing an addon on an extension?

Once you execute the following command :

ant addoninstall -Daddonnames="myAddOn" -DaddonStorefront.yacceleratorstorefront="myStorefront"

ant addoninstall will :

  • Add myAddOn into extensioninfo.xml as required for myStorefront extension
  • Add myAddOn to addons.less for myStorefront
  • Generate a new project.properties file from the project.properties.template inside myAddOn.
  • Configure the myAddOn web spring configuration myAddOn-web-spring.xml into myStorefront.additionalWebSpringConfigs

When need to uninstall an addon, does it need to use the uninstall command?

Yes, you need to execute ant addonuninstall in order to rollback the actions listed in the second response.