One of the major pain points when deploying Sitecore based web sites has always been configuration management. Sitecore has thousands of lines of configuration scattered across more than a dozen files. 

With Sitecore 6 we were given the ability to use 'patch' or 'include' files that greatly helped us manage changes in the Sitecore configuration section. While this was a huge step forward there was still a major problem with this. That problem being, we aren't able to patch, or transform, any configuration outside of the Sitecore section. 

One of the main goals of Team Development for Sitecore has always been to ease the deployment of your Sitecore based sites. When we shipped the first version of TDS for Visual Studio 2008 we provided a "File Replacements" feature. This feature let you manage files that may be specific to an environment. This feature worked well in that you were able to deploy environment specific configuration files automatically as part of your build process. The down side to using File Replacements for configuration files is that you needed to manage the entire file for each environment, but there were no alternatives at the time.

When Visual Studio 2010 was released we were given config transformations, but this feature has its flaws especially for Sitecore developers. The first major issue is that Visual Studio only supported adding a transform file to the web.config file. Second, in order to transform a file you needed to run it via web deploy (or packaging within Visual Studio). And, finally, many Sitecore developers still work in the web root and transforming a file "in place" would be a bad thing.

As a Sitecore developer using TDS we are able to use Sitecore include files to patch the Sitecore configs and we can leverage TDS file replacements to manage environment specific versions. If we wanted to use a config transform on the web.config file than we would have to use web deploy for our files as opposed to using TDS. It never felt right.

I'm very excited to say that with Version 4 of Team Development for Sitecore we are supporting config transformations as part of the build process! This means that you can use out of the box Visual Studio tooling to add a transform to your web.config file and when TDS builds your solution it will transform the web.config file and deploy or package the transformed file. The really exciting part is that you are able to leverage a Visual Studio add-in such as SlowCheetah to add transforms to all config files and TDS will transform them too!

Note:

We aren’t reliant on SlowCheetah to do the transformation at all. We would recommend that you use it in order to get the ability to add a transform to any config file and to preview the transformed file.

Have you ever had a TreeList field in Sitecore only to see this when editing an item?

There is no easy way to tell what is actually selected! Now, sure, you can rename the 1/2/3 items to be more descriptive, but that feels clunky to me. I've seen this a few times in Sitecore solutions we've inherited as well as ones we've created and I felt it was time to resolve this. I feel that a much better way to render a Tree List field would be this:

There are only three things required to make this happen.

  1. Add an item into the core database to define the new field type
  2. Code for the field type
  3. A config file to wire it all up

You can grab the source code and standard Sitecore package here.

We, at Hedgehog Development, have been intimately working with Sitecore serialization since it was released with Sitecore 6.0 in 2008. Specifically our interest has been in helping developers bring their Sitecore items into Visual Studio and essentially allow you to treat your Sitecore items as code. We do this with our Team Development for Sitecore product.

I was having a discussion the other day and was asked to elaborate on the serialization format that Sitecore uses. I figured I would have some notes, or official documentation, on the format, but I couldn't find any! I figured this is a good a place as any to describe the serialization format that Sitecore uses. More...

Sitecore Rules Engine and RegEx

September 29, 2011

I was having some fun with the Sitecore (6.5.0.110818) rules engine over the last couple days. Specifically, I was trying to show content editor warnings as well as control icons for templates based on the name of the item. However the Item name comparison, when using a regular expression, was never evaluating to true. More...

I have a nice assortment of little scripts that I've written over the years to perform various tasks within Sitecore. Based on this Stack Overflow question I figured I would release one.

This script will show, and allow you to reset, the __security field on all items in a subtree. The code wasn't written to be pretty; it was written quickly to perform a very specific task.

To use this, simply drop this aspx file into your webroot and browse to it. Delete when done. More...

This post is in response to another blog post by Dmitry Vasilinenko. I posted this up as a comment, but it was quickly taken down for some reason.


Dmitry,
Continuous Integration (CI), for Sitecore based web sites, has been gaining traction over the past few years particularly amongst solution partners (i.e. Hedgehog Development, Pentia, Inmento, etc...) and I am glad Sitecore is starting to take an interest in it.

