Friday, 4 December 2009

I was following the “Deploy Office Web Apps (SharePoint Server 2010)” beta guide published by Microsoft and got to the part on page 8 where it describes how to create the service applications and their proxies using PowerShell.

Well, I didn’t even get past the first line without PowerShell reporting an error. I could have switched to the UI and configured it there, but as I decided to crack the problem instead. After a good old trial and error session, the script now reads:

Thursday, 12 November 2009

I came across a problem with the global navigation in a MOSS site collection where the top navigation bar only showed a link to its own site and another one showing the word “Error”.

When you hovered over the link, it displayed the message “An error occured while rendering navigation for requested URL” with a “The system cannot find the file specified (Exception from HRESULT: 0x80070003)” exception message. When I tried to change the navigation using the normal site settings option, it gave me a “File Not Found” message with a pretty large and undecipherable stack trace.

I tried deactivating the publishing features at both the site and site collection level, which returned the normal WSS navigation bar back successfully, but when I reactivated the features, the problem came back again.

I thought I might have more success via the Object Model, so I developed a small Windows application that goes through all the navigation nodes and deletes them one by one. I ran this application pointing at the relevant site collection and although it reported a “Cannot complete this action. Please try again” message, it did enough to get rid of the Error message in the navigation bar and allow me to go back into the navigation settings using the browser and delete the remaining nodes.

I have uploaded the application to my SkyDrive, in case it helps anyone else out there: Download

Thursday, 1 October 2009

I tried to delete a custom master page in MOSS 2007 and it gave me the following message:

“This item cannot be deleted because it is still referenced by other pages”

Microsoft published a workaround for this here, which suggests hiding the master page, but I needed to replace it with a new one and hiding it didn’t seem like a good idea to me. So, I thought I’d try and delete it in SharePoint Designer, which showed exactly the same message as the browser UI. I then tried to delete the file in Windows Explorer, and it disappeared, but then reappeared in the UI again. Grrrrrr!

I also noticed that if I tried to change the properties of the file, it gave me a “There is no file with url” error, which pointed to some sort of corruption or orphaned file. I uploaded a new file over the top to resolve this error, but I still couldn’t delete the file.

Not a perfect solution, but the only way I could overcome the problem was to open the Master Page Gallery in Windows Explorer, create a new folder (I called it “Unused”), and move the master page into the folder. I could then upload the new master page and use it as normal. You will still probably want to perform the actions suggested in the Microsoft article referenced above to hide the faulty one, or it will appear in the Site Master Page Settings page in Site Settings, otherwise you will have two master pages to choose from – the replacement one recently uploaded and the old one preceded with the name of the folder you created to hide it.

Wednesday, 9 September 2009

I was writing a small Windows application for a customer to create keywords and best bets using a CSV file and experienced a weird problem. I used the code published here by Stefan Goßner as a starting point, which successfully added the keywords to the Manage Keywords UI in Site Collection Administration, but when I tried to search on one of the keywords, no best bets were shown in the search results.

I then found that if I clicked on one of these keywords in the Manage Keywords UI and clicked OK without changing anything, the search for that keyword worked. I eventually discovered that SharePoint didn’t like adding the semi-colon delimited synonyms as a single string and that they needed to be created separately. Therefore, I changed the code to below, using the semi-colons to split the string up into an array of separate synonyms, which worked:

Multiple Site Manager for SharePoint is a server tool which allows administrators to create, delete, and manage SharePoint 2007 sites, site collections, and My Sites either using a CSV file. Site columns with specific settings can also be created using XML.

Full details can be found on the Codeplex site. If you have any questions or requests for future releases, please let me know.

Wednesday, 22 April 2009

Here are some steps you can use to create a Web Part using SharePoint Designer that displays a new item form for a list with a submit button. It provides an interface for users to be able to post feedback or requests for information (brochures, documents, etc.) without having to go to the standard new item form for the list. The advantage here is that you can add this Web Part to a dashboard or home page to provide a better user experience.

