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
BedrockMission!

Learn More

View all

Sign in to view all badges

How to get absolute page path of the live copies from the source/master path

Avatar

Avatar
Give Back
Level 2
vijays80591732
Level 2

Likes

6 likes

Total Posts

56 posts

Correct Reply

4 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 5
Boost 3
View profile

Avatar
Give Back
Level 2
vijays80591732
Level 2

Likes

6 likes

Total Posts

56 posts

Correct Reply

4 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 5
Boost 3
View profile
vijays80591732
Level 2

07-12-2020

Hello Guys,

 

I have the master page "/content/we-retail/ca/en/experience/climbing-in-the-massif-du-mont-blanc" and I have created live copies for the below markets,

 

au - /content/we-retail/au/en/experience/climbing-in-the-massif-du-mont-blanc

nz - /content/we-retail/nz/en/experience/climbing-in-the-massif-du-mont-blanc

 

I'm trying to get the live copy URL's from the master page. I have tried with the below code, but it's returning up to the market level ("content/we-retail/au/en",/content/we-retail/nz/en) and not the absolute path.

 

I wanted to get the exact path of the live copy URL "/content/we-retail/nz/en/experience/climbing-in-the-massif-du-mont-blanc". Any idea? 

 

String itemPath = "/content/we-retail/ca/en/experience/climbing-in-the-massif-du-mont-blanc";
Resource res = resourceResolver.getResource(itemPath);
RangeIterator rangeIterator = liveRelManager.getLiveRelationships(res,"",null);
while (rangeIterator.hasNext())
{
LiveRelationship liveCopy =(LiveRelationship) rangeIterator.next();
log.debug("LiveCopies URL's..." + liveCopy.getLiveCopy());

}

@arunpatidar26 @Vijayalakshmi_S @Veena_Vikram @Ratna_Kumar @kautuk_sahni @smacdonald2008 @BrijeshYadav 

 

Regards,

Vijay

AEM blueprint Livecopy MSM Relationships

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 3
MVP
Manjunath_K
MVP

Likes

140 likes

Total Posts

188 posts

Correct Reply

61 solutions
Top badges earned
Give Back 3
Give Back
Boost 50
Boost 5
Boost 3
View profile

Avatar
Give Back 3
MVP
Manjunath_K
MVP

Likes

140 likes

Total Posts

188 posts

Correct Reply

61 solutions
Top badges earned
Give Back 3
Give Back
Boost 50
Boost 5
Boost 3
View profile
Manjunath_K
MVP

07-12-2020

Hi @vijays80591732 ,

Use liveCopy.getTargetPath() instead of liveCopy.getLiveCopy() as highlighted below, it will return the absolute path of the live sync resource.

 

https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/javadoc/co...

 

String itemPath = "/content/we-retail/ca/en/experience/climbing-in-the-massif-du-mont-blanc";
Resource res = resourceResolver.getResource(itemPath);
RangeIterator rangeIterator = liveRelManager.getLiveRelationships(res,"",null);
while (rangeIterator.hasNext())
{
LiveRelationship liveCopy =(LiveRelationship) rangeIterator.next();
log.debug("LiveCopies URL's..." + liveCopy.getTargetPath()); //returns the absolute path of the live sync resource.

}

 

Hope this helps!

Answers (0)