Making Project Server Development Easy

/, Development, Project Server Development/Making Project Server Development Easy

For at least 9 years I worked on a project called mpFx, which is just marketing-speak for a library that encapsulated the Project Server Interface to ease Project Server development. It started out open source and then shipped with a product later on as an internal asset.

You can find plenty of information about it with this search.

Time (Again) for An Encapsulation Library for Project Server and Beyond

When CSOM arrived (Client-Server Object Model) for SharePoint and Project Server 2013-2016 and Online, I knew there was another opportunity to make things just a little easier, although this time around the easing was less painful in the birthing because the CSOM is a nice API to start with.

I did some preliminary work on an encapsulation library but I didn’t get deep into it until joining DeltaBahn LLC, where I am chief architect. Sorry folks, this one won’t like end up open source, but I will share pieces of it that may help you out.

But, to wet your whistle, I will give you and idea of the overall API layout I am designing by showing you some sample code and then I will dive into a particular piece of the code that may help somebody out there.

CloudClient for Project Server Development

This time around, my encapsulation library covers much more than the PSI. It includes functionality for working with SharePoint, Project Server, Project Server oData, and some Azure features as well.

Let’s take a look at connecting to Office 365 with a “Scope”, which defines which major components of Office Online you want to work with: CSOM for SharePoint, CSOM for Project Server, and Project Server oData. This scoping approach allows you to be light as your requirements demand.

What follows comes from my unit tests. The method is called from the ConnectTest unit test:

You can see in the creation of the ServerOptions, towards the end, the Scope, which is the union of bit flags that signal the API which component parts to initialize.
Another unit test enumerates through the projects and tasks. In this case I am doing some additional processing on a project called “CTA Test I”, which is where we will dive into my “how-to” for this post.

How-To Read Text Custom Fields Backed by a Lookup Table

I a not doing anything in particular with the custom field values except for in the method object result = client.CustomFields.GetTaskValue(task, customField, out isList).   Text fields in Project Server have the unique condition of being either text, a textual lookup value from a lookup table, or a list of entries from a lookup table.
The situation is this:  I have two custom fields backed by lookup fields.  One allows for more than one selection, and another allows a single selection. I call client.PSLoad(task); which is a shortcut for LoadQuery and Execute, which in a production application would use generics to include just what you need, like this: However, for the purposes of getting to the meat of what we are doing here with lookup fields, I just load the entire task.  Let’s take a look at that. What follows is the output. Towards the bottom of the listing, in bold, the single-value lookup and the multi-value lookup values are apparent. You will notice that when you unpack the string array, each element of the array will begin with “Entry_” followed by the GUID of the lookup value.

Okay, that’s it for this evening.[/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]

By | 2017-11-17T11:30:35+00:00 May 16th, 2017|Categories: .NET, Development, Project Server Development|Tags: , , |Comments Off on Making Project Server Development Easy

About the Author:

Thanks for taking the time to read my profile and presumably my posts. I am a big city person living in a tiny town that offers no distracts from my passion: Creating software that helps others be more productive, happy, and enhances their work or personal life. I am a life-long learner, builder, writer, tinkerer, and when duty calls, an focused engineer and project manager.