First, we need to create the list. In this example, I would like to give users the option of requesting a number of different brochures. I have created a custom list called “Brochure Requests” with the following columns (I have renamed the default “Title” column to “Your Name”) – The “Brochure Type” column allows the user to choose which documents they wish to be sent:

Go to the page on the site where the Web Part will be created (To prevent the live page from being customised by SharePoint Designer, you may want to create the Web Part on a dummy page in the same site, export it to a file, import it on the live page, and delete the dummy page).

Edit the page in SharePoint Designer, click on the Web Part zone, and select Insert Data View from the Data View menu.

From the Data Source Library, click on your custom list and select Show Data.

Select the columns that you would like to show in the Web Part (for my example, I have chosen Your Name, Your Address, and Brochure Type), click the Show Selected Fields as… button, and select New Item Form.

The Web Part will now appear in the page. From here you can change all sorts of options to style it how you want. I need to change the text on the Save button to Submit, so I have double-clicked the button and changed the Value/label setting.

Once finished, save the page.

Go to the page in the browser and give it a try.

When users click the Submit button, the item will be created in the list. Because the columns are referenced directly from the Web Part, if you make any changes to them (e.g., add a new brochure type), these will automatically appear in the Web Part.

Once this has been done, you can start adding more out-of-the-box functionality to the list. For example, you could set up an alert on the list so that members of the reception desk receive an e-mail when a new brochure request has been posted. They can then go to the item directly from the e-mail and send the brochure to the address specified by the site visitor. You could also have a “Brochure Sent” yes/no column created in the list that was exposed in a “Brochures to be sent” list view, so that reception workers can view outstanding items and confirm when a brochure has been sent to clear it from the list view.

Tuesday, 7 April 2009

If your looking for an easy way to create a Web Part which allows users to launch applications from a page on a SharePoint site, then it can be done with the Content Editor Web Part, as pictured below:

You will also need to set "Prompt" or "Enable" for the "Initialize and script ActiveX controls not marked as safe for scripting" security option in Internet Explorer for the zone in which the portal is accessed. If this is an intranet, this should be fairly straightforward as your site should already be present in the "Local intranet" security zone, and more often than not controlled by a Group Policy. This is more difficult if your site is accessible as an extranet site because these machines a) may not trust the site and b) are quite often not controlled by a Group Policy. Obviously, this will relax the security for that zone in the browser, so do not modify this option unless you are sure about doing so.

Tuesday, 24 March 2009

If like me you have SharePoint 2007 and Windows Server 2008 installed on the same computer for development purposes, you may find that you have problems signing into your SharePoint site once Internet Explorer 8 has been installed.

Update: This also appears to be happening on IE7 after the installation of recent Windows Update KB963027 - Thanks Virinder for the update.

The sign in request seemed to be trying to log me on using a domain name called PORTAL, which doesn't exist but is the NetBIOS name of my SharePoint site URL - portal.pacdomain.local. When I tried signing on using the DOMAINNAME\Username format, the logon failed with the same message in the event logs.

To resolve the issue, I followed the steps documented in the following article - http://support.microsoft.com/kb/956158/en-us, which seems completely unrelated to the issue I was having as it references a problem when using SQL Server 2008 Reporting Services.

Thursday, 12 March 2009

There are many scenarios where you might want to store metadata on a site - for example, if you are creating project team sites, you might want to attach the project reference number, manager, RAG status, etc. If you are into development, you can do this by writing to the site property bag, but if you're not, the easiest way I have found is to create a custom list on the site and add your site information to the first item in the list.

This is very easy to do, and of course users will be able to add the information using the standard list edit form in the UI and you can assign appropriate permissions for specific people to add this information to the site.

There is one request I have had from users though, and that is to show the metadata in a Web Part on the home page of each site and allow new sites to be created from a template which also show the metadata on the home page by default. Whilst not the biggest fan of SharePoint Designer, it does allow you to do this quite easily:

