Nomads in Oman

A site I've been working on for the last few months has now gone live.

Nomads in Oman provides an online archive of photos taken of the Harasiis tribe in the Jiddat-il-Harasiis. The photos were taken between 1978 to 1994, mainly by Dr Dawn Chatty of Oxford University who lived and worked with the Harasiis.

I worked on the project as the principal designer, working on the site's information architecture, interaction design and implementation via wireframes, visual design through to the HTML templates and integration file for the back-end Plone-based CMS.

It was the first time I'd worked as part of a remote team -- Fry developed the back-end and pretty much all of my communication with them was via email but this caused no problems at all. I used Balsamiq to communicate the site's interaction design to the development team -- using the interactive PDF output and making my first protocast

It was also the first time I used rules-based theming with XDV (soon to be known as Diazo) in Plone. This allows for the mapping of parts of the originating Plone-based output to your own template using an XML file and CSS mapping syntax. It wasn't without its problems and frustrations but is a big improvement on the traditional Plone 3 theming model. I've worked with Plone for a while now which gave me a head start on understanding some of the issues that were bound to come up, including Plone's complex CSS stack which makes integrating its editing interface into an external template a challenge to say the least.

5194720786_dd7b7c276c.jpg

Collective.xdv headaches

I've been wanting to use collective.xdv on a couple of projects I've been working on as a) it seems like a sensible approach to Plone theming and b) the thought of playing around with all those portlet managers and zcml code again makes me want to sob.

As anyone who's played around with xdv will know, getting it to install is not the easiest thing to do. Having said that I've managed to get it working on OSX (both Leopard and Snow Leopard) after following the documentation, and even got it working on Windows. After these minor triumphs I thought actually installing it on my Ubuntu web server (running Ubuntu 8.04) would be a breeze. Not so.

I followed the general install instructions on plone.org to get xdv set up but buildout tripped over when trying to install lxml.  So, no xdv. Ok, so I followed the instructions for installing on OSX and added 'lxml' to the parts = section and used the static lxml recipe à la OSX:

[lxml]
recipe = z3c.recipe.staticlxml
egg = lxml
force = false

This time lxml installed and buildout ran. But, when I started up Plone I was unable to add a new Plone site, getting this error:

('No traversable adapter found', {'extension_profiles': ({'product': 'kupu', 'description': 'Kupu is a cross-browser visual editor.', 'for': , 'title': 'Kupu', 'version': u'1.4.16', 'path': 'plone/profiles/default', 'type': 2, 'id': 'kupu:default'},), 'args': (), 'base_profiles': (), 'default_profile': 'Products.CMFPlone:plone'})

After posting to plone-users with this and the zope debug traceback, Martin Aspeli isolated where the problem was occurring and suggested clearing out my buildout-cache(s) before trying again.

In the meantime I stumbled across this page describing how to install Deliverance on Ubuntu 8.04 and 9.04. This suggested that on Ubuntu 8.04 you need to use libxslt1-dev as part of lxml as opposed to libxslt-dev. So, I gave this a try which worked.

In summary here's what I did to get it working:

  • Removed 'lxml' from the 'parts' = section of my buildout.cfg
  • Removed the [lxml] section from my buildout.cfg
  • Cleared down my buildout-cache of any lingering lxml products
  • Ran # apt-get install libxslt1-dev
  • Ran buildout

When I started up Zope I was able to add a new Plone successfully and install xdv.

The irony of all this is that xdv is supposed to save designers and integrators time (and sanity) when theming a Plone site. However, getting it running has actually cost me a big slice of time I don't really have. Due to the problems I had I more or less decided to abandon Plone and use Wordpress for one of the sites I'm building.

Postscript 23.02.10

Martin Aspeli responded to my plone-users email with this:

I'm glad you got it working. However, the staticlxml recipe is *supposed* to download and compile static versions of libxml2 and libxslt, so your system-wide ones shouldn't matter. 

Out of interest, did you actually try to do what I suggested, or did you go with the other option first?

So, it is possible that the libxslt1-dev option is a red herring. Having said that, although I can't swear to it, I'm pretty sure I did clear my buildout-cache when running my original tests. It may be worth ensuring that you do as Martin says first before trying my solution.

Postscript 03.08.10

Re: Martin's Tweet -- yes, I agree -- of course it would have been helpful for me to include some signposting for people who need any further help with this. Apologies for not doing so.

The best place to start if you have any problems getting XDV up and running is the Plone Users list -- they've been very responsive in helping me out with my problems -- so many thanks as always to them.

Also, if you haven't already please check out Theming with collective.xdv on the plone.org site.

Review of Plone 3 for Education by Erik Rose

