如何自定义hybris中的插件? [英] How can customize addons in hybris?

查看:83
本文介绍了如何自定义hybris中的插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过添加和更改一些jsp文件来自定义Hybris中的现有插件,但是我找不到任何文档该怎么做.我可以通过将现有插件复制到自定义文件夹中来做到这一点,但是我不知道这是一个很好的解决方案.

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.

推荐答案

为什么要将文件添加到现有插件?为什么不使用新功能创建一个新的呢?这样一来,您就不必在hybris的代码库中弄乱了.

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.

如果只想添加新功能,只需使用新的URL,控制器,jsp等在新的附件中实现它即可.

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

这里最重要的是"Bean更改"的最后一部分.在那里,您可以看到如何在插件中覆盖控制器(对于给定的URL).现在,使用不需要的功能将新组件中的依赖项添加到该组件中.这将导致不想要的addons bean在新的addons bean之前被加载,从而导致覆盖现有bean.这样,您可以更改为给定URL加载哪个控制器.

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.

这篇关于如何自定义hybris中的插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