name = schema.TextLine(title=_(u"Name"),
                           description=_(u"The friendly name of the template")
                           )

    def template():
        """return the template (PageTemplate instance)"""

    def validate():
        """Return true/false by checking if the template can be applied to
        the context.

        Best example is picasa_slideshow with Link content type must check if
        the url is a picasa one.
        """

#dependencies
try:
    #plone4
    from plone.app.folder.folder import IATUnifiedFolder          as IFolder
    from Products.ATContentTypes.interfaces.link import IATLink   as ILink
    from Products.ATContentTypes.interfaces.topic import IATTopic as ITopic
    from Products.ATContentTypes.interfaces.image import IATImage as IImage
except ImportError, e:
    logger.info('BBB: switch to plone3 %s'%e)
    #plone3
    from Products.ATContentTypes.interface import IATFolder as IFolder
    from Products.ATContentTypes.interface import IATLink   as ILink
    from Products.ATContentTypes.interface import IATTopic  as ITopic
    from Products.ATContentTypes.interface import IATImage  as IImage
Beispiel #2
0
        """return the template (PageTemplate instance)"""

    def validate():
        """Return true/false by checking if the template can be applied to
        the context.

        Best example is picasa_slideshow with Link content type must check if
        the url is a picasa one.
        """


#dependencies
try:
    #plone4
    from plone.app.folder.folder import IATUnifiedFolder as IFolder
    from Products.ATContentTypes.interfaces.link import IATLink as ILink
    from Products.ATContentTypes.interfaces.topic import IATTopic as ITopic
    from Products.ATContentTypes.interfaces.image import IATImage as IImage
    from Products.ZCatalog.interfaces import ICatalogBrain
except ImportError, e:
    from collective.gallery import logger
    logger.info('BBB: switch to plone3 %s' % e)
    #plone3
    from Products.ATContentTypes.interface import IATFolder as IFolder
    from Products.ATContentTypes.interface import IATLink as ILink
    from Products.ATContentTypes.interface import IATTopic as ITopic
    from Products.ATContentTypes.interface import IATImage as IImage

    class ICatalogBrain(interface.Interface):
        pass