Friday, March 12, 2010

Sitecore Fetch Squad

Automated crawler fetching websites and blogs from Sitecore content

Archive for January, 2009

Comprehensive Configuration Guide

Posted by admin On January - 29 - 2009
We have published the configuration guide for Sitecore 6. The document was in the draft state for a while and now it is officially released after thorough review. It covers multiple configuration options as Sitecore is pretty flexible in that perspective. The set of databases for the content delivery instance can be reduced to only one "web" and the size of this instance in default configuration

Consulting and Supporting Sitecore Developer Community

Temporary files, again….

Posted by admin On January - 29 - 2009
So about a month and a half after blogging about this very issue, here we go again. This time I wasn’t thinking very deeply about things, so when I tried to install Update 8 and got hit by a File Exists error I contacted Sitecore Support.
Luckily these guys are not without humour, and referred me back to my own blog post for a fix LOL ;-) 1 : 0 to Sitecore Support.
As can be seen, apparently all of these files were created 14/1. Now I have NO idea what I was doing that particular day, but I was wondering…. anyone else having this problem or is it just something really messed up on my development box here?
Gonna get to the bottom of this, one day… :P

Into the core

typesThatShouldNotBeExpanded

Posted by admin On January - 29 - 2009
After having ran into this myself a few times, and for the 5th time being asked by one of my Sitecore friends; I though I would bring this one up.

Ever had trouble getting your ASP.NET ListView controls to retain ViewState or do standard Paging?

As many of you will know, Sitecore’s web.config is a source of endless configuration fun. Sitecore’s modular nature is basically founded on this configuration - want to switch something around or change how Sitecore works (at your own risk, usually, but that’s ok)? Web.config is the place to go.

Many of the settings are self explanatory and well commented, so working out what they do is fairly straight forward. In some cases, they are not, however.

If you look through, you will find an element named “
typesThatShouldNotBeExpanded”.

In it you will find two entries:

  • System.Web.UI.WebControls.Repeater
  • System.Web.UI.WebControls.DataList

And while I don’t have enough insight into exactly HOW Sitecore ties in to the ASP.NET lifecycle to determine exactly WHY this setting is needed, I can however tell you what happens if you don’t fully control it.

Say you have a control, where you drop in an ASP.NET ListView Control. Or a GridView control. They’ll appear to work fine at first, but you’ll quickly notice that paging and viewstate is acting up a bit on your controls.

The fix for this is easy, and as far as I know this is well known by Sitecore Support. Add your controls to this - almost black magic like - web.config setting, and you’re set :-)

So

Add System.Web.UI.WebControls.ListView, and System.Web.UI.WebControls.GridView to this collection if you find paging, viewstate or other things “that normally works” doesn’t.

I don’t know when this setting was introduced, or even IF there is a reason Sitecore doesn’t include these common controls in the list. Maybe there’s a negative effect on performance or otherwise.

Searching on the web only produces this one link (searching on SDN, two results but similarly without explanation), and that doesn’t tell us anything else than the config setting was apparently introduced in Sitecore 5.3.2 071220.

Into the core

Sitecore Australia and NZ User Group established

Posted by admin On January - 29 - 2009

Yesterday Sitecore Australia announced the opening of the Sitecore Australia and NZ User Group (SCAUG). The user group will be the central meeting place for Sitecore developers in the region and contains lots of valuable information and a mailing list for developers to communicate with each other.

The user group was rolled out by Sitecore Australia, but is from now on led by Alistair Deneys, Sitecore MVP.

You can join at http://scaug.sitecoreaustralia.com.au.

Philipp Heltewig

Is your vendor becoming a fine young cannibal?

Posted by admin On January - 29 - 2009
"Channel partners" are consulting or integration firms that implement
or provide supplementary services to a software vendor’s technology. They are
ubiquitous across all the technologies
we cover
, and in fact tend to generate substantially more revenues than
the vendors themselves. This makes vendors envious, and sometimes their baser
instincts take over.

Consider the case of Web CMS Vendors Ektron
and Sitecore, fierce
competitors in the mid-market who both issued formal praise of their channel
partners earlier this month.

Ektron announced a partner
engineering group
and touted
one-hundred consultancies as certified
in its latest platform. Sitecore
praised
its "growing network"
and then cited
some channel "MVPs."

The timing of those announcements was kind of ironic, since we had just heard
from partners of both companies complaining about the vendors muscling in on
some of their business. Ektron’s lovey-dovey announcements followed on the heels
of a release promoting the
vendor’s own consulting services
— so perhaps they were issued
to mollify a restive channel?

