Subtyping Unleased!
    Speaker: Rocky Burt
Who I Am




     Rocky Burt
          ServerZen Software
          http://www.serverzen.com




Subtyping Unleased!      ...
Subtyping?




        Narrow classification
        Functionality hook



Subtyping Unleased!     Slide 3   Plone Confe...
Why Subtype?



        Many possible faces for an
         existing content type
        Simple conversion
        Del...
Use Cases



        Need different content identity
         depending on situation
        Need some way to transform
...
p4a.subtyper



        Minimal framework
        Hooks up subtypes into content
         menu



Subtyping Unleased!   ...
An Example:
   Setting up p4a.subtyper




     easy_install p4a.subtyper




Subtyping Unleased!   Slide 7   Plone Confer...
An Example:
   Creating New Package

     p4a.subtyperdemo

     Example source at:
     http://www.plone4artists.org
    ...
An Example:
   Sub-type Marker Interface



        New module named interfaces
        New interface named IUltraDoc


...
An Example:
   Sub-type Marker Interface



 class IUltraDoc(interface.Interface):
     quot;quot;quot;A new ultra documen...
An Example:
   Sub-type Descriptor


        New module named
         descriptors
        New descriptor named
        ...
An Example:
   Sub-type Descriptor

 class UltraDocDescriptor(object):
     implements(IPortalTypedDescriptor)
     title ...
An Example:
   New View




        New template called ultradoc.pt




Subtyping Unleased!     Slide 13   Plone Conferen...
An Example:
   New View


 <div metal:fill-slot=quot;mainquot;>
 <h2>This is an ultradoc!</h2>
 <h3 tal:content=quot;conte...
An Example:
   Tying Together – ZCML



        Register descriptor as utility
        Hook new view up applying to
    ...
An Example:
   Tying Together – ZCML
     <utility
         name=quot;ultradocquot;

factory=quot;.descriptors.UltraDocDes...
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 Unleas...
Conclusion

                      Questions?
                      Comments?
               Resources at:
        http://w...
Upcoming SlideShare
Loading in...5
×

Rocky Burt Subtyping Unleashed

2,537

Published on

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.

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,537
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
55
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Rocky Burt Subtyping Unleashed

  1. 1. Subtyping Unleased! Speaker: Rocky Burt
  2. 2. Who I Am Rocky Burt ServerZen Software http://www.serverzen.com Subtyping Unleased! Slide 2 Plone Conference 2007 – Naples
  3. 3. Subtyping?  Narrow classification  Functionality hook Subtyping Unleased! Slide 3 Plone Conference 2007 – Naples
  4. 4. Why Subtype?  Many possible faces for an existing content type  Simple conversion  Delayed specification Subtyping Unleased! Slide 4 Plone Conference 2007 – Naples
  5. 5. 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
  6. 6. p4a.subtyper  Minimal framework  Hooks up subtypes into content menu Subtyping Unleased! Slide 6 Plone Conference 2007 – Naples
  7. 7. An Example: Setting up p4a.subtyper easy_install p4a.subtyper Subtyping Unleased! Slide 7 Plone Conference 2007 – Naples
  8. 8. 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
  9. 9. An Example: Sub-type Marker Interface  New module named interfaces  New interface named IUltraDoc Subtyping Unleased! Slide 9 Plone Conference 2007 – Naples
  10. 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. 11. An Example: Sub-type Descriptor  New module named descriptors  New descriptor named UltraDocDescriptor Subtyping Unleased! Slide 11 Plone Conference 2007 – Naples
  12. 12. 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
  13. 13. An Example: New View  New template called ultradoc.pt Subtyping Unleased! Slide 13 Plone Conference 2007 – Naples
  14. 14. 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
  15. 15. 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
  16. 16. 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
  17. 17. An Example: Before Subtyping Unleased! Slide 17 Plone Conference 2007 – Naples
  18. 18. An Example: After Subtyping Unleased! Slide 18 Plone Conference 2007 – Naples
  19. 19. An Example: Regular Content Subtyping Unleased! Slide 19 Plone Conference 2007 – Naples
  20. 20. Other Features  Special subtype events  Extension by adapters and schema's Subtyping Unleased! Slide 20 Plone Conference 2007 – Naples
  21. 21. Conclusion Questions? Comments? Resources at: http://www.serverzen.com /training/subtyping-unleashed Subtyping Unleased! Slide 21 Plone Conference 2007 – Naples
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×