Published on

Plone for Web Development and Content Management CMS

Published in: Business, Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide


  1. 1. Using Plone to devolve Web site management and maintenance Vancouver Python Workshop 2004 Dominic Hiles Web Developer
  2. 2. Overview <ul><li>Who am I ? </li></ul><ul><li>Project background </li></ul><ul><li>Devolving content maintenance </li></ul><ul><ul><li>Business roles </li></ul></ul><ul><ul><li>Workflow </li></ul></ul><ul><ul><li>Editing content </li></ul></ul><ul><li>Devolving user management </li></ul><ul><ul><li>MembershipTool limitations </li></ul></ul><ul><ul><li>Notifications mechanism </li></ul></ul><ul><ul><li>Transfer of object ownership on account deletion </li></ul></ul>
  3. 3. Who am I ? <ul><li>Web developer within the Internet Development (ID) group of the Institute for Learning and Research Technology (ILRT) </li></ul><ul><li>ID group has 10+ staff: usability engineers, designers, developers, project managers </li></ul><ul><li>Started Zope/Python development April 2003 </li></ul><ul><li>A Plone &quot;newbie&quot; – started September 2003 </li></ul>
  4. 4. Church of England Project <ul><li>Proposal finalised Feb 2003 </li></ul><ul><li>Graphic design agreed Sep 2003 </li></ul><ul><li>Plone development started October 2003 </li></ul><ul><li>Development happened in tandem with Plone 2 release cycle </li></ul>
  5. 5. Background - content <ul><li>2000 static HTML pages </li></ul><ul><li>350 images, 450 &quot;text&quot; files ( e.g. PDFs, MS Word docs) </li></ul><ul><li>4 ASP Web applications, serving data from around 20,000 database records, held in 4 different databases </li></ul>
  6. 6. Migration of static content <ul><li>HTML pages passed through HTMLTidy to convert to XHTML </li></ul><ul><li>All pages then undergo manual editing whilst on the file system </li></ul><ul><li>Pages, folders and files (e.g. PDFs, images etc .) imported into ZODB via script and created as Plone objects </li></ul>
  7. 7. Migration of Web applications <ul><li>3 MS Access databases exported as CSV files and imported into new Archetypes objects </li></ul><ul><li>1 remaining database: </li></ul><ul><ul><li>Data must be maintained elsewhere </li></ul></ul><ul><ul><li>Previously exported as CSV, manually imported into MS Access, then displayed via ASP </li></ul></ul><ul><ul><li>Now, CSV file uploaded &quot;Through The Plone&quot; (TTP) and data are automatically imported into PostgreSQL </li></ul></ul>
  8. 9. Devolving content maintenance <ul><li>All content can now be maintained TTP but… </li></ul><ul><li>… up to 100 users with responsibility for content in different areas of the site </li></ul>
  9. 10. Talk focus <ul><li>Providing the mechanisms for these users to easily maintain the content for which they’re responsible </li></ul><ul><li>Providing the tools to manage these users </li></ul>
  10. 11. Content maintenance <ul><li>Create the business roles – what should people be able to do to the content? </li></ul><ul><li>Create the workflow – provides the mechanism to underpin these roles </li></ul><ul><li>Provide the GUI for maintaining the content </li></ul>
  11. 12. Content maintenance - roles <ul><li>Broadly, 4 different business roles: </li></ul><ul><ul><li>Editor </li></ul></ul><ul><ul><ul><li>Creates and edits content in an area, submitting it for publishing </li></ul></ul></ul><ul><ul><li>Reviewer </li></ul></ul><ul><ul><ul><li>Reviews submitted content, altering, rejecting or publishing it as appropriate </li></ul></ul></ul>
  12. 13. Content maintenance – roles (2) <ul><ul><li>Administrator </li></ul></ul><ul><ul><ul><li>Able to perform functions of Editor and Reviewer </li></ul></ul></ul><ul><ul><ul><li>Grants roles to other users in the area for which they’re responsible </li></ul></ul></ul><ul><ul><li>Site Manager </li></ul></ul><ul><ul><ul><li>Able to perform functions of Administrator </li></ul></ul></ul><ul><ul><ul><li>Manages users </li></ul></ul></ul><ul><ul><ul><li>Uses other custom tools ( e.g. import of CSV data) </li></ul></ul></ul>
  13. 14. Content maintenance – roles (3) <ul><li>4 Business roles distilled to 3 Zope roles: Editor, Reviewer, Administrator </li></ul><ul><li>&quot;Site Manager&quot; = Administrator role granted at site root </li></ul><ul><li>Groups were created and named according to a folder-dependent role </li></ul><ul><ul><li>e.g. info_editors (editors of the info folder) </li></ul></ul><ul><li>Users were placed in group(s) according to their role(s) in a given content area </li></ul>
  14. 15. Workflow <ul><li>Business roles implemented by designing appropriate workflow </li></ul><ul><li>Approx. 40% of Plone development time spent on aspects of workflow design and implementation </li></ul>
  15. 16. Private Pending Published Reject Retract Submit Publish Retract Publish
  16. 17. Workflow – key requirements <ul><li>All actions should be collaborative </li></ul><ul><ul><li>Editors and reviewers must be able to work together on content in folders for which they're responsible </li></ul></ul><ul><ul><li>No notion of ownership – content is owned by the &quot;business&quot; </li></ul></ul><ul><ul><ul><li>Creator, workflow history and edit history should still exist </li></ul></ul></ul><ul><ul><li>Not the traditional Plone ethos! </li></ul></ul><ul><ul><li>Solution: transition guards and state permissions don't reference Owner role </li></ul></ul>
  17. 18. Workflow – key requirements <ul><li>Revisioning (aka simple Staging) </li></ul><ul><ul><li>The ability to work on a draft copy of a published object, before committing this copy to a new publishing cycle </li></ul></ul>
  18. 19. Workflow - revisioning <ul><li>Re-edit transition available on objects in published state </li></ul><ul><li>Takes a copy of the published object, and attaches it to that published object as an attribute, with a fixed id </li></ul>Published object: index.html Revision: ~~revision~~ Publish Re-edit
  19. 20. Workflow - revisioning
  20. 21. Workflow – key requirements <ul><li>Versioning </li></ul><ul><ul><li>Ability to view and revert to previously published versions of the same document </li></ul></ul>
  21. 22. Workflow - versioning <ul><li>Publish transition creates a versions container on the published item </li></ul><ul><li>Old copy is placed in this container each time the object is published </li></ul>Published object: index.html Versions container Version 1 Version 4 Version 3 Version 2 Publish Revert
  22. 23. Workflow - versioning <ul><li>The versions container </li></ul><ul><ul><li>class HistoricalVersions (SimpleItem): </li></ul></ul><ul><ul><li>&quot;&quot;&quot;Manages historical versions of an object&quot;&quot;&quot; </li></ul></ul><ul><ul><li>security = ClassSecurityInfo() </li></ul></ul><ul><ul><li>meta_type = 'Historical Content Versions' </li></ul></ul><ul><ul><li>def __init__( self, id ): </li></ul></ul><ul><ul><li> = id </li></ul></ul><ul><ul><li>self._versions = Folder('_versions') </li></ul></ul><ul><ul><li>self._delete_history=() </li></ul></ul><ul><ul><li>Note use of _versions so that old versions items aren't accessible via traversal </li></ul></ul>
  23. 24. Workflow - versioning
  24. 25. Re-edit (copy) Versioned Revert Private Pending Published Reject Retract Submit Publish Retract Publish
  25. 26. Workflow – key requirements <ul><li>Notifications </li></ul><ul><ul><li>The closest, most appropriate person needs to be notified of actions on content </li></ul></ul><ul><ul><li>Consider a folder : /info/transport/trains </li></ul></ul><ul><ul><ul><li>Bert is a Reviewer of /info/transport </li></ul></ul></ul><ul><ul><ul><li>Fred is a Reviewer of /info/transport/trains </li></ul></ul></ul><ul><ul><ul><li>If an editor submits content for publishing in /info/transport/trains, Fred should be notified but Bert should not </li></ul></ul></ul><ul><ul><li>Solution: skin scripts, triggered by transitions, send mail appropriately </li></ul></ul>
  26. 27. Workflow – under the bonnet <ul><li>Uses DCWorkflow </li></ul><ul><ul><li>DCWorkflow allows scripts to be triggered on state transition </li></ul></ul><ul><ul><li>By default, scripts or external methods must be added to ZODB </li></ul></ul><ul><ul><li>Subclassed DCWorkflowDefinition to allow </li></ul></ul><ul><ul><ul><li>Use of FSPythonScripts, accessible via skin and maintainable in CVS </li></ul></ul></ul><ul><ul><ul><li>Use of (unprotected) methods held within Product module (to provide versioning and revisioning) </li></ul></ul></ul><ul><ul><li>Added custom states, permissions & guard conditions </li></ul></ul>
  27. 28. Workflow – key requirements <ul><li>Email management - &quot;Great workflow, but I don't want all of this Junk mail!&quot; </li></ul><ul><ul><li>Prioritise </li></ul></ul><ul><ul><ul><li>Not all emails require action, e.g. </li></ul></ul></ul><ul><ul><ul><ul><li>&quot;An item is awaiting your review&quot; vs. &quot;An item has been published&quot; </li></ul></ul></ul></ul><ul><ul><ul><li>Users should be able to subscribe only to emails requiring an action </li></ul></ul></ul><ul><ul><li>Provide a digest option </li></ul></ul><ul><ul><li>Provide an unsubscribe option </li></ul></ul><ul><ul><ul><li>Users may go on holiday or want to hide! </li></ul></ul></ul><ul><ul><ul><li>Other users need to be notified to take action instead </li></ul></ul></ul>
  28. 29. Workflow – email management <ul><li>Solution: two user options </li></ul><ul><ul><li>Email frequency </li></ul></ul><ul><ul><ul><li>Immediate (default) </li></ul></ul></ul><ul><ul><ul><li>Digest </li></ul></ul></ul><ul><ul><ul><li>Disabled </li></ul></ul></ul><ul><ul><li>Email categories </li></ul></ul><ul><ul><ul><li>Info ( e.g. &quot;An item has been published in your area&quot;) </li></ul></ul></ul><ul><ul><ul><li>Warning ( e.g. &quot;An item is awaiting your review&quot;) </li></ul></ul></ul><ul><ul><ul><li>Critical ( e.g. &quot;Your account has been deleted&quot;) </li></ul></ul></ul><ul><ul><li>Critical mails always sent immediately </li></ul></ul><ul><ul><li>Users can just subscribe to warning emails, or receive info emails as well </li></ul></ul>
  29. 31. Workflow – email management <ul><li>digest_mail tool subclasses MailHost </li></ul><ul><ul><li>Possible workflow actions are set on the tool by the developer, grouped into the three categories </li></ul></ul><ul><ul><li>Workflow emails are sent with: sendTriggeredMail(self, messageText, mto_userid, mfrom=None, subject=None, encode=None, action=None) </li></ul></ul><ul><ul><li>sendTriggeredMail() looks up user preferences from mto_userid , cross-checks them with the action category and then handles email appropriately </li></ul></ul><ul><ul><li>Digest mails are created on the FS, the tool sends them when sendQueuedMail() is called ( e.g. by a cron job) </li></ul></ul>
  30. 33. Workflow – key requirements <ul><li>Deletion must be managed </li></ul><ul><ul><li>A workflow concept, but normally handled outside of DCWorkflow </li></ul></ul><ul><ul><li>Should hook into standard notifications machinery </li></ul></ul><ul><ul><li>Should be possible to restore deleted content </li></ul></ul><ul><ul><li>State dependant e.g. editors should be able to delete objects in their Private state but not when published </li></ul></ul>
  31. 34. Workflow – managing deletion <ul><li>Idea was to mimic Windows Recycle Bin </li></ul><ul><li>folder_delete() skin method provides a simple hook </li></ul><ul><li>Drop in Product - &quot;PortalWastebasket&quot; </li></ul><ul><li>Items moved to Wastebasket on deletion </li></ul><ul><li>Items restored to original location on demand </li></ul><ul><li>State dependency handled by controlling &quot;Delete objects&quot; permission with workflow </li></ul>
  32. 35. Workflow – managing deletion <ul><li>Essentially just another folder but… </li></ul><ul><ul><li>Must be collaborative – anyone should be able to restore content in areas for which they have responsibility </li></ul></ul><ul><ul><li>Original security context lost when item is moved to folder, so how do you set e.g. View permissions? </li></ul></ul><ul><ul><li>Objects must be moved to private state when restored </li></ul></ul><ul><ul><li>Must be possible to delete more than one object with the same id, or the same object more than once! </li></ul></ul>
  33. 36. Workflow – managing deletion <ul><li>Solution: </li></ul><ul><ul><li>Move object to Wastebasket, holding its original id/path in a registry </li></ul></ul><ul><ul><li>Transition object to private state en route to Wastebasket (now invisible to Anonymous) </li></ul></ul><ul><ul><li>Grant users with Authenticated role View permission on wastebasket items </li></ul></ul><ul><ul><li>When restoring the object, use workflow definition to reinstate security in correct context </li></ul></ul>
  34. 37. Workflow – managing deletion
  35. 38. Workflow - summary <ul><li>3 roles: Editor, Reviewer and Administrator </li></ul><ul><li>3 states: Private, Pending and Published </li></ul><ul><li>Collaborative workflow ( i.e. no &quot;Owner&quot;) </li></ul><ul><li>Revisioning and versioning system </li></ul><ul><li>Email notifications </li></ul><ul><li>Email management </li></ul><ul><li>Wastebasket ( cf. Windows Recycle Bin) </li></ul>…
  36. 39. Maintaining the content <ul><li>WYSIWYG editor </li></ul><ul><li>Why not Epoz/Kupu? </li></ul><ul><ul><li>Both were immature when project started </li></ul></ul><ul><ul><li>Inconsistent tidying from MS Word </li></ul></ul><ul><ul><li>No spell checker </li></ul></ul><ul><ul><li>Inconsistent XHTML quality </li></ul></ul><ul><ul><li>No support for Mac OS X in Kupu </li></ul></ul><ul><ul><li>Previous experience of edit-On Pro </li></ul></ul>
  37. 40. edit-On Pro <ul><li>Commercial WYSIWYG editor, produced by RealObjects </li></ul><ul><li>Java applet </li></ul><ul><li>Created Zope Product to integrate into Plone </li></ul><ul><li>Biggest problem was/is requirement for recent JRE to be installed locally </li></ul><ul><li>Kupu looking increasingly attractive! </li></ul>
  38. 41. edit-On Pro in action
  39. 42. Devolving content maintenance Summary <ul><li>Decide on the business roles </li></ul><ul><li>Create the workflow to facilitate the business roles </li></ul><ul><li>Provide appropriate editing tools </li></ul>
  40. 43. Devolving user management <ul><li>Good TTP interface, but there are some problems </li></ul><ul><ul><li>MembershipTool permissions and local role methods make delegation hard, in effect, requiring Zope &quot;Manager&quot; role </li></ul></ul><ul><ul><li>No notification mechanism for changes in users’ status </li></ul></ul><ul><ul><li>No mechanism for transferring ownership upon user deletion </li></ul></ul>
  41. 44. User management - solutions <ul><li>MembershipTool </li></ul><ul><ul><li>Subclassed tool and redefined permissions where necessary </li></ul></ul><ul><ul><li>Overloaded local role methods to handle custom roles </li></ul></ul>
  42. 45. User management – solutions (2) <ul><li>Notification </li></ul><ul><ul><li>Hooked user management methods to fire emails when users are added, deleted or change their group memberships </li></ul></ul><ul><ul><li>Used digest_mail tool </li></ul></ul>
  43. 46. User management – solutions (3) <ul><li>Ownership Transfer </li></ul><ul><ul><li>When a user is deleted: </li></ul></ul><ul><ul><ul><li>Find objects owned by user </li></ul></ul></ul><ul><ul><ul><li>Transfer ownership to the closest appropriate person in context of each object </li></ul></ul></ul><ul><ul><ul><li>Notify any users to whom ownership has been transferred </li></ul></ul></ul><ul><ul><ul><li>Notify the user who has been deleted </li></ul></ul></ul>
  44. 47. User management – summary <ul><li>Effective delegation of user management is impossible in &quot;out-the-box&quot; Plone </li></ul><ul><li>Plone can be extended to add this functionality </li></ul><ul><li>CMFMember looks promising for providing a more generic solution </li></ul>
  45. 48. Final review <ul><li>Effectively devolving content maintenance was hard, principally because of the workflow design and development </li></ul><ul><li>Lots of open-source Products now appearing to tackle complex workflows, including versioning and revisioning ( e.g. Occams ) </li></ul><ul><li>Devolving user management was much easier – CMFMember may make it easier still </li></ul><ul><li>Extensible Zope/Plone architecture allowed functionality to be added as required </li></ul>
  46. 49. Questions? Slides available at: