Skip to content

DotNetNuke and SharePoint — An {EndBracket} response from Shaun Walker

Apparently Shaun Walker read my {End Bracket} article in MSDN Magazine.  He responded on his blog with You Should Learn DotNetNuke.

I have an appreciation for DotNetNuke — it’s definitely the right solutions for some clients/organizations.  In fact, when faced with the question about whether to setup SharePoint or DNN for the church I am a member of, I chose DNN.  I wanted to get a better understanding of DNN so I performed a technical edit of the Wrox title Beginning DotNetNuke Skinning and Design.

I have a great deal of respect for DNN.  Most of my work — because my clients generally deal with documents, and large scale sites — is SharePoint.  However, DNN is a great alternative.

Article: { End Bracket } You Should Learn SharePoint

For a developer,  there’s never a shortage of material to learn. Whether you’re exploring the backwoods of Sys- tem.DirectoryServices.Protocols, spending quality time with generics, or delving into the fine art of garbage collection, there is always something clamoring for your attention. So why should you make learning Microsoft® SharePoint® technologies a priority?

http://msdn.microsoft.com/msdnmag/issues/07/12/EndBracket/ [Article no longer available]

SPFileCollection.Add(string, Stream, Hashtable)

If you’re using one of the SPFileCollection overloads to create a file in SharePoint you’ll find that there’s a few overloads that take in a Hashtable for properties.  The key of the Hashtable can not be the GUIDs for the fields, they should be the internal names of the fields.

SPContentType.Fields and SPContentType.Parent

A few random observations about SPContentType…

.Fields — This isn’t a complete collection of fields as it might be on SPList.  It’s just the fields that are directly added to the content type.

.Parent — This won’t return you a null if there are no parents to this content type.  Instead it keeps returning you the same content type.  So rather than doing what you would normally do — SPContentType.Parent == null — to test to see if you’re at the top content type, you must check SPContentType == SPContentType.Parent.  (or add .Id to each of these to make sure that you’re getting an equality comparison rather than a reference comparison.)

You may notice that some of the core fields for SharePoint items aren’t represented anywhere in the hierarchy (Author, Editor, Created, and Modified were the ones I noticed).

A final note is that even if a content type is activated in a site collection you may not be able to get to it from the SPWeb object of the current web site, so you get to walk the tree up to the root site in the site collection and pickup the reference from there.  Of course, you don’t want to add it to the current SPWeb object because you’ll get an error about a duplicate object.  (Apparently it exists, you just can’t retreive it.)

Article: Understanding SharePoint Branding Options

When we’re talking about branding in Microsoft SharePoint there are several options. You’ve probably heard about site definitions, site templates, themes, master pages, page layouts, CSS, and so on. In this article we’ll tear apart each of these options and discuss what you’ll want to use to modify the appearance of your pages.

http://www.intranetjournal.com/articles/200711/ij_11_20_07b.html [Website removed]

What I missed – MOSS Camp 2007 (Chicago)

There were many reasons to miss the MOSS Camp 2007 in Chicago that the MS DPE team hosted.  It conflicted with SharePoint Connections (which I didn’t attend) and TechED Europe (which I also didn’t attend).  The reason I didn’t make it was that I was supporting a Women’s Ministry candle light dinner at my church.  I committed to that before knowing about the MOSS Camp event.  It was held on 11/9/2007.

Larry Clarkin posted a report about how it went.  There were some “grievances” aired.  I want to respond to a few of them because I think that they could look at the problem from a better angle or they’re the result of some relatively simple errors.  In all honestly several others I don’t understand (Filtering views is not clear, having all fields available on contacts, etc.).  If someone wants to explain them to me perhaps I can dispel a few of them too.

  1. Column level security on lists – Another perspective on this is helpful.  How many people use column level security in their database?  (Does the word “none” come to mind?)  The real core issue here, the thing that’s absolutely missing is relationships between lists.  Two relationship types — one-to-one and one-to-many relationships – would be a great help.  With a one-to-one relationship you can suddenly just put fields that you want to control access to in a separate table.  So I’m not saying that we don’t have issues here – we do, but the real problem – the one that the product team can solve and get more scenarios – is relationships.  By the way, as a workaround, it’s possible to set a field not to display on the display form and it’s possible to change the forms to your own forms so people don’t see those fields if they don’t need to.
  2. Impersonation testing – I can only assume people are having problems with the SPSecurity.RunwithElevatedPrivileges() call.  This is pretty common. Most of the time it’s someone trying to use SPContext.Current.Site (or SPContext.Current.Web).  These already contain the authentication information for the current user – you have to create your own instances inside the RunWithElevatedPrivileges call.
  3. HTML Editor – Yea, ok, the built in editor is weak.  However, Telerik offers their commercial RadEditor that can be dropped in as a replacement.  Or you can get the commercial version or the free lite version off the version selector page.  Admittedly Telerik’s site is impossible to navigate.  However, with those links you should be able to get everything you need.
  4. Lotus Notes Integration – This is one of those items that is on the line for me not understanding their point.  From my perspective, SharePoint should be used to replace Lotus Notes except where rich offline support is needed.  Notes can be searched and you can embed direct links to Notes documents if the client has Notes installed.  What else do you want/need?
  5. Relative links are broke(n) – Yea, they are.  Server relative links work.  Absolute links back to the SharePoint server are converted to server relative links and thus work across different access paths (think internally (server) vs. externally (server.mycompany.com))  Fully relative links don’t work, and here’s why:  You don’t know where the content will be displayed.  If I display it on the home page vs. on the listing page the path is different.  Thus the relative paths wouldn’t work.  So yes, the system totally strips them and you can’t prevent it from doing this.  That being said, server relative links can be used as a workaround if you plan correctly.
  6. WYSYWIG on Web Parts – Another perspective on this is helpful.  There isn’t a WYSYWIG for server controls either and people don’t complain about that – they user controls.  Web Parts are essentially sophisticated server controls.  So my response is use user controls wrapped in a web part.  There are public samples of how to do this all over the place.  The most famous is undoubtedly SmartPart.  Admittedly there are issues there.  However, I have a configuration management supported process that works well for this – I just haven’t had time to convert it into a book yet.  (If someone wants to engage me to show them how to do it I can.)

