Nick Porter's profileNick Porter - SharePoint...BlogLists Tools Help

Nick Porter - SharePoint & More

8/22/2008

Microsoft Office SharePoint Server 2007 - SiteMapProviders


The four main site map providers for Microsoft Office SharePoint Server 2007 specified in the web.config file, all inherit from the same type: Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider
 
The main difference between these SiteMapProviders is the 'NavigationType' property.
Every SiteMapProvider uses one of three different NavigationTypes. Global, Combined or Current.
 
Global = Displays the same navigation as the parent site
Current = Displays only the navigation items below the current site
Combined = A combination of both Global and Current navigation

Looking in the <Providers> section of the web.config file you will see the four main publishing navigation providers. The name of each provider corresponds to the NavigationType specified:
 
GlobalNavSiteMapProvider
        <add name="GlobalNavSiteMapProvider" description="CMS provider for Global navigation"
type="Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0,
Culture=neutral, PublicKeyToken=71e9bce111e9429c" NavigationType="Global" EncodeOutput="true" />
 
CombinedNavSiteMapProvider
        <add name="CombinedNavSiteMapProvider" description="CMS provider for Combined navigation"
type="Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0,
Culture=neutral, PublicKeyToken=71e9bce111e9429c" NavigationType="Combined" EncodeOutput="true" />
 
CurrentNavSiteMapProvider
        <add name="CurrentNavSiteMapProvider" description="CMS provider for Current navigation"
type="Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0,
Culture=neutral, PublicKeyToken=71e9bce111e9429c" NavigationType="Current" EncodeOutput="true" />
 
CurrentNavSiteMapProviderNoEncode
        <add name="CurrentNavSiteMapProviderNoEncode" description="CMS provider for Current navigation, no encoding of output"
type="Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0,
Culture=neutral, PublicKeyToken=71e9bce111e9429c" NavigationType="Current" EncodeOutput="false" />

 
Custom SiteMapProviders
 
If none of the SiteMapProviders above give you what you want, you can easily create your own custom SiteMapProvider.
 
Just add another line to the <Providers> section of the web.config file specifying a unique name and the 'NavigationType' you want to use.
For example, if I wanted to create a custom provider which used the 'Combined' NavigationType (like the CombinedNavSiteMapProvider above) but I also wanted to enable security trimming and increase the maximum number of nodes to display from the default of 50 to 100, I would insert the following:

<add name="MyCustomSiteMapProvider" description="A custom SiteMapProvder that enables localization and security trimming"
type="Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0,
Culture=neutral, PublicKeyToken=71e9bce111e9429c" NavigationType="Combined" EncodeOutput="false" SecurityTrimmingEnabled="True" DynamicChildLimit="100"/>
 
 
SPNavigationProvider
The SPNavigationProvider is another provider which can be used for navigation. This provider is generally used for Windows SharePoint Services or MOSS 2007 implementations without the Publishing Feature enabled.
 
The main difference between this provider and the other ones above is that it inherits from: Microsoft.SharePoint.Navigation.SPNavigationProvider and you can't specify a 'NavigationType'
 
        <add name="SPNavigationProvider" type="Microsoft.SharePoint.Navigation.SPNavigationProvider, Microsoft.SharePoint,
Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
 
Personally, I would stay away from using the SPNavigationProvider within MOSS 2007 unless it was absolutely necessary.
 
 
Next Post: Implementing your SiteMapProvider within the PortalSiteMapDataSource
8/14/2008

Manage Content and Structure errors (missing features)

 
I was using the "Manage Content and Structure" feature of MOSS 2007 when I came across a problem.
 
When trying to expand one of the site nodes, an error appeared:
"There was an error in the callback"
 
Clicking on the actual site name, a new page loaded and I received a different error:
"Feature 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' for list template 'xxxx' is not installed in this farm.  The operation could not be completed"
 
I wasn't sure what was happening here because I could still browse to the actual site by typing in the URL. There didn't seem to be any problem.
 
I took a look at the log files at "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS"
 
I did a search on the GUID which appeared in the error and found a match:
"Failed to determine definition for Feature with ID 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'"
 
I also noticed quite a few similar entries with different GUIDs

Cause
The Site Collection I was using, was originally created on an Enterprise version of MOSS 2007, in a proof of concept environment.
 
