Chris’s SharePoint Reflections

Just another weblog

  • Chris Zhong

    IT consultant Australia

  • Advertisements

Archive for April, 2008

Call or Fold – CQWP

Posted by chrissyz on April 27, 2008

Content Query Web Part is a powerful web part in MOSS 2007 publishing sites. Unlike the Data View Web Part, it can easily query across lists within the same site collection and centralize the content in the presentation layer regardless of where it resides. You can query the content of particular type and filter it using various criteria and targeting scenarios as well. As it produces XML you can separate the presentation layer from the data layer and format the output using XSL. Despite its powerful query & content refinement option, CQWP is always being argued about its application in the real word. I reckon the reasons are as followed:
1. OOTB limitations:
• It cannot query across site collections
• It cannot query across different content types (you can overcome it by modified the QueryOverride and ListOverride in the exported webpart, but it is not OOTB and the different content types you try to query against have to be the same Base Type)
• It can only query against single-value look up or choices
2. Looks & feel Customization:
Although highly customizable, the recipe involves editing the style sheets (XSLT) for the CQWP. The CQWP uses three different style sheets for rendering the content set up to be displayed. By default these three are: ContentQueryMain.xsl, Header.xsl and ItemStyle.xsl. They are all located in SharePoint Style Library. There is a good article on how to customize the display for a Content Query Web Part.
These looks & feel customizations will definitely involved a developer who is familiar with XSL (or at least willing to learn) and going through a non-browser UI (The debugging process can be really, really painful).
3. Deployment
Another holdback is the way CQWP being deployed as it includes the custom XSL styles. Well, customizing the ItemStyle.xsl file is all right in the dev environment, it is not something that is preferable when deploying your solution to the production environment. One reason is that you are not supposed to modify through your custom Features any file provisioned by another Feature, another reason would be it will affect ALL the instances that use it. In the real world, “ALL” is a very dangerous word and not many people like it. It is always best practice to customize for a specific instance. The work around will be to provide your own CustomItemStyle.xsl containing the required templates and export the CQWP, changing the reference to point to your own custom style sheet. That means more work for developers, more errors prone to happen, and more maintenance for the administrator.

1. CQWP will be best utilized by Power Users. Using OOTB CWQP features such as audience targeting, content filtering to drive the enterprise content organization and administration is the best way I see to utilize CQWP. For example, you can have a Content Query that displays all files that have been changed in the repository each day. Or a list of all files modified by a particular user, or those that contain specific keywords, etc. Maybe you can use it as a complementary component for Search as well. 🙂

2.  While DVWP excels at single –list view customization, it is a one-off customization that must be done each time in SPD. I will still recommend customized CQWP if your portal relies heavily on some reusable web part across site to display filtered views of items stored in sub-site library. However, heavily customization is not suggested (I can’t come up with any scenario that can only be achieved by CQWP other than custom web part at the moment). Unless you really love to coding against XSL.

3. Last but not least, make consideration of your company’s content management needs upfront, think about the content schema and filter fields, tagging and audience before start using CQWP (a checklist or chart will do). Leverage CQWP from business application context and make its use strategic.


Posted in CQWP | Tagged: | 3 Comments »

Blog away with SharePoint

Posted by chrissyz on April 27, 2008

 “What’s it going to be then, eh?”

The most quoted sentence in my favorite movie “The Orange Clock”.  I guess lots of people will pop up the same question for SharePoint just like me

First introduced in 2001 as SharePoint Team Services, then as SharePoint Server in 2003, now the much more mature and pro-enterprise Microsoft Office SharePoint Server 2007 is making major inroads within large corporations as the base for collaborative applications. Microsoft has stuffed BI, search, form services, workflow automations and content management capabilities all into MOSS this large playground. What you can do with it? You can work it into almost anything.

Yes, people want choices. It is one of the things Sharepoint fascinates me. Playing with all sorts of possibilities, try to get the best bid out of it. But this is a double-sword: either it can be a competitive advantage and innovation catalyst for the business or it can be another layer of chaos sitting on your already complex enough enterprise system. It is not an easy game, but I am sure you don’t want to (and can’t afford) to miss it.

Being an IT consultant, I inevitably need to work with SharePoint from time to time.  I start this blog to share some of my thoughts on SP during my daily work. Special thanks for my good teacher and friend Patrick Tisseghem’s inspiration and encouragement. Enjoy the reading.


Posted in General | Tagged: | 1 Comment »