Fetch list of language copies for a particular page programmatically | Community
Skip to main content
Uma_Nath_Jha
Level 2
November 14, 2016
Solved

Fetch list of language copies for a particular page programmatically

  • November 14, 2016
  • 3 replies
  • 2371 views

I want to know all the language copies available or created for a particular page.

say, a particular page are in two different languages french and dutch. 

if i select french page , how can i know programmatically know that dutch copy of this page also exist?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kautuk_sahni

Hi 

You can make use of "PageInfo" servlet to obtain page information in JSON format.

Example:- http://localhost:4502/libs/wcm/core/content/pageinfo.json?path=/content/geometrixx/

It will return JSON values, 

Link:- 

"languages":{  
      "rows":[  
         {  
            "path":"/content/geometrixx/en",
            "exists":true,
            "hasContent":true,
            "lastModified":0,
            "iso":"en",
            "country":"gb",
            "language":"English"
         },
         {  
            "path":"/content/geometrixx/fr",
            "exists":true,
            "hasContent":true,
            "lastModified":0,
            "iso":"fr",
            "country":"fr",
            "language":"French"
         },
         {  
            "path":"/content/geometrixx/de",
            "exists":true,
            "hasContent":true,
            "lastModified":0,
            "iso":"de",
            "country":"de",
            "language":"German"
         }.........So on

 

Here you can easily determine the all language copies available.

Documentation link:- https://docs.adobe.com/docs/en/aem/6-2/develop/components/pageinfo.html

I hope this would help you.

~kautuk

3 replies

Premkarthic-7WP
Level 4
November 15, 2016

You can leverage the functionality of default servlet with selector as "language"

/content/geometrixx/en.languages.json?deep=false, with deep set as true, it will give the list of sub pages also.

kautuk_sahni
Community Manager
kautuk_sahniCommunity ManagerAccepted solution
Community Manager
November 15, 2016

Hi 

You can make use of "PageInfo" servlet to obtain page information in JSON format.

Example:- http://localhost:4502/libs/wcm/core/content/pageinfo.json?path=/content/geometrixx/

It will return JSON values, 

Link:- 

"languages":{  
      "rows":[  
         {  
            "path":"/content/geometrixx/en",
            "exists":true,
            "hasContent":true,
            "lastModified":0,
            "iso":"en",
            "country":"gb",
            "language":"English"
         },
         {  
            "path":"/content/geometrixx/fr",
            "exists":true,
            "hasContent":true,
            "lastModified":0,
            "iso":"fr",
            "country":"fr",
            "language":"French"
         },
         {  
            "path":"/content/geometrixx/de",
            "exists":true,
            "hasContent":true,
            "lastModified":0,
            "iso":"de",
            "country":"de",
            "language":"German"
         }.........So on

 

Here you can easily determine the all language copies available.

Documentation link:- https://docs.adobe.com/docs/en/aem/6-2/develop/components/pageinfo.html

I hope this would help you.

~kautuk

Kautuk Sahni
Uma_Nath_Jha
Level 2
November 28, 2016

Thank you