Two quick things I agree with:

  1. Service Unavailable Message – We need better control of error messages.  The 404 error is another example of this.
  2. XHTML Compliance –Some of this is fixable with new master pages and new page layouts – however, there’s some that can’t be fixed.  The ListViewWebPart and ListFormWebPart are tops on my hit list for this.  In addition to standards compliance issues, they hardcode attributes rather than using CSS.  (Check the output of a display form, you’ll find hardcoded cell widths.)

Feel free to send me mail on this if you don’t agree – or you need more details.

Windows SharePoint Services Search – No Results and Errors

I had a client who has WSS.  They weren’t seeing any search results.  There were also some errors being logged on the server the most prevalent of which was:

 

Event Type:        Warning
Event Source:    Windows SharePoint Services 3 Search
Event Category:                Gatherer
Event ID:              2436
Date:                     11/5/2007
Time:                     10:00:03 AM
User:                     N/A
Computer:          SERVER
Description:
The start address <sts3://server/contentdbid={70792d37-74fc-430d-8939-d55afebdb795}> cannot be crawled.

Context: Application ‘Search index file on the search server’, Catalog ‘Search’

Details:
The object was not found.   (0x80041201)

 

The reason for the error … the server couldn’t reach the web application on its default URL.  Once I changed the alternate access mappings so that the default URL was reachable from the server and issued a command to start a full search (see below), it finally indexed things correctly.  The command to force a full crawl is:

STSADM –o spsearch –action fullcrawlstart

Restoring a site collection and an error

I recently received the following message while trying to restore a site collection backup:

“No content databases are available for this operation.  Create a content database, and then try the operation again.  To create a content database, click “Content databases” on the Application Management page, select the Web application to use, and then click “Add a content database”

The issue was that I had already restored the backup on the system and in the existing content database for the web application.  Since the site collection doesn’t change GUIDs you can’t restore a site collection into two site collections in a web application that has only one content database – it has to be in a separate content DB.  Add a new content DB and the error goes away.

Training Resources for Web Content Management

[Note: I put this together for a client a few months ago and forgot to post it here.]
[Note: 07-11-12: Updated a few links.]

This is a list of resources for Microsoft Office SharePoint Server 2007’s (MOSS) Web Content Management feature (WCM).

On-Line

The following resources are On-Line resources.  This includes web casts, blog entries, articles, etc.

Microsoft (Free)

The following links are free links from Microsoft’s web sites.

MS Site Content
Downloads 2007 Office System Video: Enterprise Content Management [resource removed]
Channel9 Web Content Management in MOSS 2007
MSDN Customizing and Branding Web Content Management-Enabled SharePoint Sites (Part 1 of 3): Understanding Web Content Management and the Default Features
MSDN Customizing and Branding Web Content Management-Enabled SharePoint Sites (Part 2 of 3): Extending WCM
MSDN
Customizing and Branding Web Content Management-Enabled SharePoint Sites (Part 3 of 3): Creating and Configuring WCM-Enabled Sites
MSDN Webcasts
The Evolution of Web ContentMangagement in the 2007 Version of Microsoft Office – Level 200

[These were all removed – sorry!]

Microsoft Office SharePoint Server 2007 Web Content Management for Developers and Designers

Microsoft Office SharePoint Server 2007 Web Content Management for Site Administrators and Owners

Microsoft Office SharePoint Server 2007 Web Content Management for Content Owners and Authors

 

