Archive for the ‘Work’ Category
HTML formatting made easy
There’s a tool for everything somewhere on the web.
Whilst about 99.5% perfect (some indentation issues remain), I’ve found a pretty nice, easy to use, and very feature-rich HTML code formatter. See http://www.mycoolform.com/index.php?lang=en for the formatter.
It’s something I was looking for a while back but didn’t have so much luck to stumble onto something so useful. Previously, I was looking for something that would fix up some HTML to XHTML and whilst I’m sure something was out there, the problem was I needed something that would do the job, but stay away from TAL attributes on my elements. The things that I had found did “too good” of a job and dumped those elements, which is fair enough because things like ‘tal:content=’ isn’t valid XHTML.
This formatted though does new lines, auto-indentation, change of case for tags and attributes (hello XHTML compliance), comment removal and white space elimination. Great stuff; so many thanks to its author (who is anonymous I guess?).
Missing content menus in Plone
Another dose of insanity please! Coming right up, sir.
Today’s second discussion comes from an issue I was having recently with a new Plone site that I was hosting behind Apache and Deliverance. No Varnish here yet, because I’d rather the site worked first before I try and cache the life out of it.
Now, the specific problem I was having was that the content menus in Plone (eg Add New, Display, State, Actions and for me, Sub-types) weren’t displaying. I thought it a Deliverance issue – maybe I was dropping those content items accidentally or not including the JavaScript needed to display them. Uh, nope on both accounts.
Solution
After a detailed search of everything I could have been doing wrong, I can across my Apache rewrite rules. Amazingly enough, I’d left off the /_vh_mysite at the end, so the URLs weren’t being written correctly. Whilst the site was loading (mostly) fine, because I’d inserted the URL to point to the site correctly, I’d forgotten that the VHM needs the _vh_mysite part.
Adding it in fixed the problem in a second, along with a throat-clearing shift-refresh.
Migrating a Plone site off to another database (Zeo)
Another of the interesting things in my professional life has been migrating a Plone site from one database (where it lived as a dev site, along with many others) onto a nice, clean database of its own. Now, yes, I’m aware that the export/import feature of Zope ISN’T supposed to be used for migrating content or sites. I am also aware, however, through personal experience, that things have always been fine because I’m using the same eggs and essentially the same installations everywhere, thanks to buildout.
So, the process goes as follows, with the above-mentioned points considered already:
- Head to the root of your ZMI and export your given Plone site as ZEXP
- Shut down your instance (or do what you will with your old site and installation)
- Copy the ZEXP file into the ‘import’ folder of your new Zope instance
- Start your new instance, with your new empty database
- Log in to the root of the ZMI
- Add a new Plone site and call it anything you want (eg ‘foo’). I’ll explain why shortly.
- Delete your ‘foo’ Plone site.
- Import your existing Plone site and be happy because it’s now arrived safe and sound.
Note
The reason I highlight adding a new Plone site a point 6 is because if originally, you were like me and imported your site first to a bare Zope install, you’ll get errors everywhere in your site. They’ll look like “AttributeError: getGroups” or possibly something more obscure (if possible!) and everything will fall over and die.
Now, by creating a new Plone site first ‘massages’ the root of Zope, and then your site should be fine. Among other things, adding a site changes the acl_users of the ZMI (seeing an abnormal acl_users is what led me to the solution). At a guess, given its type, this acl_users change probably has something to do with the error above.
The biggest problems have the simplest answers…
..and how true that is. Today’s time consumer is directly related to just 1 misplaced line of a buildout configuration (and presumably something that’s changed somewhere else).
The result
After much hunting and hunting, it turns out my Zope2 Fake Eggs weren’t being generated. (more…)
Deliver me from … Deliverance?
Always one for being on and beyond the bleeding edge of new technology, I’ve (with the help of colleagues) been setting up a new technology for applying themes to web sites. In particular, I’m applying Deliverance to Plone and whilst I’m not the first one to venture out into the wilderness this way, I’ve got to be thinking that I could be one of the few people documenting their experience. Ah, but where to begin? (more…)
You are currently browsing the archives for the Work category.