Reputation: 123
A page in author with UUID(jcr:uuid) is activated and its content is replicated onto the 3 associated publish servers. The content available in all the 3 publish servers has different UUIDs. So, considering the same content across all the 4 instances on AEM (1 author + 3 publish), how to associate with something unique?
I'm implementing a solution where I need to associate a unique id that can be mapped to the individual content across all the instances.
Approaches that I've tried till now:
Used the content path - to generate a unique id - by removing the '/' & '-' in the path. The issue faced - For some paths this can be more than 128 chars which is the limit for the service to accept a unique id.
If I generate a unique id programmatically it will work, but how can I try to use that to track the back content? As I cannot store this programmatically created id on the jcr:content and activate the page. Issues - If I replicate the page, it will change the activation date as well- which is also important metadata for the content.
What can be the most feasible solution for the use case? Kindly help with suggestions and possible solutions.
Upvotes: 1
Views: 1217
Reputation: 18556
You could use a hash of the content path. Easiest way to get a hash is using hashCode()
. For compactness, use the Base64 representation of the hash bytes and truncate after a predetermined number of chars.
Upvotes: 1