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

Catalog Sync Restriction

Former Member
0 Likes
386

Hello. I want to sync only products with the statusApproval of approved. I've created an user with the following restrictions:

 INSERT_UPDATE SearchRestriction; principal(uid)[allownull = true]; code[unique = true]; restrictedType(code)[unique = true]; active; query; generate
 ; approvedProductSyncUser; "Approved Product Sync User Visibility"; Product; true; "{approvalStatus} IN ( {{ SELECT {pk} FROM {ArticleApprovalStatus as a} WHERE {a:code} = 'approved' }} )"; false;
 ; approvedProductSyncUser; "Approved MediaContainer Sync User Visibility"; MediaContainer; true; "EXISTS ( {{ SELECT {pk} FROM {Product as p} WHERE {item:qualifier} LIKE CONCAT({p:code}, '%') }} )"; false;
 ; approvedProductSyncUser; "Approved Media Sync User Visibility"; Media; true; "{mediaContainer} IN ( {{ SELECT {pk} FROM {MediaContainer} }} )"; false;

The Product and MediaContainer syncs correctly but the sync for Media never does anything. The query SELECT * FROM {Media} using the approvedProductSyncUser returns the expected medias, but the syncJob does not find anything. Log from the job:

 INFO  [00008T5J::br.com.fh.fliegercommerce.occ.core.jalo.RestrictedCatalogVersionSyncJob] (00008T5J) [CatalogVersionSyncJob] Starting configuration ...
 INFO  [00008T5J::br.com.fh.fliegercommerce.occ.core.jalo.RestrictedCatalogVersionSyncJob] (00008T5J) [CatalogVersionSyncJob] Sync  'sync sharedContentCatalog:Staged->Online2' (pk:8799664767476) configured 1 entries for job '00008T5J' (pk:8809561719285) schedule medias: 0
 INFO  [00008T5J::br.com.fh.fliegercommerce.occ.core.jalo.RestrictedCatalogVersionSyncJob] (00008T5J) [CatalogVersionSyncJob] Finished configuration in 0d 00h:00m:00s:478ms.
 INFO  [00008T5J::br.com.fh.fliegercommerce.occ.core.jalo.RestrictedCatalogVersionSyncJob] (00008T5J) [CatalogVersionSyncJob] Starting synchronization ...
 INFO  [00008T5J::br.com.fh.fliegercommerce.occ.core.jalo.RestrictedCatalogVersionSyncJob] (00008T5J) [CatalogVersionSyncJob] Finished synchronization in 0d 00h:00m:00s:005ms. No errors.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Likes

Turns out we have to be careful when restricting the Media type because the Sync uses this type on the proccess.

To resolve this i've addedd this to my Media restriction: OR {folder} IN ({{ SELECT {pk} FROM {MediaFolder AS folder} WHERE {folder:qualifier} = 'catalogsync' }})