Blog

Blog

Professional Plone 4 development review

Posted by Nejc Zupan at Nov 20, 2011 10:38 PM |

Short summary

If you are doing Plone 4 development, go buy this book. Now.

Some background

I started working with Plone in 2006. Back then I was really just beggining with development in general and did not know how to do things properly. I only knew how to tweak some templates and to use ArchGenXML to generate some content types. No version control, no tests, no nothing.

Then Professional Plone 3 Development came. "Wow, I'm doing things seriously wrong" was my first reaction. That booked steered me in the direction of using Subversion to control my source code, writing tests to prove my code doesn't break in various places, using pdb - the Python debugger, deploying Plone sites myself, etc.

Plone 3 vs. Plone 4

However, Plone 3 was complicated. There were all these new technologies and concepts that you now had to use. That's not bad in itself, but those technologies only delivered part of the story. You still had to use old ways to do certain tasks. Plone's learning wall was higher than ever.

With Plone 4, these technologies are not new anymore. They are polished and widely used. You only need to learn one way to do something, not three. As a consequence of this, Plone is now easier to learn. Plone's development process is cleaner, more defined, with better tools. The new book from Martin is the same: less history overhead, more confidence in newer, better tools and concepts.

PP4D

Having in mind how much Martin's previons book improved my development process I was so stoked when I heard him announcing that he started writing an updated version. After waiting for many months, it's finally out. Bigger, better, more up-to-date. Unlike how Plone 4 is leaner than Plone 3, the new book packs a hundred more pages of insights into efficient development and deployment process. It starts with introductory chapters where the author shows you how to prepare basic project specification. Then it goes over preparing your development environment for productive work. I cannot stress enough how important a well prepared environment is. Having tools pointed out in the book at your fingertips when things go wrong is just godsent. What follows is how to write actual code. Several chapters, full with examples of code that you can use in your own projects. I really like how all examples come with tests to really show developers that tests are an important part of your development process. Finally, there's deployment. These chapters show you how to properly deploy and maintain your Plone site and gives you pointers on how to scale your deployment when your projects starts getting more attention.

The information Martin gives is in accordance with latest best practices developed in the Plone community. Even if you are a seasoned Plone developer I'm sure you will find at least a few useful tricks and tools that you don't yet use and will grow to love them as soon as you do. I know I did!

Plone 4 dev on Lion

Posted by Nejc Zupan at Sep 15, 2011 08:20 AM |

Introduction

Recently I upgraded to OS X Lion and here are my notes on how I got my working environment working.

XCode

First things first, you need to setup build tools (gcc, make and the like). On OS X these come as a part of XCode. Even if you had XCode installed on Snow Leaopard before upgrading to Lion, do take time and reinstall it completely. Stuff changed since the white cat and it's safer to have your build tools up-to-date.

collective.buildout.python

Same story as with XCode. Remove your collective.buildout.python directory entirely and recreate it from scrach. It takes a while, go make yourself some nice tea.

UPDATE: In OSX 10.7.1 readline does not get built because it's configuration script does not correctly recognizes the OS. You can fix this by appending the following two lines to the bottom of src/readline.cfg in your local checkout of collective.buildout.python and re-running buildout.

make-options =
    SHOBJ_LDFLAGS="-dynamiclib"

egg cache

If you are using a local egg cache it might get tricky. Some people report everything works fine, but several people also report that things were randomly breaking until they had removed all eggs from their egg cache and re-ran buildout. My suggestion? Clear the cache! It takes a while to download all those eggs again, but it beats losing a day chasing readline related SEGFAULTS causing Zope crashes on seemingly random requests:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x00000001131ccf09 in call_readline ()

lxml

