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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

How can we add watermark to an expired asset in aem as a cloud?

Avatar

Level 2
 
1 Accepted Solution

Avatar

Correct answer by
Level 8
5 Replies

Avatar

Correct answer by
Level 8

@ReddyIshanvi Please refer to the link for adding the watermark to your asset https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/manage/water...

Hope this helps!

Thanks

Avatar

Community Advisor

Hi @ReddyIshanvi,
You did not add much details about your use case. Let me try to answer with possible use cases. 
If you want to do it manually, There is a workflow process (Add Watermark) available to add watermark to assets. Create a workflow and run this workflow for expire assets.
If you want to do it at particular interval and automatically, Create a scheduler or job to find expired assets and execute this Workflow/Model using this scheduler.

 

Avatar

Level 2

Thankyou @kumar_sunil . This is helpful .How can I find out expired assets. I want to add a watermark as soon as an asset is expired. Also is there a way to remove the watermark when the expiry date is changed to a future date for an asset?

Avatar

Level 8

@ReddyIshanvi 

For that you can create the workflow launcher from the path "http://localhost:4502/libs/cq/workflow/admin/console/content/launchers.html" based on the event type i.e. "Modified". And within the process step for the workflow you can write the logic to check and perform the respective business logic to remove the watermark.

 

Or, you can write the EventHandler and from that you can perform the respective business logic to remove the watermark.

@Component(immediate = true, service = EventHandler.class, property = {
		Constants.SERVICE_DESCRIPTION + "= This event handler listens the events on page activation",
		EventConstants.EVENT_TOPIC + "=org/apache/sling/api/resource/Resource/ADDED",
		EventConstants.EVENT_TOPIC + "=org/apache/sling/api/resource/Resource/CHANGED",
		EventConstants.EVENT_FILTER + "(&" + "(path=/content/we-retail/us/en/*/jcr:content) (|("
				+ SlingConstants.PROPERTY_CHANGED_ATTRIBUTES + "=*jcr:title) " + "(" + ResourceChangeListener.CHANGES
				+ "=*jcr:title)))" })
public class CustomEventHandler implements EventHandler {

	/**
	 * Logger
	 */
	private static final Logger log = LoggerFactory.getLogger(CustomEventHandler.class);
	
	@Override
	public void handleEvent(Event event) {
		
		log.info("Event is: {}", event.getTopic());
	}

}

Reference - https://aem.redquark.org/2018/10/day-14-eventing-in-aem.html

 

Hope this helps!

Thanks

 

Avatar

Level 2

Thank you @shaileshbassi . This is helpful. Can you also help explaining how can I trigger an event/action as soon as an asset is expired. I am looking for adding a watermark as soon as the status changes to expired for an asset.