在 hybris cmscockpit 中,自定义组件无法识别同步
In hybris cmscockpit the custom components are not recognised for synchronization
了解自定义 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>
对此定制有什么建议吗?
如果它不起作用,您可以复制粘贴整个 bean 定义,因为它在您的 customcockpit-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>
感谢@KilleKat 和@Shreshtt Bhatt 的回复。
在我评论了 yacceleratorcockpits
扩展的 cmscockpit-services.xml
中定义的自定义 bean 后,我发现它工作正常。
据我了解,如果我们有加速器扩展更好地扩展加速器模板而不是使用 ycockpit 模板。
了解自定义 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>
对此定制有什么建议吗?
如果它不起作用,您可以复制粘贴整个 bean 定义,因为它在您的 customcockpit-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>
感谢@KilleKat 和@Shreshtt Bhatt 的回复。
在我评论了 yacceleratorcockpits
扩展的 cmscockpit-services.xml
中定义的自定义 bean 后,我发现它工作正常。
据我了解,如果我们有加速器扩展更好地扩展加速器模板而不是使用 ycockpit 模板。