Rocky Burt   Subtyping Unleashed
Upcoming SlideShare
Loading in...5
×
 

Rocky Burt Subtyping Unleashed

on

  • 3,869 views

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 ...

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.

Statistics

Views

Total Views
3,869
Views on SlideShare
3,867
Embed Views
2

Actions

Likes
1
Downloads
54
Comments
0

1 Embed 2

http://www.slideshare.net 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Rocky Burt   Subtyping Unleashed Rocky Burt Subtyping Unleashed Presentation Transcript

  • Subtyping Unleased! Speaker: Rocky Burt
  • Who I Am Rocky Burt ServerZen Software http://www.serverzen.com Subtyping Unleased! Slide 2 Plone Conference 2007 – Naples
  • Subtyping?  Narrow classification  Functionality hook Subtyping Unleased! Slide 3 Plone Conference 2007 – Naples
  • Why Subtype?  Many possible faces for an existing content type  Simple conversion  Delayed specification Subtyping Unleased! Slide 4 Plone Conference 2007 – Naples
  • Use Cases  Need different content identity depending on situation  Need some way to transform identity based on event reaction Subtyping Unleased! Slide 5 Plone Conference 2007 – Naples
  • p4a.subtyper  Minimal framework  Hooks up subtypes into content menu Subtyping Unleased! Slide 6 Plone Conference 2007 – Naples
  • An Example: Setting up p4a.subtyper easy_install p4a.subtyper Subtyping Unleased! Slide 7 Plone Conference 2007 – Naples
  • An Example: Creating New Package p4a.subtyperdemo Example source at: http://www.plone4artists.org /svn/projects/p4a.subtyperdemo/ Subtyping Unleased! Slide 8 Plone Conference 2007 – Naples
  • An Example: Sub-type Marker Interface  New module named interfaces  New interface named IUltraDoc Subtyping Unleased! Slide 9 Plone Conference 2007 – Naples
  • 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
  • An Example: Sub-type Descriptor  New module named descriptors  New descriptor named UltraDocDescriptor Subtyping Unleased! Slide 11 Plone Conference 2007 – Naples
  • An Example: Sub-type Descriptor class UltraDocDescriptor(object): implements(IPortalTypedDescriptor) title = u'Ultra Doc' description = u'New ultra style ' u'document.' type_interface = IUltraDoc for_portal_type = 'Document Subtyping Unleased! Slide 12 Plone Conference 2007 – Naples
  • An Example: New View  New template called ultradoc.pt Subtyping Unleased! Slide 13 Plone Conference 2007 – Naples
  • An Example: New View <div metal:fill-slot=quot;mainquot;> <h2>This is an ultradoc!</h2> <h3 tal:content=quot;context/Titlequot;></h3> <p tal:content=quot;context/Descriptionquot;></p> </div> Subtyping Unleased! Slide 14 Plone Conference 2007 – Naples
  • An Example: Tying Together – ZCML  Register descriptor as utility  Hook new view up applying to marker interface Subtyping Unleased! Slide 15 Plone Conference 2007 – Naples
  • An Example: Tying Together – ZCML <utility name=quot;ultradocquot; factory=quot;.descriptors.UltraDocDescriptorquot; /> <browser:page for=quot;.interfaces.IUltraDocquot; name=quot;document_viewquot; permission=quot;zope2.Viewquot; template=quot;ultradoc.ptquot; /> Subtyping Unleased! Slide 16 Plone Conference 2007 – Naples
  • An Example: Before Subtyping Unleased! Slide 17 Plone Conference 2007 – Naples
  • An Example: After Subtyping Unleased! Slide 18 Plone Conference 2007 – Naples
  • An Example: Regular Content Subtyping Unleased! Slide 19 Plone Conference 2007 – Naples
  • Other Features  Special subtype events  Extension by adapters and schema's Subtyping Unleased! Slide 20 Plone Conference 2007 – Naples
  • Conclusion Questions? Comments? Resources at: http://www.serverzen.com /training/subtyping-unleashed Subtyping Unleased! Slide 21 Plone Conference 2007 – Naples