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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Detach a live copy programatically

aemg12
Level 2
Level 2

My translation tool creates new language copies as live copies since we send live copies for translation. I am looking for a way to detach live relationship through code. Any suggestions will help.

1 Accepted Solution
Bimmi_Soi
Correct answer by
Community Advisor
Community Advisor

Hi @aemg12 ,

 

You can use the below method of LiveRelationshipManager to detach relationship as detach(Resource resource, boolean autoSave) is Deprecated. 

 

endRelationship(Resource resource, boolean autoSave)

Ends the LiveRelationship of the given Resource.
The Resource has to be part of a LiveCopy As indicated by hasLiveRelationship method
A detached Resource is treated as any other Resource that is created in the LiveCopy tree.
NOTE: this means especially that any history of this relation is gone

View solution in original post

6 Replies
vmadala
Level 3
Level 3

@aemg12 ,

The best practice is always sent the english language copy  (not the live copy) for translation. You have to create your blueprint accordingly.  

 

Anyway, Yes we can detach the live copy through programatically, in your site root page,   "jcr:content/cq:LiveSyncConfig" in this node needs to add "cq:excludedPath" property with all the detach page paths.

 

Thanks,

Venkat 

 

 

 

aemg12
Level 2
Level 2
Thanks Venkat I think it will be too much of work for us to send blueprint for translation since then we will have to at least roll out content in 15 different languages. What I fail to understand is why our translation tool copies over the live copy nodes to language copy
aemg12
Level 2
Level 2
@vmadala Also I am not sure if this will solve the issue because for me translation tool is not rolling out the page, its copying over the page along with its nodes and properties therefore live nodes also gets copied over to language copy.
Bimmi_Soi
Correct answer by
Community Advisor
Community Advisor

Hi @aemg12 ,

 

You can use the below method of LiveRelationshipManager to detach relationship as detach(Resource resource, boolean autoSave) is Deprecated. 

 

endRelationship(Resource resource, boolean autoSave)

Ends the LiveRelationship of the given Resource.
The Resource has to be part of a LiveCopy As indicated by hasLiveRelationship method
A detached Resource is treated as any other Resource that is created in the LiveCopy tree.
NOTE: this means especially that any history of this relation is gone

View solution in original post