Exemplo n.º 1
0
 def newsml_allowed(self):
     util = getMultiAdapter((self.context, self.request),
                            name='syndication-util')
     if not util.site_enabled():
         return False
     elif ISyndicatable.providedBy(self.context):
         settings = IFeedSettings(self.context, None)
         if settings.enabled:
             return True
     return False
Exemplo n.º 2
0
 def newsml_allowed(self):
     util = getMultiAdapter((self.context, self.request),
                            name='syndication-util')
     if not util.site_enabled():
         return False
     elif ISyndicatable.providedBy(self.context):
         settings = IFeedSettings(self.context, None)
         if settings.enabled:
             return True
     return False
Exemplo n.º 3
0
    def getDexterityFolderTypes():
        try:
            from plone.dexterity.interfaces import IDexterityFTI
            from plone.dexterity.utils import resolveDottedName
        except ImportError:
            return set([])

        portal_types = getToolByName(portal, "portal_types")
        types = [fti for fti in portal_types.listTypeInfo() if IDexterityFTI.providedBy(fti)]

        ftypes = set([])
        for _type in types:
            klass = resolveDottedName(_type.klass)
            if ISyndicatable.implementedBy(klass):
                ftypes.add(_type.getId())
        return ftypes
Exemplo n.º 4
0
def _getDexterityFolderTypes(portal):
    try:
        from plone.dexterity.interfaces import IDexterityFTI
        from plone.dexterity.utils import resolveDottedName
        from Products.CMFPlone.interfaces.syndication import ISyndicatable
    except ImportError:
        return set([])

    portal_types = getToolByName(portal, 'portal_types')
    types = [fti for fti in portal_types.listTypeInfo() if
             IDexterityFTI.providedBy(fti)]

    ftypes = set([])
    for _type in types:
        klass = resolveDottedName(_type.klass)
        if ISyndicatable.implementedBy(klass):
            ftypes.add(_type.getId())
    return ftypes
Exemplo n.º 5
0
 def context_allowed(self):
     if not ISyndicatable.providedBy(self.context):
         return False
     elif not self.site_enabled():
         return False
     return True
 def test_syndicatable(self):
     from Products.CMFPlone.interfaces.syndication import ISyndicatable
     self.assertTrue(ISyndicatable.providedBy(self.collection))
Exemplo n.º 7
0
 def test_syndicatable(self):
     from Products.CMFPlone.interfaces.syndication import ISyndicatable
     self.assertTrue(ISyndicatable.providedBy(self.collection))