Implementing logging in SharePoint 2010 using the SharePoint Guidance library

By bhoeijmakers at December 04, 2011 08:18
Filed Under: .NET, SharePoint 2010

In this post I will talk about a way to implement a logging component in SharePoint 2010 that uses the Microsoft SharePoint Guidance Patterns and Practices library. The SharePoint Guidance library contains a lot of cool and very useful components. I will only focus on the logging component in this post and how to use it in practice to create your own logging component. In this post I am creating a Farm Solution. In a later post I will talk about how to do this in a sandboxed solution.

 

If you don’t want to read the theory and go straight to downloading the example solution, click here

 

More...

Taxonomy fields revisited: Getting the Term Store programmatically

By bhoeijmakers at November 04, 2011 16:12
Filed Under: .NET, SharePoint 2010

In my series of posts about using Taxonomy Fields in SharePoint 2010 I am using code to do all kinds of stuff with Taxonomy Fields and Terms from code. Because I can´t leave those fascinating Taxonomy Fields for what they are, here is yet another post about this subject Smile 

 

This is a follow up on my previous posts on this subject:

Using Taxonomy Fields in SharePoint 2010 - Part I

Using Taxonomy Fields in SharePoint 2010 - Part II

Using Taxonomy Fields in SharePoint 2010 - Part III

 

This post is meant for those of you that have read the previous posts (or attended one of my sessions on Managed Metadata Fields), and want to know more in order to write better code.

 

To get the Term Store from code I was using the following code in the Using Taxonomy Fields in SharePoint 2010 series of posts:

 

// set up the field for my termstore
TaxonomySession session = new TaxonomySession(site);
 
if (session.TermStores.Count > 0)
{
      // get termstore
      TermStore ts = session.TermStores[0];
 
      // more code here...
}

 

This is not very robust code and should not be used in a production environment. The code above gets the first (default) Term Store from the Taxonomy Session. But what if there are multiple Term Stores associated with the Web Application? In this post I will show you how to get the Term Store programmatically the right way More...

Creating a sortable CoreResultsWebPart in SharePoint 2010

By bhoeijmakers at February 16, 2011 18:41
Filed Under: .NET, SharePoint 2010

If you are using the out of the box SharePoint CoreResultsWebParts to show your search query results, you are limited to two options for sorting your results: Relevance (Rank) and Modified Date. What if we want to sort our search results to some other column? This post describes how to write code to create a custom CoreResultsWebPart that lets you sort search result on any column you want. Pretty sweet, so let’s get to it! More...

Using taxonomy fields in SharePoint 2010: Part II

By bhoeijmakers at November 21, 2010 02:13
Filed Under: .NET, SharePoint 2010

In this series of posts I will talk about using Taxonomy fields in SharePoint 2010 development. They are a funky bunch and don´t work quite as you would expect. I will talk about the following subjects:

 

Introduction

Part I: Declaration and initialization

Part II: Using taxonomyfields programmatically (you are reading it!)

Part III: Searching taxonomy fields

 

The other part will be online in the next couple of weeks.

 

In this part I will talk about using the TaxonomyFields in your code. Read part I of my series to read about how to declare a TaxonomyField and create a contenttype containg the field.

 

Creating the basis

If I create a custom list on my site called TaxList and add the contenttype I’ve created in part 1 of this series to the Content Types of the list, I get a list with the following settings: More...

About the author

Bart-Jan Hoeijmakers is Lead SharePoint Developer at VX Company. Since 2006 he is the driving force behind the development of several enterprise SharePoint projects within VX Company. He is a hardcore developer in both SharePoint and ASP.NET and loves to dive into the dark sides of SharePoint development.

Month List