Part of my responsibilities here, at Hedgehog Development, has been to help other Sitecore partners create a proper build/deployment processes including the use of CI for their team. The major hurdle I've seen is the amount of understanding and time required to get a proper process in place.

You've identified some fundamental concepts of Continuous Integration for any software development project. I also strongly agree that your project and the underlying CMS should be separate! This is something I've been pushing for some time now, and I believe is finally gaining support.

The one aspect of CI with Sitecore that appears to be glossed over though is the Sitecore templates, or Sitecore items in general, and how they are handled. In my opinion, the Sitecore templates (and items) that are created specific for the solution at hand should be treated as code. The C# code you write would be worthless without the items then require. We, at Hedgehog Development, had created the Team Development for Sitecore (TDS) product to close this gap. TDS addresses many of the points you raise as well as the ability to deploy your sitecore items as code to a different Sitecore installation.

As for your recommend free tools, and this is just my own opinion, I don't particularly care for them. I would suggest that the readers take a look at TeamCity by JetBrains, rather than cc.net + nAnt. TeamCity is also free and is a bit easier, IMHO, to work with. Personally, I am very happy with using Microsoft Team Foundation Server. The integration with Visual Studio is 2nd to none and the build and testing functionality is great. I do understand that this software isn't free, which is why you mentioned SVN, cc.net and nAnt.

Sean Kearney
Sitecore MVP


References:
Sitecore and Visual Studio: http://seankearney.com/post/Visual-Studio-Projects-and-Sitecore.aspx
Hedgehog: http://TeamDevelopmentForSitecore.com
Pentia: http://mcore.wordpress.com/2008/02/29/continous-integration-and-sitecore/
Oshyn: http://oshyn.com/_blog/Web_Content_Management/post/Enterprise-Sitecore-Continuous-Integration-Configuration-Management/

You might be interested to hear about a new initiative that Hedgehog Development is undertaking, the Sitecore Users' Virtual Group. This user group is dedicated to supporting the Sitecore community wherever they exist across the globe. We have some great speakers lined up for our first sessions, and we’re looking forward to their deep expertise on Sitecore development. All sessions are free of charge and conducted over the web. The current schedule is at http://www.sitecoreug.org
 
Our first presentation will take place next Wednesday, May 18, at 9:00 AM Pacific, Noon Eastern, or 5:00 PM UK time. John West, CTO of Sitecore North America, will discuss the state of Sitecore and the CMS marketplace. John has graciously agreed to answer your questions. If you have any questions, please go ahead and submit them to our site at http://www.sitecoreug.org/question.aspx.
 
The attendance link will be mailed out next week. If you would like to attend, please register at http://www.sitecoreug.org/registration.aspx.

Looking back at 2010 I can confidently say the biggest news I was hit with was that I am having triplets. A pair of identicals girls and a singleton girl to be exact. This is, of course, in addition to my two year old son. I always wanted four kids so I am pretty stoked!

The actual due date is April 29, 2011 but as you can imagine we are expecting them a bit earlier. The average gestational period for triplets is 33 weeks, which puts them around March 11.

Needless to say things have been changing in my world. The most recent would be the sale of a web site I owned. I hope to have some more good news as soon as next week and I'll save that for another post.

I did stumble on this video and must say it has summed up a lot of my conversations recently and I imagine how they will be for a long time.

 

Selling RSWarrior.com

January 24, 2011

In the Summer of 2002, I was 24 years old, single, had a good number of friends who rode motorcycles, and my 1989 Suzuki GSXR 750 just broke down. I purchased the Yamaha Road Star (Star Cycles) Warrior in June, which, at the time, was one of the fastest and best handling power cruisers in the market. Being that I was coming from the sport bike realm, this was the bike for me.

2002 was the first model year for the Warrior so there wasn’t yet a community site up and running. There was a community of Warrior owners on a hosted forum site (Delphi), as well as a fan’ type site, but they had missing pieces. I started the rswarrior.com site in June of 2002 primarily using software written by me. With a bit of luck, and help from key people, the site took off.

