Syndication
===========

Current syndication functionality is provided using the Zope 2 
``fatsyndication`` product.

Lets begin by creating an video container with some video files.

  >>> id = folder.invokeFactory('Folder', 'video-container')
  >>> container = folder[id]
  >>> config = container.restrictedTraverse('@@video-config.html')
  >>> config.media_activated = True

  >>> id = container.invokeFactory('File', 'video-item-1')
  >>> item1 = container[id]
  >>> config = item1.restrictedTraverse('@@video-config.html')
  >>> config.media_activated = True

  >>> from p4a.video import interfaces
  >>> video = interfaces.IVideo(item1)
  >>> video.title = u'My Test Video'
  >>> video.description = u'Lorem Ipsum'

Since some sample content has been configured we can now start testing
the syndication feeds.

  >>> feedview = container.restrictedTraverse('@@rss.xml')
  >>> feed = feedview.getFeed()
  >>> feed
  <p4a.plonevideo.syndication.VideoContainerFeed ...>

  >>> entries = feed.getFeedEntries()
  >>> len(entries)
  1
  >>> entries
  [<p4a.plonevideo.syndication.VideoFeedEntry ...>]

  >>> str(entries[0].getTitle())
  'My Test Video'
  >>> 'video-item-1' in entries[0].getWebURL()
  True

  >>> entries[0].getDescription()
  u'Lorem Ipsum'

Now add a video link to the container

  >>> id = container.invokeFactory('Link', 'video-link-1')
  >>> item2 = container[id]

  >>> config = item2.restrictedTraverse('@@video-link-config.html')
  >>> config.media_activated = True
  
  >>> feed = feedview.getFeed()

  >>> entries = feed.getFeedEntries()
  >>> len(entries)
  2
  >>> entries
  [<p4a.plonevideo.syndication.VideoFeedEntry ...>]