If you are using z3c.recipe.staticlxml you are in more trouble. The latest version uses libxml2-2.6.32 and libxslt-1.1.24 and these two break in a very nasty way when you try to access a Plone site themed with Diazo. Zope crashes with no traceback. Attaching gdb to the process spits out the following error:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000001400001c4f
[Switching to process 89119]
0x00007fff8dbcd403 in strncmp ()
(gdb) bt
#0  0x00007fff8dbcd403 in strncmp ()
#1  0x00000001088e5830 in __xmlParserInputBufferCreateFilename (URI=0x1400001c4f <Address 0x1400001c4f out of bounds>, enc=163580032) at xmlIO.c:2412
#2  0x00000001088bc951 in xmlNewInputFromFile (ctxt=0x10985e5b0, filename=0x10407fd30 "/Users/zupo/work/example.project/eggs/diazo-1.0rc3-py2.6.egg/diazo/defaults.xsl") at parserInternals.c:1462
[...snip...]

One solution is to add the following two lines to the [lxml] part of your buildout.cfg:

libxml2-url = ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
libxslt-url = ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz

These tell lxml to build against newer versions of libxml2 and libxslt making those nasty errors go away.

UPDATE: You can just as well use the latest version of z3c.recipe.staticxml which includes URLs to newer versions of both libxml2 and libxslt.

The other solution is simply to not use z3c.recipe.staticlxml at all. It seems that you can now use your system's libxml provided to you by XCode (located at /usr/include/libxml2). To do this, remove [lxml] from your buildout.cfg and re-run buildout.

Help me get to PloneConf!

Posted by Nejc Zupan at Aug 27, 2011 04:01 PM |
Filed under: Plone

Intro

Hi, I'm Nejc, a Plone user since 2005. I'm trying to get to the Plone Conference in San Francisco this year to do a talk on Raptus Article and I need a few dollars worth of help.

At first I did not plan to go due to being expensive to get from Slovenia to the States. But then my talk Plone Article -> Raptus Article got accepted! Now I have strong motivation to go! I also plan to attend the post-conference sprint and will work on things that anyone donating would like me to. Read more about me below or help me out immediately.

Why I need $800?

Well, I did a quick back-of-the-envelope calculation of what expenses I'll have: plane ticket from Slovenia ~$900, accommodation ~$250, food ~$250 and a student rate conference ticket $225; the total sum being ~1600. I can afford to cover half of these expenses, but not much more. And man would I like to attend this conference :).

About me

I started using Plone in 2005 and liked the hell out of it immediately. Shortly after that I started my own Plone consultancy firm for small projects in Slovenia, my home country. Meanwhile I am still a student at University of Ljubljana, currently in my (hopefully) last year.

In these 6 years of me being a Plonista I've taught Plone to numerous students on international student workshops we organized throughout Europe (google for "Plone My Web"). Some of them became active members of the community. In the last years I focused on shifting these workshops from being strictly student oriented to be more Plonista oriented. The result was Sauna Sprint 2010, Neoplanta Sprint and Sauna Sprint 2011. Yep, I was one of the organizers for that fabulous weeks in Finland and Serbia ;)

I've been a Plone core contributor for about a year now. I try to open-source as much code as possible. Lately I contributed the Plone Boutique along with several niteoweb.* packages. Some people tell me they find them useful, which is nice. Oh, and I've been a Plone Help Channel Superstar 2010 nominee <http://plone.org/news/2010-plone-irc-superstars-results>. I'm hanging around on IRC under the nickname "zupo". Uhm, and I've just finished my Google Summer of Code project: collective.table.

That'll be all, I'm eager to meet everyone in SF! Donate by visiting this site: http://helpmegettoploneconf.chipin.com

collective.table, report #3

Posted by Nejc Zupan at Aug 08, 2011 09:00 PM |
Filed under: GSoC, Sprint, Plone

Work report

A week ago, myself and my mentor both participated in the Plone Sauna Sprint. It was an epic event, thanks to all sprinters for being that great throughout the week.

blog/rebooting-brain-on-sauna-sprint

During the event my mentor and I discussed in great length how to approach challenges that collective.table presents. We want the table to be pluggable and reusable. We want to support having several tables on one page. We want to support having multiple backend data sources for our tables, with a dedicated configuration view for each data source.

