David Rey Lessons Learned Updating Content Licensing To Be Plone 3 Compatible

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

    3 Groups

    David Rey Lessons Learned Updating Content Licensing To Be Plone 3 Compatible - Presentation Transcript

    1. Lessons Learned: Updating ContentLicensing to be Plone3 compatible
        • David Ray, Brent Lambert Center for Open and Sustainable Learning Utah State University
    2. Disclaimer!
      • We are not Core Developers
      • Some solutions presented may not be the definitive way of solving Zope 3 issues
    3. Disclaimer
      • However, issues that we have faced will be relevant to any Zope 3 related work
      • We are still learning, and welcome suggestions and feedback
    4. Background
      • Based on PLIP #136
        • http://plone.org/products/plone/roadmap/136
        • 'neutral licensing engine'
        • standard behavior for all types
      • Result of remote sprinting at Big Apple Sprint in Summer 2006
    5. What it does
      • Licenses content on a per object basis
      • Acquires default site license unless specifically set
      • Provides support for Creative Commons, GNU, All Rights Reserved
    6. What it does
      • Able to add additional reusable license(s) to the licensing engine via control panel
      • Able to add custom license per object, as needed
      • Demo
    7. Who's using it?
      • eduCommons
      • Plone4Artists
      • EngageMedia
    8. Source Code
      • Plone 3 branch found in Plone Collective
        • http://dev.plone.org/collective/browser/ContentLicensing/branches/cosl-plone3
        • Place in Products directory, apply profile to new Plone Site
      • eduCommons project
        • http://cosl.usu.edu/trac/browser/eduCommons3/trunk
    9. From Zope 2 to Zope 3
      • Annotations
      • Tools vs Local Utilities
      • Replacing Placeless Scripts
      • Custom Views
      • Using the new Control Panel
    10. Annotations
      • DublinCoreExtensions Module
        • Adds extended DC metadata to content objects
          • Rights License
          • Rights Holder
        • Mitigates ambiguity of default Copyright field
    11. Annotations
      • ILicensable interface marks content as annotate-able
      • Marker interface
    12. ILicensable Interface
      • <class class=&quot;Products.ATContentTypes.content.document.ATDocument&quot;>
      • <implements interface=&quot;Products.ContentLicensing.DublinCoreExtensions.interfaces.ILicensable zope.annotation.interfaces.IAttributeAnnotatable”
      • />
      • </class>
    13. Annotations
      • Where would annotations be accessed from?
        • Placeless script
        • Zope3 View
        • Archetypes generated form
      • How to access annotations in these situations?
    14. Annotations
      • Zope2 placeless environments
        • Do not have access by default
        • Can provide access through zope 3 views
        • Access from placeless scripts via restrictedTraverse()
        • Access from page templates using the structure tag
    15. Annotations – Placeless Script
      • message = obj.restrictedTraverse('@@change_copyright_view').changeCopyright(copyright_action)
    16. Annotations – Zope 2 Page template
      • <div tal:replace=&quot;structure context/@@copyright_byline_view|nothing&quot; />
    17. Annotations – Zope 3 View
      • <div tal:omit-tag=&quot;&quot;
      • tal:define=&quot;objstuff python:view.getLicenseAndHolderFromObject(here);
      • objHolder python:objstuff[0];
      • objLicense python:objstuff[1];
      • objLicenseId python:objLicense[0];&quot;>
    18. Annotations – Archeypes
      • A little more complicated
      • customize edit macros
    19. Customizing Archetypes Forms
      • Add field via edit_macros
        • check view for availability
        • <tal:licensingfield tal:condition=&quot;python:fieldset == 'ownership'&quot;>
        • <div tal:replace=&quot;structure context/@@dc_metadata| nothing &quot; />
        • </tal:licensingfield>
    20. Annotations - Indexing
      • ProxyIndex
        • AddOn Product
        • Don't have to install
        • Lives in Products directory
      • http://infrae.com/download/ProxyIndex
    21. Annotations - Indexing
      • ProxyIndex allows TALES expressions to retrieve the value to index an object
      • Defined in setupHandlers.py
    22. Utility
      • Move settable properties to GenericSetup
      • Register Utility in setupHandlers.py
      • Explicity setSite(site) to register
    23. Utility
      • def setupUtilities(site):
      • &quot;&quot;&quot; Register a local utility &quot;&quot;&quot;
      • if not Isite.providedBy(site):
      • enableLocalSiteHook(site)
      • setSite(site)
      • sm = getSiteManager()
      • if not sm.queryUtility(IContentLicensingUtility):
      • sm.registerUtility(ContentLicensingUtility('contentlicensing'),
      • IContentLicensingUtility)
    24. Events
      • CMFFormController scripts evolve
      • Determine if placeless script can be assigned to an event
    25. Events
      • Recursive License on Folderish Objects
        • Fire event on IObjectModified
        • <subscriber for=&quot;Products.ATContentTypes.content.folder.ATFolder zope.app.event.interfaces.IObjectModifiedEvent” handler=&quot;.events.recursive_license” />
    26. Events
      • Check state of Object for certain events
        • IObjectAddedEvent
    27. Viewlets
      • Do you need to customize all those page templates?
      • Viewlets can simplify codebase
    28. Viewlets
      • Beware! Layer management incomplete!
      • ZCML executed regardless of whether or not layer is installed
    29. Formlib - ControlPanel
      • Separate concerns with interfaces/fieldsets
        • Content License Settings
        • Add New License
      • Control Panel Adapter
        • Adapts schema of Control Panel to Plone Site
    30. Formlib : ControlPanel
      • New License Form
        • getter/setter of properties does nothing
        • handle data in handle_edit_action
          • also handles default view
    31. Formlib
      • Custom Widgets
        • Hidden fields
          • Attach to existing custom widget
          • Formlib doesn't provide a hidden widget
        • ccwidget.pt
    32. Other Examples
      • eduCommons Course Builder Widget
        • Existing vs New Division
    33. Questions?
    34. Additional Resources
      • http://cosl.usu.edu/projects/plone-add-on-products/
        • List of COSL authored projects
        • Check Plone3 branches for additional examples

    + woodawooda, 2 years ago

    custom

    1824 views, 0 favs, 1 embeds more stats

    This session will provide an overview of updating a more

    More Info

    © All Rights Reserved

    Go to text version
    • Total Views 1824
      • 1822 on SlideShare
      • 2 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 44
    Most viewed embeds
    • 2 views on http://localhost:9000

    more

    All embeds
    • 2 views on http://localhost:9000

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as innappropriate

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

    Cancel

    Categories

    Groups / Events