Expand my Community achievements bar.

SOLVED

Live copy is not working for programatically created pages

Avatar

Community Advisor

Hi,

I've created the live copy and it is working fine for the existing content. However, If I create a page page programatically using JCR api then live copy is not copying that page to Spanish but if I create the same page manually in English then live copy is copying that page to Spanish. 

Any idea why live copy is not able to copy the programatically created pages to spanish.

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

noksc wrote...

Hi,

I've created the live copy and it is working fine for the existing content. However, If I create a page page programatically using JCR api then live copy is not copying that page to Spanish but if I create the same page manually in English then live copy is copying that page to Spanish. 

Any idea why live copy is not able to copy the programatically created pages to spanish.

Thanks.

 

JCR API is not adding cq:lastModified property to the newly created node. So live copy is not able to understand its timestamp. I had to add this property and now live copy is working fine.

View solution in original post

7 Replies

Avatar

Level 10

When you create a page using an API, you need to make sure it has the same props as a page that is created manually, I am not even sure this is supported. I will check.

They will ask why are you trying to create a page for a LiveCopy using an API? 

Avatar

Employee

Hi,

Can you share the lines in the code you are using to create the page?

Regards,

Opkar

Avatar

Correct answer by
Community Advisor

noksc wrote...

Hi,

I've created the live copy and it is working fine for the existing content. However, If I create a page page programatically using JCR api then live copy is not copying that page to Spanish but if I create the same page manually in English then live copy is copying that page to Spanish. 

Any idea why live copy is not able to copy the programatically created pages to spanish.

Thanks.

 

JCR API is not adding cq:lastModified property to the newly created node. So live copy is not able to understand its timestamp. I had to add this property and now live copy is working fine.

Avatar

Employee

Were you using the PageManager API or creating Nodes?

Regards,

Opkar

Avatar

Community Advisor

Opkar Gill wrote...

Were you using the PageManager API or creating Nodes?

Regards,

Opkar

 

I am using JCR API. 

Avatar

Level 10

Great pickup -  i suspected it was a prop issue as I suggested. Thank you for posting this! 

Avatar

Community Advisor

smacdonald2008 wrote...

Great pickup -  i suspected it was a prop issue as I suggested. Thank you for posting this! 

 

Thanks Scott.