on ‎2016 Jul 19 9:48 AM
Is it possible to exclude an attribute from synchronization programmatically? So that I don't need to adjust the synchronization properties manually in hmc.
The attributes must not be synchronized through CMS Cockpit nor through hmc. Also the sync marker in CMS Cockpit must not change to red when changing that attribute.
In my case it's a Date and an Enum.
My ideas so far:
Outsource them with a relation and don't add that relation to cmscockpit-services.xml.
Extend SynchronizationService with a attribute blacklist.
I don't like that solutions. Is there a more straight forward way?
Request clarification before answering.
As explained by the sync marker in CMS Cockpit works on type level. Therefore it's not possible to exclude attributes without much effort.
We ended up creating a new item type with the attributes that are not relevant for synchronization.
This new item type has an attribute which points back to the original item type. You can't do it the other way around, else it would be synced of course, and relations cannot be 1-to-1.
Optionally one could create dynamic attributes on the original item type, which will retrieve the outsourced values.
We use an Init Defaults Interceptor to make sure the additional item gets created.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christian,
Here are the steps to remove an attribute, for this example I will take the Product type but the same applies to any other type. As part of my example I will remove an attribute called variants from being synchronized when Product is synchronized.
Go to HMC (http://localhost:9001/hmc/hybris)
Click on Catalog >> Catalog Management Tools >> Synchronization
From the Source catalog version table click on the catalog that you want to synchronize
Click on the Catalog Versions tab
From the Dependent catalog versions table, click on the Synchronization target (in my case it is: electronicsProductCatalog)
Click on the Synchronization Properties tab
Properties to synchronize section contains a tree whose root is: Item. Navigate that tree and open Product, then Properties, then look for the variants attribute. By default it should be checked, remove the checkmark.
Scroll up and click on Save
For a programmatic approach:
As of versions 5.2 you can use Spring to configure rootTypes for both ProductCatalogSyncJob and ContentCatalogSyncJob, as well as attributes of SyncAttributeDescriptorConfig. Here is the document that explains how to do so:
Regards,
Luis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I hope this is what you mean, if not I apologize in advance. As of versions 5.2 you can use Spring to configure attributes of SyncAttributeDescriptorConfig for given items. Have a look at the document: https://wiki.hybris.com/display/release5/commerceservices+Extension+-+Technical+Guide#commerceservic...
Hello Christian, yes you can remove an attribute from synchronization by configuration only. See: https://wiki.hybris.com/display/release5/Synchronization+Guide#SynchronizationGuide-EditingSynchroni... point 5
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.