March 2010 Entries
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....
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: ...
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...
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...
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...
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...
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...