[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, "&", "&amp;")
strContent = ReplaceString(strContent, "<", "&lt;")
strContent = ReplaceString(strContent, ">", "&gt;")
strContent = ReplaceString(strContent, """, "&quot;")
 
 
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("'", "&#039;")
 
   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>&lt;input type="hidden" name="MyContent1" 
value="This is the initial content."&gt;<BR>I need to convert certain 
characters.&nbsp; 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>&nbsp;<BR>String strContent<BR>strContent = 
ReplaceString(strContent, "&amp;", "&amp;amp;")<BR>strContent = 
ReplaceString(strContent, "&lt;", "&amp;lt;")<BR>strContent = 
ReplaceString(strContent, "&gt;", "&amp;gt;")<BR>strContent = 
ReplaceString(strContent, """, "&amp;quot;")<BR>&nbsp;<BR>&nbsp;<BR>The 
following (in custom/wysiwyg_support) works as long as I don't put any 
apostrophes in my content:<BR>&nbsp;<BR>&lt;span tal:replace="structure 
string:&lt;input type='hidden' name='text' value='" /&gt;<BR>&lt;span 
tal:content="inputvalue" /&gt;&lt;span tal:replace="structure string:' /&gt;" 
/&gt;<BR>&nbsp;<BR>&nbsp; &lt;span tal:replace="structure string:&lt;script 
language='JavaScript'&gt;" /&gt;<BR>eWebEditPro.create("text", "90%", 
450);<BR>&nbsp; &lt;span tal:replace="structure string:&lt;/script&gt;" 
/&gt;<BR>&nbsp;<BR>I have tried to follow the lead that I found 
at:<BR>&nbsp;<BR><A 
href="http://plone.org/Members/tlynch/HowToIntegrateEditize/view">http://plone.org/Members/tlynch/HowToIntegrateEditize/view</A> 
<BR>&nbsp;<BR>I have tried to replace the first two lines 
with:<BR>&nbsp;<BR>&lt;span tal:replace="structure string:&lt;input 
type='hidden' name='text' value='" /&gt;<BR>&lt;span tal:replace="structure 
python:here.eweb.munge(inputvalue)" /&gt;&lt;span tal:replace="structure 
string:' /&gt;" /&gt;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;<BR>I have the follwing in a file at 
Plone/eweb<BR>&nbsp;<BR>&nbsp;&nbsp; ## Script (Python) "munge"<BR>&nbsp;&nbsp; 
##bind container=container<BR>&nbsp;&nbsp; ##bind 
context=context<BR>&nbsp;&nbsp; ##bind namespace=<BR>&nbsp;&nbsp; ##bind 
script=script<BR>&nbsp;&nbsp; ##bind subpath=traverse_subpath<BR>&nbsp;&nbsp; 
##parameters=inputvalue<BR>&nbsp;&nbsp; ##title=<BR>&nbsp;<BR>&nbsp;&nbsp; # to 
guard against files that might contain only<BR>&nbsp;&nbsp; # returns or 
linefeeds, we will delete each separately<BR>&nbsp;&nbsp; # rather than trying: 
replace("\r\n", "")<BR>&nbsp;&nbsp; inputvalue = inputvalue.replace("\r", 
"")<BR>&nbsp;&nbsp; inputvalue = inputvalue.replace("\n", "")<BR>&nbsp;&nbsp; 
inputvalue = inputvalue.replace("'", "&amp;#039;")<BR>&nbsp;<BR>&nbsp;&nbsp; 
return inputvalue</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>When I try this, I get the following:<BR>&nbsp;<BR>Site 
error</FONT></DIV>
<DIV>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT size=2>Error Value <BR>__call_</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</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>&nbsp;<BR></FONT></DIV></BODY></HTML>

--=_E7B9D680.E786F432--