问题
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:
- Use the addon functionality as it is.
- 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