[ZOPE] Compare ?

Mark Zimmermann mark.zimmermann@web.de
Thu, 7 Mar 2002 20:43:52 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_000B_01C1C618.CB96B190
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Is there a way to do this :
 
 
#import History module
from OFS import History
 
#derive from Historical mixin
class Document(PortalContent, DefaultDublinCoreImpl,
History.Historical):
 
#add the History tab to the Zope Management Interface
manage_options=PortalContent.manage_options+History.Historical.manage_op
tions
 
#override the manage_historyCompare method
#NOTE: in this example I set the resultso f hte comparison into the
REQUEST variable, historyComparisonResults
#which is then rendered by a pagetemplate history_comparison
    def manage_historyCompare(self, rev1, rev2, REQUEST,
                              historyComparisonResults=''):
        historyComparisonResults=History.html_diff( rev1.CookedBody(),
rev2.CookedBody() )
        self.REQUEST.set('historyComparisonResults',
historyComparisonResults)
        return self.history_comparison(self.REQUEST)

 
with DTML only ?

------=_NextPart_000_000B_01C1C618.CB96B190
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<TITLE>Nachricht</TITLE>

<META content=3D"MSHTML 6.00.2713.1100" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D081234319-07032002><FONT face=3DArial size=3D2>Is =
there a way to do=20
this :</FONT></SPAN></DIV>
<DIV><SPAN class=3D081234319-07032002><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D081234319-07032002><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D081234319-07032002><FONT face=3DArial =
size=3D2>#import History=20
module<BR>from OFS import History</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=3D081234319-07032002><FONT face=3DArial =
size=3D2>#derive from=20
Historical mixin<BR>class Document(PortalContent, DefaultDublinCoreImpl, =

History.Historical):</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=3D081234319-07032002><FONT face=3DArial size=3D2>#add =
the History tab=20
to the Zope Management=20
Interface<BR>manage_options=3DPortalContent.manage_options+History.Histor=
ical.manage_options</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=3D081234319-07032002><FONT face=3DArial =
size=3D2>#override the=20
manage_historyCompare method<BR>#NOTE: in this example I set the =
resultso f hte=20
comparison into the REQUEST variable, historyComparisonResults<BR>#which =
is then=20
rendered by a pagetemplate history_comparison<BR>&nbsp;&nbsp;&nbsp; def=20
manage_historyCompare(self, rev1, rev2,=20
REQUEST,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
historyComparisonResults=3D''):<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;=20
historyComparisonResults=3DHistory.html_diff( rev1.CookedBody(), =
rev2.CookedBody()=20
)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
self.REQUEST.set('historyComparisonResults',=20
historyComparisonResults)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
return=20
self.history_comparison(self.REQUEST)<BR></FONT></SPAN></DIV>
<DIV><SPAN class=3D081234319-07032002><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D081234319-07032002><FONT face=3DArial size=3D2>with =
DTML only=20
?</DIV></FONT></SPAN></BODY></HTML>

------=_NextPart_000_000B_01C1C618.CB96B190--