Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Getting the replication status of a content fragment, problems on publish instance

Avatar

Level 1

Hello

In one of our functionalities, we use a servlet that recovers the information of some content fragments in the project, however our client is asking us to dismiss content fragments that exist but are not published.

 

To achieve this, we have tried a few things, this being the most promising from what we have researched.

Resource cfResource = resolver.getResource(pathCf);
ReplicationStatus replicationStatus = cfResource.adaptTo(ReplicationStatus.class);
JsonObject isCfPublished = new JsonObject();
isCfPublished.addProperty("isPublished", replicationStatus.isActivated());
Boolean statusCf = isCfPublished.get("isPublished").getAsBoolean();
LOGGER.warn(pathCf+" isPublished "+statusCf);

this works well in showing only published Content fragments, however if one content fragment is unpublished, and then published again, the publish instance of our AEM as a cloud service instance is still recognizing it as deactivated. When in author it is showing the content fragment as valid again.

 

Is there a delay from author to publish as far as recovering the replicationStatus? is publish somehow unable to recover the updated value?

Is there a more effective way we could do this operation, that would work on publish?

Any advice is welcomed.

 

Thanks in advance

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

0 Replies