Expand my Community achievements bar.

SOLVED

Unable to run catalog blueprint rollout programmatically

Avatar

Level 1
I’m using the AEM Hybris connector to import my product catalog from Hybris to AEM and create products pages using the catalog blueprint. I would like to perform some other operations in sequence so I considered using a workflow. Currently, a step in the work step runs a catalog blueprint rollout for a section using the RolloutCommand via HTTP POST using some sample parameters like these:
 
POST /bin/wcmcommand HTTP/1.1
Host: localhost:4502
Cache-Control: no-cache
 
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="cmd"
 
rolloutSection
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="srcPath"
 
/content/catalogs/my-app/catalog/jcr:content
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="destPath"
 
/content/my-app/en_us/products
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="force"
 
false
----WebKitFormBoundaryE19zNvXGzXaLvS5C
 
The problem is that, this POST in my first step seems to be running in the background, causing the step to complete instantaneously and advance to the next workflow step. For obvious reasons, I will like the rollout to complete before moving to the next step.
 
I would like to programmatically mimic what the rollout command does but either the API is not exposed in OSGI or I haven’t being able to make the API work. The ones I tried were CatalogGenerator and RolloutManager.
 
Has somebody tried to do this before to share a snippet or advise me how to accomplish this?
 
Thanks in advance.
1 Accepted Solution

Avatar

Correct answer by
Level 10
1 Reply

Avatar

Correct answer by
Level 10