I set up a mysql database earlier and was getting a very slow response (about 4 seconds to connect) from a php script on another server. Both servers were windows (yeah I know, not my choice!). After a bit of googling I found the cause of this is DNS checking that occurs for incoming requests from seperate servers. The solution is to put skip-name-resolve into the mysqld section of my.ini (mysql config file)
Firstly an apology: I was sent Martin Aspeli’s Professional Plone Development for review back in October last year, and I still haven’t got round to reviewing it – not out of laziness, but extreme time shortage due to going freelance/ starting a company last year. Hopefully I can make amends now by reviewing it section by section as I jump into Plone 3.
A bit of background about me and Plone: I have worked predominantly with Plone for about 4 years, coming from a background in classic asp and php. My area of Plone expertise is front end templating and skinning, which was my main area of usefulness at Netsight for a couple of years. I have also presented a couple of Plone based workshops at Bristol Skillswap, attended two Plone conferences and a Snow Sprint. Despite this involvement with Plone, I have had a love/hate relationship with it, at times thoroughly lost deep down in the software stack, and fighting my tendency to think purely in terms of scripts and relational databases, other times singing it’s praises to anyone who will listen. Since leaving Netsight I have only worked on one Plone (2) project, as i’ve gone back to my old ways, favouring php for most projects, but just got stuck into an inherited Plone 3 project, and started using a vanilla Plone 3 site as a knowledge base/document repository/intranet/extranet for my own company, olivewood. (Hosted on a mac mini in-house, which I thoroughly recommend, but that’s another post!).
I’m currently feeling a little lost, with the Plone 3, which is why I decided to finally start reading/ reviewing the book.
Ok, enough about me, lets talk about the book: I opened the book last night and read through the foreword by Alexander Limi, and the first chapter. It left me with a fantastic feeling about Plone and the future of Plone – it summarised what is different about Plone, and how important (and fun) it is to participate in the Plone community to get the best out of it – the polar opposite to working with a proprietary product, where the vendor tries to cultivate a community around it, but it’s not the same. It also made me feel slightly guilty for moaning about aspects of Plone in the past – who exactly was I complaining to? I resolved to make sure that the next time something frustrates me, that I actively participate in making the situation better, i.e. to at least actively become part of the problem, if not part of the solution!
Chapter 1 covers Zope and Plone history, Plone as application vs Plone as framework, considerations for when deciding if Plone is the right tool for the job, and the importance of the community.
A couple of other things I learned from the foreword and chapter 1:-
- The original release of Plone was built (predominantly*) by just two people, Alexander Limi and Alan Runyan who didn’t meet until Europython 2002 just after the first release
- The Goldegg initiative is a sponsored effort to improve Plone’s framework stack, not a type of python egg!
Ok, I will try to deliver another installment as soon as possible, but i won’t necessarily be doing it in order – i’ll be skipping straight to chapter 8 (skinning)
* Building on top of Zope/ CMF – the work of many people!
Scenario: I added a new attribute “orderPriority” to a few different archetypes based content types. These attributes had default values. As this is an existing site, there were 400 or so existing objects that had not picked up these default values – i.e. they would only pick up the value after they had been re-saved. To make sure these objects picked up the default value I created a skin script, which I proxied as manager (watch out for indentation here, really must find a better way to display preformatted code):-
catalog = context.portal_catalog
# objects are all in folder /directory/listing/
listing_folder = getattr(context.directory, 'listing')
for brain in catalog(portal_type = ['NameOfMyContentType']):
print brain.portal_type + ' ' + brain.id + ' ' + brain.Title
listing = getattr(listing_folder, brain.id)
#this gets the default vakue from the schema
order = listing.getOrderPriority() #this sets it
I needed to be able to sort by this field in a catalog query/ Topic/SmartFolder/Collection so, so I then added the field as a fielindex in the portal catalog, reindexed the catalog (ZMI) and used the collection edit options in site setup to add it as a field
I attended BathCamp at the weekend and it was great fun. I met some lovely people, talked geek and gave a short talk on (“the gurgitator”) a python script I have been writing, which I use to generate boiler plate code for web projects in different technologies (i’ll write about this when it is further down the line). I haven’t got time to do a full write-up, but wanted to thank the people who made it happen. Check out the photos on flickr: mine all