HowTo

HowTo
Creating a custom Refinement Filter Generator

A few months ago I added a post on configuring the Refinement web part that ships with SharePoint 2010. The post is mainly focussed on the Filter Category Definition property and the XML that you can add in there to configure the Refinement panel to do what you need. Since then the good folks as MS have added more in-depth documentation to MSDN covering this topic. In this post I want to move on from that and look at how you can develop your own custom filter generators and call them using the Filter Category Definition property. One situation...

posted @ Friday, August 20, 2010 3:41 PM | Feedback (0)

Combining LINQ to SharePoint and LINQ to Objects

Although the join syntax in LINQ to SharePoint is very powerful, sometimes there are situations where you won’t be able to retrieve the data that you need using this syntax. Sometimes there may be operations that you require that are not permitted on the LINQ to SharePoint provider since they are considered inefficient. Performing an in memory sub-query As an example, let’s imagine that our sample application requires a list of asset tags and locations codes for a particular contract, but only where the locations are also being used to store assets that are subject to another contract....

posted @ Tuesday, March 16, 2010 12:08 PM | Feedback (0)

Creating a web service to access BCS data in SharePoint 2010

Programmatically accessing BCS data BCS exposes an extensive object model that allows developers to create clients applications that leverage the flexibility of the BDC service. Using this object model we’ll create a simple web service application that will demonstrate some of the major functions of the API. In Visual Studio 2010 create a new ASP.Net Web Service Application project. Name the project ModelDataWebService.Remember to set the CPU to x64. Add references to: Microsoft.BusinessData (listed as Microsoft® SharePoint® Foundation Business Data) and Microsoft.SharePoint. Connecting to the BDC Service Add a new web method as follows: ...

posted @ Monday, March 15, 2010 10:14 AM | Feedback (3)

Using the Refinement Web part in SharePoint 2010

20 Aug 2010 Update : I’ve added an article on creating custom refinement generators here. The RefinementWebPart can be used to automatically generate a series of refinement filters for a given result set. Refinements are basically property filters that derived from a result set. So for example, if a result set contains results of different types such as web pages and Word documents, there refinement web part will show refinement option for only web pages or only Word documents. Let’s look at how the RefinementWebPart works in a bit more detail since a good understanding of the inner...

posted @ Sunday, March 14, 2010 10:20 AM | Feedback (7)

Make a Custom Activity available to SharePoint Designer 2010

Creating custom workflow activities for use in Visual Studio is all fine and well but what happens if we want to make those activities available within SharePoint Designer? Thankfully the process is pretty straightforward. Since SharePoint Designer is a client tool, it’s designed to run remotely as opposed to on the SharePoint Server. As a result of this, when determining which workflow action should be available for use on a particular site, SharePoint Designer connects to the server to retrieve a list of available actions. The list of actions is stored at %SPRoot%\Template\1033\Workflow. In this folder there are a...

posted @ Saturday, March 13, 2010 9:58 AM | Feedback (2)

Joins in LINQ to SharePoint 2010

You may have noticed above that the Join extension method is not permitted within LINQ to SharePoint. However, this does not mean that retrieving related data isn’t possible, only that arbitrary joins are not supported. Where the relationship between two entities is defined by a lookup column, retrieving related data is permitted and in fact is actually achieved using a much simpler syntax than is required by the Join operator. Simple join private void button8_Click(object sender, EventArgs e) { using(SampleDataContext dxRead = new SampleDataContext(SiteUrl.Text)) { StringBuilder...

posted @ Friday, March 12, 2010 9:19 PM | Feedback (0)

Debugging Excel Services UDFs using Visual Studio 2010

Debugging UDF’s is not quite as simple as debugging other SharePoint artefacts. The UDF is called by the Excel Services service application which runs as a separate process. Bearing this in mind we have two options, we can either attach our debugger to all instances of the w3wp.exe process, or we can find out which process is being used to run service applications on out server. Discovering the ProcessID used to run a User-Defined Function Even though I’m sure that everybody will take the lazy option of attaching to all worker processes, here’s how we can find out...

posted @ Thursday, March 11, 2010 9:02 PM | Feedback (0)

How Deploy a WCF Service To SharePoint 2010

The new packaging and deployment stuff for SharePoint 2010 is certainly a lot better than VSeWSS but there are a few things missing, such as the ability to add a WCF service as a project item. One of these days I’ll build a template to do it but for now here’s a quick step by step guide. Add SVC file to Layouts folder To make a Windows Communication Framework service available we need to host it somewhere. Since SharePoint runs on IIS, we need to create a .svc file with details of the service implementation. Of course before...

posted @ Wednesday, March 10, 2010 8:39 PM | Feedback (2)

Disentangling Render Patterns

I few months ago I posted on RenderPatterns and how they are used when creating custom fields for SharePoint. In that post the point I was trying to make was that when viewing data in a list nothing else matters except the render pattern. None of your highfalutin C# SPField derived classes can save you from the madness that is the render pattern. Never mind what MSDN says about using an .ascx control - there is no other way. So with that said, given that we’re stuck with the render pattern, it would be good to know a bit...

posted @ Tuesday, February 02, 2010 9:35 AM | Feedback (0)

Automatically generating thumbnail images in SharePoint

When you upload images to a SharePoint picture library three images are actually stored. Firstly there's the actual image that you uploaded then there are two others with specific sizes. There’s a thumbnail image that’s scaled to a particular width and is used in the default ‘All Pictures’ view then there’s a web image that’s resized to a specific width and height. The thumbnails are saved to a hidden folder in the picture library named _t and the web images are saves to a hidden folder named _w. Let’s say you have a few web parts that make use...

posted @ Thursday, January 28, 2010 2:32 PM | Feedback (0)

Full HowTo Archive