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

How to get current page or current page sub page or all pages contents byte for post to remote server for translate

Anonymous
Not applicable

Now there is a need to get current page or current page sub page or all pages in CQ5, also need 1)to post the page content to remote server for translate; 2) and if necessary to post the page's properties like title and description to remote server for tranlate. As a result, these page file translated will be pulled back to CQ5

And now i found in this forum someone mentioned as below could get:

currentPage - request.getResource().adaptTo(Page.class)

currentNode - request.getResource().adaptTo(Node.class)

 

My question is:  if developer could get the whole page file (XX.html) to post remote server for translate and how to get?  If false, how to deal with that case: get page content that need to translate, then post it to remote server for translate?

 

So anyone could help provide suggestion? Thanks in advance.

1 Accepted Solution
Sham_HC
Correct answer by
Level 10
Level 10
6 Replies
Sham_HC
Correct answer by
Level 10
Level 10
Anonymous
Not applicable

Hi sham,

Many thanks for your reply, i think it is helpful to me really. Now i am checking it but a place let me confused that there is no any defined language in the "workflow" tab of the sidekick. Please see the screenshot following: [img]nolanguage.jpg[/img]

Sham_HC
Level 10
Level 10

lei brian wrote...

Hi sham,

Many thanks for your reply, i think it is helpful to me really. Now i am checking it but a place let me confused that there is no any defined language in the "workflow" tab of the sidekick. Please see the screenshot following:

 

One of the cause might be you are missing hotfix NPR-3561 http://helpx.adobe.com/experience-manager/kb/cq561-available-hotfixes.html 

Anonymous
Not applicable

Hi sham,

Again, now i need to use Java language to develop the translating logic that copy page or get page information in AEM. But i notice that the CQ provide relevant API, you can see here: http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/wcm/api/PageManager.html. So my question is following:

1) How to get the CQ jar to develop?

2) Should i use JCR(JAR) API or CQ(JAR) API to develop? I don't know what the difference between both?

 

Thanks a lot.

Sham_HC
Level 10
Level 10

Hi bbboy2014,

The links works for me. If  translating logic witin aem then can use aem api, if external outside aem then use jcr api.

Thanks,
Sham
 Tweet: @adobe_sham