Monday, February 6, 2012

Sitecore Fetch Squad

Automated crawler fetching websites and blogs from Sitecore content

Archive for February, 2009

Session State and the Integrated Pipeline in Sitecore

Posted by admin On February - 18 - 2009
Currently (release 090120) Sitecore has a known issue when it comes to running in the new IIS7 Integrated Mode pipeline.

The issue states:

“The ASP.NET session state may be unavailable to web page’s code depending on the URL used to access a Web site’s homepage. This occurs with a short URL, such as http://mysite.com/, while longer URLs, such as http://mysite.com/default.aspx do not encounter the issue. “

It actually goes a bit further than that. I did some testing on a completely fresh 090120, Created “Test1″ under “Home”. And then “Test2″ under “Test1″. Like so.

Sitecore
- Content
- – Home
- – - Test1
- – - – Test2

I set up my website to run 32 bit Integrated Pipeline, with a binding to host header “integrated”. I then added some test code to the Sample Layout.aspx, like so.

%
string lala;
if ( HttpContext.Current.Session != null )
lala = “Session has value”;
else
lala = “Session is NULL”;
Response.Write( lala );
%

(Extremely bad coding practice however, don’t do this in any real scenario :P Breaks preview and page editor and whatnot… was just to test)

Now, after navigating to the following URLs, I was getting these results.

http://integrated/ “Session is NULL”
http://integrated/default.aspx “Session has value”
http://integrated/test1 “Session is NULL”
http://integrated/test1.aspx “Session has value”

Ok so. A known issue and according to Sitecore Support, no immediate ETA for a fix.

Why would you want this however? Well let’s consider SEO. Often have I been met with the requirement that SEO friendly URLs are required. And for some reason, SEO specialists seem to think that http://integrated/products/classical-piano is a better URL than http://integrated/products/classical-piano.aspx. Whether they are right or not, I leave with someone who knows more about these things than I do. Bottom line is, I needed these types of URLs for a client of mine.

And I was curious :P

According to Microsoft, the list of Breaking Changes for Integrated Pipeline isn’t all that long, and none of those stood out to me as something that should be affecting Sitecore.

After much digging around, searching the web and reading lots and lots of articles about this new Integrated Pipeline – many of which was full of praise but none really helping me in any way – I finally came across something from someone who knew “what’s what”.

ASP.NET Session State for Native HTTP Requests in IIS 7.0

Upon reading, I felt 99% sure this was the fix I was looking for. A bit of coding, and a bit of optimisation (read through the comments) and I was ready to give it a shot.

And it worked :-)

A bit of coding (or rather, code pasting), a compile, a simple web.config change and voila. Now all of the above URLs seem perfectly happy to give me the Session State I’ve come to rely on.

If you can’t be bothered to set up a project for this yourself, I’m attaching the project and the DLL. Just plop the DLL into your /bin folder and add the following to your web.config at the end of the system.webserver/modules node.

add name=”CorePointIntegratedSessionFix” type=”CorePoint.IntegratedSessionFix.Module, CorePoint.IntegratedSessionFix”

remove name=”Session”

add name=”Session” type=”System.Web.SessionState.SessionStateModule” preCondition=”"

(excuse the markup, I am REALLY not happy with my blog texteditor.. but that’s a story for another day)

And the project file here:

CorePoint.IntegratedSessionFix.rar

Enjoy :-)

Caveat: Be aware however, I don’t have the resources to execute a complete regression test of this fix. It seems fine, but there could be repercussions that I am not seeing at this stage. I have an open support ticket with Sitecore Support on this issue; and I will post these findings there for their review.

Will update if needed.

Into the core

Expert Systems

Posted by admin On February - 18 - 2009
I know many of you follow this blog, but today’s entry certainly did bring back memories.

Those of us who worked when the IT industry (or maybe just the Internet industry, I am not THAT old :P ) fired off probably all have some terrifying tale to tell that resembles todays entry in TheDailyWTF. Be it some director’s nephew “who was a genuine whizkid with websites”, old-skool Mainframe programmers adjusting to the new wave of computing or whatnot.

Fortunately, these days, this phenomenon is pretty much a thing of the past. Mostly anyway. IT/Web projects have become business critical and are therefore generally regarded as something best left to proven professionals with at least something of a track record. But even professionals get it wrong.

If we look at the article, Victor is probably what WTF describes as “A Complicator“. In summary, described as:

“There are some so deeply embedded within The Complicators, that they’ve acquired a sort of sixth-sense: the ability to find meta-problems (“a problem with the process of creating a solution for the actual problem”) in virtually any solution. As we’ve all seen, the systems that these developers create often end up as a barely functional application comprised of a Matryoshka-doll-like nesting of problems and solutions.”

