Posts – Page 14

Plone How-To: XHTML Compliant Flash Insertion

Wow, it seems easy doesn’t it. Just add an object tag, params, and embed and we’re done, right? Well, sure, if we didn’t want to adhere to W3C standards.

To do the right thing, we need something like this:

<object type="application/x-shockwave-flash" data="movie.swf" width="100" height="100">
    <param name="movie" value="movie.swf" />
    <img src="alt.jpg" width="100" height="100" alt="" />
</object>

Not much to it there, and this is available everywhere on the web. It validates okay, and that’s what we need.

However, if you follow normal procedure for sticking this …

Plone: PloneFormGen Customisations

Another fun problem for me to address today: upgrading to the latest version of Plone (3.1.7 at time of writing) caused my custom PloneFormGen (otherwise known as PFG) view to break in a nasty way:

Module None, line 13, in fgvalidate_base
- <fscontrollervalidator at /site/fgvalidate_base used for /site/registration-form>
- Line 13
Module Products.PloneFormGen.content.form, line 519, in fgvalidate
Module plone.protect.authenticator, line 60, in check
Forbidden: Form authenticator is invalid.

Obviously there’s some new validation code for forms in Plone 3.1+. Thanks to a very simple (and useful!) blog entry: http://www.die-welt …

Rewrite Rules Made Easy

I’ve pretty much got a nice handle on Rewrite rules for Apache. Once you’ve seen a few of them, it’s straight forward enough to replicate for new Plone sites and so forth.

However, to make things even easier on my brain I’ve found this: http://betabug.ch/zope/witch , the Rewrite Rule Witch. Seems like the rules it produces are what I’d expect, which makes me ponder why, if I know they’re right, would I bother.

Reason: easy confirmation and less chance of typos.

Buildout and Version Problems

Two blog entries in one day - wow it’s been a good work day.

Just a quick chronicle of my thoughts: version conflicts in buildout aren’t always pretty. My latest escapade into trying to load up Varnish through zc.buildout resulted in a hair-tearing out message:

An internal error occured due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/tmp/tmp8o-_PD/zc.buildout-1.1.1-py2.4.egg/zc/buildout/buildout.py", line 1477, in main
File "/tmp/tmp8o-_PD/zc.buildout-1.1.1-py2.4.egg/zc/buildout/buildout.py …

Ubuntu: PulseAudio Joy

Well, it’s a sad state of affairs when simply unplugging your set of USB headphones causes your Intrepid Ibex install of Ubuntu to crap itself. Even with the same set of headphones plugged back into the same port not 10 seconds later. Painful.

But, the good news is that after a few hours of pain, PulseAudio works and it’s magical in comparison to the older audio systems (3 apps playing audio at once..wow).

Check out http://ubuntuforums.org/showthread.php?t=789578 for a great walk-through on how to set it up on Hardy or Intrepid. Unfortunately …

Plone: Python Eggs And Development

Welcome to the new year! It’s the start of another journey around the sun and the beginning of work for me. Whilst I’m the only one actually working around here today, I thought I’d take the chance and update with some useful info:

Troublesome Python eggs

Now, much to my amazement, when you’re creating/compiling/whatever Python eggs for Plone you need to actually specify the files you want included in the build. I suppose it’s fair enough, but thought it might have actually done it for me. No such luck!

The SOURCES.txt file …

Plone: Buildout Won’t Install Products.OpenXml

UPDATE: Installation of Products.OpenXml appears to work happily with buildout when I’m using z3c.recipe.staticlxml to build lxml separately from having to easy_install or install system-wide packages.

So it’s almost Christmas time and I’m still slaving away working. It’s all about commitment.

Today in my life I’ve been trying to install the OpenXml product for Plone (using buildout, of course):

david@computer:~/buildout/instance$ ./bin/buildout
Uninstalling zopepy.
Uninstalling instance.
Updating plone.
Updating zope2.
Updating productdistros.
Installing instance.
Getting distribution for 'Products.OpenXml'.
Got Products.OpenXml 1.0.1.
Getting distribution for 'openxmllib' …

Unix: SSH Port Forwarding

So it’s not that special and I bet 1000 people have already posted the same details. Still, it’s cool and I need a place to record my thoughts about this:

ssh host.name -L YYYY:other.host:ZZZZ

Essentially, this means logging into the first machine and creating port YYYY on the local machine as the port ZZZZ from other.host

Works well.

Plone: Archetypes With Paster

From http://www.koansys.com/tech/create-plone-3-archetype-product-with-zopeskel-and-buildout:

ZopeSkel can create Archetype-based products for Plone 3. Wire it up in Buildout.

After creating a Plone 3 instance (e.g., with Unified Installer) go into the src/ directory and create a development product with ZopeSkel:

> paster create -t archetype
Enter title (The title of the project) ['Plone Example']: Koansys Newproduct
Enter namespace_package (Namespace package (like plone)) ['plone']: koansys
Enter package (The package contained namespace package (like example)) ['example']: newproduct
Enter zope2product (Are you creating a Zope 2 Product?) [False]: True
Enter version (Version) ['0.1']:
Enter description (One-line description of the package …

Plone: Ploneboard Conversation Editing

I’m back with even more Plone goodness. Turns out Ploneboard has a problem/issue (well, HAD an issue until I went and edited the code on the SVN repository for the Collective of Plone. Read: will not have in the next major release) with redirecting the user after they go and edit a post. So essentially the user ends up getting to a page that says ‘Insufficient privileges’, which is was extremely odd considering I do everything as an admin.

The fix goes a little something like this:

In ploneboard_scripts/comment_redirect_to_conversation change it to be:

# XXX if we ever …