Example #1
0
 def _make_info(self):
     """Add an old style SyndicationInfo to the folder"""
     from Products.CMFDefault.SyndicationInfo import SyndicationInformation
     info = SyndicationInformation()
     info.syUpdateBase = DateTime()
     info.syUpdatePeriod = 1
     info.syUpdateFrequency = 1
     info.isAllowed = 1
     info.max_items = 5
     return info
Example #2
0
 def _make_info(self):
     """Add an old style SyndicationInfo to the folder"""
     from Products.CMFDefault.SyndicationInfo import SyndicationInformation
     info = SyndicationInformation()
     info.syUpdateBase = DateTime()
     info.syUpdatePeriod = 1
     info.syUpdateFrequency = 1
     info.isAllowed = 1
     info.max_items = 5
     return info
Example #3
0
def syndicateFolderishObject(object, event):
    """ Enable RSS feed upon FolderishObject creation. """
    if not hasattr(object.aq_explicit, "syndication_information"):
        syInfo = SyndicationInformation()
        object._setObject("syndication_information", syInfo)
        portal = object.portal_url.getPortalObject()
        portal_syn = portal.portal_syndication
        syInfo = object._getOb("syndication_information")
        syInfo.syUpdatePeriod = portal_syn.syUpdatePeriod
        syInfo.syUpdateFrequency = portal_syn.syUpdateFrequency
        syInfo.syUpdateBase = portal_syn.syUpdateBase
        syInfo.max_items = portal_syn.max_items
        syInfo.description = "Channel Description"
Example #4
0
    def enableSyndication(self, obj):
        """
        Enable syndication for the obj
        """
        if not self.isSiteSyndicationAllowed():
            raise 'Syndication is Disabled'

        if hasattr(aq_base(obj), 'syndication_information'):
            raise 'Syndication Information Exists'

        syInfo = SyndicationInformation()
        obj._setObject('syndication_information', syInfo)
        syInfo = obj._getOb('syndication_information')
        syInfo.syUpdatePeriod = self.syUpdatePeriod
        syInfo.syUpdateFrequency = self.syUpdateFrequency
        syInfo.syUpdateBase = self.syUpdateBase
        syInfo.max_items = self.max_items
        syInfo.description = "Channel Description"
Example #5
0
    def enableSyndication(self, obj):
        """
        Enable syndication for the obj
        """
        if not self.isSiteSyndicationAllowed():
            raise 'Syndication is Disabled'

        if hasattr(aq_base(obj), 'syndication_information'):
            raise 'Syndication Information Exists'

        syInfo = SyndicationInformation()
        obj._setObject('syndication_information', syInfo)
        syInfo = obj._getOb('syndication_information')
        syInfo.syUpdatePeriod = self.syUpdatePeriod
        syInfo.syUpdateFrequency = self.syUpdateFrequency
        syInfo.syUpdateBase = self.syUpdateBase
        syInfo.max_items = self.max_items
        syInfo.description = "Channel Description"