Packt Publishing's latest addition to its Plone-related titles is Plone 3 for Education by Erik Rose. It's an excellent short introduction to setting up Plone within the context of a school or university, covering topics such as using Plone as a Virtual Learning Environment (VLE), installing third party products, using multimedia, theming your Plone-based sites and system-level concerns. Despite its focus on education it would serve as useful companion for anyone starting out with Plone.

Erik Rose of Penn State University's WebLion group distills his considerable experience in using Plone in an educational context into ten chapters which roughly divide into three distinct sections: chapters one to seven concentrate on using third party products to extend Plone's functionality, chapter eight briefly examines theming and chapters nine and ten cover making your Plone site live and how to manage backups and upgrades.

The book assumes some familiarity with Plone, but to no great depth, at least for the first few chapters. Chapter four gets more advanced, covering how to extend Archetypes-based content types with schemaextender. I found this very useful and explained in a way that I didn't find overly complex.

Leaving setting up courses and faculty directories, many of the use cases in the first section of the book are common enough to be of interest to those outside education. Chapter five covers setting up blogs using a combination of standard Plone content types and add-ons, including Scrawl and QuillsEnabled. Chapter six covers multimedia, including the use of plugin media players such as collective.flowplayer and getting started with podcasting using Plone4Artists Audio

The book provides and overview of Plone theming in chapter eight. This isn't exhaustive by any means (after all there is a separate, much bigger book dedicated to that subject) but should serve as a useful introduction to the subject.

As a non-systems person I found the last two chapters, "Going Live" and "Maintenance, backups and upgrades" useful summaries of some of the systems-level issues to be considered when running Plone-based sites. Chapter nine includes a handy section of setting up CacheFu and Squid to improve your site's performance; something it's vital to have at least a basic understanding of as anyone who's dabbled with Plone will know.

The book's main strength is in providing overviews of some of the main features and peculiarities of Plone without overloading the reader with too much detail. For anyone operating as a one-person outfit or with limited time will find it extremely useful.

New Plone-specific blog

"Sorry, there seems to be an error" is my new Plone-specific blog. Well, there's not much new about it -- at the moment it's mainly made up of archival posts taken from my main website which was losing a bit of focus.

The name is taken from the message I seem to get the most when I'm creating new Plone sites.

Posts will concentrate on Plone theming, integration and any other random Plone-related stuff I stumble across.

Review of Plone 3 Theming by Veda Williams

Media_httpwwwlittledn_jlfhx

Veda Williams' Plone 3 Theming (Packt, 2009) [Amazon UK | Amazon US | Packt] is a useful reference for anyone involved in customising the look and feel of their Plone-based website. Used alongside the various online resources on the plone.org website, particularly the Plone Theme Reference,  it should ease  most of the pain that Plone themers experience. Unfortunately (and this is not a criticism of the author), the book is let down by some poor copy-editing. It also contains a number of errata, which the author is gathering on the plone.org website.

The book is broken down into fifteen chapters, the most useful of which I found were chapters seven to twelve which deal with the day-to-day business of Plone theming.  These chapters cover customising viewlets and portlets, an overview of the Zope templating language ( ZPT), the creation and installation of a Plone theme, template changes, custom page views and theming tips. Although I've done a fair amount of Plone theming, I still find it quite esoteric and complex so it's certainly very useful to have these chapters to refer back to.

Chapter fifteen, written by Alex Limi, gives an overview of the future of Plone theming using products such as collective.xdv and Deliverance. These seem an ultimately saner way to proceed and should allow non-Plone specialists to theme a site without getting too bogged down in Plone specifics. This article is also freely available on the Plone website where it will be updated as the project develops.

I did wonder if the second chapter was really necessary -- this provides an overview of the main graphic design, browser and text editing tools. I imagine that most web designers and developers already know about these and the complete beginner would be encouraged to to stay away from Plone until they are a little more experienced.

That aside, the only real complaint I have about the book is the quality of the copy-editing. I think the text would in places benefit from a little slimming down or rephrasing. I occasionally struggled with some of the explanations , although it must be borne in mind that Plone 3 theming is complex so is by its very nature difficult to explain in simple terms. Some other examples: it's probably not necessary to have sentences like, "now what, you ask?" in a tutorial book and I'm not sure why there is a lengthy code sample from Plone 2 on pages 129-30 which is really only produced to show how things were done the "old way".

Anyone who has been involved in Plone theming will know how hard Veda Williams has worked on it: in addition to this book, she coordinated the Out of the Box Plone Themes project. For her work I'm sure she has the gratitude of every Plone themer. Hopefully subsequent editions of the book will address the editorial issues and errata.

Fancy helping with plonetheme.hamnavoe?

