How to search for only pages which are published using querybuilder?
We are trying to get json from components of specific pages to render on client. We can individually lookup each required page by its template type:
path=/content/mysite/en/
type=cq:page
1_property=jcr:content/cq:template
1_property.value=/conf/mysite/settings/wcm/templates/my-page-template
some othe properties to narrow down the required page.
Then we can do another query to retrieve all its children, and iterate through them looking for the 2 components we required, and then copying each property to a model for later conversion to json.
The problem is that the first query returns unpublished pages, which the user should not yet be able to see.
How do we only return published content?
The page only seems to have 3 properties:
1) jcr:created
2) jcr:createdBy
3) jcr:primaryType.
There is no property to give the published status?