Wednesday, April 30, 2008

Where is what in the database?

Ever wondered where things are being stored in the database? Or do you need to check that your web part contains the right information?
I've been struggling to get a good overview of the different databases and their tables. Now I've finally found it. And this it's Microsoft themselves who comes to the rescue!

Check out the Databases reference here:
http://msdn.microsoft.com/en-us/library/aa185404.aspx

This reference contains information on all tables (both content database tables and configuration database tables) and stored procedures.

Also check out Ethan Bertsch's blog post on the content database: Inspecting The SharePoint Content Database. It contains information on the most common used tables, as well as some SQL scripts on common queries. But the best part is the excellent database diagram of the content database. Thanks, Ethan.

Finally, to repeat what cannot be said often enough:
Direct editing in the SharePoint databases is NOT supported by Microsoft, and should therefore never be done. If you however need to, make sure you BACKUP your databases or farm before doing so.

Monday, April 14, 2008

Forefront Security for SharePoint with Service Pack 2

Mostly for those wanting to upgrade to Windows Server 2008, but also for those of you wanting to get the latest fixes in Forefront for SharePoint.
More information here...

Friday, March 14, 2008

Editing XSL Style Sheets - beware!

Made a discovery yesterday afternoon.
I have made some changes to my default XSL Style Sheet, ItemStyle.xsl. I'm gonna be honest, I'm no style sheet guru! But I have managed to create a few methods for formatting things, for instance formatting and displaying a date. (I found tips for this on this article.)

At first I had these methods in ItemStyle.xsl, but then I saw that these came up as alternatives in the ContentQueryWebPart Item Style dropdown list. So I thought that I would put them in the Main style sheet, the ContentQueryMain.xsl. I also changed the method names, to more alike the ones that are already there, for instance "OuterTemplate.FormatDate". And it worked! Beautiful!

But on some of sites, the SummeryLinkWebPart has been used. This is a pretty straight-forward "display my links" kind of web part. For some reason, this web part now didn't work as it should. It displayed the following error:

"Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor such as Microsoft Office SharePoint Designer. If the problem persists, contact your Web server administrator."
Solution:
After much error searching inside the definition of this web part in my site definition, I found out that the custom methods I created in ContentQueryMain.xsl, also had to be added to a style sheet file called SummaryLinkMain.xsl. This file also resides in /Style Library/XSL Style Sheets/, along with the style sheets for the ContentQueryWebPart and the RSS web part.

Tuesday, March 11, 2008

How to display all fields available in the content query web part (CQWP)

When working with customizing the Content Query Web Part (aka CQWP), you often want to know what you're dealing with. In this article I'm going to show you how you can show all the fields and their contents for all the items being displayed.

There are several suggestions out there on how to accomplish this, but here's my take. This 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:

  1. /Style Library/XSL Style Sheets/ContentQueryMain.xsl
  2. /Style Library/XSL Style Sheets/Header.xsl
  3. /Style Library/XSL Style Sheets/ItemStyle.xsl
The one we are going to focus on, is the last one: ItemStyle.xsl.

Using SharePoint Designer, open this file. Add the following template text in the bottom of the file (but before the closing tag):

<xsl:template name="ShowXML" match="Row[@Style='ShowXML']" mode="itemstyle">
<xsl:variable name="SafeLinkUrl">
<xsl:call-template name="OuterTemplate.GetSafeLink">
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<b>
Item: <i>
<a href="{@LinkUrl}">
<xsl:value-of select="@Title" />
</a>
</i>:
</b>
<ol>
<xsl:for-each select="@*">
<xsl:sort select="name()"/>
<li>
<xsl:value-of select="name()" />
<xsl:text disable-output-escaping="yes"> </xsl:text>
<i>
<xsl:value-of select="." />
</i>
</li>
</xsl:for-each>
</ol>
<br />
</xsl:template>

  • Save the file, and do a Check-in.
  • Now go back to your page containing your CQWP, Edit Page, and choose Modify Shared Web Part on the CQWP.
  • Under the Category Presentation, in the Item Styles dropdown list, now choose your new style called ShowXML. See screen shot below


  • Finally, click Apply or OK.
The CQWP will now display all the items with all the fields and their content. I've formatted the output somewhat, but as you can see from the code pasted into ItemStyle.xsl earlier, it's easy to make changes.
For example of result, see screen shot below.


That's it! There's nothing to it!

But, the point of doing this in the first place is not only to see which fields you have available. You have probably created your own fields you want to use in the CQWP. So, to make them available here, I would like to send you over to Heather Solomons' excellent article on how to accomplish this. Check it out here: Customizing the Content Query Web Part and Custom Item Styles

For more information on how to customize the CQWP and its style sheets, check out my de.icio.us bookmarks on http://feeds.delicious.com/rss/frankove/cqwp. I won't bother posting all the links in this post, since I constantly find new good links. But here are a few good ones:

Monday, February 18, 2008

Visual Studio 2005 extensions for Windows SharePoint Services 3.0, version 1.1

An update has been published to this tool. For those who are unfamiliar to this, it enables Visual Studio developers to create SharePoint elements (lists, web parts, features, etc.) directly from Visual Studio, and deploy directly to your SharePoint installation.

It also enables you to export sites and lists from your SharePoint installation using a tool called SharePoint Solution Generator. When doing this, it automatically wraps the exported elements into a Visual Studio project, ready for you to develop in.

For download and more information, check out this page on Microsoft Download.

Here's what's new for version 1.1:

  • Support for "Web Solution Package" editing
    • View and edit all solution content (no more hidden generated content)
    • Create new Features and rename existing ones
    • Reorder elements between Features
    • Check for conflicts with existing Features
    • Change Feature activation order
  • Visual Basic support
  • List Instance item template
  • List Event Handler item template
  • File System template (project file deployed to the SharePoint application file system)
  • Bug fixes

Thursday, January 31, 2008

Default values on columns


In SharePoint Portal Server 2003 and Windows SharePoint Services 2.0, default values were entered using the index on the value you wanted as, well, default. An example is given in the screen shot to the right:



In the new version, however, default values are now entered in clear text.
As I discovered in document libraries after migrated from SPS2003 to MOSS 2007, You will be prompted by a dialog box stating "The default value for a Choice column must be chosen from amongst the specified choices.



In this case, you would need to enter the text "Final" instead of the index 0 (zero).

Wednesday, January 30, 2008

Passed 70-541!

I finally got around to it. Last Friday I passed 70-541 WSS 3.0 Application Development. Yeehee!

Now on to the next one... Which I think will be WSS Configuration.

For more information on how you can get certified on MOSS or WSS, check out these pages:

MOSS 2007:
  1. MCTS: Microsoft Office SharePoint Server 2007 – Configuration (70-630)
  2. MCTS: Microsoft Office SharePoint Server 2007 ― Application Development (70-542)

Windows SharePoint Services 3.0:

  1. MCTS: Microsoft Windows SharePoint Services 3.0 – Application Development
  2. MCTS: Windows SharePoint Services 3.0 – Configuration