Fast forward to December 2010. I am 33 years old, married, a home owner, a father to a two year old, and I have three girls on the way (yes you read that correctly). I still have the Warrior and put a few miles on it a year back and forth to work. However, my life has changed. I have responsibilities that life insurance just won’t cover, many of my friends no longer ride, and my passion time for motorcycles has dwindled.

I’ve been a fairly silent member on rswarrior.com over the last five or more years. There has been a great moderator team and, to be honest, they’ve ran it so well that I’ve been able to be silent. As silent as I was, I did always have my hands and eyes on it. The site had grown to over 21,000 registered members making about 30,000 pageviews a day. However, as my time for riding has dwindled so has my time for running the site. Even with the moderators doing a phenomenal job I just can’t help but feel that the site would be better off under someone else.

In light of the recent changes in my life, and changes yet to come, I’ve decided to let the site go. As of November 1, 2010 I am no longer the owner of rswarrior.com and by the time your read this you will have noticed that the site has changed hands.

I know that many of the 21,000 rswarrior.com members reading this are wondering what this means for them. I sincerely hope that it means you have a much better experience using the site. I created the site with a lot of blood, sweat, and tears and I know the moderators put in countless hours to keep the site running. I wouldn’t turn the site over unless I thought it was for the better. I still have the Warrior and will continue to be a member on the site.

Reflecting back, the site has had its share of bumps along the way. Very poor web hosts, server upgrades, weekend long down time, lost members, fighting members, thieving vendors, design and software changes, etc.. ultimately the community got through it all. I really do hope that the ownership change is just another small bump in the road and the community continues to grow.

I have a multi-lingual Sitecore (6.2) site that has been having many issues with item versions showing up in their site myseteriously. The client has over 12 languages in their site and certain items shouldn't be accessible to certain languages. Now, Sitecore says simply don't create a version of the item and it won't appear in the site for the language. Perfect? Nope.

There are dozens of pages scattered in the Sitecore tree that shouldn't exist in the English site. However, on any given day one of these pages starts showing up in the English site. There isn't an English site author creating a version and, to make it even more frustrating, there is no audit trail of them being created! I've logged about 10 'bugs' with Sitecore on ways to have these versions magically appear in the tree (and there are more that I haven't reported). Most of them have been addressed with hot-fixes, but I think it boils down to one fundamental issue with Sitecore...

A Sitecore item NEEDS at least one version. Shared fields are the reason we need a version. A "shared field" is a field whos value has no boundaries. The value is available to all versions in any language. Things like workflow, security, display name, sort order, etc... are stored in a shared field on a version of an item. If you have an item with no version than it has no security, display name, or sort order.

This leads me to one of my bugs. As an example, try this.

Create a little subtree of five items names 1, 2, 3, 4 and 5. Now:

  1. Remove all versions from this item
  2. Sort item '5' using the 'First' sorting button
  3. Sort item '5' moving it 'Down' below item '1'

You should now observe that there is a version for every item in our subtree. We only worked on item '5' yet all items have a version. This shouldn't happen; I never told it to create a version!

Once you introduce multiple languages into the equation it gets better! Say you have this same sub-tree and they all have a version in English. Now, change the language you are working on within Sitecore to Danish and resort the tree. You will notice that Sitecore went ahead and created Danish versions of all the items. Worth noting is that the version that was created would have bypassed any language security too. Why couldn't Sitecore just save the sort field on the English version (it is a shared field)?

I will admit that my example is a bit contrived. It probably would never exist as is, but we do have a client that has items scattered in their tree that do not have any versions. I will also admit that this could be a training issue, but I still feel it raises a fundamental flaw in the system.

I think the first step in fixing the problem is that there NEEDS to be at least one version of an item. The "Remove Version" button should check to see that it isn't the last version of all languages. If it is the last version then it can't be deleted.

I would love to hear your thoughts.

P.s. I haven't seen Sitecore 7.0, but I can imagine that the fundamental architecture changes with it will (hopefully) address this.