The Site Collection was moved to a Standard version of MOSS 2007 when put into production.
 
The problem with this was, users had enabled certain 'enterprise only' features on some of the sites and created 'enterprise only' objects, like Reporting Libraries etc.

 
Resolution
My solution was simple - delete the enterprise lists and libraries from the problem sites. The data wasn't critical as it was proof of concept only. If your data is critical, the only thing I can suggest to stop the errors from appearing is, to enable the enterprise license.
 
Otherwise.....
 
1. Browse to the site and click on 'View all site content'
 
2. Determine if the site contains any 'Enterprise' lists or libraries
   E.g. Report Library, Data Connection Library, KPI List
 
3. Record the exact name of each list or library
 
4. Log on to the local SharePoint server
 
5. Open a command prompt and change directory to "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\Bin"
 
6. Execute the following command
    stsadm -o forcedeletelist -url "http://<server>/<site>/<list>/"
 
 
Once the lists have been successfully deleted, you should be able to use the 'Manage Content and Structure' feature for the site.
 
 
 
6/23/2008

Applying a User Filter to the SharePoint Profile Import Connection.

 
I hadn't really paid much attention to the user profile information in MOSS 2007 after initially configuring the User Profiles and Properties.
I thought it was about time to fine tune these settings and exclude all of those old disabled users and service accounts who were still showing up in the People Search results.
 
I followed this KB article, which provides a specific user filter to prevent disabled users from being imported, however, after applying this filter there were still a number of old employees showing up in the search results? After a bit of investigation I found that these accounts were still being held in a "Deleted Users" location in AD. These users weren't actually disabled, but rather flagged as deleted.
I then appended the following query to prevent disabled users from being imported also: ( !(IsDeleted=TRUE))
 
I then had the problem of service accounts showing up in the search results. The quickest way around this was to import only accounts which had a valid email address: (mail=*.com)
In most organisations, service accounts won't have an associated email address. You may need to think up another way to filter these accounts if your organisation does associate email with service accounts.
 
NOTE: One important thing to remember is, once you have applied these filters, you will also have to run an update on the content source which holds your profile information (by default this is the "Local Office SharePoint Server sites" content source).
Even though the users may have been excluded from the import once you have applied the filter, the old profiles will still sit in the index until you run another full crawl.

Here is the full user filter:

 

(&(objectCategory=person)(objectClass=user)( !(userAccountControl:1.2.840.113556.1.4.803:=2))( !(IsDeleted=TRUE))(mail=*.com))

 
 
 
6/20/2008

Create a simple yet effective footer using <SharePoint:FieldValue> and <PublishingWebControls>

 
Copy and paste the following code into your master page on a publishing site in MOSS 2007: 
 


Content owner: <a href="mailto:<SharePoint:FieldValue runat='server' fieldname='PublishingContactEmail' /> "><SharePoint:FieldValue runat="server" fieldname="PublishingContactName" /></a> Technical Help: <a href="mailto:support@yourcompany.com">Help Desk</a> Last Modified: <PublishingWebControls:LastModifiedIndicator runat="server" />

 

Here are some more fieldnames you can use:

Title                                    FieldName
-----                                    ------------
Approval Status                   _ModerationStatus
Approver Comments            _ModerationComments
Article Date                         ArticleStartDate
Byline                                 ArticleByLine
Check In Comment              _CheckinComment
Checked Out To                   CheckedOutTitle
Checked Out To                   CheckoutUser
Checked Out To                   LinkCheckedOutTitle
Contact                               PublishingContact
Contact E-Mail Address         PublishingContactEmail
Contact Name                      PublishingContactName
Contact Picture                    PublishingContactPicture

6/19/2008

How to add custom styles to the Content Editor Web Part (Rich Text Editor)

 
1. Open the stylesheet you are using on your site
2. Add a new style starting with .ms-rteCustom-
e.g.
.ms-rteCustom-Heading1
{
  font-family: Helvetica, Arial, Verdana;
  font-size:18pt;
  font-weight:bold;
  color:#0087c7;
  line-height:22pt;
}
 
3. Save changes
 
4. Now when you use the rich text editor in the Content Editor web part, your custom styles will appear.
 

Nick Porter

Location