Greetings,
I have a task to get, each 2 hours, some informations SAP and create or update, a file in DAM. But, i need to replicate, too. How to do this? How can i replicate(publish) this DAM file each 2 hours? My enviroments do not have "DAM Update Asset".
Solved! Go to Solution.
Views
Replies
Total Likes
You can use the Replication API to take care of the replication. You will have to write custom code. Check this post: https://helpx.adobe.com/experience-manager/using/aem64_replication_api.html
To run this every 2 hours make use of Scheduler. https://www.adobe.io/experience-manager/reference-materials/6-4/javadoc/org/apache/sling/commons/sch...
You can use the Replication API to take care of the replication. You will have to write custom code. Check this post: https://helpx.adobe.com/experience-manager/using/aem64_replication_api.html
To run this every 2 hours make use of Scheduler. https://www.adobe.io/experience-manager/reference-materials/6-4/javadoc/org/apache/sling/commons/sch...
Given your scenario, I would do something like this:
You can create a designated folder like /content/dam/my-site/automagic
This folder will be watched by the AEM OSGI Event Hander, org.osgi.service.event.EventHandler. for both EventConstants.EVENT_TOPIC + "=org/apache/sling/api/resource/Resource/ADDED", EventConstants.EVENT_TOPIC + "=org/apache/sling/api/resource/Resource/CHANGED" where a the assets JCR_CONTENT node's properties will be updated with something like "pendingAutomaticReplication=true";
Next, Using the scheduler, https://www.adobe.io/experience-manager/reference-materials/6-4/javadoc/org/apache/sling/commons/sch... you can use the JCR_SQL2 query strings to find all assets that has pendingAutomaticReplication=true; and replicate each asset every 2 hours. Dont forget to change pendingAutomaticReplication=false;
Regards,
Brian.
Views
Likes
Replies
Views
Likes
Replies