Hamnavoe is one of my contributions to the Out of the Box Plone Themes project and has had almost 500 downloads since its release last October. I've been meaning to do some minor fixes (mainly CSS) on it for a while now but am too bogged down with other things to be able to give it any time. So ... this could be where you come in. If you're a budding Plone themer and would like to have a poke around with an existing Plone 3 theme before starting on your own, then this could be an opportunity for you to help out. It's for the community (i.e. it's not my own private project!), so the reward would really just be in doing it (and getting your name in the documentation obviously). Ok, so don't all rush at once. But, seriously, if you're interested, drop me an email at my Gmail address: d.little1971 (at gmail.com) or send me a Tweet: @djlittle.

Migrating from Zope 2.6.4 to Plone 2.5.3

I'm currently working on the roll-out of Plone 2.5.3 sites to replace our old Zope 2.6.4 / CMF 1.4.2 sites (Plone 3 to come for new sites in the new year hopefully). I can safely say that after doing this a few times, migrating from such an old version of plain Zope/CMF to a relatively new version of Plone is a complete nightmare. The number of steps I've had to go through to get this working seems to get larger every time I do it. I've now got to stage where I'm not 100% sure if a step is needed or not, but what the hell I'm going to do it anyway. To be honest, I'd probably recite incantations backwards over a boiling cauldron if I thought that was going to help. Here's a summary of what I've had to do:
  • Export the content from the old Zope 2.6.4 site
  • Create a new CMF site on a Zope 2.9.7 instance
  • Run through a load of Zope upgrade routines,  including fixing the catalog and adding a load of new folder actions
  • Export the folder(s) containing the content you want to migrate
  • Create a new Plone site somewhere on a trashable Zope 2.9.7 instance
  • Set this up with a theme / policy product
  • Import the converted Zope/CMF folders
  • Clear and rebuild the Plone site's portal catalog
  • Go to portal_atct / Type migration and click on "Fix" under "Fix portal names"
  • Click on "Migrate" under "Type migration"
  • This should fix all old CMF documents, links and files
  • Now, I've got the fix the old CMF Folders. Oh, this is a good one. The only way to get these into the catalog is to go to portal_catalog and go to "Find Objects". I leave the search fields blank to get absolutely everything into the catalog, even stuff that doesn't really belong there
  • I create a migration script that handles the transfer of old "Portal Folders" to Plone Folders (not at the ATFolders stage yet). It also does some other minor migrations I need to do (e.g. converting ATDocuments to a custom content type)
  • Here's another great one: now make sure your folders don't contain any objects with the IDs of "language" or "subject". This causes the migration to fail (I found this out by trial and mainly error). There may be some more IDs that cause this problem, I don't know.  Rename any verboten IDs.
  • Go back to portal_catalog and do a Clear and Rebuild
  • Go back to portal_atct and re-rerun Migrate Types. My Plone Folders now become ATFolders (woohoo!). Oh hang on, they don't have any titles!
  • I write a script that gives the folders the same titles as their index_html documents. Luckily, by and large the titles of folders and their index pages are the same, so this usually works.
That's it. Simple and pain-free it's not. But it is a good advert for not leaving it so long between upgrading your Zope/Plone versions, or being a better programmer.

180 downloads for Hamnavoe

I've just checked the download stats from PyPi and saw that the Hamnavoe egg has been downloaded 180 times. Now I know that this very likely doesn't equate to 180 unique downloads but I'm still pretty pleased. I'd love to see some sites using the theme to see the different ways in which it's being used and to get some feedback, so if you're using it please do drop me a line.

Plone and Flash Player 10: Opera's revenge

An addendum to the problems I was having with Plone and Flash Player 10. Looks like another problem occurs with Opera if you change the content disposition header to "inline". Basically, screeds of nonsense displaying instead of the Flash movie or the fall-back image. I'm not sure how widespread this problem is and I'm not prepared to do lots of testing but for the record this was happening with Plone 2.5.3 / SWFObject to embed the Flash file.  Various versions of Opera were tested -- for instance I'm running version 9.10 on Windows. I got round it with a bit of old-fashioned browser detection. Basically, Opera's quite happy to have the content-disposition header left alone, so I needed a direct path to the Flash file for Opera and a path that took in my header setting script for everyone else:
if (navigator.userAgent.indexOf('Opera')>-1) {
   swfurl = '&dtml-portal_url;/path/to/flash/myflash.swf' }  else {
   swfurl = '&dtml-portal_url;/path/to/flash/showflash?flashvid=myflash.swf'
}
swfobject.embedSWF(swfurl, "my-dom-id", "435", "290", "9.0.115");
Not sure why Opera should behave differently to other browsers here.