There’s a cycle in vendor-partner relationships, and I’ve seen it run full-circle
many times in the last twelve years of analyzing content technologies. The cycle
goes something like this:

  1. Vendor builds partner channel to increase sales — while recognizing its
    incompetence at key collateral services (like graphic design and SEO in the
    Web CMS space, for example)
  2. Partner and vendor salespeople engage in an intricate dance with prospective
    customers — choreography that typically involves copious beer and horse-trading
  3. During a sales downturn or feared sluggishness (e.g.., now), vendor
    increasingly "cannibalizes" channel by promoting its own consulting
  4. Vendor re-discovers to its delight that basic services can be highly profitable,
    while deluding themselves that they can scale it horizontally
  5. License sales from the jilted channel predictably start to drop
  6. Vendor loses some deals and reputation by overcommitting to consulting services
    where they don’t excel
  7. Vendor realizes belatedly that margins diminish once they get beyond boutique
    architectural services
  8. Vendor hires new channel marketing rep with "fresh commitment"
    to building partner channel
  9. Initial resistance arises within vendor consulting team, but the rest of company
    finally comes along after multi-month delay
  10. Some jilted partners get back in the game with idealistic new salespeople
  11. Vendor dips into bottomless well of consulting and integration firms to
    recruit new partners
  12. Everyone returns to Step #2

In the case of Ektron and Sitecore, the story will vary from country to country.
It’s the same with a lot of other WCM and ECM vendors: their channel posture
may differ in North America than say, EMEA or Asia-Pac.

As a customer this all might seem like insider talk, but you
need to be aware of the dynamics
when starting or renewing a vendor relationship.
As we’ve counseled repeatedly in these pages, "partnerships" can take
many forms. Ultimately, managing your suppliers to best effect remains your
responsibility.

CMS Watch Sitecore Feed

Contributing to Sitecore Shared Source Projects

Posted by admin On January - 29 - 2009

