Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Creating Custom meta data that displays page status (Publish or Unpublish)

Avatar

Avatar
Give Back
Level 1
Manlosa
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 1
View profile

Avatar
Give Back
Level 1
Manlosa
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 1
View profile
Manlosa
Level 1

12-04-2021

Hi there, we are using an external service for search and want to provide tons of meta-data info. One which includes the status of page content whether it is published or not. Since the service can't fetch the isActivated properties, we are creating a custom meta-data field that exposes the status of the page. Can this be done?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

613 likes

Total Posts

591 posts

Correct Reply

231 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

613 likes

Total Posts

591 posts

Correct Reply

231 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
BrianKasingli
MVP

12-04-2021

@Manlosa,

When you think of the AEM content architecture, the public-facing AEM environment, which is the publish instances, would only store activated resources. Therefore if your external service is reading data from an AEM publish instances, they will never be able to see these unpublished resources. 

If however, your third party service is directly accessing your AEM author instance, then they will be able to retrieve every cq:Page node, and read the cq:lastReplicationAction attribute. Definetly I would review the external service API to understand what it is doing before thinking about using the AEM author as a data source, as in most cases are not best practice. 

And why are you allowing users to search your un-publish web pages? Unpublished pages are unpublished for a reason?

Manlosa

@BrianKasingli,

     With this solution, our audience is the content authors so this is why the data source is author. The 3rd-party service can not retrieve the value for "cq:lastReplicationAction" but it can retrieve values from the custom meta-data schema that we created.

This is why I thought of extending the custom schema and add a field called "Is Published" and display the value of "cq:lastReplicationAction". Something like this. And if I can somehow get a value of "True/False", then I think the 3rd-party service might be able to fetch.

Not really sure if there are other ways around this.

 

Thanks!

BrianKasingli
hmm, how is the 3rd party api accessing the content from your author? when you use something like model.json or infinity.json, you can see all the properties for a given resource.
Manlosa

Hi Brian,

  Thanks for the input. Without going to details, this application is catered to content authors and they will need to see all contents in different states, including unpublished pages.

 

If you really think accessing the cq:Page will give access to attributes such as cq:lastReplicationAction, then maybe I need to review the 3rd-party service.

 

-Leo

BrianKasingli
Leo, there are a few properties that would or would NOT exist in a given cq:Page resource. for instance, if a page have never been replicated then cq:lastReplicationAction would not exist, therefore you can default the status to "not published". Assuming that you are providing a user-service user with the correct permissions, you will be able to see all the properties of a given resource using either the Sling API or Node API. Definitely have a look at how the data is received in the 3rd party API. Good luck.

Answers (0)