codeflood logo

Posts from 2011

Automated Testing in Sitecore Without an HttpContext

This year was the first year that Sitecore’s Dreamcore conference was held in Australia. And I for one jumped at the opportunity to speak at it. One topic that quite interests me is unit testing, and if you’ve read my posts over the years you’d see I have come up with a variety of techniques for getting unit testing (or rather, integration testing) working for Sitecore projects. So what better...

Presenting to the Sitecore Users Virtual Group

This Thursday (well, it will be Thursday for me, Wednesday if you’re on the other side of the date line) I’ll be presenting to the Sitecore Users Virtual Group on testing strategies for Sitecore. This is the same talk I gave at Dreamcore this year, so if you missed out, here’s another opportunity to see me talk about some testing techniques. Details can be found here:...

WeBlog Summit 2011

Ealier this year in April, Sitecore’s Dreamcore US event was held in Boston. One of my WeBlog colleagues, Nick Wesselman, gave a presentation at the event on the shared source WeBlog module. There was quite a lot of buzz around the module, especially from Sitecore themselves, who saw what we were doing with the module as a great example of Sitecore community.

Dreamcore AU 2011

It was my great pleasure to present at Sitecore’s Dreamcore event in Sydney, Australia this week. This was the first time the conference was held in Australia and it was fantastic with lots of great speakers and interesting people. My session was titled “Testing Strategies for Sitecore” and was run in the developer stream, so it focused on automated/unit testing. As promised for everyone who...

Solving Generic Casting Issues with Actions

Generics in .net are a great way to avoid having to repeat your code when all you need to do is alter a few of the types involved in the code. Recently I was retrieving some objects from a data store in several different places in my code, and just altering the return types at each call. This felt like an ideal candidate for generics. I didn’t want to have to cast the array of objects to the...

SEFE On-Site Payment Provider

I’ve recently had the opportunity to get to know the Sitecore eCommerce Fundamental Edition or SEFE for short. One of our clients wanted to port their existing online shop to Sitecore which we’d used to rebuild their site. The main reason I chose SEFE was due to the fact that SEFE IS Sitecore and is built completely in Sitecore. All other eCommerce platforms I assessed were external applications...

Virtual Items in Sitecore

One of the many benefits of using a good CMS like Sitecore is the ability to reuse a single piece of content in multiple locations around your site. This ability is provided through virtual items. So what is a virtual item? A virtual item is an item that doesn’t actually exist. Why wouldn’t you want the item to exist? One reason would be to keep your content tree clean and another would be to...

Importing lists with Revolver

Recently I had to create a list of reference items in Sitecore that was a few hundred items long. Doing this exercise manually would have been mind numbing and taken a few hours out of my day. Thanks goodness for Revolver! Revolver contains the split command which can be used to split larger strings up. Combined with the echo command which can be used to input text from files and I’ve got the...

Singleton Patterns for ASP.NET

Update 13th June 2011: Thanks to Damian Kulik who left a comment on this post pointing out that the classic singleton pattern I show below is not thread safe and provided a link to a great article showing a few options for creating a thread safe singleton in C#. I’ve updated the code examples for the classic singleton pattern to use a thread safe singleton pattern. Many of you are probably aware...

Unit Test Test Data

One of the most valuable lessons I learnt whilst doing unit testing with Sitecore projects was to ensure my tests were robust and repeatable. I went through a lot of pain in my earlier projects with brittle tests that as soon as one test failed, all the others would start failing. All this instability was to do with the test data I was using. I had a small amount of test content that I assumed was...

Decoupling through the Rules Engine

Recently I was designing a feature on a site that required dynamic behaviours. This kind of thing is right up the Sitecore rules engine’s alley so I made use of it in the design. But the use of the rules engine had larger benefits than simply meeting the requirements. More on that in just a second. Before getting too far into this blog post I feel I should make mention of Sitecore 6.5 which landed...

Calling Control

Several years ago I remember watching a dnrTV (dot net rocks TV) episode featuring Venkat Subramaniam discussing Ruby like features of .NET 2 and C# 2. You can catch the episode at http://www.dnrtv.com/default.aspx?showNum=41. One programming technique that stuck in my head from that episode was to do with passing control inside a method back to the calling code to allow it to fill in the specific...

Revolver 1.2 Released

Yesterday I released Revolver 1.2 for Sitecore 6.4. Releases for other Sitecore versions should be available over the next few days. Along with a few bug fixes and behind the scenes stuff the following list provides a brief overview of updates made to Revolver for the 1.2 release. Maximum Query Results Warning Sitecore query provides a nice way to query for Sitecore items using an XPath like...

Long Running Process Options

Recently I was asked by another developer about what options we had in Sitecore for long running processes. It wasn’t until I had to list them out all at once did I realise just how many options there are, all with their appropriate uses. Sitecore contains a very visual and engaging UI. And when it goes away to do something for a long time, it will provide feedback to the user so they know what’s...

How to Choose a CMS

So how do you currently select a CMS for a project. And I’m asking this more of the people who will be using the CMS to manage their website rather than those that will be doing the development work. Far too often people assess a CMS platform with giant spreadsheets listing features the CMS should have and score each candidate on each feature. The problem with this approach is that any good CMS...

Access Sitecore data with WCF

So, my laptop died. Again. Second time within 12 months. Time to get a new one…but as a result I’ve had to borrow another for this blog post. This laptop is quite under spec’d compared to my previous laptop. In fact, this laptop is actually a netbook with only 1 gig RAM and a 1.66 Ghz atom processor running Windows XP home. Yet I’ve been able to get Sitecore 6.4.1 running on it. I’m also missing...

Responsible Blogging Rules

When I started this blog many moons ago I mentioned a few pet peeves about blogs I had in my introductory post. Also in that post I mentioned I had a few guidelines for myself to follow to help prevent me from committing some of those mistakes myself. However at the time I never published what those guidelines were. This was mainly because I had never written a blog before and I didn’t know how...