Monday, June 22, 2009

making pages containing lists of sites, lists

One of the projects I am working on needed some pages containing lists of subsites and lists of lists. Some examples include:

  • A top-level site that has lots of blog sites beneath it. The user wants a list of all of the blog sites to appear in a web part on the top level site.
  • A top-level site that has lots of discussion boards contained within it. The user wants a list of all of the discussion boards inside this site.


Note that top-level in this case does not necessarily mean a site collection.

I could not find a built-in web part to accomplish this. However, it is very straighforward to create a DVWP (i.e. data view web part) talking to built-in WSS web services. This is done using SharePoint Designer. Here is the process:

  • create a web part page (Site Actions >> Create >> Web part page)
  • open the page in SPD (use either Design or Split view)
  • Data View >> Manage Data Sources
  • In the Data Source Library, select Connect to a web service

Here the directions will be slightly different for sites vs. lists

For Sites:

  • use http://<your site>/_vti_bin/webs.asmx for sub-sites
  • use the GetWebCollection method
  • after creating this data source, drag it into one of the web part zones on the new page (this creates a DVWP)
  • use the context menu ">" and season to taste

For Lists:
  • use http://<your site>/_vti_bin/lists.asmx for containing lists
  • use the GetListCollection method
  • after creating this data source, drag it into one of the web part zones on the new page (this creates a DVWP)
  • use the context menu ">" and season to taste

Good luck!

Wiki pages are not first class "items" in WSS v3

One of the strengths of the WSS platform is that all of the built-in list types have the same features set, such as alerting, permissions, folders, metadata. Not!

One of my customers is doing a Web 2.0 implementation using MOSS as the platform. They will be using the Wiki page type extensively.

Now I have recently discovered that Wiki page libraries cannot make folders for the pages.

This has the potential to be a large issue for 2 reasons:

  • folders allow a better organization of the pages
  • WSS has a well-known performance issue when a single view of data becomes longer than 2000 items

So this is definitely a drawback that will need to me mitigated. It is certainly possible that a code-based solution will be the best mitigation for this issue.

Here is a MSDN thread with the start of a workaround on this.

Note further that the Kwizcom product with enhanced Wiki capability also has this limitation.

Tuesday, June 9, 2009

InfoPath cannot handle URL fields in SP lists

One component of the dream of no-code SharePoint is to store data in SharePoint lists and expose the data thru Infopath [which business analysts and administrators can use to change the UI design easily].

This dream is dimmed slightly when InfoPath cannot handle SharePoint list types correctly. In this case, URL fields are not parsed correctly causing the link field to fail [when clicked].

In this example, I made a URL field in a custom list called "u 0" and I stored a value in it.

Make the infoPath form with a datasource pointing to the custom list. Then you will see the symptom of this problem. The problem itself is caused by this XSLT code stored in view1.xsl. (Sorry, I could not get the formatting to work!)

<span class="xdHyperlink" hideFocus="1" title="" style="OVERFLOW: visible; WIDTH: 130px; TEXT-ALIGN: left" xd:xctname="Hyperlink">
<a class="xdDataBindingUI" xd:CtrlId="CTRL4" tabIndex="0" xd:disableEditing="yes">
<xsl:attribute name="href">
<xsl:value-of select="@u_0"/>
</xsl:attribute>
<xsl:value-of select="@u_0"/>
</a>
</span>


The correct code is shown below:


<span class="xdHyperlink" hideFocus="1" title="" style="OVERFLOW: visible; WIDTH: 130px; TEXT-ALIGN: left" xd:xctname="Hyperlink">
<a class="xdDataBindingUI" xd:CtrlId="CTRL4" tabIndex="0" xd:disableEditing="yes">
<xsl:attribute name="href">
<xsl:value-of select="substring-before(@u_0, ',')"/>
</xsl:attribute>
<xsl:value-of select="substring-after(@u_0, ',')"/>
</a>
</span>

I find it hard to believe but apparently noone has documented this out on the web. After I debugged it, I found this link from 2005 about the SPD predecessor, of which #5 & #6 are the answer.

It is also frustrating that Microsoft has not fixed this in the InfoPath 2007 product.

Regards..