Archive for the 'olivewood' Category

zend framework and isapi rewrite on IIS (and why)

Wednesday, April 23rd, 2008

Recently I decided to standardise on php/zend framework for future ground-up development (where I have a choice/ influence). As some of you may have gathered, i’m a bit of a “jack of all trades” when it comes to web dev and I have a legacy of projects using different technologies. One of these is a sprawling classic ASP/ mysql app for a distribution company which is a (very successfully) working prototype of something I want to rebuild in a more generic, modular and industrial way, as a flagship product for Olivewood to develop and sell.

To be honest the classic asp works fine for most purposes, but is becoming increasingly obsolete, along with availability of developers, and I have been trying to move on from it for years. The obvious choice for migrating a classic ASP app would usually be ASP.NET, but frankly the idea of spending the rest of my working life tied into windows-only development, and the fighting with software licences and scarce availability (it seems, at least in this town) of contractors makes me want to give up try a different career altogether. So I decided on php a while back (mainly because I wanted something open source, with an abundance of developers - I think if you throw a coin randomly in the watershed in bristol, chances are you would hit a freelance php developer).

So with php decided on, I then spent time evaluating a few frameworks. They all look good - this was a difficult decision - but I decided on Zend because Olivewood will be primarily concerned with eCommerce and eProcurement, and with magento being built on zend, and the “big industry” partnerships, it seemed the right fit. It also seemed to be useful and provide structure without being overly prescriptive. Also by writing this here i’m hoping to commit myself to at least something!

So, I also wanted something that would work cross platform, even though the obvious choice is to run open source web apps on linux/ apache, it was important to me that it would also play nicely with IIS, as many businesses have already invested in windows servers and already run other apps on IIS and wouldn’t be happy supporting anything else. This gets an indignant response from many “purist” developers/ sysadmins, but i’m basing this on real-life situations, and I hate the idea of a potential client ruling out open source software because it won’t run on their IIS server.

The other factor here was that I wanted something that would coexist with my classic ASP app until such a time that I have rewritten everything I need to make it a pure zend framework/php app. The classic asp scripts will handshake with the php code by dumping session data to the database and passing credentials via a cookie, so the session data can be shared between the two. This is vital to the plan, as it is a long term project - and much of the investment in migrating this will be my own time and money.

Installing Apache on the same server and setting up some kind of proxying would be another option, but not on the live server that this app runs on. I also needed to prove that it would work on just IIS before betting my future business plans on it, even if the first thing I would do is suggest that it is run on Apache.

I wasted a monumental amount of time getting this working, although it turned out to be fairly trivial once I had cracked it. The red herring is that there are two versions of isapi rewrite - version 2 and version 3. All the zend related documentation I found (hardly any) seems to be for version 2 (although this wasn’t mentioned!), which I just couldn’t get to work at all for my setup, but eventually I gathered that version 3 has been almost completely rewritten to work with apache mod_rewrite rules. So now I have a classic asp app, with a single folder (caled “zend”) containing my front controller from where all the php will be served the application folder (with all the models, views, and controllers) is outside the site root.

My httpd.conf file looks like this:-

RewriteEngine on
RewriteBase /zend/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !.(js|ico|gif|jpg|png|css|asp)$ /zend/index.php

Remember this is for version 3 of Isapi rewrite. All quite simple really, when you know how. It’s a pity it took me about 9 hours to work out how!

New drupal based site - Green Infrastructure in the west of England

Wednesday, April 16th, 2008

Olivewood have recently launched a new drupal based site Green Infrastructure in the west of England.

Green Infrastructure in the West of England

This has actually been quietly live for a while now, but wanted to monitor how it coped with the fairly heavy load exerted by the AJAX based mapping tool, which bought our dev server to it’s knees during original user testing, before being moved to a server with a bit more RAM.
GI Mapping tool

Olivewood Studio

Tuesday, December 18th, 2007

I’ve just started renting some studio space in the infamous Tobacco factory in Bristol. This will be where most of the day to day running of Olivewood will take place, though I will still be working from the Ubley office from time to time. I actually worked in a studio in the tobacco factory at the beginning of the decade, when a certain large digital agency were based here. This is a much more relaxed vibe though, as i’m renting space from (and sharing tea making duties with) the lovely Fanatic Design.

OK maybe this Zope object database makes sense now..

Tuesday, October 2nd, 2007

I’ve just made a breakthrough in my perception of Zope and its object database. Despite the fact I have been working with Plone for over three years i’ve always struggled to shift my way of thinking away from relational databases and SQL queries, due to my previous experience of building sites and applications mainly with asp (classic) and php, hooked up to a relational database.
So what caused my Eureka moment? A combination of:-

