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

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

How to convert jcr:data to readable text.

Avatar

Level 7

akshaybhujbale_0-1662041976927.png

How I can convert this jcr:data binary to readable text?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

You can read the data without subservice if user has access to that node.

Although you need jcrsession or resourceresolver to read the node.you can get this from request object.

 

Display binary data in readable fromat is totally depends on what kind of data is stored in the node. if it is json you can see but if the format is something else then you need those applications to see that data in readable format

0 Replies

Avatar

Level 7

HI @arunpatidar Thanks

Is there any to get this without resourceresolver.

Is there any way to encode the binary data to readable text.

Avatar

Correct answer by
Community Advisor

Hi,

You can read the data without subservice if user has access to that node.

Although you need jcrsession or resourceresolver to read the node.you can get this from request object.

 

Display binary data in readable fromat is totally depends on what kind of data is stored in the node. if it is json you can see but if the format is something else then you need those applications to see that data in readable format

Avatar

Employee Advisor

Hi @akshaybhujbale ,

 

You can try below snippet

 

ValueMap properties = currentPage.getProperties();
data = IOUtils.toString(properties.get(“jcr:data”, InputStream.class), “UTF-8”);

Hope this helps!!

 

Thanks