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

Need suggestion on storing data containing special characters

Avatar

Avatar
Springboard
Level 4
bilal_ahmad
Level 4

Likes

66 likes

Total Posts

106 posts

Correct Reply

16 solutions
Top badges earned
Springboard
Validate 10
Validate 1
Ignite 1
Establish
View profile

Avatar
Springboard
Level 4
bilal_ahmad
Level 4

Likes

66 likes

Total Posts

106 posts

Correct Reply

16 solutions
Top badges earned
Springboard
Validate 10
Validate 1
Ignite 1
Establish
View profile
bilal_ahmad
Level 4

24-05-2020

Dear community members,

I'm trying to create JCR nodes based on the data returned by http get. Some of the data contains special characters.

 

..
..
"details": [
{
"label": "Présentation de l’entreprise:",
"value": "<p style=\"margin: 0px;\">Chez , nous donnons aux gens la possibilit&eacute; d'interagir naturellement avec leurs divers appareils connect&eacute;.</p>"
},
{
"more-details": "Sommaire du poste: ",
"value": "<p style=\"margin: 0in; margin-bottom: .0001pt;\"><span style=\"font-family: arial, helvetica, sans-serif; font-size: 10pt;\">"
},
..
..

 

I cannot directly save the data, can someone please suggest a way I can save this information? I need to display the information as well.

 

Just to give another insight, I cannot create i18 key-value pair for this data(yeah 😞 )

 

Thanks,

Bilal.

AEM AEM6.4

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
ArpitVarshney
MVP

Likes

135 likes

Total Posts

185 posts

Correct Reply

36 solutions
Top badges earned
Validate 1
Establish
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
MVP
ArpitVarshney
MVP

Likes

135 likes

Total Posts

185 posts

Correct Reply

36 solutions
Top badges earned
Validate 1
Establish
Give Back 5
Give Back 3
Give Back 25
View profile
ArpitVarshney
MVP

24-05-2020

Hi @bilal_ahmad 

why don't you create a node and save the whole API response as nope property?[Like a node "response" in JCR repository and a property apiResponse as key and json as value]

 

You can create the node and property in AEM programmatically and there are various ways of doing that like using sling or node API.

 

Go through below links to refer the code 

Programatically create node

create content node

 

Regards,

Arpit

 

Answers (2)

Answers (2)

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,279 likes

Total Posts

3,156 posts

Correct Reply

889 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,279 likes

Total Posts

3,156 posts

Correct Reply

889 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

24-05-2020

This can be done easily.

Create node based on the response, valid node name can be set using https://helpx.adobe.com/experience-manager/6-2/sites/developing/using/reference-materials/javadoc/co...

data can be mapped as child nodes and properties.

Encode property values before saving.

 

If you are planning to map this data for a component then you can divide these data into small components.

 

Avatar

Avatar
Ignite 1
MVP
Ankur_Khare
MVP

Likes

152 likes

Total Posts

363 posts

Correct Reply

56 solutions
Top badges earned
Ignite 1
Validate 10
Validate 1
Give Back 50
Give Back 5
View profile

Avatar
Ignite 1
MVP
Ankur_Khare
MVP

Likes

152 likes

Total Posts

363 posts

Correct Reply

56 solutions
Top badges earned
Ignite 1
Validate 10
Validate 1
Give Back 50
Give Back 5
View profile
Ankur_Khare
MVP

24-05-2020

While creating the nodes please replace the special characters with _ or -.

Refer-

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