a. Not developing with plone for a while

Since going it alone I have been doing an eclectic mix of work for different agencies and companies, who all have their own pet technologies and ways of working (so far I have slotted straight into them all with a minimum of fuss- Jack-of-all-trades at your service! Except Perl. I had to turn that one down).

b. Doing a bit of old school Zope

From the moment I started with plone, when I haven’t been skinning/ templating, I have worked almost entirely with Archetypes. Archetypes generates forms for you and all the other “magic” - some lovely helpful magic, some dark voodoo that shouldn’t be spoken aloud in front of non-programmers (like me). This means that with Zope I never learned how to do a typical build a form that posts to script, script writes to database, script pulls out of database and renders it back in the page/form routine, which is usually the first thing I would learn with any other web technology/scripting language.

c. Starting to think in objects

Once again, this had more to do with not working with zope for a while. Before zope I only had a basic understanding of objects and only used them where I was forced to because I was working with someone elses code. I would encapsulate functionality by sticking a load of php/asp functions in an include file with a meaningful name, but I never took the step of wrapping them up in a class and treating the piece of functionality as an object. Something must have sunken in during my Zope years, because now I find it difficult to not think of something as an object.

So, i’m rambling - what exactly was my moment of clarity? It was simply adding a few extra fields (wait - properties) to portal_memberdata and personalize_form in Plone. I went off searching for the python script that would take the data out of the database and pump it into an object for me to use again in a page template - but of course, being stored in the ZODB, it already was an object. Z.O.D.B. Zope Object DataBase - geddit?

So in summary, I think anyone new to plone development could do with learning things the “old” way before they move onto developing with Archetypes - purely for the sake of demystifying the ZODB, especially if like me you come from a php/asp background and have trouble understanding why you would use an object database rather than a relational database.

Next stop Zope 3 - I’ve read several reports about the large amount of boiler plate code needed to create something fairly simple with Zope 3, and a few solutions to speed up the process, but I will definitely make sure to understand how it is done “manually” before attempting to move onto using any shortcuts this time.

on the road

Sunday, August 26th, 2007

mobile office

I’m not sure where I read it, but I remember someone remarking that the term “Road Warrior”, was dreamed up by marketing bods to make sales reps feel that there is something glamorous about a lifestyle involving being holed up in a travel lodge in a different place each night, working on a spreadsheet on their laptop. I don’t quite fall into that category, but I am working in a few different places (albeit mostly a skateboard/bike/car journey away from home). I’m doing all of this on a laptop (lovely black macbook) - and even when working at home, I don’t have a desktop machine anymore, preferring just to plug my macbook into a mouse/keyboard/monitor, rather than consider having a dedicated desktop machine.

I’m trying to avoid gushing about the macbook, but it has so far proved to be a massive step up from my 12″ powerbook. The powerbook was great too, but I quickly went out and replaced it when I struggled to use it on a day to day basis in a freelance situation - where I would turn up at a clients site and be expected to get straight down to working all day, without the luxury of plugging it into external peripherals (other than a mouse), and often not being able to get access to other machines for testing in IE etc. My hands would “fall off” the sides of the keyboard, the screen resolution was too low, it was slow, and it was just useless trying to use virtual PC to do testing in multiple versions of IE. So the powerbook will now hopefully see a few more years service as a more than adequate general home living room email, web, word processor, print server and music/ video jukebox machine.

The macbook, with 2gb of ram and a copy of windows XP running in a VM using parallels in coherence mode, has (touch wood) improved the situation massively. The screen resolution is adequate, speed is significantly better, the keyboard is lovely (I actually prefer it to an external keyboard - the “spaced out keys” seem to suit my clumsy typing style) and it has a solid, sleek feel to it. I know some people see them as expensive, but even with the highest spec model it is still under a grand, which makes it cost effective in my eyes, as I hope/expect to get a few years out of it. Parallels is excellent - although I struggled with it before I upgraded my RAM from 1gb to 2gb, it now runs really well and I have it open most of the time, with multiple versions of IE and other windows apps just a click away and opening almost seamlessly, but otherwise working within OSX.

I’m also chuffed to find out that the macbook has wifi reception in the apparent wifi “deadspot” in my garden, where my powerbook wouldn’t find my network. I’d been out and bought a wifi range extender to resolve this, but haven’t yet set it up, and probably won’t need to now. I’d heard before that the aluminium case on powerbooks inhibits the wifi reception, which might explain this.

