Sunday, 14 March 2010

Working on an Umbraco Project with Multiple Developers

Over the past couple of months I've been working with the open source .Net CMS Umbraco, and been very impressed with the breadth of features and opportunities for extension and customisation that it provides. Operating as a one man band, it's very straightfoward to work with the product using the web based UI for most of the development tasks.

However one concern it gave was how to set it up such that in can be used within a development team - with multiple developers working on the same project and how to integrate it with source control systems.

Issues arise from the fact that whilst some content is saved as files on disk (e.g. templates, XSLT macros), others are held in the database (e.g. data types, document types, and the content itself of course).

In order to get around this, we've set up and used the following model - which seems to ameliorate the concerns:
  • Firstly, a single database is set up on a networked server for access by all developers. This means any created document types, data type and content nodes are immediately available to all developers, and they can rely on any IDs used to be consistent.

  • Secondly, each developer installs a clean Umbraco installation onto their local PC.

  • Finally, a companion Visual Studio solution is created. A project can be created within this for the creation of user controls and custom pages as would necessary in any case if such extensions were required. In addition though, copies of all file based information (stylesheets, scripts, templates/master pages, config files, xslt macros) are also created here.

    This being the case, such files can be managed as they would in any other ASP.Net project, and checked into source control as required. The key change to working practice is that they are edited within Visual Studio rather than Umbraco.

    An added advantage here is that you get access to VS.Net's intellisense and colour coding, which I've found to be a particular benefit when editing XSLT macros. There is the downside that you don't get to use Umbraco's own tooling support - in particular the toolbars for inserting fields and macros. However in practice I found that even an fairly novice Umbraco developer soon doesn't require these helpers, and if they are needed, can still be used of course provided the developer remembers to replicate the change into the VS.Net files.

    In order to integrate with Umbraco, a post-build script is set up that runs an xcopy statement to copy the necessary files from the VS.Net project to the Umbraco installation.

    So whenever an edit is made that needs to be reviewed, Ctrl + Shift + B will build the solution, and run the post-build script to copy the files into the Umbraco folder. And loading up the site running on localhost will allow the latest changes to be viewed in the browser.

3 comments:

  1. hello!
    thats a very good idea!
    could you please provide an example visual studio solution for downloading?

    Thx a lot! Stevo

    ReplyDelete
  2. Thanks Stevo - haven't got a full VS.Net solution to download, but here's an example of a line in one of my post build scripts so you can see the xcopy syntax required:

    xcopy c:\vsnet2008\project\bin\*.dll c:\umbraco\bin\ /y

    ReplyDelete
  3. This comment has been removed by a blog administrator.

    ReplyDelete