Feed the Masses

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Feed the Masses - Presentation Transcript

    1. Introducing Vice - Outbound Syndication in Plone via the Zope Component Architecture Paul Bugni Center for Public Health Informatics Feed the Masses T: 206.221.7444 F: 206.616.5249 1100 NE 45 th Street, Ste 405 Seattle, WA 98105 www.cphi.washington.edu
    2. Agenda
      • Syndication
      • Vice History and Demonstration
      • Zope Component Architecture
      • Vice Integration
      • Customizing Syndication
    3. What is syndication?
    4. To publish or broadcast
      • Alternative to browser only audience for publishing content
    5. “Web Feed” or “News Feed”
    6. Data format for frequently updated content
    7. Content distributors syndicate a web feed
    8. Users can easily subscribe to the feed
    9. Simplifies keeping up with changes
    10. Using Aggregators
    11.  
    12.  
    13. Prevailing syndication formats
      • That’s the beauty of standards, there are so many to pick from!
    14. Two prevailing formats (as of mid-2005)
      • RSS 2.0
      • Atom 1.0
    15. Exposing the myth of RSS compatibility
      • “I would like to publicly apologize for my previous misstatements. There are not 7 different and incompatible versions of RSS; there are 9” - Mark Pilgrim[1]
      • [1] http://diveintomark.org/archives/2004/02/04/incompatible-rss
    16. RSS Stands For?
      • RDF (Resource Description Framework) Site Summary (RSS 1.0 and RSS 0.90)
      • Rich Site Summary (RSS 0.91)
      • Really Simple Syndication (RSS 2.0)
    17. First, there was the mark up language RDF
      • Resource Description Framework
      • Used to store metadata (author, language, copyright…) about the content
    18. RSS 0.90
      • In 1999 Netscape created the standard named RSS version 0.90
      • The beginning of RSS as we know it today
    19. RSS 0.91 (part 1)
      • Dan Libby (Netscape) improved 0.90 and released RSS version 0.91
    20. RSS 0.91 (part 2)
      • Dave Winer (Userland) also created an improvement of RSS 0.90 and called his version 0.91
    21. Confusion ensued
      • Two versions named RSS 0.91 with different specifications
    22. RSS 1.0
      • Rael Dornfest (O’Reily) released RSS version 1.0
      • Based on the RDF standard rather than RSS
      • RSS 1.0 was therefore incompatible with previous RSS versions
    23. So to clear things up
      • Userland named their next release version 2.0
      • Harvard Law accepted responsibility for the RSS 2.0 specification
      • RSS 2.0 is very similar to 0.9 series (generally compatible)
      • RSS 1.0 remains very different
    24. RSS 2.0
      • The specification is copyrighted by Harvard University and is frozen.
      • The intent is that future work will be done under a different name.
    25. Atom 1.0
      • In part, motivated by the desire to be free of the RSS confusion
    26. Atompub Working Group
    27. IETF (Internet Engineering Task Force)
    28. The Atom syndication format has been adopted as IETF Proposed Standard RFC 4287
    29. RSS 2.0 versus Atom 1.0
      • A number of ambiguities exist in RSS 2.0 including:
        • No required fields (Atom requires title unique id and last updated)
        • No way to indicate if payload is encoded or plain text (Atom requires explicit declaration and includes options such as another XML vocabulary)
        • Autodiscover is not standardized and relies on an unregistered MIME type
        • Only Atom 1.0 is in an XML namespace and has specific guidelines for interpreting extension elements. (RSS 2.0 does not permit well formed XML markup)
      • http://www.intertwingly.net/wiki/pie/Rss20AndAtom10Compared
    30. Need For Better Syndication in Plone
      • 2006-Feb-01 PLIP #128 was born
        • PLIP: Plone Improvement Proposal, analogous to python’s PEPs: Python Enhancement Proposal
      • #128: Pluggable Plone Syndication (PPS)
    31. PLIP #128 Motivation
      • The current portal_syndication tool [only supports RSS 1.0 format and therefore] doesn’t have support for enclosures
    32. PLIP #128 Motivation (continued)
      • [No current support to] extend syndication beyond common object attributes (i.e.Title, description, body etc.)
    33. PLIP #128 Motivation (continued)
      • [No current support for] different types of feed entries for different content types (i.e. enclosures for media content a.k.a. podcasting)
    34. PLIP #128
      • Enable advanced (RSS 2.0, Atom) site-wide syndication on all ATCT content “out-of-the-box” using Zope 3-based adaptors (via Five) which are extendable beyond ATCT to any content type.
      • (ATCT : ATContent Types)
    35. Vice to the Rescue!
    36. And the name ?
      • Before vice, there was “CMFSin”, “basesyndication”, “fatsyndication”, “synz”…
      • “ Vice was the cleanest name we could come up with.”
    37. Vice was Born at the (now infamous) BBQ Sprint
      • Participants
        • Derek Richardson
        • Liz Dahlstrom
        • Mikel Larreategi
        • Jørgen Gårdsted Jørgensen
        • Paul Bugni
    38. Then Vice Picked up a Sponsor
      • Derek Richardson (student)
      • Florian Schulze (mentor)
      • Report: http://www.openplans.org/projects/vice/google-summer-of-code-report
    39. Vice also benefited from additional sprints
      • Plone4Artist Multimedia Sprint
      • 2007 Plone Conference Sprint
    40. Installing Vice
    41. Add Vice to the Buildout Eggs
      • Using buildout, edit buildout.cfg and add vice.plone.outbound to the [eggs] section:
      • eggs =
      • elementtree
      • vice.plone.outbound
    42. Include the Vice Configuration Files (a la zcml slug)
      • Edit buildout.cfg and add vice.plone.outbound to the [instance] zcml
      • [instance]
      • zcml = vice.plone.outbound
    43. That’s It?
      • Well, it should be, but Zope2 is not yet “eggified” and vice has dependencies related to Zope3 eggs
    44. Workaround:
      • Add “fake_zope_eggs = true” to the [zope2] section of your buildout
    45. Re-run ./bin/buildout
    46. Install Product in Portal
      • Install “Outbound Syndication (Vice)”
    47. Configure for Use
      • From the plone_control_panel (site setup)…
      • Find the syndication “configlet” listed in the add on product configuration
      • Enable syndication
    48. Out of the box demo
      • < break to vice demo >
    49. Design Goals
      • So which format do we architect around?
    50. Ideally, none of them!
    51. Separation of Concerns
      • Goal: separate the action of syndication from any particular format
    52. Goal: Make it easy to add additional feed types
    53. Goal: Make it easy to extend beyond common object attributes
    54. How to Manage the Complexity?
      • Idea: isolate behavior in “objects” dedicated to a single purpose.
    55. The Previous Approach:
      • Use multiple inheritance to mix and match objects (create mix-ins)
      • Subclass the mix-ins for further customizations
    56. The Downsides
      • Complexity: objects built from a large number of base classes
      • Lack of cohesion: lots of unrelated attributes and methods
    57. A Better Way
      • Introducing the Zope Component Architecture
    58. Three Core Concepts
      • Interfaces
      • Components
      • Adapters
    59. Interfaces
      • A formal description of how to interact with an object
      • Can be as simple as a label, or “marker”
    60. Components
      • An “object” with introspective interfaces
    61. Adapters
      • Inexpensive mechanism to add behavior (defined in interfaces) to existing components
      • Extends a components functionality without modifications to the component
    62. Types of Components
      • Content Components
      • View Components
      • Adapter Components
      • Utility Components
    63. Zope Component Architecture
      • Web Component Development with Zope 3, 3rd ed.
      • Philipp von Weitershausen
    64. Core Vice Concepts
      • Containers (such as Folders) are “Feedable” (marked with the IFeedable interface, adaptable to the IFeed interface)
      • Content Objects (such as Documents) are “Feed Items” (adaptable to the IFeedItem interface)
    65. IFeedable
      • Mark all folders as being “feedable”:
      • <class class=&quot;zope.app.folder.Folder&quot;>
      • <implements interface=&quot;.interfaces.IFeedable&quot; />
      • </class>
    66. IFeed
      • Represents a “Feed”
      • Use to adapt objects that can provide items to feed
    67. IFeed
      • class IFeed(Interface):
      • &quot;&quot;&quot;A syndication feed e.g. RSS, atom, etc. To syndicate a container,
      • adapt it to IFeed.
      • &quot;””
    68. IFeed Adapters
      • Adapted to the Plone Site Root
      • All Folders (IATFolder)
    69. IFeedItem
      • Represents a single item, or entry in a feed
    70. IFeedItem
      • class IFeedItem(Interface):
      • &quot;&quot;&quot;A single syndication feed item.
      • &quot;&quot;”
    71. IFeedItem Adapters
      • Adapted to the respective AT Content Types:
        • IATDocument
        • IATEvent
        • IATLink
        • IATImage
        • IATFile
        • IATNewsItem
    72. Thus Vice Handles all AT Content Types “out of the box”
      • This includes any customized ATCT subclasses
    73. How to Syndicate a New Type
    74. New Type Must Be Adaptable to IFeedItem
    75. Register the Adapter Factory
      • <!-- Vice demo, adapt example.dexterity.page.IPage to IFeedItem
      • so the example dexterity pages can be syndicated -->
      • <adapter
      • factory=&quot;.syndication.ExampleDexterityPageFeedItem&quot;
      • name=&quot;vice-default&quot;
      • trusted=&quot;true&quot; />
      • <class class=&quot;.syndication.ExampleDexterityPageFeedItem&quot;>
      • <require
      • permission=&quot;vice.ViewFeeds&quot;
      • interface=&quot;vice.outbound.interfaces.IFeedItem&quot; />
      • </class>
    76. Define the IFeedItem Adapter Class
      • class ExampleDexterityPageFeedItem(ExampleDexterityFeedItemBase):
      • &quot;&quot;”Makes example.dexterity.page.IPage IFeedItem adaptable.
      • &quot;&quot;&quot;
      • implements(IFeedItem)
      • adapts(IPage, IFeed)
      • @property
      • def body(self):
      • &quot;&quot;&quot;See IFeedItem
      • &quot;&quot;&quot;
      • v = getMultiAdapter((self.context, self.context.REQUEST), Interface, name=u'syndicate_page')
      • return v().encode('utf-8')
    77. Page Template for Body of Feed Item
      • <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot;
      • xmlns:tal=&quot;http://xml.zope.org/namespaces/tal&quot;
      • xmlns:metal=&quot;http://xml.zope.org/namespaces/metal&quot;
      • xmlns:i18n=&quot;http://xml.zope.org/namespaces/i18n&quot;
      • lang=&quot;en&quot;
      • i18n:domain=&quot;plone&quot;>
      • <body>
      • <p tal:content=&quot;context/Description&quot; />
      • <div tal:content=&quot;structure context/body &quot; />
      • </body>
      • </html>
    78. That’s It
      • < break to demo using example.dexterity >
    79. Adding a new Feed Format
      • This trivial act is left as an exercise for the reader
    80. But there’s a vice sprint going on this weekend!
      • http://www.openplans.org/projects/plone-conference-2008-dc/vice
    81. Inbound Story?
      • Ajax approach: plone.syndication.inbound
      • Persistent approach: feedfeeder
        • http://plone.org/products/feedfeeder
    82. How to get involved
      • Did I mention the sprint?
      • Join the mailing lists:
      • http://www.openplans.org/projects/vice/lists
        • Developer list: vice-dev@lists.openplans.org
        • Discussion list: vice-discussion@lists.openplans.org
    83. Questions?

    + pbugnipbugni, 2 years ago

    custom

    429 views, 1 favs, 1 embeds more stats

    This talk will introduce the audience to Vice http: more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 429
      • 424 on SlideShare
      • 5 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 5
    Most viewed embeds
    • 5 views on http://plone.org

    more

    All embeds
    • 5 views on http://plone.org

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories