The odd bit

Once is an accident, twice is a coincidence, three times is an enemy action.

The odd bit - Once is an accident, twice is a coincidence, three times is an enemy action.

Sitecore Web Service Pitfalls

I recently started an adventure involving Sitecore’s out-of-the-box web service. In fact, I didn’t know such a thing existed in Sitecore until I searched the web for information about accessing Sitecore from a process outside the ASP.NET runtime.

The good news is a web service exists. The bad news is the documentation barely exists. Apart from a document titled The Sitecore Web Service Reference Guide on the Sitecore Developer Network, you literally are on your own.

Thankfully, there’s no problem in getting it to work. The problem is actually using the web service.

Problem 1: Return values

The document describes – in nothing more than just a few words – all available methods. The return value is always of the type System.Xml.Linq.XElement but no part of the documentation shows what the return value actually looks like. After some debugging I found out the result always takes this form:


Problem 2: The documentation is wrong

Ouch! The documentation for the Save method tells us that it needs the XML representation of an item. A special note even points us in the right wrong direction:

You can obtain the XML representation by the GetXML method.

So you call GetXML, modify the XML to include your updates and then supply that XML to the Save method. Been there, done that and received the status ok reply. Woohoo!

… or not. Despite the OK from Sitecore I didn’t see my updated field value. Time to figure out what the Save method actually does using dotPeek. Upon inspection it seems the method expects an XML like:

    <field itemid="{guid-of-item-to-update}"
           fieldid="{guid-of-field-to-update}" />
    <field ... />

That XML is completely different than the XML representation of an item! I changed my methods to produce the “new” XML format and… it worked :)

I really hope I don’t need to create a follow up post!

CSS: Love Hate

The slightly odd title is there for a reason. This post exists for a reason. I’ll explain both…

I’ve always struggled to remember the order in which hyperlink styles should be defined in a stylesheet. Hyperlink styles? Order? I’m talking about these (in alphabetical order):

  • :active
  • :hover
  • :link
  • :visited

They should be specified in the right order or things won’t work the way you’d expect them to. Here they are again but this time in the correct order:

  • :link
  • :visited
  • :hover
  • :active

I could go into details why this is the right order but I won’t :-) That’s not the purpose of this post.

The good news is that there’s a mnemonic to remember the order: LoVe HAte. For those not paying attention: mind the casing of the mnemonic!

So that’s the title of this post. But why? To keep me from googling each time I forget the order 😛

Administrative shares in Windows 7

Those who have experience with NT-based operating systems on a network will certainly be familiar with the concept of administrative shares. If that doesn’t ring a bell, you access them like \\computername\c$. With this intro and the title of this post, you might be alarmed or enter panick mode fearing they might be gone in Microsoft’s latest OS iteration. Well don’t go into cardiac arrest because they are still there… but of course not without the odd problem.

Windows 7 still creates the administrative shares on install, but you can’t use them out of the box. First of all, you need to have File and Printer Sharing enabled. And the way to do that has once again been changed:

  1. Open the control panel.
  2. Go to Network and Internet.
  3. Go to Network and Sharing Center.
  4. In the left column, click on Change advanced sharing settings.
  5. There are two profiles. You probably don’t want this on when you’re on a public network so open Home or Work.
  6. Under the header File and Printer sharing, select the Turn on… option.

And now your administrative shares still don’t work 😛 You’ve just completed step 1 which implies there’s at least a step 2 and here it is: you also need to change the registry.

  1. Click on the orb (= the round button with the Windows logo in the taskbar) and type regedit in the search box.
  2. Open the registry editor.
  3. Navigate all the way to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System.
  4. Right-click in the pane on the right side and add a new DWORD (32-bit).
  5. Give the new setting the name LocalAccountTokenFilterPolicy.
  6. Double click on that setting and give it a value of 1.

It’s probably wise to reboot after doing this, although it might not be needed. I’m not sure if it works straight away because I rebooted without trying.

Anyways, if you’re lucky you will be able to access administrative shares after performing these steps. If you’re unlucky, like me, doing all these things appears to have zero effect at all. Once again don’t panick, because there’s another hint/tip/solution coming your way.

Somewhere at some point during the installation or configuration of Windows 7, you will be asked to do something with a thing called Homegroup. It’s some weird new sharing tool that looks OK but isn’t quite what you’re used to. Once you have enabled that feature, you won’t be able to use the administrative shares. So the tip is: disable the homegroup feature.

  1. Open the control panel.
  2. Go to Network and Internet.
  3. Go to HomeGroup.
  4. Click on the blue link Leave the homegroup.

The popup dialog should point out itself, but I believe I picked to first option. Once I had left the homegroup, the administrative shares started working again.

