Posts – Page 9

Plone/Zope: Utilising zope.testrecorder for unit testing

Writing unit tests (especial doctests) for your Plone product is reasonably time consuming. For us developers, having tested code is absolutely essential. This is especially true when clients are beating down your door looking for a fully functional product and you need to know what you’ve written works and isn’t going to fall over (just yet, anyway). Web apps are able to be tested using a multitude of frameworks, and whilst not the most fully featured (eg lacking Javascript support), Zope’s doctest machinery is right there within your Plone product. In order to write these, enter zope …

GenericSetup and “mismatched” tags in ZCML

Ever the issue-magnet, I’ve spent the better part of my morning trying to debug a mistmatched tag error from within some ZCML (aka XML for the non-initiated).  Essentially, the issue boiled down to the system telling me that it was certain that I had a mistmatched tag within my configuration, and presented me with the problematic XML tag (complete with line numbers).  However, life’s not always that simple.

The traceback looked like this:

Traceback (most recent call last):
zope.configuration.config.ConfigurationExecutionError: xml.parsers.expat.ExpatError: mismatched tag: line 6, column 70
in:
File "/home/david/buildout/src …

Wget a Plone site (and make it actually work)

There’s a lot of different resources and posts on the web about how to export a Plone site to static html content, but no methodology would actually solve all of my problems. Now, Plone is inherently a complicated beast, given just how much it does, and that’s definitely putting it lightly. But here goes at my attempt to provide an actual, workable solution.  Word for the wise though, this is for more than just your front-end administrator to handle.  Also, instructions are designed for Ubuntu 9.10.  Mileage may/will vary on other distros or OSes.

Requirements

  • Needs …

CSS: Internet Explorer and Self-Imposed Limitations (+ Plone)

Microsoft and IE are insane.  Yes, we all knew this, but here’s the proof:

IE won't accept more than 30 style sheets to be loaded via <style> tags within a single page.

Insanity?  Yes.  It’s made even worse by the fact they openly admit this lunacy!  See the relevant support article from MS as proof.

Good gosh.  I can just imagine the staff (managers, probably) from Microsoft thinking “30 style sheets?  Who needs more than 30 style sheets?  Just kill off anything after that and those sites that use that many can BURN.”

I mean, really, who does …

Apache: Directories and trailing slashes

Apache does something interesting (yes, I still think it’s logical) when you’re accessing a directory that it’s serving: if you access it without a trailing slash, it’ll add one by default. This makes sense if you’re going after some static content or a folder index (or pretty much any sane usage) but it didn’t fit my use case of serving Plone using rewrite rules in a .htaccess file.

The issue that arises for myself with Plone is that my sites need to have their access customised through that .htaccess file and that’s been …

Ubuntu: Crackling audio noises on a Dell M1530 (or HDA cards)

The problem I found (so did everyone else) when updating to Ubuntu 9.10 Karmic was static/popping noises when your sound card is silent (aka goes into power-save mode). It applies to my Dell XPS M1530 laptop’s on-board sound and probably to the same chipset elsewhere.

The fix couldn’t be simpler! Simply edit this file (as root):

/etc/modprobe.d/alsa-base.conf

and comment out the last line. Then, restart ALSA to save you having to do a reboot to check it worked:

sudo /etc/init.d/alsa-utils stop sudo alsa force-reload sudo /etc/init.d/alsa-utils …

(Lack of) Kupu CSS Styles, Plone and Deliverance

Note: see this post for up-to-date details.

Essentially, the issue is that Deliverance doesn’t theme (and rightly so) the Kupu editor within Plone and hence any styles applied to normal pages by Deliverance don’t show up.  My workaround, as detailed on that post, is to customise the “emptypageresources” page template and include a suitable link to the CSS file, like so:

<link href="site.css" type="text/css" rel="StyleSheet" tal:attributes="href string:${context/@@plone_portal_state/navigation_root_url}/static/theme/site.css;" />

(changing the tal:attributes section accordingly).  This should introduce perfectly correct styles for your editor from your …

Logged out users can’t bring up the Plone popup calendar

It’s another one of those ‘strange’ problems that has cropped up, but by default in Plone, users who aren’t authenticated aren’t actually able to bring up a pop-up calendar on a date field.

It’s amazing that I haven’t run into this issue before with something like PloneFormGen, where you’d think that a simple Date input field would be pretty common.  Although, I guess it’s the case that even though I’ve used these given forms, I’ve probably never taken much notice of the popup calendar icon and just selected a random date …

David tries Plone 4.0a2 (Part 2)

Rightio!  So we’ve got Plone 4.0a2 installed and up and running.  Boy, she looks sweet:

  • The new Plone site setup is flawlessly simple.  No more ZMI for those of us that don’t want to use it.  It’ll always still be useful, but having Plone throw up a simple, no no-nonsense front-end installer is just what it needed.  Other PHP based CMSes always had it too easy ;-)
  • Editing view:  clearer tabs at the top (no idea how many clients miss those, me included to start!) and resizable editing fields.  Great. TinyMCE as the editor — just what the …

David tries Plone 4.0a2 (Part 1)

Plone 4 is approaching!  Excellent!  Lots of new features to play around with and plenty more things to have to fix with the upgrade.  I’ve been keeping tabs on the change log of updates and it’s looking really good. Lots of little, but significant, changes are afoot.  Now, how about actually installing the Alpha 2 version of Plone 4 to see it for real? Let’s do it!

My steps are not going to work on your computer.  I don’t think you’ll be able to follow my words/commands exactly, but here goes anyway about my …