320 likes | 660 Views
Diving into Team Foundation Server Extensibility. Damian Brady - SSW # sswdev. About me: SSW Solution Architect and QLD State Manager Visual Studio ALM MVP MCSD in Visual Studio ALM Co-author of Professional TFS 2013 I love: ASP.NET MVC HTML5/CSS/JS TFS and Scrum.
E N D
Diving intoTeam Foundation Server Extensibility Damian Brady - SSW #sswdev
About me: • SSW Solution Architect and QLD State Manager • Visual Studio ALM MVP • MCSD in Visual Studio ALM • Co-author of Professional TFS 2013 • I love: • ASP.NET MVC • HTML5/CSS/JS • TFS and Scrum http://brdy.in/ProTFS2013
What do I mean by extensibility? • “Extensible (n.): capable of being extended” • AKA: Make it do things it doesn’t do out of the box.
In what ways can we extend TFS? Customization Notification Interception Reading Writing
Extensibility Points • Process Template Customization • Alerts • The Client Object Model • The Server Object Model
Process Template Customization Customization
What can you change? Lots. • Startup configuration, default settings, reports, etc. • Work Item tracking
Work Item customizations • Fields • States and Transitions • Work Item Form Layouts • Work Item Controls • Categories • Link Types • Global Lists • Global Workflows and Fields
Process Template Customization • Work Items • Fields, states, transitions, UI, etc. • Process and rules • Resources available and start up options
Process Template Customization Cons Not available for VS Online Future upgrades may be compromised Pros • Powerful • Easier than you think • Fit the template into your process
Alerts Notification
Alerts • Not just for email! • You also have the option to get a SOAP message delivered to an endpoint* • Been available since TFS 2005 • Actually XML-first – you can find and modify the XSLTs used to construct emails. • TFS 2012 gave us much better UI for configuring alerts • * Delivery not real-time or guaranteed!
WCF Alert Handling • Create an Endpoint • Set up an alertvia Web Access • OR use the BisSubscribe.exe tool • One service to rule them all • Create specific alerts, then filter in code
WCF Alert Handling Cons Delivery not guaranteed Delivery not real-time Legacy technology Pros • Very easy • Minimal impact to TFS
Client Object Model Reading Writing
Client Object Model • Assemblies that expose the Team Foundation Server objects • Most common way to interact with Team Foundation Server • Used by Team Explorer and all .NET-based client applications
Client Object Model Useful Assemblies • Microsoft.TeamFoundation.Client.dll • Microsoft.TeamFoundation.VersionControl.Client.dll • Microsoft.TeamFoundation.WorkItemTracking.Client.dll Useful Objects: • TfsConnection • TfsConfigurationServer • TfsTeamProjectCollection • VersionControlServer • WorkItemStore • TeamProjectPicker vartfs = newTfsTeamProjectCollection(uri, credentials); varvcs = tfs.GetService<VersionControlServer>();
Client Object Model • Exposes nearly everything! • VersionControlServer has nearly 200 methods • Microsoft.TeamFoundation.VersionControl.Client contains about 360 classes • Remember, everything Team Explorer does uses these libraries* • See MSDN for the full story: http://aka.ms/TFS2013SDK • * Potentially a loose definition of “everything”
Client Object Model Cons Potentially dangerous Some small version inconsistencies Not always easy to find working examples Pros • Incredibly powerful • Fast • Easy to work with • Huge amounts of documentation
Server Object Model Notification Interception
Server Object Model • Server-side interaction with Team Foundation Server • Uses a plugin model: • 1. Implement an interface • 2. Drop it in the correct location (Application Tier\Web Services\bin) • Many out-of-the-box features are implemented as plugins
Server Object Model A lot is exposed, however not every interface is suitable for extending. Useful Interfaces: • ISubscriber • ITeamFoundationRequestFilter • ITeamFoundationJobExtension Scary Interfaces: • ISecurityNamespaceExtension • IIdentityProvider
Server Object Model • The most powerful extensibility option • Implementing ISubscriber gives you 40+ events you can capture • Some are notification and decision • Some are notification only • ITeamFoundationRequestFilter gives you access to every request • ITeamFoundationJobExtension lets you write your own periodically-run jobs • See MSDN for the full story http://aka.ms/TFS2013ServerOM
Server Object Model Cons Potentially very dangerous Not available for VS Online Some tricky hurdles when coding Often quite hard to find working examples Pros • Incredibly powerful • Allows you to change TFS behaviour • Truly add functionality to TFS
What's Next? This page intentionally left blank
Summary Customization Notification Interception Reading Writing Process Template Customization Alerts, Server Object Model Server Object Model Client Object Model Client Object Model
More Information • SHAMELESS PLUG • MSDN - http://brdy.in/ExtendingTFS • Blog – http://www.damianbrady.com.au
THANK YOU Damian Brady @damovisa http://www.damianbrady.com.au