[Zope] eWebEditPro+XML
Palmer Leon
Info@hunterdonhealthcare.org
Wed, 02 Jul 2003 15:33:12 -0400
--=_E7B9D680.E786F432
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
I am trying to plug eWebEditPro+XML from Ektron into Plone as my WYSIWYG
editor. I have been successful up to one tiny unacceptable glitch.
Initial content for the editor is typically stored in the value
attribute of a hidden field. For example,
<input type="hidden" name="MyContent1" value="This is the initial
content.">
I need to convert certain characters. The documentation from Ektron
says that if my environment does not provide such a function, I have to
write it and they provide the following pseudo code as an example:
String strContent
strContent = ReplaceString(strContent, "&", "&")
strContent = ReplaceString(strContent, "<", "<")
strContent = ReplaceString(strContent, ">", ">")
strContent = ReplaceString(strContent, """, """)
The following (in custom/wysiwyg_support) works as long as I don't put
any apostrophes in my content:
<span tal:replace="structure string:<input type='hidden' name='text'
value='" />
<span tal:content="inputvalue" /><span tal:replace="structure string:'
/>" />
<span tal:replace="structure string:<script language='JavaScript'>"
/>
eWebEditPro.create("text", "90%", 450);
<span tal:replace="structure string:</script>" />
I have tried to follow the lead that I found at:
http://plone.org/Members/tlynch/HowToIntegrateEditize/view
I have tried to replace the first two lines with:
<span tal:replace="structure string:<input type='hidden' name='text'
value='" />
<span tal:replace="structure python:here.eweb.munge(inputvalue)"
/><span tal:replace="structure string:' />" />
I have the follwing in a file at Plone/eweb
## Script (Python) "munge"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=inputvalue
##title=
# to guard against files that might contain only
# returns or linefeeds, we will delete each separately
# rather than trying: replace("\r\n", "")
inputvalue = inputvalue.replace("\r", "")
inputvalue = inputvalue.replace("\n", "")
inputvalue = inputvalue.replace("'", "'")
return inputvalue
When I try this, I get the following:
Site error
This site encountered an error trying to fulfill your request. The
errors were: Error Details Error Type
AttributeError
Error Value
__call_
Is there anyone who might be able to steer me in the right direction or
has already successfully done this?
--=_E7B9D680.E786F432
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Content-Description: HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY style="MARGIN-TOP: 2px; FONT: 8pt Tahoma; MARGIN-LEFT: 2px">
<DIV><FONT size=2>I am trying to plug eWebEditPro+XML from Ektron into Plone as
my WYSIWYG editor. I have been successful up to one tiny unacceptable glitch.
<BR>Initial content for the editor is typically stored in the value attribute of
a hidden field. For example,<BR><input type="hidden" name="MyContent1"
value="This is the initial content."><BR>I need to convert certain
characters. The documentation from Ektron says that if my environment does
not provide such a function, I have to write it and they provide the following
pseudo code as an example:<BR> <BR>String strContent<BR>strContent =
ReplaceString(strContent, "&", "&amp;")<BR>strContent =
ReplaceString(strContent, "<", "&lt;")<BR>strContent =
ReplaceString(strContent, ">", "&gt;")<BR>strContent =
ReplaceString(strContent, """, "&quot;")<BR> <BR> <BR>The
following (in custom/wysiwyg_support) works as long as I don't put any
apostrophes in my content:<BR> <BR><span tal:replace="structure
string:<input type='hidden' name='text' value='" /><BR><span
tal:content="inputvalue" /><span tal:replace="structure string:' />"
/><BR> <BR> <span tal:replace="structure string:<script
language='JavaScript'>" /><BR>eWebEditPro.create("text", "90%",
450);<BR> <span tal:replace="structure string:</script>"
/><BR> <BR>I have tried to follow the lead that I found
at:<BR> <BR><A
href="http://plone.org/Members/tlynch/HowToIntegrateEditize/view">http://plone.org/Members/tlynch/HowToIntegrateEditize/view</A>
<BR> <BR>I have tried to replace the first two lines
with:<BR> <BR><span tal:replace="structure string:<input
type='hidden' name='text' value='" /><BR><span tal:replace="structure
python:here.eweb.munge(inputvalue)" /><span tal:replace="structure
string:' />" /></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> <BR>I have the follwing in a file at
Plone/eweb<BR> <BR> ## Script (Python) "munge"<BR>
##bind container=container<BR> ##bind
context=context<BR> ##bind namespace=<BR> ##bind
script=script<BR> ##bind subpath=traverse_subpath<BR>
##parameters=inputvalue<BR> ##title=<BR> <BR> # to
guard against files that might contain only<BR> # returns or
linefeeds, we will delete each separately<BR> # rather than trying:
replace("\r\n", "")<BR> inputvalue = inputvalue.replace("\r",
"")<BR> inputvalue = inputvalue.replace("\n", "")<BR>
inputvalue = inputvalue.replace("'", "&#039;")<BR> <BR>
return inputvalue</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>When I try this, I get the following:<BR> <BR>Site
error</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>This site encountered an error trying to fulfill your request.
The errors were: Error Details Error Type <BR>AttributeError</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>Error Value <BR>__call_</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT size=2><BR>Is there anyone who might be able to steer me in the right
direction or has already successfully done
this?<BR> <BR></FONT></DIV></BODY></HTML>
--=_E7B9D680.E786F432--