How can customize addons in hybris?

 ̄綄美尐妖づ 提交于 2020-01-05 08:33:08

问题


I want to customize an existing addon in Hybris by adding and changing some jsp files, but I coudn't find any document how can I do this. I can do this by copying existing addon to custom folder, but I don't know that it is a good solution.


回答1:


Why do you want to add files to an existing addon? Why not create a new one with the new functionality? That way you don't have to mess around in hybris' codebase.

If you just want to add new functionality, just implement it in a new addon using new URLs, controllers, jsp's and so on.

If you want to change the way a controller in that addon works, you can even override this controller in a new addon. Just override the functionality as if it was declared in the storefront:

https://help.hybris.com/6.0.0/hcd/8acfaf1186691014af82b18f46e90f49.html

Most important here is the last part "Bean changes". There you can see how to override a controller (for a given URL) in an addon. Now add a dependendy from your new addon to the addon with the undesired functionality. This causes the undesired addons beans to be loaded prior to your new addons beans, resulting in overriding existing beans. That way you can change which controller is loaded for a given URL.




回答2:


I had the same issues like you. I want to use functionallity of an existing addon but also want to modify it a little bit. So I asked th following question:

Hybris addons install / uninstall / concept

So I understand the addon concept currently so: They are demo implementation of funtionallity. So you have 2 Options:

  1. Use the addon functionality as it is.
  2. Copy and own the functionality into your project. (Into your custom extensions, or create your own addon)

I don't like those addon concept of hybris. But another solution I didn't found.



来源:https://stackoverflow.com/questions/46993565/how-can-customize-addons-in-hybris

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!