I believe comparing lastModified time against replication status help to decide on the asset that needs to get republished.
thanks for your reply.
I have implemented this with "jcr:lastModified" & "cq:lastReplicated" dates to find updated assets.
Using replicator.replicate() method I used to activate page and respective assets.
Here I am facing one issue that All activated items (page and their respective assets) are shows publish status as green irrespective of publisher server on or off.
As per mine below should be functionality.
1) If publisher server is off then page and assets should show status in amber color (in queue)
2) If publisher server is on then page and assets should show status in green color
How to set the replication status using workflow on above scenarios. It would be great if you give me some snippet in java mode.
Thanks in advance
Sorry I do not have code to share with you.
One approach could be:
1) Create a workflow process step pointing to a process Java class.
2) In your Java class get payload and find all references (http://wemcode.wemblog.com/get_asset_reference_in_page)
3) Compare last:modified date of asset with published date (Some example here http://www.wemblog.com/2011/10/how-to-find-all-pages-modified-or.html)
4) Then using replication API replicate those asset as well.
hope it helps.