02.28 Fiori extension hook和Hybris的template

Fiori extension hook

类似ABAP里的BAdI definition,即SAP预留了一些增强的hook,application或者partner/customer可以实现自己的增强逻辑。

See my blog An example of End to End extension on CRM Fiori application – part3


https://blogs.sap.com/2015/06/20/an-example-of-end-to-end-extension-on-crm-fiori-application-part3/


Fiori extension hook和Hybris的template

Hybris

在我们通过前面issue介绍的办法找到Hybris home page的实现之后,如果通过debug的方式启动server,打开首页时断点会在line 6停下来。

Fiori extension hook和Hybris的template


这个template后面的page其实被一个名称叫page.tag的文件实现:

Fiori extension hook和Hybris的template


这个tag文件里有大量的jsp:attribute和jsp:invoke。从jsp的namespace也能看出,这些tag并不是Hybris特有的,而是JSP标准的用法。

有什么用?网上的帮助文档是这样说的:

The jsp:attribute element allows you to define the value of a tag attribute in the body of an XML element instead of in the value of an XML attribute.

看个具体例子。

我创建了一个template.tag, 里面定义了一个skeleton, 其中蓝色的div是我hard code进去的,而两个fragment headerarea和footerarea相当于Fiori里的extension hook,允许这个template的consumer填值进去。

Fiori extension hook和Hybris的template


这是我的consumer, 里面给header和footer指定了如下的值。

Fiori extension hook和Hybris的template


最后的结果:

Fiori extension hook和Hybris的template


分享到:


相關文章: