[Zope-CMF] CMF Site syndication buggy ?

Andrew Sawyers andrew@zope.com
Fri, 1 Mar 2002 11:03:34 -0500


Gilles,
The steps to enabling Syndication are 1) Enable it on the tool.  2) Enabl=
e
it on the folder you wish to Syndicate.  In your case, I'd suspect you
enabled it on the tool, but not on the root folder for your site.  Going =
to
http://www.mycmfsite.net/synPropertiesForm will be the place to do this.
Then going to http://www.mycmfsite.net/RSS works as expected.
If you look in the SyndicationTool module, you'll see that the method
getMaxItems returns 'Syndication is not Allowed' if the syndication
information object does not exist:

   syInfo =3D getattr(obj, 'syndication_information', None)
       if syInfo is not None:
           return syInfo.max_items
       else:
           return 'Syndication is not Allowed'

This is neither a bug nor a nonsense feature.  It works as I intended it.
Thanks,
Andrew

-----Original Message-----
From: zope-cmf-admin@zope.org [mailto:zope-cmf-admin@zope.org]On Behalf
Of Gilles Lenfant
Sent: Wednesday, February 27, 2002 3:07 PM
To: zope-cmf@zope.org
Subject: [Zope-CMF] CMF Site syndication buggy ?


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 th=
is
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



_______________________________________________
Zope-CMF maillist  -  Zope-CMF@zope.org
http://lists.zope.org/mailman/listinfo/zope-cmf

See http://www.zope.org/Products/PTK/Tracker for bug reports and feature
requests