Monday, September 24, 2012

TFS 2012 - Web Access Plugins

Update 1

Found a blog series on how to write custom work item controls (plugins) in javascript (which is quite old, oops).  Custom controls don't seem all that exciting to me, but there may be enough information there to develop something else with the information.

Update 2

Tiago Pascoal has released a Plugin that enhances the Task Board

Update 3

Wrote my own very basic plugin to make the logo a clickable link
While using the new WebAccess for TFS 2012 I noticed an interesting tab in the administration section named extensions, but it appears Microsoft haven't made the API public yet (1) so I thought I might have a quick dig to see what I could figure out.  Because the information has not been made public by Microsoft there's a good chance it will all change in upcoming TFS builds.

The Plugins
Plugins appear to be uploaded as a zip file containing an xml manifest file which defines its name, version, vendor and a few other properties. The author can also specify which other modules it loads after suggesting it has some form of dependency management.

All files included in the archive appear to be uploaded to a filestore somewhere, but the only required file that I could see was the manifest.xml.  Unfortunately whenever I tried making a extension I got the error message "TF400900: Invalid zip archive file :" upon upload, no resolution as of yet.

Registered plugins are added to a common xml file and serialized to a database or other persistent storage. Neither my TFS_Configuration nor Team Collection databases appeared to contain this file, more than likely it is created when the first plugin is uploaded.

There's a couple of properties and an ActionFilter that make it look like javascript plays a big part of these plugins. The website itself does reference a file named builtin-plugins.js, which then references a bunch of other javascript files by name.

The builtin javascript plugins align very nicely with the areas defined earlier, although not a 1 to 1 mapping.

I curious to see a lack of NuGet, it would have made a great plugin repository as seen in a number of projects now and would have provided a few major benefits such as better dependency management and a distribution channel. Although given Microsoft's recent announcements of other App Stores maybe they plan to take the same route with TFS.

Another point of interest is that TFSPreview does not appear to have this tab, which would be a curious ommision if they are just javascript scripts.

Portable Areas

TFS 2012 also seems to make heavy use of MVC areas, each area defined seems to be separated into its own assembly file containing the relevant controllers, viewmodels and other relevant code.  Some form of portable area code must have been developed, although i'm guessing nothing was taken from either MvcContrib nor Orchard.

Interestingly they don't appear to take advantage of the new WebAPI, nor do they use razor for their view engine. But they do typically contain a basic controller for serving views with little logic and an api controller to query via json.

While i haven't had the time to dig into this whole thing properly it looks like it should be possible to create complete new tabs/areas using MVC in the new webaccess, or to augment the existing ones using javascript plugins.  Considering how much of the UI appears to be created on the clientside this could be a very powerful little framework.  I hope Microsoft start releasing information about it soon, if not I'm sure a blogger will.