I hope this post can help anyone who experiences the same problem.

Windows Vista: Explorer opens folders in a new window

Recently, Vista started opening folders in a new window even though “Open each folder in the same window” was selected in the folder options. Obviously something had changed but I didn’t know what. There were more indications that something was wrong, including:

  • Explorer opens folders in a new window, ignoring the folder options setting.
  • The Windows flag on C: is gone.
  • DVD-drives are labelled as CD-drive.
  • Trying to access a CD/DVD results in a Format blank disc dialog box.

Searching the internet resulted in heaps of complaints about the new window issue so finding the right fix wasn’t easy. It turned out that Internet Explorer 8 was the culprit. So there you have solution #1: uninstall IE8. Actually, that’s not a solution so I wasn’t satisfied :)

Another solution that I encountered a couple of times suggested to launch IE8 as administrator. Several users reported that this method fixed the problem, but it certainly didn’t fix it for me.

Eventually, I found a comment on the IEBlog with a list of 19(!) steps to fix it. Fortunately, and as noted in the comment too, step #11 seems to be the critical one. I was able to solve all issues mentioned above by doing this:

  1. Open a command prompt as administrator (right click -> Run as Administrator)
  2. Type: regsvr32 actxprxy.dll
  3. Click OK in the popup window.
  4. Reboot

And Vista was back to its normal self. YMMV!

Counterintuitive or counterproductive?

Do you ever get that feeling where a piece of software seems to make your life as a developer harder instead of easier? Well, I do but I’m not sure whether it’s the software or me.

I’ve worked with an open source content management system written in PHP for close to 6 years. In that timeframe, I got to know the little beast inside out. I knew the strong points of the product but more importantly I also knew the weak points and how to avoid/circumvent them. Anything I do with it just works and if it doesn’t I soon enough find out it was caused by a mistake on my part.

The new content management system is some commercial software written in .NET. I haven’t figured out why, but I seem to be in a constant fight with the software. I can’t have it working perfectly for 2 days straight. I do something, it fails… I finally get it working again and less than a day later it breaks again. Perhaps it’s the software, perhaps it’s me but I’m certainly not used to working with such flaky software. All I know is that it’s pretty frustrating at the moment.

Viewing Tip: Star Trek

I have collected all Star Trek The Next Generation and Star Trek Voyager seasons on DVD over the past few years. That’s a total of 14 Trek seasons which equals to an awful lot of minutes. I’ve watched every episode as I was collecting the seasons, but now I’m at a point where I’m wondering which episodes I’d like to watch again.

Instead of putting my own mind at work I decided to let Google do all the work for me. A blink of the eyes later, I was looking at a top 50 someone compiled. It’s a top 50 that includes all series, except Enterprise I think, but that’s not an issue for me. I just filter for TNG and VOY.

Looking at the list I’ve come up with a new plan: watch all episodes again and create my own catalog with my own ratings. That would be much easier to browse through than all those little booklets. And it also has the benefit that it can finally give me some real content for my web site that’s been in the works since… well, far too long already :-)

Milk Inc: Forever

It started with Milk Inc Supersized in the Sportpaleis in Antwerp to celebrate the 10th anniversary of the most popular Belgian dance group. It was supposed to be a one-time event, but it was such a success that they decided to do 3 concerts the year after. And because they came back, I also headed to Antwerp for Milk Inc Supersized 2.

That was nearly a year ago and back then they already announced Milk Inc Supersized 3 for this year. The event has been renamed to Milk Inc Forever because that’s also the name of their latest album. I’m going this Saturday to what will be the second concert from a total of six. I’m sure it will be one hell of a party :)

PS: And the damn commercials on the radio seem to make it an even longer wait…

Interesting browser stats

I just checked the browser stats for this blog and there are some interesting facts to gather from the data. Just so you know, the data is based on the past month (Aug 23 – Sep 22).

The first one is not really a surprise to me because this blog has a higher chance of attracting a more technical crowd that the average site. The number one spot is clinched by Firefox with 52.18%. Second place then of course goes to Internet Explorer with 33.88%. If I take the same browsers combined with the operating system, I end up with the following list:

  1. Firefox / Windows: 39.74%
  2. IE / Windows: 33.88%
  3. Firefox / Linux: 9.71%

Conclusion: Firefox is the leading browser on this blog on all major operating systems (Mac is further down the list with 2.74%) and thus also overall.

But what really surprised me was the browser that clinched the number 3 spot overall. My guess would’ve been Opera and while it did come close, it was just beaten by Google Chrome. I guess this shows what a strong brand name can do. I’m curious to see how Chrome’s percentage will evolve.

For the record: Safari came in fifth.