rocky burt subtyping unleashed

Download Rocky Burt   Subtyping Unleashed

Post on 23-Jan-2015




2 download

Embed Size (px)


Subtyping is a new pattern for extending the functionality of existing content types as provided by Plone. Zope 3 enables subtyping using adapters and views. After this session, attendees will be capable of adding additional functionality to content types using subtyping and Zope 3. The Plone4Artists suite of projects will be used to demonstrate existing uses of subtyping. Attendees will be expected to understand the basics of the Zope 3 CA particularly concerning interfaces, adapters, and views. They will also need to understand the basics of ATContentTypes and how they relate to Plone.


  • 1. Subtyping Unleased! Speaker: Rocky Burt

2. Who I AmRocky Burt ServerZen Software Subtyping Unleased! Slide 2Plone Conference 2007 Naples 3. Subtyping? Narrow classification Functionality hookSubtyping Unleased! Slide 3 Plone Conference 2007 Naples 4. Why Subtype? Many possible faces for anexisting content type Simple conversion Delayed specification Subtyping Unleased! Slide 4 Plone Conference 2007 Naples 5. Use Cases Need different content identitydepending on situation Need some way to transformidentity based on event reaction Subtyping Unleased! Slide 5 Plone Conference 2007 Naples 6. p4a.subtyper Minimal framework Hooks up subtypes into contentmenuSubtyping Unleased!Slide 6 Plone Conference 2007 Naples 7. An Example:Setting up p4a.subtypereasy_install p4a.subtyper Subtyping Unleased! Slide 7 Plone Conference 2007 Naples 8. An Example:Creating New Package p4a.subtyperdemo Example source at: Unleased! Slide 8 Plone Conference 2007 Naples 9. An Example:Sub-type Marker Interface New module named interfaces New interface named IUltraDocSubtyping Unleased! Slide 9 Plone Conference 2007 Naples 10. An Example:Sub-type Marker Interface class IUltraDoc(interface.Interface):quot;quot;quot;A new ultra document subtype.quot;quot;quot; interface.alsoProvides(IUltraDoc, IContentType) Subtyping Unleased! Slide 10 Plone Conference 2007 Naples 11. An Example:Sub-type Descriptor New module nameddescriptors New descriptor namedUltraDocDescriptor Subtyping Unleased! Slide 11 Plone Conference 2007 Naples 12. An Example:Sub-type Descriptor class UltraDocDescriptor(object):implements(IPortalTypedDescriptor)title = u'Ultra Doc'description = u'New ultra style 'u'document.'type_interface = IUltraDocfor_portal_type = 'Document Subtyping Unleased! Slide 12 Plone Conference 2007 Naples 13. An Example:New View New template called Subtyping Unleased! Slide 13 Plone Conference 2007 Naples 14. An Example:New View

This is an ultradoc!

Subtyping Unleased! Slide 14 Plone Conference 2007 Naples 15. An Example:Tying Together ZCML Register descriptor as utility Hook new view up applying tomarker interfaceSubtyping Unleased! Slide 15 Plone Conference 2007 Naples 16. An Example:Tying Together ZCML Subtyping Unleased!Slide 16 Plone Conference 2007 Naples 17. An Example:Before Subtyping Unleased! Slide 17 Plone Conference 2007 Naples 18. An Example:After Subtyping Unleased! Slide 18 Plone Conference 2007 Naples 19. An Example:Regular Content Subtyping Unleased! Slide 19 Plone Conference 2007 Naples 20. Other Features Special subtype events Extension by adapters andschema'sSubtyping Unleased!Slide 20 Plone Conference 2007 Naples 21. ConclusionQuestions? Comments?Resources at: Subtyping Unleased! Slide 21 Plone Conference 2007 Naples