Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Update and publish DAM file, each specific time

thionor
Level 1
Level 1

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

1 Accepted Solution
ibishika
Correct answer by
Level 4
Level 4

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

View solution in original post

3 Replies
ibishika
Correct answer by
Level 4
Level 4

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

View solution in original post

BrianKasingli
Community Advisor
Community Advisor

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.