Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Issue in saving/retrieving RICH TEXT in/from MySQL Database

Avatar

Level 7

Hi,

I am not able to save rich text (htm tag) to the database. when i save textfield-rich text content to database, it is getting saved as plain text but not as rich text.

when i make select statement from the table. I am getting Plain text but not rich text.

this could be variable mismatch. I have mapped text field rich content to Text variable type column. Please let me know what do i do to store the mapped rich text to database.

following commands i used..

CREATE TABLE fordEformTC4

(

eformName VARCHAR(25),

Fr1Value TEXT,

Fr2Value TEXT,

Fr3Value TEXT

);

I am trying to put below content to column Fr1Value

<?xml version="1.0" encoding="UTF-8" ?>

- <TextField1 type="text">

- <body xmlns="http://www.w3.org/1999/xhtml">

- <p style="margin-top:0pt;margin-bottom:0pt;text-valign:middle;text-align:justify;font-family:'Myriad Pro';font-size:10pt;font-weight:bold;text-decoration:none">

Problem

<span style="font-weight:normal">in Storing Text in Database</span>

</p>

</body>

</TextField1>

when i retrieve the xml from the database, i see plain text ...

<?xml version="1.0" encoding="UTF-8"?>

<form1>

     <Page1>

          <TextField1 type="text">Problem in Storing Text in Database</TextField1>

          </TextField1>

     </Page1>

</form1>

Please let me know what is the issue. What mistake i am doing in my designing.

Regards

Sunil


1 Accepted Solution

Avatar

Correct answer by
Level 7

i used serialize() and deserialize() function in setValue activity from Misc to save and retreive xhtml data from adobe to db.

It worked fine.

Regards

Sunil

View solution in original post

1 Reply

Avatar

Correct answer by
Level 7

i used serialize() and deserialize() function in setValue activity from Misc to save and retreive xhtml data from adobe to db.

It worked fine.

Regards

Sunil