Adobe Experience Manager: Listing up published pages with Query Builder API

Description description

Environment

AEM as a Cloud Service, AEM 6.5

Issue/Symptoms

This article explains how to list the pages published on an AEM author.

Resolution resolution

Using Query Builder API, search the pages with cq:lastReplicationAction = Activate.

Example:

Query

path=/content/wknd
1_property=sling:resourceType
1_property.value=wknd/components/page
2_property=cq:lastReplicationAction
2_property.value=Activate
3_daterange.property=cq:lastReplicated
3_daterange.lowerBound=2019-01-01T00:00:00.000+09:00
3_daterange.lowerOperation=`>` =
orderby=path

URL

http://localhost:4502/bin/querybuilder.json?1_property=sling%3aresourceType&1_property.value=wknd%2fcomponents%2fpage&2_property=cq%3alastReplicationAction&2_property.value=Activate&3_daterange.lowerBound=2019-01-01T00%3a00%3a00.000%2b09%3a00&3_daterange.lowerOperation=%3e%3d&3_daterange.property=cq%3alastReplicated&orderby=path&path=%2fcontent%2fwknd

Result

{
  "success": true,
  "results": 8,
  "total": 8,
  "more": false,
  "offset": 0,
  "hits": `[`
    {
      "path": "/content/wknd/language-masters/en/magazine/arctic-surfing/jcr:content",
      "excerpt": "We traveled to Northern Norway to document the joy of surfing in extreme, but breathtakingly beautiful conditions.",
      "name": "jcr:content",
      "title": "Arctic Surfing",
      "lastModified": "2019-10-14 11:08:42",
      "created": "2023-04-10 21:56:45"
    },
    {
      "path": "/content/wknd/language-masters/en/magazine/guide-la-skateparks/jcr:content",
      "excerpt": "Breaking down the top skate destinations in all of Los Angeles. You don't want to miss this!",
      "name": "jcr:content",
      "title": "Ultimate Guide to LA Skateparks",
      "lastModified": "2020-10-01 09:37:33",
      "created": "2023-04-10 21:56:47"
    },
    ...
  `]`
}

Executing the query for a content path that has many pages under it may cause a performance issue. It is recommended to narrow down the path and execute the query multiple times rather than trying to retrieve all of the data in a single query execution.

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f