Consider simply using escape() to encode the htmlText on the way into
the db and unescape() it before assigning it to the RTE.

 

I haven't thought this all the way throug, now.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of shawn.gibson
Sent: Thursday, March 29, 2007 9:53 PM
To: [email protected]
Subject: [flexcoders] Getting the RichTextEditor to do some dancing in a
database...> to XML file

 

Hi Guys, I want to add a comments area to the gallery/blog I'm
building, and I'd like to be able to offer users an RTE interface,
with the resultant html text to be properly displayed when later
retrieved. This, in my case, will most likely be a 2-part affair. The
user will enter a comment into a text area as provided by the RTE, and
that data will be dumped into a sql/mysql db, and I will run a CF
script that passes me back (i.e., creates when invoked by the
administrator - me) an xml file that I can use HTTPService to load in
the data into a TextArea...I think...I'm still learning.

My core question today, if I'm even on the right track, is...how do I
populate the db, and get it back into the xml file, in the sense that
I think I'd need to wrap the users' input around CDATA areas within
the generated xml (that's my guess)?

In other words, how do I populate the database, not with "hi there,
nice pic", but instead with "<b>hi there</b>,<i>nice pic!!!</i>" and
pass THAT into the generated xml file, andback out to a TextArea
component?

I do have an XML generating file in CF that someone got me started on,
to read values in the db and pass me back a proper xml file (and it
works like a charm so far!), but it's pretty simple at this stage. I
can't even show it because my server is in for configuration with Win
Server2003SBS...and all my files are on it...

If my approach doesn't make sense, let me say, I'm doing most of the
db work as the owner (creating and updating galleries, images, photo
data etc.), and spitting out xml files for the client to upload, to
minimize actual client db access (and, I believe, reduce wear and tear
on my equipment, i.e., spitting out XML files seems less intensive on
my machine than having users constantly accessing the same
db...caching issues being a problem I'll deal with when I get to
them). But this is one of the cases where I DO seem to need to allow a
user access to the db itself - to enter a blog/comment.

Any guidance would be appreciated. I know part of the answer is:
you're doing it wrong, use a CRUD CFC and shove it somewhere offsite
so you can validate it yourself before allowing it onto the site, but
I haven't been able to figure those things out yet...and if anyone
would be willing to teach me that (Build a CRUD CFC and get it
working, all 4 operations, in Flex), just for demonstration purposes,
I'd be willing to pay for it, because I really need to learn this
stuff for my gallery (I'm a photographer/designer, not yet a developer).

Shawn

 

Reply via email to