Current status

Table works, we have one data source. Multiple sources are being supported, prototype for configuration view is ready.

Also, my brand new MacBook Pro died. Apparently RAM problems, or so they say at the repair shop. So now I am stuck using an old laptop, which hinders my ability to be productive.

Plans

First, I need to get my MacBook back from the repair shop to restore my normal working environment. Hopefully they can get it fixed in a couple of days.

Next thing on the menu is to polish and document configuration views for storages. Followed with tests for them.

After that, we'll see how much more time we have until the GSoC deadline and decide priorities based on that.

collective.table alpha release

Posted by Nejc Zupan at Jul 21, 2011 11:43 AM |

Introduction

It's now past the mid-term evaluation deadline for my Google Summer of Code project and it's time to release my work out to the wider community to receive feedback and ideas on how to improve it.

Status

During the last days I was focusing on polishing the first release: writing documentation, adding more comments, increasing test coverage and such. My plan was to have a public release just days before Sauna Sprint so I can start getting valuable feedback from the community on the progress and roadmap for the project.

But why did I chose Sauna Sprint as a deadline? Well, myself and my GSoC mentor Martijn Pieters will both be there for the entire sprint next week.Productivity will be through the roof if I can judge based on the number of Plone sprints I attended in the past. We'll mainly be focusing on improving the UI and making our storage more scalable.

Give it a spin!

So: buckle-up, add collective.table to your eggs and give it a spin! Any and all feedback is greatly appreciated. The release is available on PyPI and code is available on GitHub.

Twitter
RT @ iElectric: @CentrifuzijaTo bi slo :) Si prepripravljena delit stroske? :D Feb 02, 2012 09:58 AM
RT @ nzupan: Everything you need in a foreign city is a Plonista. Everything else sorts itself out. #plone #best #community #ever Feb 01, 2012 02:02 PM
RT @ iElectric: Jenkins (JVM) crashes after few minutes after start http://t.co/NSsnxmQf Jan 31, 2012 09:39 PM
RT @ iElectric: #python tip: date(time) objects have .replace() method: datetime.datetime.now().replace(hour=0, minute=0, second=0, m... Jan 31, 2012 05:56 PM
RT @ nzupan: Arrived to #barcelona! Jan 31, 2012 12:42 PM
RT @ iElectric: When #android is installed in cars, so streaming music with mpd is straightforward from my home, I'm buying one. Jan 29, 2012 05:11 PM
RT @ iElectric: OH: wordpress is an unauthenticated remote shell that, as a useful side feature, also contains a blog Jan 29, 2012 04:43 PM
RT @ iElectric: Wohoo, I can finally not lose time with my music collection - http://t.co/TZmRbv3r Jan 29, 2012 04:06 PM
RT @ iElectric: In #gentoo one can patch sw by putting patches in correctly formatted folders and they will be applied before compili... Jan 29, 2012 02:05 AM
RT @ iElectric: Stop Internet #Censorship! Sign the urgent global petition @Avaaz urging the EU Parliament to reject #ACTA: http://t.... Jan 29, 2012 02:05 AM
RT @ BCSearch: We're back online. :) Read the blog post: http://t.co/uGhsz6VW http://t.co/pAqDOobU Jan 28, 2012 08:17 PM
RT @ nzupan: If you are managing a #plone site with many users, give collective.listusers a try! Jan 28, 2012 07:12 PM
RT @ BCSearch: A maintenance downtime coming up shortly! Jan 28, 2012 06:09 PM
RT @ nzupan: niteoweb.click2sell updated to support plone.app.testing, plus moved to GitHub and http://t.co/e1WHmvMd! #plone @click2 Jan 28, 2012 06:09 PM
RT @ nzupan: Wow, I just got a 7-fold decrease in one of my buildout's run time, thanks to @rosspatterson! You rock dude! #plone Jan 28, 2012 12:17 PM