Archive for February, 2007

Master Pages for Admin and global pages

One of the pains about master pages in SharePoint is that when you set one for a site, it doesn’t apply to the admin pages. This can lead to a, um, interesting difference in appearance.

I started looking into overcoming this. Obviously, there is a fairly straight-forward approach - modify the application.master. Ouch. Then, any changes to design in one file have to be replicated elsewhere, with one file in the Master Page Gallery, and one on the file system.

Alternatively, I found a neat solution at David’s blog. This uses an HTTP Module to reset the master page for any pages looking for application.master.

But after following his instructions, my admin pages wouldn’t work. I just got the error page ‘Unknown Error’.

Digging into the logs, I found what was going on - there were 2 content placeholders that the application.master uses which weren’t on my ‘normal’ master page. Make sure you add place holders for:

<asp:ContentPlaceHolder id="PlaceHolderPageDescriptionRowAttr" runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderPageDescriptionRowAttr2" runat="server"/>

The full list of placeholders used in both files is:

  • PlaceHolderPageTitle
  • PlaceHolderAdditionalPageHead
  • PlaceHolderBodyAreaClass
  • PlaceHolderBodyLeftBorder
  • PlaceHolderBodyRightMargin
  • PlaceHolderCalendarNavigator
  • PlaceHolderFormDigest
  • PlaceHolderGlobalNavigation
  • PlaceHolderGlobalNavigationSiteMap
  • PlaceHolderLeftActions
  • PlaceHolderLeftNavBar
  • PlaceHolderLeftNavBarBorder
  • PlaceHolderLeftNavBarDataSource
  • PlaceHolderLeftNavBarTop
  • PlaceHolderMain
  • PlaceHolderMiniConsole
  • PlaceHolderNavSpacer
  • PlaceHolderPageDescription
  • PlaceHolderPageImage
  • PlaceHolderPageTitleInTitleArea
  • PlaceHolderSearchArea
  • PlaceHolderSiteName
  • PlaceHolderTitleAreaClass
  • PlaceHolderTitleAreaSeparator
  • PlaceHolderTitleBreadcrumb
  • PlaceHolderTitleLeftBorder
  • PlaceHolderTitleRightMargin
  • PlaceHolderTopNavBar
  • PlaceHolderUtilityContent
  • SPNavigation
  • WSSDesignConsole
  • PlaceHolderHorizontalNav Normal master page only
  • PlaceHolderPageDescriptionRowAttr Admin master page only
  • PlaceHolderPageDescriptionRowAttr2 Admin master page only

The format of Dates in CAML

So, a colleague asked me about what format dates should be put into the where clause of a CAML query as. I’d had a lot of problems finding this out myself, and ultimately I found that a .ToString(”u”) on a DateTime object did the trick. The produces a time of the form 2006-04-17 21:29:09Z

For example, using a StringBuilder to create my CAML query (for my SPQuery object), this might look like:

caml.Append("<Leq>");
caml.Append("<FieldRef Name='MyDueDate'/>");
caml.Append("<Value Type='DateTime'>");
caml.Append(System.DateTime.Today.ToString("u"));
caml.Append("</Value>");
caml.Append("</Leq>");

(This query contains the date contained in the MyDueDate column with the current date and time).

Building a Base Web Part Class

From Bob Mixon’s blog:

Part I, Part II, Part III

MOSS Branding link dump from Angus Logan

Dump of links to do with MOSS Branding from Angus Logan. Lots of stuff from Shane Perran in there - yup, I’ve been reading a lot of his posts now that I’m trying to rebrand a site.

Best Practices Analyser

From Stefan Gossner’s blog - a tool to analyse your MOSS system

SharePoint Licensing

Found on Cornelius Van Dyk’s blog - SharePoint Licensing Information. Interesting stuff. No, wait, the other thing - tedious. Still, quite how you license your Internet facing WCM site did strike me as an interesting issue, especially as one of my colleagues kept going on about having external sites as ‘read only’. What, no feedback forms? Comments? Survey submissions? Well, it seems that the definition is one of accessibility - so long as everyone can access these features, you can use an Internet access license. I wondered how they’d deal with that.

(For content accessible to employees/partners only, I presume it’d be a normal client access license).

Update: See the Logical Architecture Model: Corporate Deployment document for details on this, and dealing with partners. That’s quite interesting - you can host partners sites on Internet or Intranet farms.

No Theme Inheritance in SharePoint

Bit of a shocker - no inheritance of themes through a site hierarchy in WSS3. There is of Master Pages, but not of themes.

Given that you can do all of what you do with Master Pages it does make me wonder - what are Themes for?

Updated: Heather Solomon has looked at it, and her suggestion is to just put your styles in the Master page.

Custom activities in SharePoint Workflow

Custom SharePoint aware Workflow Activities

Don’t forget to add into the System.Workflow.ComponentModel.WorkflowCompiler section of the web.config file.

There is a known issue with Delay activities

Apparently there is a fix. Bit late for me.

Three things that still annoy me about Workflow in SharePoint

There is no support for tracking services. Or rather, if there is, nobody is saying. You’re stuck with ‘History’ lists, which suck. All I want is a table I can query, and that I’ll expose that via the BDC. But without this, workflow in SharePoint is nothing more than a toy, which isn’t fair given the effort put into it. I know that Microsoft don’t want to step on K2’s toes - fair enough. Truth be told, I was wondering what K2 were going to do, figured that they must be running scared - but having seen Black Pearl, I see that they’ve been running hard, and have a good lead. A SQL tracking service won’t erode that lead.

Repeating fields in Infopath forms are unusable. Nobody knows how to do this. I spent ages working on it, but I didn’t get anywhere. I couldn’t write to these properties through the task properties at all. Indeed, the whole TaskChangedProperties.ExtendedProperties hash is daft. Forcing everything to flatten, well, sucks. Can’t I have a stream? Or a node-child tree of some sort? I mean, is it surprising to want to send InfoPath forms to/from a workflow task and a library? You know, use the workflow for routing, and the xml form in a library as the data store? That should be easy - it’s not.

Debugging workflows is hard. I mean, apart from Visual Studio crashing as I connect it to the appropriate service, there is a question over actually being able to get meaningful error messages out of workflow, and getting it able to breakpoint in the right places. In fairness, this is a complex thing. I have no idea how I’d set about allowing debugging in Visual Studio, say, after a Delay activity had expired. But it would be cool to have something a bit better.

Next Page »