[Zope-CMF] CMF Site syndication buggy ?

Gilles Lenfant gilles@objectis.net
Wed, 27 Feb 2002 21:07:13 +0100


Hi,

Anybody tried to enable and try the site wide syndication and view it ?

http://www.mycmfsite.net/RSS

=3D=3D> Syndication is disabled !

Something's buggy : try this simple script at the root of your CMF site:
=3D=3D=3D=3D
po =3D container.portal_url.getPortalObject()
so =3D container.portal_syndication
r1 =3D so.isSiteSyndicationAllowed()
r2 =3D so.isSyndicationAllowed(po)
return [r1, r2]
=3D=3D=3D=3D
This returns [1, 0].  This should be [1, 1]

Another experiment (always with site wide syndication enabled): create =
this RSS2 script in the "custom" skin.
=3D=3D=3D=3D=3D
from Products.PythonScripts.standard import url_quote
req =3D context.REQUEST
if context is context.portal_url.getPortalObject():
    ok =3D context.portal_syndication.isSiteSyndicationAllowed()
else:
    ok =3D context.portal_syndication.isSyndicationAllowed(context)
if ok:
    req.RESPONSE.setHeader('Content-type', 'text/xml')
    return context.rssBody(context, req)
else:
    message =3D url_quote('La syndication est desactiv=E9e')
    req.RESPONSE.redirect(context.absolute_url() + =
'/rssDisabled?portal_status_message=3D' + message)
    return
=3D=3D=3D=3D
then call http://www.mycmfsite.net/RSS2

This returns a traceback... because...
put this script at the root of your CMF
=3D=3D=3D=3D
po =3D container.portal_url.getPortalObject()
so =3D container.portal_syndication
a =3D so.getMaxItems(po)
return a
=3D=3D=3D
click the "test" tab... And it returns...
"Syndication is not Allowed"
When an integer is expected.

Is this a bug or am I trying a nonsense feature ?

TIA
--Gilles