在SAP hybris中添加自定义的CMS Component,需要注意以下几点: 参考链接: https://wiki.hybris.com/pages/viewpage.action?pageId=294094319
- 在addon中添加,可免去对accelerator的修改
- 在//resources//web/spring/-web-spring.xml中添加renderer和rendererMapping的定义
- 使用ant命令安装addon
/-web-spring.xml的代码示例如下:
1 2 3 4 5 6 7 8 9 10 11 12 13
| <bean id="yourComponentRenderer" class="org.training.renderer.yourComponentRenderer"> <property name="typeService" ref="typeService" /> <property name="uiExperienceService" ref="defaultUiExperienceService" /> <property name="cmsComponentService" ref="cmsComponentService" /> <property name="modelService" ref="modelService" /> <property name="uiExperienceViewPrefixMap" ref="uiExperienceViewPrefixMap" /> <property name="unknownUiExperiencePrefix" value="desktop" /> </bean>
<bean id="yourComponentRendererMapping" parent="addonCmsComponentRendererMapping"> <property name="typeCode" value="yourComponent" /> <property name="renderer" ref="yourComponentRenderer" /> </bean>
|