1 / 22

Advanced SmarTeam Programming

Advanced SmarTeam Programming. Marc Young CEO xLM Solutions, LLC. Overview. SmarTeam and .NET 2.0 Configuring Visual Studio Developing and Debugging a User Defined Tool Windows Client Web Client. SmarTeam and .NET 2.0. SmarTeam currently a .NET 2.0 Application

boyce
Download Presentation

Advanced SmarTeam Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Advanced SmarTeam Programming Marc Young CEO xLM Solutions, LLC

  2. Overview • SmarTeam and .NET 2.0 • Configuring Visual Studio • Developing and Debugging a User Defined Tool • Windows Client • Web Client

  3. SmarTeam and .NET 2.0 • SmarTeam currently a .NET 2.0 Application • .NET 2.0 minimum supported runtime • Visual Studio 2005 and 2008 can target the .NET 2.0 environment

  4. Configuring Environment • SmarTeam Primary “Interop” Assemblies (PIA’s) • Copy from Global Assembly Cache (GAC) to make referencing easier • Optionally add copy folder to Visual Studio’s reference search path (HKLM\Software\Microsoft\.NETFramework\AssemblyFolders on 32 bit windows)

  5. User Defined Tool • Simple BOM Tree Report • Runs on an Assembly in SmarTeam • Generates a simple text file • Will write in VB.NET • More people understand VB.NET • Counterpoint example to the C# code provided in documentation

  6. Creating Projects • Personally prefer two projects • Class Library Project • Contains business logic • Entry point of Windows client code • Exposes a COM compatible interface for SmarTeam script engine (COM Interop) • ASP.NET Web Application Project • Contains code to support web • Project type not available in original VS2005. Either need latest service pack or additional project template from Microsoft Web Site

  7. Project References • Both Projects • SmarTeam.Std.Interop.SmarTeam.SmApplic • SmarTeam.Std.Interop.SmarTeam.SmRecList • Web Project • SmarTeam.Std.Applications.WebEditor.dll (found in SMARTEAM\WebEditor\web\Bin) • SmarTeam.Std.Foundation.Specialized • SmarTeam.Std.Foundation

  8. Project References • Tip: Change Copy Local and Specific Version to False. Makes it easier to recompile on newer versions of SmarTeam.

  9. Tips for Creating a Windows Customization • As SmarTeam’s scripting engine is COM based, the .NET library must expose a Com interface. • VB.NET comes with a template for COM classes • C# is a bit more complicated but you have finer control on what happens. • Advanced Tip: By default in VS2005, all classes are set with ComVisible = True. • Prefer to update the AssemblyInfo.vb (via UI or direct edit) to set this to false and explicitly expose the classes.

  10. VB.NET COM Class Template

  11. Debugging Windows Customization • Code is written, time to debug • Technique will not work with any Express Edition of Visual Studio • Requires Remote Debugging • Express Editions do not have it

  12. Debugging Windows Client • Configure Debugger • Set Breakpoints • Run Code

  13. Configuring for Debugging • Configure the Library to start SmarTeam.exe when debugging starts

  14. Windows Client Debugging Example

  15. Web Customization Code Overview • Start with an ASP.NET Web Application • Write ASPX files • Copy ASPX files to proper locations • Copy compiled DLLs to <SMARTEAMHOME>\WebEditor\web\bin • Important: Restart SmarTeam web editor (easist to just run IISReset) • Start Debugging

  16. Creating a User Defined Tool • Example UDT is in <SMARTEAMHOME>\WebEditor\web\Views\UserDefinedTools\UserDefinedToolDemo1.aspx • Example written in C# • Example is a completely self-contained ASPX file. It does not have external DLLs. • Self-contained is easier to deploy, but more difficult to write.

  17. Web User Defined Tools Tips • JavaScript is required in most Web Editor customizations due to the need to change the contents of a specific target frame. • Sample page defines some JavaScript functions but are written in a way that does not lend itself to compiled code • Example JavaScript can be used as starting place for versions seen in this sample.

  18. Web Debugging Limitations • Every time you make a change to the code and roll out to web server, SmarTeam Web Editor needs to be restarted. • Must attach debugger to a running aspnet_wp.exe (XP) or w3wp.exe (Win2003) process • Dynamically changing code as it runs is not possible because of attaching and not running code inside of Visual Studio.

  19. Recap • Web and Windows client customization can share the same business logic • User interface/user interaction code is very different • Windows client customziation requires knowledge of COM/VB.NET/.NET Programming • Web client customization requires knowledge of the same as windows plus ASP.NET. JavaScript knowledge helps.

  20. Thank You! Questions? This presentation and example shown are available at: http://www.xlmsolutions.com/presentations/COE2009 Marc Young xLM Solutions, LLC. 248-926-5932 myoung@xlmsolutions.com

More Related