Highlighted

List the pages which got activated on a particular day

Arun_007

19-03-2018

Hi All,

Am running on AEM 6.1 SP2-CFP11.

We had a scenario:

The author has de-activated (by mistake) and activated the parent node of the content page which has 200+ child pages.

The problem is we need to identify what are all the pages which got activated newly during this bulk activation and deactivate them again.

Can someone please help me with the better solution to address this scenario? We don't have the error logs/replication logs since this happened a month ago.

Note: We have a workflow created which activates/deactivates the bunch of child nodes when a parent node is activated/de-activated.

Thanks,

Replies

Highlighted

Jörg_Hoh

Employee

19-03-2018

By default the replication creates a new version of a page.

* For each of these pages:
** Identify the version which has been created by this replication action

** Check the replicationStatus property on that version

** if (replicationStatus == DEACTIVATED):

*** The page was deactivated when this mistake happened

** if (replicationStatus not present):

*** The page has never been activated

** (if (replicationStatus == ACTIVATED):

*** The page was activated at that time

You should probably validate this approach in some test environment 🙂

Good luck!

Jörg

Highlighted

Arun_007

19-03-2018

Hi Jörg, Thanks much for spending your time to answer my problem.

Am trying to implement your solution, can you please help me with a sql2 query or a query builder params, which gets me the replication status of a page? - Am struggling here.

Thanks,

Arun.

Highlighted

edubey

19-03-2018

You can use something just like this ( below one only for pages which are activated )

path=/content/project

type=cq:Page

group.p.or=true

group.1_property=jcr:content/cq:lastReplicationAction

group.1_property.value=Deactivate

group.2_property=jcr:content/cq:lastReplicationAction

group.2_property.operation=not

Highlighted

Hemant_arora

20-03-2018

SELECT * FROM [nt:base] AS s WHERE ISDESCENDANTNODE([/content/we-retail]) and s.[cq:lastReplicated] >= '2018-03-20T14:37:27.530+05:30'

you can also add another and clause to find between two dates

Highlighted

Jörg_Hoh

Employee

20-03-2018

You need to check that property on the versioned nodes (which live under /jcr:system), not on the current pages in /content. Therefor a simple query does not help. You need to traverse the version history of each of the nodes which was affected.

And before you start to implement code, you should validate the algorithm manually.

Jörg