And this would all be funny if the most recent experience I had with such a type was “back in the 90s”. It was actually very recent.

As a Sitecore consultant (as in, a consultant working with the Sitecore product, not to be confused with a consultant working for Sitecore) I was recently tasked with what looked to be a very straightforward assignment. The client had oversold (which is impressive given the current state of financial affairs) and needed an extra pair of hands to wrap up some loose ends on a few existing projects and then help on the implementation of 1-2 new sites from scratch.

The client didn’t have years and years of experience in working with Sitecore, and therefore already had another professional Sitecore consultant on the task. He apparently came with an impressive track record, a good friend of the house and so on. All in all, this was promising to be a sweet deal and I was looking forward to it.

The first week or so, I would be working on my own. No problem. I mean, that’s what one would be thinking, no? Almost complete site, just a few issues with some “Related People” not showing quite like the client wanted it. Sounded like straight forward filtering to me, or possibly adjusting a few queries.

I should know better by now, that to jump to conclusions ;-)

Much to my surprise, when I started digging in, I found a Sitecore implementation unlike anything I’ve ever seen before. And I’ve seen quite a few. Both done in companies I worked for, in clients I’ve contracted to, in solutions I’ve been tasked to review. I was confident in my belief that I pretty much had this thing called “Sitecore” nailed and nothing could truly surprise me to any real extent.

Well how about this then. Ever seen a entire Sitecore site done in just 1 rendering sitting hardcoded into 1 layout? Ever seen a Sitecore site with 3 layers of inherited templates (65 of them in all, just about) yet the ENTIRE site consisted of content items ALL based on just 1 “Mega Template” (aptly named “Page”)? And being designed like this, ever tried to explain to your end user why there are 50 fields, and depending on what values you define in some of them, other fields need to have specific values set?

Complicator indeed.

We’re not talking a simple website here either, mind you. While it is difficult to rate the complexity of a website, it had all the bits you would normally expect today. Content pages, menu structure, left hand navigation, right hand spot elements, you know. The works.

Ok so. With the issue at hand; “Mr. So and So displays BELOW Mrs. This and That on the People Page. We need the order to be reversed” I started investigating. Now what probably should have been a 30 minute task ended up taking a couple of days of my time. Backtracking through an immense hierarchy of included XSLT renderings, mode=”whatIneedNow” switches and so on – just to get a basic overview of how this Expert System was actually producing page output. Must be my limited mental capacity shining through, or me getting old or something. Or both ;-)

See to build a site like this, essentially bypassing everything “Sitecore” except for perhaps “Sitecore-as-an-advanced-field-editor”, one needs to come up with an alternative system. Enter “The Meta System”. A sophisticated hierarchy of tags, metatags and content “blobs” which users could then (in theory, at least) tag up and ultimately have displayed on the site. See there was a “PeopleLister” meta component, an “Office” component, and if you happened to tag everything up just right – you would eventually get information out on your site. All generated by the very clever rendering Expert System. And as for the problem at hand, I guess the system didn’t really consider the order People needed to be presented. Worse yet – this changed from time to time. Sometimes an alphabetical list of All People was needed, and sometimes the order (as in the case I was tracking) followed “silly business rules” (this is an actual quote).

A week came and went, and I finally had the chance to confront my colleague-consultant. While my first inclination was to ask “WTF!?” I did start on a more subtle approach. After all, being a visitor to the client a consultant is expected to show some degree of humility – maybe they preferred it their way.

Turns out they did.

Q: But what about the Page Editor? Surely clients must have seen a Sitecore demonstration, Nicam or otherwise, and expect this to work?
A: Nah, noone uses that anyway. It’s not imporant.

Q: Ok. So what about caching? Sitecore has little chance to implement much in terms of useful caching when all it sees is ONE rendering on ONE layout?
A: That’s not important. Servers are so quick today anyway.

Q: Umm ok. Well then what about user security? How will you assign permissions in this hierarchy of metadata – controlling which users can actually access/change/delete what?
A: We just give everyone “Is Administrator” permissions and write a guide. If they break anything we can always restore back.

Q: Aha. Well how about integrating other Sitecore modules, like for eCommerce, SEO and so on?
A: It can be done. Or we can just install those on a separate installation and run it on a sub domain. That’s what the users want anyway, not to complicate things.

Some may think I am kidding, sadly this is not the case :P Not to complicate things….

Sitecore Support, you have my heartfelt sympathies. I certainly hope you don’t get many of these cases dumped into your support tool. And if you do, kudos for what must be endlessly much more patience than I have myself. After these initial rounds in the ring, everyone decided it was probably best I went on to greener pastures and left them to it ;-)