The following tips for working with Sitecore shared source are based on my recent experience contributing the FieldValueComparer (based on to the comparer in this post) to the Sitecore Shared Source project.

  • Review this introduction to contributing shared source to obtain access to Subversion or to request a new project room.
  • Each project room is basically a Wiki. The only way back to the list of project rooms seems to be http://trac.sitecore.net/Index, so most project rooms include this link.
  • Review this guide to contributing shared source.
  • Copy files into the Trunk directory and check them in.
  • I don’t like learning a new markup, but when editing the Wiki:
    • It seems to format linefeeds as HTML paragraphs or line breaks.
    • Use equals signs for major headings (the spacing seems to be important): 
      = heading =
      
    • Use more equals signs for minor headings:
      == heading ==
      
    • Preceed text with an exclamation mark to avoid the Wiki automatically creating a link:
      = Welcome to the !ProjectRoomName =
      
    • Wrap URLs with quare brackets, optionally followed by a space and the text of the link:
      [http://sitecore.net Sitecore Marketing Site]
      
    • Wrap code with three curly braces to preformat it for easy copy and paste:
      {{{
      // code
      }}}
      
    • You can create entries in numbered lists by entering a space character, a number, and a period on a blank line:
       1. First.
       2. Second.
      
  • Please report issues and feature requests for shared source components by posting on the Shared Source Modules forum on the Sitecore Developer Network.

I will try to maintain this list and the FieldValueComparer project room as a template for cutting and pasting when creating new projects.

John West Blogs about Sitecore

Sitecore Configuring Production Environments Guide Published

Posted by admin On January - 29 - 2009

Sitecore published a guide to Configuring Production Environments. I updated my post that provides links to the best Sitecore documentation.

John West Blogs about Sitecore

Sitecore blogs, now all neatly indexed

Posted by admin On January - 29 - 2009
Mark Van Alst from Evident in The Netherlands have made a very nice site over the Christmas holidays which utilizes Google custom search to index over 30 Sitecore related blogs. Check it out here: http://www.sitecoreblogsearch.com/   Original post by Mark: http://www.markvanaalst.com/2008/12/26/custom-search-for-sitecore-blogs/ Well done!

Sitecore on the road

About Data Driven Websites and Object Relation Modeling

Posted by admin On January - 29 - 2009

I’ve reinstalled my machine of last night with Windows 7. I’m very happy with this new platform… Thank you Microsoft. One of the final reasons to start yesterday was that my database integration in Visual Studio was broken. Of course there where many more reasons, but that was the issue which made me do it yesterday evening.

So far so good. This morning I started of with a clean and very fast machine. Visual Studio 2008 was ready to roll. I’ve installed the Developer Edition of VSTS yesterday eve.

Today I decided to spent a little bit of time on getting the Entity Framework to work for a small, highly data-driven portal I’ve to develop. One of the issues with the portal is that it should be ready by yesterday. Not so much pressure, but I wanted to be highly productive. Unfortunately I’m highly disappointed.

While we all still claim that simplistic data driven websites should be online in a couple of hours, the truth is the opposite. I’ve got an app where you’ve got users. Users can be in a WorkGroup and some of those these users are leaders of the group. In objects:

  • User.WorkGroups –> List<WorkGroup>
  • WorkGroup.Users –> List<User> –> All users associated, incl leaders.
  • WorkGroup.Leaders –> List<User> –> All leaders

In the database you’ll store this as 3 tables: User, WorkGroup and an AssociationTable with a property ‘IsLeader’ (bit).

The database design was easily made, as I told you before, I decided to use the Entity Framework. But somehow I was absolutely unable to get this to work. I could get the User <-> WorkGroup(many to many relation) to work, but the Leader-relation couldn’t be made without modifying the generated code(or maybe the XML?). 

I’m sure one of you guys will give me the solution how to get this to work. And once again absolutely sure that this is not impossible. But I’m in general wondering why I couldn’t figure this out during the 2 hour R&D I’ve spent on it. The designer doesn’t seem to support something like that. Or it is hidden, somewhere. I’m not sure if this is just a limitation of the Entity Framework or of many O/R mappers.

I do know I generally dislike my whole process. I’ve been switching over and over between the different designers for my entities and database. This makes me wondering. What if this is your daily task? Getting a model designed by business users(interpretation I), normalize this(interpretation II), fit this into an object design(interpretation III) and maybe redo some of these part during one of the stages.

Let’s look from a perspective of a developer. I do not care about the database. It should just be stored. I care about the way I can access the data, so I want to control the types in my entities. My illusion: create a model(we’ve got a language for that: UML). Hit a button, and code + database should be ready.

Optimizations for storage and in the data access code should be done by the generation. The computer is way smarter when it comes to optimizing, it can calc all data access roads and ask if I want to flag more often used data. When I want to create a specific method(for example: GetById) I can define it in OCL.

The solution seems to be so obvious. Why can’t I find such a tool? I can find database generation tools, I can find O/R mappers. I can even find frameworks which should be O/R mappers(isn’t the Entity Framework the framework to be?). But none of these support my vision.

What can I do know? I can use a CMS to store my relational data. All my relational data, maybe thousands of records. I’ve to find a way how to store it internally as CMS’s use all kind of structures, but never a relational one.

I’ll end up in this project using an heavily modified Sitecore installation with lots of custom code to get around the limitations(I’m able to write that quickly as you can imagine). But hopefully you’ve seen my point. I gives me a huge headache in this age of data generation, web service generation for out scaling, advanced cache structures, cloud computing, etc.

Do you got a solution in mind for me?

Note: This is a post written out of my experience as an architect in many projects. I’m involved in general in Sitecore projects, but rarely I’ve got the opportunity to ‘work’ a little outside of this boxed environment. Often these high level problems arise as well in project where Sitecore is involved. I won’t blame a vendor, but I’m wondering why we smart guys are not able to solve issues like productivity without doing concessions on the business requirements.

.Sitecore

Custom Sitecore fields and master templates

Posted by admin On January - 29 - 2009

For a client I had to write a custom Sitecore field. The field was to contain a number that incremented every time a new item using the field was created. I created the field and so that they could seed the number created a Sitecore item that contained the current highest field number.

This worked great for a few days but then during testing for some reason the field stopped incrementing and always used the same number. After a bit of investigation I realised that this was caused by a value being set on master template. My code worked by checking to see if the field had a value and if not setting a value using the seed:

 	    if (!Sitecore.Context.ClientPage.IsEvent)
            {
                this.isEvent = false;

                if (string.IsNullOrEmpty(this.Value))
                {
                    this.Value = GetNewValue();
                }                            

                this.Controls.Add(_SeedValue);

                _SeedValue.ID = GetID("SeedVal");
                _SeedValue.Enabled = false;
                _SeedValue.Disabled = true;
            }
            else
            {
                _SeedValue = FindControl(GetID("SeedVal")) as Edit;               

                this.Value = _SeedValue.Value;
            }

What my code did not do is check that the current item being editted was not a master. To do this I had to add the following:

private bool IsMaster(Item item)
{
	if (item == null) return false;
	else if (item.ID == new Sitecore.Data.ID(new Guid("{BAD98E0E-C1B5-4598-AC13-21B06218B30C}"))) return true;
	else if (item.Parent != null) return IsMaster(item.Parent);
	else return false;
}

This method checks to see if the current item being edited is a descendant of the Master item. The guid in the method is the guid of the Master item. Unfortunately you can not check the template of master of the item being edited because a master is based on the template that it is the master for and is not made from a master itself.

The main code then changes as follows so that only if the field is blank and not a master should a value be generated:

            if (!Sitecore.Context.ClientPage.IsEvent)
            {
                this.isEvent = false;

                Item edittingItem = Sitecore.Configuration.Factory.GetDatabase("master").GetItem(this.ItemID);

                if (string.IsNullOrEmpty(this.Value) && IsMaster(edittingItem) == false )
                {
                    this.Value = GetNewValue();
                }                            

                this.Controls.Add(_SeedValue);

                _SeedValue.ID = GetID("SeedVal");
                _SeedValue.Enabled = false;
                _SeedValue.Disabled = true;
            }
            else
            {
                _SeedValue = FindControl(GetID("SeedVal")) as Edit;
                this.Value = _SeedValue.Value;
            }

Also be sure to use

Sitecore.Configuration.Factory.GetDatabase("master").GetItem(this.ItemID);

If you try to use

Sitecore.Context.Database.GetItem(this.ItemID);

You will have problems because the current context is set to the Core database.

Mike’s Blog