了解自定义parent-child components的同步解决方案后,我在customcockpit-spring-services.xml中包含了我的自定义类型。
然而,这是行不通的。
然而,当我向OOTB cmscockpit-spring-services.xml添加相同的自定义类型时,它的工作原理就像魅力一样。
我的bean定义:
<alias alias="synchronizationService" name="customSynchronizationService" />
<bean id="customSynchronizationService" class="de.hybris.platform.cmscockpit.sync.CMSSynchronizationService" scope="tenant" autowire="byName">
<property name="relatedReferencesTypesMap">
<entry key="AbstractPage">
<list>
.....
<value>SampleCampaignComponent.campaigns</value>
<value>SampleCampaignItem</value>
<value>SimpleCMSComponent</value>
</list>
</entry>
</property>
<property name="searchRestrictionsDisabled" value="true" />
</bean>对这种定制有什么建议吗?
发布于 2018-01-18 10:33:52
谢谢您的回复,谢谢您的回复。在对cmscockpit-services.xml of yacceleratorcockpits扩展中定义的自定义bean进行注释后,我发现它可以工作。
从中我了解到,如果我们有加速器扩展,更好地扩展加速器模板,而不是使用驾驶舱模板。
发布于 2018-01-17 08:13:30
如果它不起作用,您可以复制整个bean定义,就像它在您的定制座舱Spring-services.xml中一样,并添加其他组件(就像您在OOTB xml中所做的那样)。这应该能解决这个问题。
<alias alias="synchronizationService" name="defaultCMSSynchronizationService" />
<alias alias="defaultSynchronizationService" name="defaultCMSSynchronizationService" />
<bean id="defaultCMSSynchronizationService" class="de.hybris.platform.cmscockpit.sync.CMSSynchronizationService" scope="tenant" autowire="byName">
<property name="relatedReferencesTypesMap">
<map>
<entry key="AbstractCMSComponent">
<list>
<value>SampleCampaignComponent.campaigns</value>
......
</list>
</entry>
...........
</map>
</property>
<property name="searchRestrictionsDisabled" value="true"/>
</bean>如果您真的不想重写整个bean定义,那么可以使用merge="true"进行检查。
<alias alias="synchronizationService" name="customSynchronizationService" />
<bean id="customSynchronizationService"
class="de.hybris.platform.cmscockpit.sync.CMSSynchronizationService" parent="defaultSynchronizationService">
<property name="relatedReferencesTypesMap">
<map merge="true">
<entry key="AbstractCMSComponent">
<list merge="true">
<value>SampleCampaignComponent.campaigns</value>
</list>
</entry>
</map>
</property>
</bean>https://stackoverflow.com/questions/48271423
复制相似问题