Nick Porter 的个人资料Nick Porter - SharePoint...日志列表 工具 帮助
2008/8/22

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
2008/8/14

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.
 
 
 
2008/6/23

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))

 
 
 
2008/6/20

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

2008/6/19

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.
2006/4/19

Enabling Secure Sockets Layer for SharePoint Portal Server 2003

If you are looking at enabling an extranet using SharePoint Portal Server 2003 and need to implement SSL, read this article by Emily Schroeder.
 
2006/4/6

How to add a Site Template to the Site Definitions List in Windows SharePoint Services

It's easy enough to create a new site template in SharePoint, but these templates can only be saved in the top level web sites template gallery and applied to sub sites only.
 
To add a new option to the list of choices when creating a top level website you need to create a "Site Definition".
This is a far more difficult task but there is a way you can add a site template file (.stp) to the list of Site Definitions using the stsadm.exe command line utility:

1. Create a WSS Site
2. Click on "Site Settings" at the top of the page.
3. Under the "Administration" heading click on "Go to Site Administration"
4. Under the "Management and Statistics" heading click on "Save site as template"
5. Give the template a File Name, Title and Description. Also select if you want the content of the template site included (documents etc).
6. Click "OK"
7. On the following page click on the "site template gallery" link
8. Right click on the name of the template and select "Save target as"
9. Save the file to your local computer
10. Copy the file to your Front end web server (preferably onto your c:\ drive)
11. Click on Start > Run and type "cmd" then hit "Enter"
12. Change to the following directory in the command prompt window:
           c:\program files\common files\microsoft shared\web server extensions\60\bin
13. Type the following command:
           stsadm.exe -o addtemplate - filename "c:\sitetemplate.stp" -title "Site Template"
14. Hit "enter"
15. type "iisreset" and hit enter
 
Now your site template will appear in the site definitions list when creating a new top-level website.
 
 
2005/9/22

Echo for SharePoint

Echo is a great product developed by the guys at Winapp Technology.
 
We have been using this in our production environment for a while now and it certainly saves a lot of time in updating configuration/content across multiple areas/sites.
 
Say if I wanted to add a web part, or change a view across 1000 of our WSS sites, the out-of-the-box SharePoint process would take a considerable amount of time and effort.
With Echo, it takes me no more than a couple of minutes to apply these changes. An incredible increase in productivity and an excellent ROI. And that's only the start.
 
 
Contact details and a trial version are available on their site.
 
- Nick Porter
2005/9/15

SharePoint vNext

 
PJ Hough and others – First look at next version of Sharepoint
 
- Scoble rambles a bit too much about blogging with SharePoint vNext in this video. Would have been nice to see some more stuff on collaboration. Looks good though.
 
 
Rob Lefferts – Sharepoint Services and Workflow
 
Nick Porter
 
2005/9/9

SharePoint Topics Area - where do I begin?

Follow these three simple steps to understanding the "Topics" area in SharePoint Portal Server 2003:
 
1. Read this:
http://www.othermedia.com/go/Article_28.html (replace the word "Taxonomy" with "Topics Area")
 
2. Compare these:
http://search.yahoo.com/
http://dir.yahoo.com/ (Think of it as a "Topics" area)
 
3. Classify your own data (speak to your users - they will tell you how to do this)
 
Just remember, a "Topics" area (taxonomy) is an evolving process. Don't expect it to be complete on your first attempt.
As your portal expands, so to will your "Topics" area.
 
Nick Porter
2005/9/5

Tech Ed 2005

It's been a while since I updated this space!
 
I just got back from Microsoft Tech Ed 2005 (Australia) which was held in Surfers Paradise.
I had a great time and learnt quite a lot.
 
It was great to catch up with a lot of the SharePoint people from around Australia and finally put some faces to names!
 
