codeflood logo

Coffee => Coder => Code

Ramblings on code, Sitecore and stuff

Multi environment config

Managing multiple environment configurations for any project has always been a bit of a challenge. Even when you're still in development, and different developers have different folder structures and drive assignments which would affect the location of your data folder in Sitecore, not to mention when you move to QA and production where server names will most likely also change. There are many...

Multithreading with Delegates

Multithreaded code is becoming more common place. Even for web applications. This is largely due to the increasing number of cores appearing on CPUs these days. The chip manufacturers have come close to the limit in terms of how fast a chip can run before it starts to melt. So to continue increases in processing speed, instead of continuing to try and increase speed vertically by increasing chip...

Get your workflow in order

I really like workflow in Sitecore. It's simple but powerful. The workbox is a great view into workflow and anything that needs my attention. By default, the workbox displays items in workflow states ordered by name. At times it would be nice if I could order by some other attribute like the updated field. So let's add sorting functionality to the workbox. We'll start by adding another ribbon...

Extending the Sitecore image processor

You've no doubt used the dynamic image manipulation capabilities of Sitecore before. This feature allows you to dynamically manipulate images from the media library using the query string. For example, to request an image with width 150 I would append w=150 into the query string: http://domain/~/media/images/myimage.ashx?w=150 Sitecore will then dynamically scale this image to 150 pixels wide...

Warning: Memory leaks ahead

Hang on, memory leaks? But this is .net where memory leaks are a thing of the past. If you've never done C or C++ before, then you've probably never had the enjoyment of searching through your code looking for memory leaks. A memory leak is memory an application allocates, but doesn't deallocate when it's done with it. .net solved this issue by not letting the developer manage the memory of the...

WCF Trace Tool

I've been doing a fair bit of WCF lately. And an absolute nightmare of an error to try to debug is the "Channel was in a faulted state" error. This is a very generic error and doesn't really say much at all about the cause of the error. The way WCF communicates is through channels. When a channel is in the faulted state, it means the construction and opening of a channel failed for some...

Multiple sites and the Preview Interface

I experienced a very weird issue the other day that was to do with the preview interface. When I set a publish restriction by date on a particular item for a future date, although the preview interface respected the date restriction, when I changed the preview date it's as if the interface ignored the date. No matter what I changed the preview date to, the interface wouldn't show me my item. Now,...

The Sitecore Australian and New Zealand users group

In a recent post, Phil Heltewig announced the Sitecore Australian and New Zealand users group (SCAUG although this is being changed to include our New Zealand members to SCANZUG). This is a community run group to support anyone who develops in or uses Sitecore in the Australia and New Zealand region. And who should it be headed up by? Well, that would be me :) . Although this group is for people...

External Application inside Sitecore Desktop

Recently I had to integrate Sitecore with an external application written in PHP. The integration included making the PHP application appear inside the Sitecore desktop, so it would appear to the end user that the external application was actually a part of Sitecore. Now, this is actually quite easy to do as we can make any ASPX page an application inside the Sitecore desktop. An application...

PNG curse? Solve it with a link.

This is another post which starts out with me reading another post :) . I was reading the Molten Core blog which is written by Thomas Eldblom (fellow MVP) and Jens Mikkelsen. Thomas published a post in which he points out the large number of PNG icon files included in Sitecore. Sitecore contains an extensive icon library consisting of 1,000's of files. And each of these files is provided in...

No Workflow for Web

I was reading a post by Alex Shyba recently which showed how you can get workflow history using the Sitecore API. This post reminded me of a post I was going to write a while ago on the subject of the workflow APIs. At the bottom of the above post, Alex points out that you could use the code in a workflow email action to get the history and send an email to the user who submitted the item into the...

It's official, welcome the MVPs!

Well, it's official. Today Sitecore made a press release about this years MVPs. And I am so proud to finally be able to say that I am now a Sitecore MVP. I join 12 others from the wider Sitecore community who have all been named MVPs by Sitecore. Read the press release for more details on what the MVP program is, and how we all ended up there. So onto the congrats and thanks! Congratulations to...

2008, the year that was

So. 2008. What a year! We've seen a lot of activity from Sitecore this year. We had the Beta program for the new Sitecore codenamed Crestone which was later released as Sitecore 6. This version of Sitecore is the most polished to date (as you would expect). The Sitecore product just keeps getting better and I keep having fun using it.

Sitecore Desktop in Firefox and production javascript debugging

Back in the pre Sitecore 5.3 days I would sometimes prefer to use Firefox when logging into the Sitecore desktop. Firefox was much faster than IE for this interface, and especially if I was looking at a slow implementation Firefox would help ease some frustration. The desktop didn't look exactly as it should in Firefox, which is probably why Sitecore revoked support for the Sitecore desktop for...

My Sitecore Wishlist

A few weeks ago Alex de Groot asked the Sitecore community, through a post on his blog, what we want to see in Sitecore. How would we improve it? What features are we missing? So rather than comment on his post, I am posting my response here. Hopefully it will invoke some thought and others will post their Sitecore wishlists for all too see and talk about. Below, in no particular order, is my...

Common uses for Revolver

When developing Sitecore solutions I use Revolver a lot. I find it easier and quicker at times to do things in the command prompt than clicking through the beautiful UI. So here's a bit of a list of common scenarios I use Revolver for. Most of the scripts below utilise the find command. By far I think the ability to execute the same command against a set of items is the biggest benefit. You can...

HAML Rendering for Sitecore

I first heard about Haml (XHTML Abstraction Markup Language) early this year on Alexey's blog. At first I thought "What's the point?". After all, HTML is easy to understand and is itself a markup language. Why do I need a markup language for a markup language? But when you start writing in this higher level language everything starts to zen. I have started to become a fan of significant...

A generic error occurred in gdi+

I had the above error the other day when using a new install of Sitecore. At first the error doesn't seem to reveal much, and it quite ... generic :) . This was happening when I was trying to create a new rendering through the developer centre in the Sitecore desktop. The full error was: And the error is logged in the log file as well. Exception:...

ChangeTemplate with Revolver

One of the goals of Revolver is to provide a platform for custom tool development and execution. Often we need to execute some code against an arbitrary set of items from the content tree. For example, yesterday I had to change the template of most of the items in the content tree of the site I was working on. And I wasn't about to click through 200 items changing templates using the content...

Automated Testing and Sitecore - Part 8

Well. When I started writing this multi-part series on automated testing and Sitecore I never intended for it to flow over into 8 parts. But I think what I've covered in this series are the fundamental pieces any developer requires to be able to affectively automate their tests for Sitecore code. So, now that we're at the end of the series, I'll leave you with some tips. Don't get hung up on...