cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Exclude Attribute from Synchronization programmatically.

Former Member
0 Likes
3,356

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?

View Entire Topic
Former Member
0 Likes

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.

  1. Go to HMC (http://localhost:9001/hmc/hybris)

  2. Click on Catalog >> Catalog Management Tools >> Synchronization

  3. From the Source catalog version table click on the catalog that you want to synchronize

  4. Click on the Catalog Versions tab

  5. From the Dependent catalog versions table, click on the Synchronization target (in my case it is: electronicsProductCatalog)

  6. Click on the Synchronization Properties tab

  7. 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.

  8. 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

Former Member
0 Likes

Can I do this programmatically?

Former Member
0 Likes

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...

Former Member
0 Likes

Yes, it is. Thanks. Would be nice if you edit it into your answer.

Former Member
0 Likes

I'm glad to hear that! I also added that to the answer.