<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get Activation Status of assets post modification. in Adobe Experience Manager Discussions</title>
    <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/get-activation-status-of-assets-post-modification/m-p/454144#M33653</link>
    <description>&lt;P&gt;Are you trying bulk asset properties update&amp;nbsp;&lt;LI-USER uid="17376316"&gt;&lt;/LI-USER&gt;? You can try writing a custom workflow step that replicates the assets on the update of the properties.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kiran Vedantam.&lt;/P&gt;</description>
    <pubDate>Tue, 31 May 2022 15:27:20 GMT</pubDate>
    <dc:creator>Kiran_Vedantam</dc:creator>
    <dc:date>2022-05-31T15:27:20Z</dc:date>
    <item>
      <title>Get Activation Status of assets post modification.</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/get-activation-status-of-assets-post-modification/m-p/454106#M33649</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am writing a utility wherein the page/asset would be replicated if it's modified and pending activation. The last replication date should be less than or earlier than the modification date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can we do it from backend/java code? I tried "ReplicationStatus", but it does not fit the use case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thx.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 13:45:46 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/get-activation-status-of-assets-post-modification/m-p/454106#M33649</guid>
      <dc:creator>Vinodthakur</dc:creator>
      <dc:date>2022-05-31T13:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Get Activation Status of assets post modification.</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/get-activation-status-of-assets-post-modification/m-p/454113#M33650</link>
      <description>&lt;P&gt;Hi &lt;LI-USER uid="17376316"&gt;&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can write a Sling event listener which listens to the events at the asset's node specified and then replicates the modified asset/page&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/sunilkumar1117/AEM-Sample/blob/master/acs-aem-samples-master/bundle/src/main/java/com/adobe/acs/samples/events/impl/SampleJcrEventListener.java" target="_blank"&gt;https://github.com/sunilkumar1117/AEM-Sample/blob/master/acs-aem-samples-master/bundle/src/main/java/com/adobe/acs/samples/events/impl/SampleJcrEventListener.java&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kiran Vedantam.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 14:00:42 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/get-activation-status-of-assets-post-modification/m-p/454113#M33650</guid>
      <dc:creator>Kiran_Vedantam</dc:creator>
      <dc:date>2022-05-31T14:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Get Activation Status of assets post modification.</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/get-activation-status-of-assets-post-modification/m-p/454115#M33651</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;LI-USER uid="17376316"&gt;&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I would achieve this using Workflow Launcher which provides one component to monitor all changes in the content repository and launch workflow.&lt;BR /&gt;&lt;BR /&gt;Reference:&amp;nbsp;&lt;A href="https://www.argildx.com/technology/triggering-a-workflow-using-event-listeners-in-aem/" target="_blank" rel="noopener"&gt;https://www.argildx.com/technology/triggering-a-workflow-using-event-listeners-in-aem/&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For your further requirement - sharing some code snippet&lt;/P&gt;&lt;PRE&gt;public String getReplicationStatus() {
 Session session = resource.getResourceResolver().adaptTo(Session.class);
  log.debug("Getting replication status for {}", path);
 ReplicationStatus status = replicator.getReplicationStatus(session, path);
 Status rStatus = Status.NOT_ACTIVATED;
 if (status != null) {
  if (status.isDeactivated()) {
   rStatus = Status.DEACTIVATED;
  } else if (status.isPending()) {
   rStatus = Status.IN_PROGRESS;
  } else if (status.isActivated()) {
   Calendar lastModified = getLastModified(resource.getResourceResolver(), path);
   if (lastModified != null &amp;amp;&amp;amp; status.getLastPublished() != null
     &amp;amp;&amp;amp; lastModified.after(status.getLastPublished())) {
    rStatus = Status.MODIFIED;
   } else {
    rStatus = Status.ACTIVATED;
   }
  }
 }
 
 log.debug("Retrieved replication status {}", rStatus);
 return rStatus.toString();
}&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Hope that help you!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Santosh&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 15:08:07 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/get-activation-status-of-assets-post-modification/m-p/454115#M33651</guid>
      <dc:creator>SantoshSai</dc:creator>
      <dc:date>2022-05-31T15:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Get Activation Status of assets post modification.</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/get-activation-status-of-assets-post-modification/m-p/454133#M33652</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;LI-USER uid="17330494"&gt;&lt;/LI-USER&gt;&amp;nbsp;, &lt;LI-USER uid="11813833"&gt;&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Thanks for the suggestion, the problem is that we are looking to implement this on a huge set of records like 10000 records at a time. Do you see anything more optimal solution here?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 14:47:37 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/get-activation-status-of-assets-post-modification/m-p/454133#M33652</guid>
      <dc:creator>Vinodthakur</dc:creator>
      <dc:date>2022-05-31T14:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: Get Activation Status of assets post modification.</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/get-activation-status-of-assets-post-modification/m-p/454144#M33653</link>
      <description>&lt;P&gt;Are you trying bulk asset properties update&amp;nbsp;&lt;LI-USER uid="17376316"&gt;&lt;/LI-USER&gt;? You can try writing a custom workflow step that replicates the assets on the update of the properties.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kiran Vedantam.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 15:27:20 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/get-activation-status-of-assets-post-modification/m-p/454144#M33653</guid>
      <dc:creator>Kiran_Vedantam</dc:creator>
      <dc:date>2022-05-31T15:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get Activation Status of assets post modification.</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/get-activation-status-of-assets-post-modification/m-p/454553#M33760</link>
      <description>&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;Thanks. I proceeded with the code suggested by&amp;nbsp;&lt;LI-USER uid="11813833"&gt;&lt;/LI-USER&gt;&amp;nbsp;. The requirement is to find all the references (static) of a page/XP fragment that are outdated and use them to purge Akamai cache.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 11:33:31 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/get-activation-status-of-assets-post-modification/m-p/454553#M33760</guid>
      <dc:creator>Vinodthakur</dc:creator>
      <dc:date>2022-06-02T11:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Get Activation Status of assets post modification.</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/get-activation-status-of-assets-post-modification/m-p/454792#M33769</link>
      <description>&lt;P&gt;What do you mean with "r&lt;SPAN&gt;eplicated if it's modified and pending activation"? I understand "pending activation" that the replication API as already been invoked on it and it's just sitting in the queue waiting to get replicated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;private Calendar getLastReplicationDate (Resource res) {
  ReplicationStatus status = res.adaptTo(ReplicationStatus.class);
  if (status != null &amp;amp;&amp;amp; status.isActivated()) {
    return status.getLastPublished();
  } else {
    return null;
  }
}

private boolean mustBeActivated(Page page) {
  return !page.getLastModified().before(getLastReplicationDate(page.getContentResource()));
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 17:37:47 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/get-activation-status-of-assets-post-modification/m-p/454792#M33769</guid>
      <dc:creator>Jörg_Hoh</dc:creator>
      <dc:date>2022-06-03T17:37:47Z</dc:date>
    </item>
  </channel>
</rss>