Microsoft eLearning

The following resource is a for-pay resource available from Microsoft:

  • Course 5253: Implementing Content Management Solutions by Using Microsoft Office SharePoint Server 2007

Microsoft Blogs

The following are Microsoft sponsored blogs that contain content relative to Web Content Management:

Books

The following books may be of assistance with Web Content Management topics.  I didn’t list books which were not available today:

Title Notes
Real World SharePoint 2007: Indispensable Experiences from 16 MOSS and WSS MVPs One chapter by Andrew Connell.  I did a tech edit for this book on all but one chapter – the one I wrote on workflow.
Essential SharePoint 2007 No coverage of web content management but has some decent appendices on SharePoint end user use.
Microsoft SharePoint 2007 Unleashed 24 pages on Web Content Management
Microsoft Office SharePoint Server 2007 Administrator’s Companion 30 pages on Web Content Management with a heavy focus on administrative issues.

Training

There’s only one course available for Web Content Management right now.  That is Developing Publishing Sites with SharePoint Server 2007 WCM.  It’s available as an on-site or an on-line version.

SPWorkflowAssociation.AutoCleanupDays

One of the things I like (mostly) about working with SharePoint is that I get the opportunity to learn stuff almost every day.  I say mostly because although I love to learn, sometimes I have to learn by making mistakes – and that’s never fun.

About a month ago Dave Wollerman learned something about the way workflow’s worked and blogged about it.  The post titled “Huge MOSS Workflow Issue… What is Microsoft Thinking!!!!”  The post lays out how workflows based on the out of the box workflows – Approval is the one he calls out – lose their workflow history after 60 days.  In his post he’s frustrated (as in fact I might be) because he expects that workflow history stays around as long as the item does.  He mentions that there’s a performance reason for doing this but doesn’t dig behind the scenes.

In a recent conversation with some folks on the product team I got to mention Dave’s post and talk through it with them.  Out of that conversation I was struck by a few things.

First, there is a real performance issue that they were trying to address.  Because of the way that lists are implemented there’s a soft limit around 2000 items per “view” where the performance starts to decrease.  It’s a long story about the database table that items are stored in, how SQL treats the query, etc.  The short of which is that you need to be cognizant of how big lists get.  Steve Peschka wrote a white paper on this “Working with large lists in Office SharePoint Server 2007”.  It’s good reading if you want to know more about this.  But what does this have to do with Workflow History?

Well, each workflow history entry is placed into a big list.  In that list you have all of the workflow history items for all of the workflow instance for every workflow association that has that workflow history list associated with it.  If you figure on five workflow history entries per workflow it’s easy to see that even a few hundred items with workflow can quickly cross that 2,000 item mark.  As a result deleting items – making sure that the list doesn’t get really, really huge, is an important part of maintaining performance on the system.

Second, Dave’s thinking about the workflow history list as a permanent audit record.  MOSS provides an audit mechanism – but the workflow history list isn’t it.  I have to admit that I’ve fallen into this trap.  I do have some workflows that I think of the workflow history list as a part of the auditing – so I need to go back and revisit these workflows.  A better way to think about the workflow history list is a log.  The log files that MOSS creates – the ULS Log – are automatically recycled. Based on the schedule you set new logs are created and eventually deleted.  Workflow histories are designed to be like this.

Third, there’s a gap in the documentation.  It’s not precisely clear how this automatic recycling of the list takes place.  The object model reference lets you know that SPWorkflowAssociation.AutoCleanupDays exists, however, it doesn’t offer any additional information about how it works, why it exists or how it works.  I’ve found only a few references to this property in the Blogosphere.  I haven’t found an article or book that covers it (including my chapter in Real World SharePoint 2007 or articles.)  That means that it’s not going to jump out at you – unless you go looking for it because you already know it’s there.

Fourth, and finally, I’ve not been able to find any place that it is documented how to set the AutoCleanupDays when the workflow is associated.  However, a buddy on the program team showed me where this can be set so it will apply to every new association of the workflow – it won’t solve the built in workflows but it can help you with your own workflows.  Note the addition of an node in the following sample Element Manifest Xml:

<Elements …>
<Workflow …>
<MetaData …>
<AutoCleanUpDays>9999</AutoCleanupDays>
</MetaData>
</Workflow>
</Elements>

 

That’s pretty cool and not unlike the idea of feature stapling – where you can handle all of the new instances created even if you have to go back and update the existing associations.

[Update: 2007-10-16: It turns out that autocleanup doesn’t actually clean out the workflow history.  It does, however, remove the entry from the workflow instances that connects the workflow history to the item that the workflow ran on.  It also turns out it deletes any tasks that were created by the workflow.  The net effect of this is that the actual auditing is OK — the user interface just doesn’t look so good.]

Recent Posts

Public Speaking