Rajiv
Rajiv

Reputation: 21

Page level synchronisation issue | Hybris

In our CMSCockpit for staged content when any component is updated then its synchronisation button turns into red, but the synchronisation button remains green at page level in the same case as show in the fig. However if any page level attribute is updated the synchronisation button turns into red. Also if the synhcronisation button is clicked then the updates/changes happened in its child component those don't get synchronized.

https://i.sstatic.net/QDkDA.png

Is this expected behavior if not then how it can be fixed or if yes then how can it be customised?

Thanks in advance

Upvotes: 2

Views: 1352

Answers (1)

Free-Minded
Free-Minded

Reputation: 5430

If I am understanding correct, you have issue with the nested Synchronization.

You need to add child component information (if any) in synchronizationService as well.

Open cmscockpit-spring-services.xml and check you will see a bean named with synchronizationService. Have a look OOTB RotatingImagesComponent entry. Hybris have added RotatingImagesComponent.banners in the list map because whenever any banner attribute will changes, it should get reflected.

<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="AbstractPage">
                <list>
                    <value>AbstractPage.restrictions</value>
                    <value>AbstractPage.contentSlots</value>
                    <value>ContentSlotForPage.contentSlot</value>
                    <value>ContentSlot.cmsComponents</value>
                    <value>AbstractCMSComponentContainer.simpleCMSComponents</value>
                    <value>AbstractCMSComponentContainer.currentCMSComponents</value>
                    <value>RotatingImagesComponent.banners</value>                      
                    <value>AbstractCMSComponent.restrictions</value>
                    <value>abstractMediaContainerComponent.media</value>
                </list>
            </entry>
            <entry key="AbstractCMSComponent">
                <list>
                    <value>AbstractCMSComponentContainer.simpleCMSComponents</value>
                    <value>AbstractCMSComponentContainer.currentCMSComponents</value>
                    <value>RotatingImagesComponent.banners</value>                      
                    <value>AbstractCMSComponent.restrictions</value>
                    <value>abstractMediaContainerComponent.media</value>
                    <value>MediaContainer.medias</value>
                    <value>NavigationBarCollectionComponent.components</value>
                    <value>NavigationBarComponent.navigationNode</value>
                    <value>NavigationBarComponent.link</value>
                </list>
            </entry>
            <entry key="CMSNavigationNode">
                <list>
                    <value>CMSNavigationNode.children</value>
                    <value>CMSNavigationNode.entries</value>
                    <value>CMSNavigationNode.links</value>
                    <value>CMSNavigationEntry.item</value>
                    <value>CMSLinkComponent</value>
                </list>
            </entry>
            <entry key="ContentSlot">
                <list>
                    <value>ContentSlot.cmsComponents</value>
                    <value>abstractMediaContainerComponent.media</value>
                    <value>NavigationBarCollectionComponent.components</value>
                    <value>NavigationBarComponent.navigationNode</value>
                    <value>NavigationBarComponent.link</value>
                </list>
            </entry>
            <entry key="MediaContainer">
                <list>
                    <value>MediaContainer.medias</value>
                </list>
            </entry>
        </map>
    </property>
    <property name="searchRestrictionsDisabled" value="true"/>
</bean>

You need to override this bean in your cmscockpit-services.xml to add your customer attribute items entry as well.

Upvotes: 3

Related Questions