Expand my Community achievements bar.

SOLVED

Detach a live copy programatically

Avatar

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

Avatar

Correct answer by
Employee 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

Avatar

Level 4

@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 

 

 

 

Avatar

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

Avatar

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.

Avatar

Correct answer by
Employee 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