i’ve also inherited a PDA phone - a T-mobile Vario II (pocket PC with 3G, wifi and slide out QWERTY keyboard). These have a reputation for being flaky, but it has been reliable for me so far, and incredibly useful - terminal services has come in handy for restarting services on one of my windows servers when I can’t access any other way, and I have pocket putty on there in case I need to ssh into a server (haven’t needed to yet other than to try it out). The pop email client works well with gmail, although i’ve disabled it for the time being due to the high volume of email I get. I installed the missing sync software on the mac and syncing works fine, and it is working as a bluetooth modem for the mac after installing a 3rd party modem script.

rick hurst and his geek phone

My main gripes with the Vario would be battery life (less than a day if you are using a lot of the features like wifi), and a bit of fiddliness - I often have to get the stylus out to find a contact and make a phone call. It’s also a bit bulky and no iPhone in the looks department. Also I haven’t fully figured out the wifi - it seems to randomly try to connect to any available network when switched on, not what I want. Other times (seemingly random) it gives me a list of options via a notification, but not necessarily the options I want). When connected seems to work fine (other than the aforementioned battery guzzling) - good with skype etc.

FOWA Roadtrip Bristol

Friday, August 10th, 2007

On Tuesday I went to the Future of Web Applications Roadtrip social at the watershed in Bristol. Carson Systems put some cash behind the bar and we stood around, talked geek and drank the free beer. There was an excellent turn out, probably the biggest turnout of any Bristol web designer/ techie related social i’ve been to. There were loads of people that I didn’t get to speak to, but I caught up with some old friends, met some new people and put a few more names to faces i’ve been talking to on the underscore mailing list for years, but never met.

There’s some photos on Flickr here including one with me in it (check shirt, yellow “well done” sticker!)

Another write up on the live blog

Olivewood Data Technologies HQ

Monday, August 6th, 2007

Although I still haven’t had time to build my new company a virtual HQ, a real HQ has been found in a small village called Ubley, a short commute out of Bristol. The reason for this location is that we will be sharing office space with my business partners other company (and the company I have been building an eCommerce web app for), who have warehouses on this site. I went to have a look today and was blown away by the view across blagdon lake. I won’t be working out here all the time, but i’m looking forward to it

View from Olivewood HQ

Olivewood Data Technologies HQ

Olivewood HQ

28 days later (give or take a week)

Friday, July 6th, 2007

Thought i’d better check in for a quick update since it’s been a while since I posted. I’m pleased to say that I have been incredibly busy since going it alone, working on lots of different projects for different people - consultancy, php/asp/plone back end development, html/css front end work and even some design. I’m loving the variety, and now feeling quite happy about the fact that I have diverse enough skills to do all these types of work. It used to bother me that I might be a “jack of all trades, master of none”, but I think more accurately i’m a “jack of all trades, master of some”. The only downside so far is that I have been too busy - as a new business with barely any money in the bank yet, I don’t feel like I can turn anything down yet! I’m loving being my own boss, but it was handy before having a boss to take the awkward phonecalls when I down tools at 5pm!
I’ve actually got loads of random things in my mind to blog about, maybe when things calm down a bit I will get round to it…

i’m joining the circus

Monday, May 28th, 2007

I once remember reading somewhere that leaving a steady job to set up your own business is the adult equivalent of running off to join the circus. But that’s what i’ve decided to do - as of June the 1st I will be my own boss, as after a lot of deliberation and heel dragging I have decided to bite the bullet and leave my contented job at Netsight to go into business with a friend of mine. I have always wanted to start my own business, but for various reasons I haven’t, and a business opportunity was put in front of me, that if I didn’t take then maybe it would never happen. At this point I wanted to link to the website of my new web application development company, but embarassingly I haven’t built it yet, so I’ll post about that when I have done it, and talk more about the new company, and the products and services we will be providing.

A few people have asked me if I will be continuing to work with Plone and the answer is basically this: The core business of my new company will be packaged web applicationsĀ  and these will not be built in plone, as the applications aren’t CMS-like, and plone wouldn’t be relevant. The applications will be built using some* scripting language/framework plus a RDMS. Zope 3 is a contender, but I don’t have the experience to hit the ground running with that, but i’ll certainly endeavour to get up to speed on it when time allows. However, the company will also be offering bespoke and ad-hoc development services and these will include Plone. For larger Plone projects and implementations I will refer enquiries to Netsight, as beyond the Plone skinning and customisation expertise that I have built up at Netsight over the last three years, the new company will not have the resources or expertise to support large plone projects. I will also still be contracting/freelancing for Netsight on Plone work - intially a couple of days a week, until they change the locks ;-)

Anyway, new company website to follow, and more details about exactly what we will be doing.

* probably unpopular amongst plonistas - check out my previous commercial experience and fill in the blanks yourself!