Translation Object preview

JanHumpal

16-06-2020

Hello,

 

I am trying to use the TranslationObject#getTranslationObjectPreview method to get a preview of a page. 

 

I expect a zip with all files required to open the page offline, independently of AEM.

I would then like to send this archive over http to a server (which I believe is only tangentially important).

 

My issue is that when I open this zip package, the html page has broken encoding and image links:

 

broken_preview.png

 

 

Exploring the archive structure a bit I find the images from the body of the article, however, the html does not link to them correctly. I could not find images for the icons or the image from the top of the page.

 

My question is, am I doing something wrong or is this the full extent of the preview feature that AEM supports?

Below is a screenshot of the code in debug mode showing part of the method used for converting the ZipInputStream, obtained from the TranslationObject, into a ByteArrayInputStream that can be fed to the Apache http client.

The preview shows the content of the buffer, read using UTF8 encoding.Screenshot_1.png

 

Unless I'm missing something, this shows the locale specific characters are corrupted even before transfer.
Is there maybe some configuration to be done that could remedy this?

translations

Accepted Solutions (0)

Answers (2)

Answers (2)

Nupur_Jain

MVP

18-06-2020

HI @JanHumpal 

 

We had a similar requirment to create page preview zip. We faced similar issues with zip created from getTranslationObjectPreview so we ended up creating our own utility to create page preview zip. 

 

Thanks,

Nupur

 

 

JanHumpal

23-06-2020

While I appreciate the feedback from Nupur, as it shows that this is not merely a problem local to my setup, I still hesitate to mark it as a final answer to my questions.

 

I would still like a confirmation, that this is truly a limitation of the translation framework, rather than a case of two different developers running into the same wall.