I faced an issue where jcr:uuid is not generated if we publish a page using manage publication, but not if we publish using quick publish. Upon investigation, we discovered that when we publish using quick publish, "mix:versionable" is added to the jcr:mixinTypes property. As a solution, I am trying to add a replication event handler that will add this "mix:versionable" mixin to the jcr:content node of the page if the property is not present. I am unable to add the mixin as I get an exception "org.apache.jackrabbit.oak.api.CommitFailedException: OakAccess0000: Access denied".
Is there any to add this mix:versionable mixin to the node? If there is no way to add the mixin, I will add a custom ID upon page creation but that will require a lot of changes as we have already referenced jcr:uuid for our previous solutions. So, if anyone is aware of how to add this mixin, please provide some insights.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @Ankan_Ghosh
The mix:versionable is added to page with quick publish because of new version of page is created, if you can also create a version.
Otherwise the way you are trying might work but check the permission.
Permissions : jcr:modifyProperties, jcr:nodeTypeManagement, jcr:write
Node node = session.getNode("/path/to/your/node");
if (!node.isNodeType("mix:versionable")) {
node.addMixin("mix:versionable");
session.save();
}
Hi @Ankan_Ghosh
The mix:versionable is added to page with quick publish because of new version of page is created, if you can also create a version.
Otherwise the way you are trying might work but check the permission.
Permissions : jcr:modifyProperties, jcr:nodeTypeManagement, jcr:write
Node node = session.getNode("/path/to/your/node");
if (!node.isNodeType("mix:versionable")) {
node.addMixin("mix:versionable");
session.save();
}
The problem was with the permission. After giving all the required permissions, I was able to add the mixin. Thanks!
Views
Replies
Total Likes
Hi @Ankan_Ghosh , @arunpatidar
By default AEM replication agents creates a version of page when you replicate the content. During version, AEM puts the node in checked in state so that no other operation will be done on that node. You can try checkin and checkout methods present in below API reference.
Views
Likes
Replies
Views
Like
Replies
Views
Likes
Replies