AEM Experience Flashcards
Workflow step to move an asset
What was the problem?
Solution including APIs you used
The client required a workflow to move a pdf file to different locations in the DAM without any interaction. The pdf’s filename had underscore separated codes, which identified the destination folder for the file.
Solution:
Created a workflow that is launched when a file is created under /content/dam/mosaic
Go to Tools>Workflow>Model>create new model
Tools>Workflow>Launcher > create a launcher for when a file is created event
Add a Process step to the workflow model and select your custom process step.
Created a custom workflow step by implementing the granite WorkflowProcess class and implementing the execute method. In the execute method I used the granite AssetManager api’s move method to move the asset from source to destination.
Customized site admin tools menu by adding a generate feed button
Copied site admin from /libs/cq/ui to /apps/cq/ui
Copied exiting button.
Created a new function in JS.
This function is called using a property on button node.
Explain Ajax call to servlet-> servlet Checks current user
JS -> Calls servlet -> Checks if current user is admin -> return json with true or false
JS Checks json string and displays accordingly.
Custom replication agent to call Akamai and clear the cache
Replication in aem allows you to move content across servers.
To create a custom replication agent:
Replication Agent UI: copy the replication agent from cq/replication/components/agent
Implement Content builder: creates the content that will be sent in the body of the request by the transport handler. (Select as serialization type)
Implement Transport handler: handles communication with the server
Call akami using Apache http client.