It seems like I’ve been doing Project Programmability webcasts for months… oh yeah I have :). There are still two more left, check them out:
| Date | Session Title |
| April 23, 2009 | Office Project Client Programmability |
| May 14, 2009 | EPMAuditing Solution Starter Drilldown |
Both start at 8:00 AM PDT.
Yes it’s true I’ve been cheating on my blog and (it’s too embarrassing to say)… posting to another blog. If you want to see what I’ve done, go to the Project programmability blog. Here are the posts:
MSDN Webcast: Project Server Events and Workflows, Demos & Q&A
MSDN Webcast: PSI Review, Demos and Q&A
MSDN Webcast: PSI Programming Overview, Demos and Q&A
Everything in Project Server and SharePoint have Guids associated with them. A friend asked about generating new unique Guids for repeatable deployments. So of course I started writing a little console application to use System.Guid to generate the new Guid (I’m a developer, I always think in code). But as I started thinking about emailing an exe, an idea struck me... PowerShell. I had installed PowerShell months ago because I was told about using it to maintain my 20,000+ (and always growing) photo collection. But have never got around to using it. I fired up the console and the User Guide. I looked through the TOC and found "Working with Objects." Within 10 minutes I had figured out the syntax. So, cut to the chase...
[System.Guid]::NewGuid().ToString()
I have one word for this... SWEET! I look forward to playing with PowerShell more in the future.
I'll be delivering the upcoming EPMU Developer classes. I wrote this content about two years ago for beta participants on Project 12. It's been updated by a couple different people since then, it'll be fun to see the differences. Should you want to attend this, or any other EPMU classes you can go to the following link: http://www.msepmu.com/
Current schedule for the developer classes:
| Dates | Class | Instructor | Duration | Start Time | Time Zone |
| Sep 29th - Oct 2nd 2008 | Office Project Server 2007 Developer Training | Larry Duff | 4 Days | 8:45 AM | PST (GMT -8hrs) |
| Jan 19th - Jan 22nd 2009 | Office Project Server 2007 Developer Training | Larry Duff | 4 Days | 10:45 AM | EST (GMT -5hrs) |
| May 26th - May 29th 2009 | Office Project Server 2007 Developer Training | Larry Duff | 4 Days | 10:45 AM | EST (GMT -5hrs) |
After a year hiatus, I've found a doctor to do a partial reversal of my management lobotomy ;). I've done my management job so well, that I get to do that and some consulting on the side, you know like a hobby. Everyone needs at least two jobs, so I'll be working part time for the Project team once again.
I've already helped complete a web service that will allow editing/ creation of Project Portfolio Server 2007 projects. More details on that in the coming weeks when it's ready for launch. For the foreseeable future my focus will be on creating some Project Server 2007 tools and teaching development classes. Then sometime in 2009 I'll get to start working on the next version of Project Server and supporting early adopters. This will be my fourth version of Project Server I support for early adopters. I really enjoy seeing the progression of this product, it's been like watching a child grow up. And yes I am skewed to the server. The client has been around so long (17+ years I think) that many of the interesting customization and extension have been done. But should something interesting come up on the clients side, you can bet I'll be there.
I'm really happy to back with the community. There are so many great companies doing really interesting and innovative things, and people who do that work are unsurpassed and enjoyable to work with. I look forward to sharing the journey with you once again.
Last April I took a new job at Microsoft as a consulting manager. This means my Project Server development has been shrinking toward zero (obviously you can't let managers write code). I still get questions from people periodically from my blog. I realized that I never really announced that I wasn't maintaining this blog anymore.
So here is the announcement... Larry Has Almost Left the Building. OK, why almost?
One of the last things I did for the Project team was to write a solution starter. Hopefully it will be posted to CodePlex very soon, I understand there are some bureaucracy to get through before it gets posted. But I was asked to do a session at the Project Conference on Line of Business Integration with EPM. Part of this session will be to review the solution starter that I wrote. After Project Conference in October (or December if I go to the European Project Conference) I will be leaving the building.
I've enjoyed watching Project Server go from 25 methods (Project Server 2002), to a full blown API with eventing (Project Server 2007). Most of all I've enjoyed working with the hundreds (maybe thousands) of partners and customers around their development issues over the last five years. I'm confident the base we laid with Project Server 2007 will only be enhanced with the next release. I wish everyone the best... stop by and say hi if you're at Project Conference.
P.S. The link section on my blog has some of the other Project related blogs listed that you should find helpful.
I got a request over a month ago for my presentation from TechEd. I missed the request buried in the thousands of spam comments I get :(. So attached is the deck, you already have the samples in previous posts.
Under the Godfather heading of "Everytime I get out they pull me back in" I thought TechEd 2007 was my last speaking engagement for the Project team. Well as it turns out I'll be speaking at the Project Conference 2007 in Seattle, and possibly and the European Project Conference in Madrid. So I'll see you everyone at Project Conference.
This is the final sample from my TechEd presentation. It's an event that captures the Project Published. When the event is triggered, the project being published is read, then output as an Xml file.
Here we go with the second sample, the Project Server Explorer. This sample opens a list of projects. Then you can look through all the propoerties and DataSets for a selected project. The key was binding the columns in the DataSets to controls.
This year at TechEd I'm delivering the following session:
|
Code |
Title |
Date/Time |
|
OFC339 |
Enterprise Project Management: Developer Options |
6/8/2007 10:45AM-12:00PM |
|
As Project and Portfolio Server are deployed in many enterprise scenarios it is important to understand their integration capabilities with line-of-business systems (like SAP). This session provides you with an overview of Project and Portfolio Server 2007 Development features like PPSI (Project Portfolio Server Interface), PSI (Project Server Interface), Server Side events, and Workflows developed with Windows Workflow Foundation. |
While giving this session I’ve added in the following code demos:
|
Demo |
Description |
From SDK? |
|
PPSI General |
Looking at what is available through the PPSI |
Yes |
|
PSI General |
Creating and updating a project |
No |
|
PSI Dataset |
Spelunking through the custom datasets |
No |
|
Events |
A custom event handler |
No |
|
PWA Customization |
A custom web part for PWA |
Yes |
It would be silly for me to post code for SDK samples. So I’ll leave finding them in the SDK as an exercise for the reader. BTW all my samples are designed to run against the Litware demo database included in the EPM VM.
In this post I’m putting the PSI General sample, CreateProject. The sample creates a project with some tasks, then publishes it. Finally it adds some enterprise resources to the project. As with all samples, the code is not production ready, is meant to illustrate concepts not necessarily best code practices, and should not be deployed as is or Mr Biggins will put you in the comfy chair.*** Most of the calls are standard faire for PSI, but some of the utility methods I put in may prove useful for your work. The C# project is attached in a zip file.
*** (Watch some Monty Python’s Flying Circus if you don’t understand the reference)
Hi All,
It's been a while since I posted. Well there are two really good reasons for that
1) I've was working on two really big development projects
2) I left the Project team a few months back.
On the leaving, I'm still doing some part time work for the Project team through the end of June till a replacement is in place. One of the things I agreed to do before I took my new job was speak at TechEd. I'm here all week in Orlando working the booth, and I speak Friday morning on developing in Portfolio Server and Project Server. If you are in sunny Orlando for TechEd this week look me up in the Project booth. Also I'll be posting all my samples that I'm using Friday in some posts later in the week.
On the big projects, the first one is the EPMSync tool. If you have the EPM virtual machine you may have seen this mysterious tool. In a nut shell it does an item level sync from Portfolio Server to Project Server. Final release of the tool should be in the next month if we post it to codeplex (http://www.codeplex.com/) or a bit longer if it gets published as an MSDN solution starter. In any case there is some pretty detailed code in there for handling Project updates, specifically around custom fields and lookup tables. Sorry to you VB.Net guys, it's all written in C#.
My second big project is an installation tool for our demo database for Project Server 2007. This became a really big project because restoring a demo installation is a big job. Everything from restoring databases, creating shared service providers, relinking SharePoint sites to Project Server, etc... you get the picture. Doing this by hand takes patience and understanding. Doing this programmatically is a herculean challenge. I stalled for a month because the code for restoring WSS sites quit working. To make a month long story short I found out that some calls to STADM get a new signature when you install MOSS. Again this will either go with the SDK, TechNet, or Code Plex. There hasn't been a decision if the source code will be published. But if it is the code is published, its C# with lots of good tips built in.
It's almost midnight here, and I'm still on Pacific time (i.e. not really tired). But off I go to try to sleep. Watch for the TechEd sample in later posts.
Happy New Year all! I had a really nice holiday break at the end of December, I hope you all did too. As the New Year has dawned, so have more questions around Project Server 2007 development. I’ve actually been doing quite a bit of development on Project Server for a solution accelerator to Project Portfolio Server. Along with the questions, my solution accelerator has given me a number of ideas for posts, it’s just a matter of having time to get them “down on paper.”
One recurring use case is displaying a list of projects with their start and end dates (or any other basic information about a project like owner). After reading the SDK many people think that you can make just one call to get this information, even though the SDK is pretty good at pointing out you can’t, if you read deep enough. But heck we’re developers, we only read the whole page after something doesn’t work on the first try ( or after we debug it and can’t tweak it to work). The truth is you have to make one call to get the list of projects, followed by one call for each project to get the additional information.
So our first call would be the ReadProjectList… watch out not so quick. ReadProjectList is more intended for administrative application, it requires pretty high security clearances, ManageQueue and ManageSecurity privileges. The correct call here would be to ReadProjectStatus, which will return projects based on the current users permissions. I know, it’s a little convoluted, but don’t shoot the messenger. Here is an example of what that call might look like:
ProjectWS.ProjectDataSet readProjDs = projectSvc.ReadProjectStatus(Guid.Empty,
ProjectWS.DataStoreEnum.PublishedStore, string.Empty,
(int)PSLibrary.Project.ProjectType.Project);
Our second call will be to loop on the returned dataset for each project. In the loop we will request the specific information for each project. To get the full dataset for a project we call ReadProject. Here is a sample:
foreach (ProjectWS.ProjectDataSet.ProjectRow project in readProjDs.Project)
{
currentProjectDS = projectSvc.ReadProject(project.PROJ_UID,
GetProjectList.ProjectWS.DataStoreEnum.PublishedStore);
curProj = currentProjectDS.Project[0];
Console.WriteLine(String.Format("{0} Starts {1}, Completes {2}",
curProj.PROJ_NAME, curProj.PROJ_INFO_START_DATE.ToLongDateString(),
curProj.PROJ_INFO_FINISH_DATE.ToLongDateString()));
}
The issue here is that ReadProject brings back the complete dataset, and we really only want a couple extra pieces of data from the Project table. There is a solution, use the ReadProjectEntities method. Think of ReadProjectEntities as ReadProject but with a filter on it, and conveniently a filter that you don’t need to build. If we modified the above sample to use ReadProjectEntities it might look like this:
foreach (ProjectWS.ProjectDataSet.ProjectRow project in readProjDs.Project)
{
currentProjectDS = projectSvc.ReadProjectEntities(
project.PROJ_UID, PROJECT_ENTITY_TYPE_PROJECT,
ProjectWS.DataStoreEnum.PublishedStore);
curProj = currentProjectDS.Project[0];
Console.WriteLine(String.Format("{0} Starts {1}, Completes {2}",
curProj.PROJ_NAME, curProj.PROJ_INFO_START_DATE.ToLongDateString(),
curProj.PROJ_INFO_FINISH_DATE.ToLongDateString()));
}
We now have an extra parameter to deal with called ProjectEntityType. The ProjectEntityType is really useful because you can combine the values together to get groups of entities. For example you could get the project and custom field tables only. Look in the Project Server 2007 SDK for further information on what values can be used as entity types.
I hope everyone finds this useful. Attached is the complete code sample for your consumption.
I ran into a nasty little surprise the other day. I was writing some code to see if a Project has a WSS site associated with it. So here is the code that I’ve cut down for brevity:
private string GetWSSSite(Guid projectGuid)
{
ProjectWS.ProjectDataSet pds =
ProjWebSvc.ReadProject(projectGuid,
ProjectWS.DataStoreEnum.PublishedStore);
ProjectWS.ProjectDataSet.ProjectRow pr = pds.Project[0];
string WSSSite = pr.WPROJ_STS_SUBWEB_NAME;
if (WSSSite.Length == 0)
return String.Empty;
else
return WSSSite;
}
Essentially I read the project, and then either pass back the subweb name or an empty string. The only problem was the routine was throwing an exception. I bet you can’t guess which line was throwing the exception…. give up? It was the assignment of the WSSSite. I was getting a System.Data.StrongTyping exception. When I started to debug and dig it thing became a little clearer. It seems I ran across a project that did not have a subweb associated with it. Since the DataSet is built directly from the database tables, the column WPROJ_STS_SUBWEB_NAME was DBNull. The DBNull brought on the StrongTyping exception. To work around this I modified the code as follows:
private string GetWSSSite(Guid projectGuid)
{
try
{
ProjectWS.ProjectDataSet pds =
ProjWebSvc.ReadProject(projectGuid,
ProjectWS.DataStoreEnum.PublishedStore);
ProjectWS.ProjectDataSet.ProjectRow pr = pds.Project[0];
return pr.WPROJ_STS_SUBWEB_NAME;
}
catch (System.Data.StrongTypingException ex)
{
return String.Empty;
}
}
So the lesson here is when testing column value be careful they may throw an exception. To get a better idea of where you may encounter problems you can go into debug mode and put a breakpoint after you fill the DataSet. If you look through the row in watch mode you will see a number of exceptions. See the attached picture for illustration.
Also note in the code above you should be testing for exceptions from the ReadProject call, but I removed that to better illustrate the column exception.
Sorry I missed posting that the Project Server 2007 SDK is now live... that's what happens you you take some vacation :).
· SDK Download: http://www.microsoft.com/downloads/details.aspx?FamilyId=2672F6F9-7028-4B30-99A2-18CB1EED1ABE&displaylang=en .
The pj12ProjectSDK.exe download includes:
o pjSDK2007.chm (conceptual topics and managed code reference)
o pj12ReportingDB.chm (Reporting database schema reference)
o OLAPCubeSchemas.xls lists the dimensions, measures, and properties of the Project Server OLAP cubes
o SDK code samples, including the updated ProjTool source and executable.
· SDK Online: Project 2007 SDK in MSDN online library: http://msdn2.microsoft.com/en-us/library/ms512767.aspx
· Portal: Project Developer Portal in the Office Developer Center on MSDN includes links to the Project 2007 SDK, Project 2007 blogs, as well as the Project 2003 SDK. Following are the other main pages in the Project Developer Center:
o What’s New for Developers in Project 2007 includes links to MSDN Webcasts.
o Project Community includes an RSS feed for the Project 2007 Team Blog, and other Project blogs and sites.