I have a requirement in which I have to access all the published assets from one path.
I need only published assets and unpublished assets should be skipped.
currently, I used the property
jcr:content/cq:lastReplicationAction == "Activate"
to validate it but it seems like the unpublished assets are also getting picked.
what are the other ways to validate it?
Thank you
Views
Replies
Total Likes
Did you try the ReplicationStatusManager from acs-commons?
Hello @rahul234dabas ,
You can run the following query builder to get all the published assets under a path.
path=/content/dam/my-project/master/english/home
type=dam:Asset
property=jcr:content/cq:lastReplicationAction
property.value=Activate
p.limit=-1
By this query the unpublished will not comeup and no need for extra validation for this.
I did the same but seems like it's not fetching the published assets
The query was to fetch the published assets. No working in your local or higher environment?
Can you populate this problem from the we-retail project? This will be more clear to understand it.
Hello @rahul234dabas
We are first setting a metadata ( Publish Status ) on all assets for a particular folder and then in Java code we are using to fetch status for individual asset.
@rahul234dabas , If you don't want to rely on any property. You can use ReplicationStatus API
https://javadoc.io/doc/com.adobe.aem/aem-sdk-api/latest/com/day/cq/replication/ReplicationStatus.htm...
ReplicationStatus replicationStatus = resource.adaptTo(ReplicationStatus.class)
return replicationStatus.isActivated()
You can check Asset published or unpublished through Publish Asset Report:
Hello @rahul234dabas
Please assure that the property is indexed.
jcr:content/cq:lastReplicationAction
OOTB its not defined in indexes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies