SharePoint: Programmatically Creating InfoPath Form Instance Documents Part 2 of 2

Continuing on from part 1 of this 2 part series, we discovered the hows and whys of creating InfoPath form instance documents. This post brings together that information and demonstrates the code steps required to create an InfoPath form instance document and post it to a SharePoint document library. First we’ll grab the SharePoint content [...]

Read more

SharePoint: Programmatically Creating InfoPath Form Instance Documents Part 1 of 2

In this series of posts we will be creating InfoPath form instance (XML) documents programmatically using the SharePoint object model. In contrast to other articles about this subject, we will extract the goo required directly from the InfoPath form XSN file itself, the correct  InfoPath XSN file will be determined by the Content Type associated with [...]

Read more

SharePoint: Using the SharePoint Object Model with InfoPath Form Code Behind Part 3 of 2

Like the Spanish Inquisition, “Our chief weapon is surprise…surprise and fear…fear and surprise…. Our two weapons are fear and surprise…and ruthless efficiency……” In part 1 of this 2 part series we created an InfoPath form which used the SharePoint Object Model in it’s code behind to create new Task list items. In part 2 of [...]

Read more

SharePoint: Mapping Document File Extensions to Document Images

Mapping document file extensions to their corresponding image file names can be done quite easily using the XSLT extension functions found in the DDWRT namespace, namely the MapToIcon function. The DDWRT namespace maps to the DdwRuntime class found in Microsoft.SharePoint.dll in the Microsoft.SharePoint.WebPartPages namespace. Incidently, the reference for the functions found in the DDWRT namespace can be found here. [...]

Read more

SharePoint: Displaying List Data with Client-side Technologies jQuery, SPServices and jsRender

Having recently been immersed in developing client-side functionality for a SharePoint 2007 project I thought I’d share some of the techniques and tools I’ve used in doing so. The functional requirements in this project are pretty standard, the kind of stuff we do every day using server-side technology; Processes to create new data using some [...]

Read more

SharePoint: Using the CONTAINS Predicate with FullTextSqlQuery

The FullTextSqlQuery class is part of the Enterprise Search Query Object Model and is used to perform content queries using (amongst other things) managed properties and search scopes. This functionality is used by the OOTB search components, but obviously you can use it for your own purposes too, and when doing so you will need [...]

Read more

SharePoint: Checking Arbitrary User Permissions and why SPListItem.DoesUserHavePermissions is a Big Fat Dirty Liar

To clarify, the object model method isn’t a big fat dirty liar, but the documentation certainly is. This blog post is about checking permissions of arbitrary users against SharePoint objects which expose the ISecurableObject (this interface is marked obsolete in 2010 in favour of the new SPSecurableObject class) interface using the overloaded DoesUserHavePermissions method of; SPListItem.DoesUserHavePermissions(SPUser [...]

Read more

SharePoint: Programmatically Hiding a WebPart and Web Part Zone Spacers

Problem: You have developed a custom web part and under some conditions you want to hide it from view. A couple of solutions spring to mind; In your CreateChildControls() method you determine that you need to hide the webpart and simply create no controls, effectively returning before any controls are created. At some approriate point in the [...]

Read more

SharePoint 2007: Using the ListFormWebPart on a Publishing Page

I was attempting to re-use a ListFormWebPart in a custom webpart which would be placed on a publishing page, in this case the webpart would display the metadata properties for document library items using custom rendering templates, with the parameters for the List and Item Id’s being supplied by page querystring parameters. The initial code [...]

Read more

SharePoint: Dynamically Building Complex CAML Queries

Building CAML queries dynamically can become a gnarly problem, especially when the definition of the query contains some non determinate elements, i.e. you know the combinatorial form of the expression(s) but the expression(s) conditions are 0..n. Building an expression such as this becomes a tricky programming problem, given the way in which <And>, <Or> elements are [...]

Read more

Mac: Converting a VMWare Fusion Virtual Machine to Parallels Desktop

I’ve been using Parallels Desktop for Mac for nearly 2 months now as my day to day virtualization platform for SharePoint development, having shifted over to Parallels from VMWare Fusion 4, I have to say I’m very happy with the experience and the pro’s I outlined in a previous post have all continued to be [...]

Read more

SharePoint 2010 Document Lifecycle from an Event Receiver Point of View

On a recent project I needed to write an Event Receiver for a document library which set item level security on the document library items. Given the nature of document content management and the various ways in which a document library can be configured (content types, approval, check-in/out, versioning etc) I needed to understand the [...]

Read more

Round Box Effects in SharePoint with CSS3Pie

Boxes with rounded corners seem all the rage these days, unsurprisingly perhaps, since there seems to be some neuro-biological factors which make rounded corners easier on the eye, or perhaps that should be the brain (I saw some random post about the subject somewhere, probably off twitter). So looking at how you can get this effect [...]

Read more