Let me end this by pointing out what I have already pointed out in the past; please DO be aware that Sitecore is putting great effort into publishing guidelines, best practices and “Cookbooks” for how to approach Sitecore site implementation, development and handling.

They’re all on SDN. I haven’t had time to read through ALL of them yet (shame on me); but if anyone has – is there a definition for Expert System in there? ;-)

Into the core

Language embedding in urls

Posted by admin On February - 18 - 2009

Hey there,

Sitecore 6 provides a functionality to embed your language as parts in the url e.g. http://www.test.com/en-US/test.aspx.

You can control this feature by using the web.config entries:

<linkManager defaultProvider=”sitecore”>
   <providers>
    <clear/>
    <add name=”sitecore” type=”Sitecore.Links.LinkProvider, Sitecore.Kernel” addAspxExtension=”true” alwaysIncludeServerUrl=”false” encodeNames=”true” languageEmbedding=”asNeeded” languageLocation=”filePath” shortenUrls=”true” useDisplayName=”false”/>
   </providers>
  </linkManager>

Cheers chris

Breaking xslt paradigm

Posted by admin On February - 18 - 2009

Hey guys,

writing xslt is some kind of special, isn’t it? As a original developer who started with php need to pay special attention to the xslt paradigm.

In my case I have a dropdown navigation with two columns after each 4 items where you need to split the current div tag into a new.

You can’t do something like this:

<xsl:if test=”position () = 4″>
</div><div class=”Submenu”>
</xsl:if>

Right?

The solution is some kind of “hack”, so only use this if you have tried to think over your code and another solution.

<xsl:variable name=”divider”>
  <![CDATA[</div><div class=”Column”>]]>
</xsl:variable>

Now you can do:

<xsl:if test=”(position() mod 4) = 0″>
  <xsl:value-of select=”$divider” disable-output-escaping=”yes”/>
</xsl:if>

Enjoy ;)

Sitecore query in template source fields + language

Posted by admin On February - 18 - 2009

Hey guys,

if you have:

  • A template with a dropdown (or droplink field)
  • A second template with a checkbox field

You want to have: An item based on the first template with a dropdown where only items are displayed which have the checkbox checked.

My source is:

query:/sitecore/content/home/Site/#Ueber-Uns#/Team/*[@is contact=’1′]

First you have to keep in mind that item names with “-” dashes should be covered by “#” else you get the exception: Invalid lookup source …

Second (if you operate with a second language – here: german): If you don’t get any results, mark the checkbox as shared. In some way the query doesn’t select the correct language from my point of view.

cheers chris

Sitecore released Sitecore 6.0.0 rev.090120

Posted by admin On February - 18 - 2009

Hey guys,

just a short note: Sitecore has a new recommended version of Sitecore 6 (Sitecore 6.0.0 rev.090120). I will update all of our Sitecore webs as soon as possible.

Enjoy! :-) cheers chris

Sitecore Download Section

Hey guys,

at the moment I’m facing a really strange and annoying issue using versions in Sitecore 6.

Version numbersIf you want to add a second version to an item, how do you do this? You go to the version tab and click “Add”, right? Yes! (Of course there are other ways,….) Unfortunately you get more than you want to have. In my case you have a new version called “2? – but two times (!). Check the screenshot.

If you look into the database directly by using a select statement:

SELECT * FROM dbo.VersionedFields

You will get the hint that the two version don’t have the same values in every field. The language field says “de-de” for a couple of items and de-DE for other ones.

After creating a support case at the official Sitecore Support we got the solution by converting the different values to the same by using the sql statement:

UPDATE dbo.VersionedFields
SET Language=’de-DE’
WHERE Language=’de-de’ COLLATE Latin1_General_BIN

… a couple of days later ….

We have the same issue again! Annoying!

The facts:

  • It cannot be a displaying bug, because:
    • I directly triggered the sqlDataApi to get the versions => 3 versions / 2 version numbers
    • I checked the sql table directly and got the versions
  • I switched the Sitecore Installation to a new and clean installation and just connected the corrupted databases => Same issue
  • I disabled the Cache.GetVersions() method (by stepping directly in it) => same result.
  • I created a new version programatically and have the same result

After the Sitecore Support searched my web.config, they pointed me to my sites config and that the language parameter got the value “de-de” (it has to be “de-DE”), but this cannot be as well. We have been working with that Config from the beginning (approx. Aug 08), but we first experienced this in Dec 08.

So, what did we changed? At the moment I’m not looking at software updates (not yet!) – I remembered that we set up the PublishAgent in the web.config with that configuration:

<agent type=”Sitecore.Tasks.PublishAgent” method=”Run” interval=”02:00:00″>
 <param desc=”source database”>master</param>
 <param desc=”target database”>web</param>
 <param desc=”mode (full or incremental)”>incremental</param>
 <param desc=”languages”>de-de</param>
</agent>

Could that corrupt our database? I’m not sure, because after solving the problem by using the sql update statement and changing the auto publish to 2 minutes I cannot reproduce this issue locally.

Okay guys, if any one have some hints just give me a buzz. I’m still trying to reproduce and solve it forever!

cheers chris

The Solution:

The Sitecore Support guys are the best and really fast… The solution is that simple I have never thought about. My web.config have the values de-de instead of de-DE! You can reproduce this by creating an item and change the publish restrictions. If you have the correct values in your web.config you can’t reproduce this behaviour. That simple!

So, please set your web.config language values to the same you have in your sitecore/system/language tree! Case-sensitive!

(The Support also registered this as a bug for the current version.)

Thanks to the support at this point!

HTML 5.0 – The Next Generation…

Posted by admin On February - 18 - 2009

Finally, after 10 years of HTML 4.01, a W3C working group is going to publish a new HTML standard, hopefully cleaned up and bringing more "native" support for the Web Applications without the use of JavaScript for standard behavior (like editing, drag’n'drop and so on). The following Working Draft summarizes the differences between HTML 4.01 and HTML 5.0.

Julius Ganns . netzkern

GTD 1.1 – My Personal Tips After More Than One Year…

Posted by admin On February - 18 - 2009

When I started reading Getting Things Done back in 2007, I would have never expected it to change the way I work that fundamentally. There are those things that immediately kick in and help you to structure your day like the Mastering Work Flow Model, but there is even more to GTD than that basic process. This post is about the things I learned in the last 1.5 years and that are easily forgotten.

When you start to implement GTD, especially if you’re a techie like me, you will immediately create all these fancy lists, install all these feature-rich tools and register for every web 2.0 productivity application you can find. This "learning by playing around" is an important part of getting familiar with the methodology.
In the beginning, your new tools and your new process will definitely slow you down. And that’s okay, because you have to find your way of doing things without violating the core GTD principles. Just remember yourself from time to time, why you’re doing the whole thing. GTD is not your new hobby. It’s not a new reason to procrastinate. And it’s definitely not your new purpose of life.
You’re implementing this productivity process to get more done with less thinking and with less effort. Don’t stumble around and rework your GTD infrastructure every week by setting up new tools, creating more rules or cramming more fancy "appointments with myself" in your calendar. At some point you should be done with your system (at least for a certain amount of time) and return to the really important things.

Tip #1: Allow yourself to have fun with GTD. Cut yourself some slack and experience with your new process and your new tools. But make sure that you don’t get lost in the fancy world of GTD tools and practices. Don’t forget the reason you’re doing all this stuff.

Playing around is also important because it helps you with another important thing: Do one step at a time. In the very beginning implementing GTD "to the fullest" seems to be the greatest thing on earth. Trust me, doing it all at once is not possible. Give yourself time to learn, to adjust and to integrate the principles into your life. GTD (and every other "habit") only sticks if it fits naturally in your day, without distracting or hindering your way of doing things.

Tip #2: Do one step at a time and keep it simple. GTD is a simple thing, but reading about it and implementing it is not the same. Give yourself the time to learn and don’t overwhelm yourself.

Another common problem is the thing with the weekly review. I am aware of that because I had it myself. I put in on my calendar, I wrote reminders and I read numerous blogs about the importance of the review process, but I just never really did it. I talked to my friends who are also familiar with GTD, but their response was even more frustrating: No, I don’t do it and I don’t think it’s really that important.

It was about that time I also discovered my enthusiasm for Steven Covey, especially The 7 Habits of Highly Effective People and First Things First. The latter one also contains great productivity and time management principles, but instead of starting at the profound organizing level, it helps you to get a new perspective of your life and focus on those things that are really important for you. One of these principles is "Plan Weekly – Adjust Daily". While reading that particular chapter, it suddenly hit me: Why do you always try to do your "Weekly Review" Friday afternoon? Why perform such an important control task when you are exhausted from the week, tired, looking forward to the weekend, hungry and already mentally out of the office?
So I decided to merge my "Weekly Review" with my "Weekly Planning" appointment, Monday Mornings at 10:00 AM. It worked great. I was able to review all the stuff I had and hadn’t done in the last week with maximum energy and because of that, it usually didn’t take longer than 10 minutes. It also helped me to plan my upcoming week more accurately by defining new projects and actions.

Driven by the success of my idea, I even decided to create a recurring breakfast meeting with all executives at netzkern before my personal Weekly Review and Planning session, every Monday at 9:15 AM. This so called Central Operations meeting still exists and it is a great establishment. So this brings us to our first tip…

Tip #3: Do the Weekly Review. It’s not only important, it’s critical for the successful implementation of GTD, especially in corporate environments. In the beginning, you may be able to manage a smaller amount of projects without it, but the earlier you start to review your stuff, the better. Set aside 15 to 30 minutes per week and make sure that you’re neither tired nor have something "more important" to do at that moment. Use the Weekly Review to plan your upcoming week as well and start right away afterwards with the most important thing on your updated list, ideally one that helps you to conquer one of your "Big Rocks".

As I mentioned earlier, there is more to GTD than just the Mastering Work Flow Model. It is more than just projects and actions, although most people might perceive it that way. GTD also includes two higher level models that are easily forgotten, yet they are even much more powerful.

The first one is called the Natural Planning Model and is intended to help you with the management of all kind of projects. David often refers to projects as "everything that needs more than one action to complete". The problem with that sentence is that because of that statement, a lot of people tend to think of projects primarily as "containers" for actions. But in GTD, projects are much more than that, especially when they do not have a clear outcome or already defined next actions.

I will not repeat the Natural Planning Model here, but I want to make sure that everybody understands how important this part of GTD really is. Following its five step process, Purpose and Principles – Vision – Brainstorming – Organizing – Next Actions, is a great way to conquer your own thoughts and I do it every day.

Tip #4: Don’t stop halfway between, there is much more to GTD than the Mastering Work Flow Model. Study and implement the Natural Planning Model and the Horizons of Focus Model for maximum effectiveness and efficiency in your day-to-day productivity work.

Alright, these are my most important tips so far. I could go on a while longer, but instead of just telling you about them, I find it more important that everyone experiences certain parts of the learning process himself. In the end, I really recommend that you read GTD at least twice and maybe revisit it every couple of years. It gets better every time…

Julius Ganns . netzkern

The Power of Disconnection

Posted by admin On February - 18 - 2009

Everyone knows, I’m a pretty “connected guy”. I have several Notebooks, Netbooks, PDA’s, my iPhone, my HTC smartphone and plenty of other gadgets that are usually constantly connected to the internet. There is practically no IM service and no community I’m not registered at. Although this perception is largely correct, several years ago I discovered that while these communication services can make your life a lot easier and they help you to stay in touch with your people, they are usually a real productivity killer and a constant distraction.

Let’s be honest, 95% of all IM conversations, community messages and even most of your emails fall in one of two categories: They are pretty meaningless, if not stupid -or- they contain important information that really can wait. But yet every single “connection attempt” pops up, “plings” and demands your immediate attention. That’s true for Outlook, Windows Live Messenger, ICQ and even your browser showing Google Talk or Facebook. Everything screams “here, here, read me” and implies “quick, write something back, it doesn’t matter what it is”. So most people just “take a short look” again and again and they wonder why they don’t get anything done…

So how should we deal with that? Although communication is a great thing, the first step is to disable everything… Yep, everything, just shut it off. Don’t let your IM applications connect to the internet automatically on windows startup, do not open Facebook first thing in the morning and leave it running in the back and don’t reply to every SMS right after it has been delivered to your phone. Turn off any annoying “you have new mail” notification on your desktop and for god’s sake, do not update constantly all twenty-something services with meaningless status messages like “Having fun with…”, "Just decided to…" and "Thinking about…". Trust me, nobody really cares, except those people that have the same addiction to those things you might currently experience.

The second step is to define a communication pattern that does not get in the way of your work and your life. The truth is, having all your communication service enabled all day long is like having 10 people in your office and being constantly interrupted because every 10 minutes someone asks you something. It is really the same.

My personal communication pattern is pretty strict. I have three regular times during the day on which I enable all my communication services: When I start my day at the office, right after lunch and when I leave the office. During those periods which usually last about 30 minutes, I open all “channels” to the world, check my email and chat a little with colleagues. I read through my SMS, reply to my friends and return calls. I update my twitter status, take a look at Facebook and check for new messages at studiVZ. After 30 minutes my timer interrupts me, I finish my conversations and disable all tools, sites and features completely.

Of course, this is my way and it’s only working pretty great for me. You have to find your own way, but I strongly encourage you to work more disconnected and don’t get trapped in unimportant, apparently urgent but surely mindless things. Turn off the noise in your life.

Julius Ganns . netzkern