Some of the highlights of the convention were:
- The keynote speech and seeing some of the awesome technologies coming out of Microsoft.
- Hearing about some of the features in SharePoint v3 (but not as much as I would like to know)
- The party held at Warner Bros Movie World (and the taxi ride home [don't even ask!])
 
Another thing I wanted to mention was the Sydney SharePoint User Group, which is holding it's third meeting on Tuesday, 20th September. If you are in Sydney, or even just visiting come along.
 
I will try to update this space more regularly, maybe even share details of my never-ending saga with the Portal_Conent index.
 
(some photos of my past week attached)
2005/5/10

SharePoint prompt for password after changing network password.

I have come across an issue (bug?) when using SharePoint (SPS and WSS) with Windows XP.

On our network we have a password policy, so users are required to change their password every 45 days.

I have noticed a few times now that some users, after changing their network password are then prompted by SharePoint (SPS and WSS) for their credentials. After entering the information 3 times they are given an "Access Denied" error. This was also then performing an AD "Account Lockout" on their account and preventing them from accessing their email and other network services.

If the user logged onto a different machine with their new network password there would be no problem accessing SharePoint and no prompt was displayed, which meant the problem was a local issue.

It seemed as though the old username and password was being cached somewhere.

This issue only seemed to affect some users and not everyone who changed their password.

After much investigating I found the cause and a workaround to resolve the issue.

Cause:

What seemed to happen was it was storing the old information in the Password list under the Manage Passwords section under "User Accounts". (Start > Settings > Control Panel > User Accounts)

If a user who had ever tried accessing an Area or document library in SharePoint where they didn't have permission, they were getting prompted for their credentials, and the information was being stored in this list.

When the user changed their network password after 45 days, then went to log back on to SharePoint, it was still recognising their old credentials from the cached password list, so when they typed their new password it wasn't authenticating, because the passwords matched.

To resolve this issue:

1. Click "Start" > "Settings" > "Control Panel"
2. Double click "User Accounts"
3. Click on the "Advanced" tab
4. In the "Passwords and .NET Passports" area click "Manage Passwords"
5. Remove everything there.
 
Also, delete everything IN this directory:
C:\Documents and Settings\YOURUSERNAME\Application Data\Microsoft\Credentials
 
and everything IN this directory:
 
C:\Documents and Settings\YOURUSERNAME\Local Settings\Application Data\Microsoft\Credentials

2005/5/4

Simple SQL Query to return all documents

Below is a simple SQL Query to return all documents stored in SharePoint and includes the Title, Directory Name, File Name and Size of each document that sits in the database.

Use it as a starting point for writing your own queries if you want.
Modify the WHERE clause to find specific document types.

I find it comes in handy every now and then.

SELECT 
 UserData.nvarchar7 AS Title,
 DirName AS Directory,
 LeafName AS DocName,
 Docs.Size AS Size

FROM Docs, UserData

WHERE (DoclibRowId > 0)
  AND Docs.ListID = UserData.tp_ListID
  AND Docs.DoclibRowId = UserData.tp_ID
ORDER BY Directory

2005/3/26

IIS 6.0 HTTP Compression for SharePoint

Wow, it has been a while since I posted anything.

Been unbelieveably busy, migrating users to SharePoint Portal Server 2003.

Last week I migrated about 20,000 Excel workbooks from a corporate file share to SharePoint 2003. The majority of these files were all linked as well, which meant having to write  code to programmatically run through all excel workbooks, find any links, replace the link with the new location the file had been moved to on SPS 2003, then update the link.

What I really wanted to write about though - is more to do with the performance of SPS/WSS.

We have a lot of data sitting inside our portal (about 200 GB and rising), and the peformance has been what you could call "lagging" in the last few weeks. This is mostly to do with another problem with indexes - but that's a whole other story for a whole other post.

I was trying to think of some other ways that could marginally improve the performance of SharePoint, especially in regards to the time taken to load an individual page in both an SPS Area and a WSS Site.
I remembered looking at IIS compression previously, but had never had the need to implement it before. So I decided to give it a try on our staging portal, just to see what results it may produce. I did a bit of investigating in regards to specific configuation settings for IIS 6.0 HTTP Compression and SharePoint and came across a great article written by Maurice. He provides some excellent advice and is a must read before you even think about implementing any compression for your SharePoint installation.

So I followed the advice not expecting much, but to my surprise, this fairly simple configuration seemed to make quite a dramatic improvement in regards to the time taken to load pages in SharePoint.

To cut a long story short - I was so happy with the performance gain on our staging portal that I implemented it on our production portal - and the results are a vast improvement.

There is no point in re-inventing the wheel and have me write the configuration steps involved, so if you want to know more about IIS 6.0 HTTP Compression - read about it over on Maurices Blog

My advice is - check out IIS 6.0 HTTP Compression for some great performance gains on your SharePoint Portal Server or Windows SharePoint Services installation - but make sure you read up on it first, as wrong configurations can actually have negative effects on performance. I pretty much followed Maurice's article to the letter - except I didn't include .dll and .exe files in the compression of dynamic files.

2005/2/21

Areas Vs Sites

I'm back from spending all of last week in Canberra for work... <W00t!>

The topic I wanted to post about today is: Areas Vs Sites

I have read a few articles on this topic and there a few differing opinions on how to use SharePoint Portal Server Areas versus the use of Windows SharePoint Services Sites and there is also quite a bit of confusion on what they are.

The reason why there are differing opinions is because not everyones use of Sharepoint is going to be the same. It is an extensible platform and for that reason there is no right or wrong approach to how you should use either Areas or Sites, but there was a concept behind Microsofts design and what their intended purpose was.

I thought I would try to explain the concept of Areas and Sites from how I have seen and used them in my day to day experiences.

As it has been outlined by Microsoft and by a few other SharePoint Gurus, The idea behing SharePoint Portal Server is, that it was designed to be an aggregator. A place you can go to to find information quickly and easily.

There is no point putting ALL of your collaborative documents and lists in a Portal Area, as that would sort of defeat the purpose of what an area was designed for.

Windows SharePoint Services Sites are the place to put ALL your documents and lists relevant to a task, business unit, project etc. They are typically refered to as "Team Sites" because you can allow a team of people to "collaborate" all of their work into one central place.

Let me try and think of a good analogy for Areas and Sites.....

Take for example my old High School Biology text book. You could say that the entire textbook was the portal. Each chapter would be about a different topic - just like each Area is about a different topic or department etc.

At the beginning of each chapter there would be a Chapter Summary, which highlighted the most important information that you needed to know about the topic you were viewing. So if you couldn't remember something and had to cram the night before, you would always go to the Chapter Summary and you would then have a general idea of what you needed to know. This is the equivalent to the content displayed in an Area. It is generally the most used or important information to a particular business unit (or department) and is easily accessible from the Area.

But how about the rest of the information? The stuff that may not be in the Chapter Summary (Area) but evidently, information that you may need to read. Well this is when you would need to read the chapter itself and in contrast to the portal - you would need to actually visit the WSS site related to this Area, to locate information that may be more relevant to your needs. The WSS site contains all the linking information that you may want to know about.

Book = Portal
Chapter Summary = Area
Chapter = Site

Ok...this was probably not the best analogy - but hopefully, you get my drift :)


As a rule of thumb, I would suggest only the dependable, completed, and Information which is relevant to an enterprise wide audience, should be available from a portal area. All other draft, correspondance or collaborative documentation should remain on a team site.

Pros and Cons:

Areas allow only one level of security across the whole area, where as in a site you can set permissions on indivual Libraries and Lists.
So if you have multiple document libraries and lists in an area - The user permissions you set in the "Manage Security" option for the area will be the same across all Lists and Libraries.

Areas are easily located on a portal, where as you will need to know the actual URL, content or have a well designed Site Directory to locate the site.

Sites are better for managing external access to (extranet). You probably won't want third parties accessing your portal to look at information in Areas, as the portal is more of a productivity tool for internal use. Having a separate site can allow you to provide access to external resources, and lock down content to a specific level.

Hope his cears things up for those who are a little bit confused about Areas and Sites.

 

 

2005/2/16

Effective Email Management

Via 43Folders

Not really SharePoint related but still a great article for those who find they are swamped with incoming email and can't seem to keep up.

 

 

 

2005/2/11

Lack of posts

Hmmm...just got reminded that I haven't really posted anything up here in a while.

Been a little busy and have also just started a new job, so haven't had much time to write alot.

Got a few ideas on what to write about next - going to try and step away from FrontPage a bit and focus more on the SharePoint Platform. Plus I may put up a couple of downloads which are useful with SharePoint.

Hopefully there will be some new content in the next few days.

 

2004/12/22

Re-arranging links in the SharePoint Quick Launch bar

Something that annoys me greatly when you're in a Windows SharePoint Services site is, when you add a link to the quick launch bar, it appears in the order it was added. You have no control over the order in which it is added. You'd think that it would seem more logical to display the links alphabetically rather than, no order at all?

The problem with this is, when you want a certain link to a document library or list to appear before another, your only real option in WSS is to remove all the links, then add them back in the order you prefer, but usually once you have them in nice logical ordering, someone decides to create a new document library or list, and you will need to change the order all over again - pretty time consuming and annoying.

Q: So what can I do to make this process a easier and less time consuming?
A: Microsoft FrontPage 2003

FrontPage 2003 gives you the option to add and change the order of the links in the quick launch navigation bar, very easily.

NOTE:

If you do change the way the links are displayed by editing them in FrontPage, you will cause the page to become unghosted.

For more information on ghosted and unghosted pages and how this could affect you, read Maurice's article on SharePoint Thoughts.


To edit the quick launch links in FrontPage 2003:

1. Open Microsoft FrontPage 2003
2. Click on File > Open Site
3. Type the url of the site you want to edit and click "Open"
4. Double click on the default.aspx file that is displayed in the folder list.
5. When the default home page appears for the WSS site you opened, double click on the area of the quick launce navigation bar that you want to edit (e.g. Documents, Lists etc.)
6. When you double click on the area you want to edit, a dialog appears like this one.
7. You can then select a specific link and use the "Move Up" or "Move Down" buttons on the right of the list to organize the links in a way that you prefer.
(N.B. If you select the "Styles" tab on this dialog you can also change the appearance of the menu with some pre-defined styles in FrontPage)
8. Click "OK" when you are happy with the way you have organized the links

Synchronizing a Remote Windows SharePoint Services Site

In my last post I mentioned something about the "Remote Web Site" option in FrontPage 2003.

I have found this option really useful, especially when I have two WSS sites residing on different servers, but I want to keep the same documents and/or lists synchronized on both sites.

This is also a good feature if you have an office located in a different country, running a WSS site in a different language. You can leave all the updating of announcements, events, links etc, up to the local office, but keep all documents/list content which may be used globally up to date and synchronized from the one location.

To use the Remote Web Site feature in FrontPage 2003:

1. Open Microsoft FrontPage 2003
2. Click on File > Open Website
3. Type the url of the local site you want to open. E.g. http://server/site/
4. Click "Open"
5. When the local web site opens, click on the "Remote Web Site" tab directly underneath the folder list window.
6. You will then be prompted to click on the "Remote Web Site Properties" button
7. When you select the properties button a dialog will appear like this.
8. Make sure the "Remote Web server type" selected is "FrontPage or SharePoint Services"
9. Type the url of your remote web site at the bottom and click "OK"
10. You will then see a window like this.
11. At the bottom of the window you will see that you have 3 different options under the "Publish all changed pages" heading:
  - Local to remote
  - Remote to local
  - Synchronize

These are pretty self-explanatory, but you can see it gives you an easy way of handling the published content on both sites.

12. Once you have made a selection, click on "Publish Web site" and the options you chose will then be published.

There are quite a few settings that you can modify with the Remote Web Site feature, such as publishing changed pages only, publishing all pages, including sub sites etc. but I will let you take a look for your self.

More information on FrontPage and it's features can be found here