1. Create your list on the site (I have called it Project Information for this example)

2. Create the columns to contain the metadata that you wish to store

3. Add at least one item to the list - I usually populate it by populating the Title column value with "Complete these details for this project by clicking "Edit Project Information" in the left-hand navigation" and creating a link to the EditForm.aspx file in the Quick Launch.

4. Create a new Web Part page on the site as a temporary home for your Web Part.

Monday, 23 February 2009

One thing I get asked for from time to time is to display the latest SharePoint version information in Office documents and templates. I have always found it easier to create new custom columns for this and populate them using an event handler.

Seeing as though I think this may be useful for others, I have uploaded some code and resources to Codeplex which provides this functionality. It comprises of two components:

- A site collection feature to deploy four new custom site columns for use in Content Types or document libraries where version information is to be shown in Office documents.

- A site feature which implements an event handler to populate the custom columns with version information for any document library present in the site, including the current version, when the document was last approved, who approved it, and when it was approved.

Once the custom column information is being populated by the event receiver, it can be shown in Office documents using the Quick Parts (Office 2007) or Fields (Office 2003 or 2007) features.

Friday, 13 February 2009

I think Microsoft has done a really good job with their Best Practices Resource Center for SharePoint Server 2007. It breaks down the main consideration areas and offers best practice tips in short bullet points with a link to show more detail. This site is a must-read for anyone involved in SharePoint solution architecture and development: http://technet.microsoft.com/en-us/office/sharepointserver/bb736746.aspx

Thursday, 12 February 2009

I have just added my Sign In Web Part to Codeplex. It's quite a simple Web Part really, but I have used it for a couple of customers who wanted to make the Sign In facility more prominent than the "Sign In" link in the top right corner of the page.

Once the user has signed in, the button will disappear and a message can be shown in its place, or if the authenticated message is left blank in the Web Part properties, no message is shown and the Web Part will appear invisible to the user.Both the button and authenticated message control can be customised with a CSS reference for styling, the dimensions of the button can be modified, and the authenticated message can be changed:

Monday, 9 February 2009

Whilst researching a requirement to provide people search results in a grid view, I came up with this solution using out-of-the-box MOSS Web Parts. It comprises of a new people search results page, Content Editor Web Part showing the A-Z links, and the standard People Results Web Part with changes to the XSLT to show results in a table view, as shown below.

Because it uses OOB Web Parts, you get the usual search refinement facilities on the left, and of course any federated or faceted search options that you may want to configure on the page. I have configured the XSLT so that you get the presence icon next to the person’s name, a mailto link for their e-mail address, and their profile page will open in a new window when their name is clicked. You can obviously change the XSLT to show extra columns if required.

Friday, 30 January 2009

Roger Lamb has added an excellent page on the MSDN site covering best practice around SharePoint object disposal, including links to the updated MSDN article and the new SPDisposeCheck tool, and a quick reference guide on the page itself.

Monday, 26 January 2009

One of my customers reported the message "FatalError: Value does not fall within the expected range" during the "Importing List Master Page Gallery" process when using the STSADM import command to restore an STSADM export file over a new site collection. Running the STSADM import routine a second time on the site collection successfully completes with no errors or warnings.

I have since discovered that this issue was present after the customer installed the Infrastructure Updates for SharePoint and is now fixed in the December Cumulative updates package.

However, they have also reported another problem after testing a site restored using the STSADM import routine. All existing document libraries and lists created before the export are fine, but if they create a new document library or list in a site collection restored using the import command and edit the properties of a document or list item, they receive the message "Access Denied" with the standard message asking them to sign in as another user - even if they are the site collection administrator.

I raised a PSS call regarding this issue and a hotfix is currently being developed to resolve it, although the hotfix will only fix new site collections restored using the import command AFTER the fix has been applied. Any existing site collections where the issue currently occurs will remain broken. The hotfix should be available in the next cumulative update release.