def enableSyndication(self, obj):
     """
     Enable syndication for the obj
     """
     if not _checkPermission(ModifyPortalContent, obj):
         raise Unauthorized
     settings = IFeedSettings(obj)
     settings.enabled = True
 def afterSetUp(self):
     self.syndication = getToolByName(self.portal, 'portal_syndication')
     self.folder.invokeFactory('Document', 'doc1')
     self.folder.invokeFactory('Document', 'doc2')
     self.folder.invokeFactory('File', 'file')
     self.doc1 = self.folder.doc1
     self.doc2 = self.folder.doc2
     self.file = self.folder.file
     #Enable syndication on folder
     registry = getUtility(IRegistry)
     self.site_settings = registry.forInterface(ISiteSyndicationSettings)
     settings = IFeedSettings(self.folder)
     settings.enabled = True
     self.folder_settings = settings
    def __getattr__(self, name):
        default = None
        if name in ISiteSyndicationSettings.names():
            default = getattr(self.site_settings, name)
        elif name == 'enabled' and self.site_settings.default_enabled:
            default = True
        elif name in IFeedSettings.names():
            default = IFeedSettings[name].default

        return self._metadata.get(name, default)
 def disableSyndication(self, obj):
     if not _checkPermission(ModifyPortalContent, obj):
         raise Unauthorized
     settings = IFeedSettings(obj)
     settings.enabled = False