370 likes | 473 Views
web parts. Eli Robillard ( elir@eidenai.ca ) Ali Kheradvar ( alik@eidenai.ca ) . agenda. web part framework sharepoint v2 (wss 2003) asp.net v2 (whidbey) sharepoint v3 (wss 2006). web site users want:. flexible display options personalized content reduced data entry
E N D
web parts Eli Robillard (elir@eidenai.ca) Ali Kheradvar (alik@eidenai.ca)
agenda • web part framework • sharepoint v2 (wss 2003) • asp.net v2 (whidbey) • sharepoint v3 (wss 2006)
web site users want: • flexible display options • personalized content • reduced data entry • import and export settings
developer challenges: • a lot of code is required • want a single personalization solution • secure and bullet-proof customization • complex client-side connections
web part definition. • Web Parts are components that enable non programmers to gather information they care about and customize the appearance of Web pages (in a Portal/WSS site)
web parts: connected vs. stand-alone. • stand-alone: There’s no connection to the other web parts • connected: • As a Provider • As a Consumer • As a Stand-alone
web part development. • Requirements • VS 2003 • Web Part Templates for Visual Studio .NET • Required Assemblies (Microsoft.SharePoint.dll, …)
web part development. • Steps: Initialize Development Environment (VSS, VPC, …) Initialize VS 2003 Solution • Web Part Project • Deployment Package (CAB File) • Other Libraries Develop Web Part Code Test / Debug Deploy Web Part(s) • Don’t forget to document different steps
web part files. • Web Part Class • DWP File (Web Part Definition File). Every Web Part has its own DWP file • Manifest.xml file used during installation of the Web Part(s) on the SharePoint server
connected web parts: scenarios. • Master/Detail • Parent/Child • Data Entry and Filter • Calculations • Alternate Views • Data Enhancement
connected web parts: code flow. • EnsureInterfaces() • RegisterInterface() • CanRunAt() • PartCommunicationConnect() • PartCommunicationInit() • Fire Init Events; e.g., CellProviderInit() • PartCommunicationMain() • Fire Remaining Events; e.g., CellReady()
whidbey web parts. • normal view • design view • edit view • catalog
whidbey web part toolbox. • WebPartManager • WebPartZone • WebPart • EditorZone • PropertyGridEditorPart • AppearanceEditorPart • BehaviorEditorPart • LayoutEditorPart • CatalogZone • PageCatalogPart • ConnectionsZone
whidbey web part manager. • non-visual control • <asp:WebPartManager runat=server … /> • set and track the state of the page • normal, design, edit, catalog • manages all web part zones and controls • add a WP Manager to add WP support.
whidbey web part class. • abstract class • single user controls wrapped in an instance of GenericWebPart • multiple controls: • - contain in a user control (though you can’t set properties like this) • - server control which implements IWebPart
whidbey connected web parts. • StaticConnections • node of WebPartManager • ConnectionsZone • user-configuration
whidbey connected web parts. • <asp:WebPartManager runat=“server” id=“WPManager”> • <StaticConnections> • <asp:connection • ProviderID=“invoice” • ProviderConnectionPointID=“invoiceIdProvider” • ConsumerID = “item” • ConsumerConnectionPointID=“itemIdProvider” • / > • </StaticConnections> • </asp:WebPartManager>
whidbey connected web parts. • [Personalizable(true), WebBrowsable(true)] • public int ItemId { • get { return _itemId; } • set { _itemId = value; } • } • [ConnectionProvider(“ItemIdProvider”, “ItemIdProvider”)] • private IItemInfo ProvideItemInfo() { • return this; • }
whidbey personalization. • persist control settings • shared data • per-user data • configurable data store • built-in SQLServer and Access support • extensible via providers
sharepoint v3 (2006) Windows SharePoint Services “v2” Windows SharePoint Services “Version 2” ASP.NET 1.1 ASP.NET 2.0 Windows SharePoint Services “Version 3” Windows SharePoint Services “v3” Microsoft PDC 2005
sharepoint v3 and ASP.NET. Windows SharePoint Services “Version 2” Windows SharePoint Services “Version 3” Microsoft PDC 2005
sharepoint v3 benefits. • Makes it easier for developers to build on top • Enable developers to use ASP.NET services, like HttpApplication or HttpModules • Provide WSS facilities as standardized services [SiteMap] • Consume more ASP.NET interfaces • Membership, Role Providers • More consistency Microsoft PDC 2005
sharepoint v3 and asp.net features. • Support for .ascx controls in pages • Resource support for _layouts pages, etc. • Compilation and safe code control • Customized pages can have code • Customized pages can be compiled for performance Microsoft PDC 2005
sharepoint v3 webparts. • every web part you write for whidbey will be re-usable in sharepoint v3 • the only extra step with v3 is marking safe
sharepoint v3 and iis. • WSS now creates its own application • Does not “take over” the default app • No need for “exclusions” • Unified application domains • Centralized Web configuration management object model Microsoft PDC 2005
sharepoint v3 webpart • ASP.NET 2.0 Web Parts supported • Full Compatibility for WSS “v2” Web Parts • WSS “v2” Web Part class rebased on .NET 2.0 web parts MyV2WebPart -> Microsoft.SharePoint.WebPartPages.WebPart -> Microsoft.Web.UI.WebControls.WebParts.WebPart • Improved user interface for Web Parts Microsoft PDC 2005
sharepoint v3 connections. • Similar Connection Types • ICell -> IField, IList -> Itable • Automatic translation from WSS v2 types • ASP.NET 2.0 adds support: • custom connection interfaces • custom transformers Microsoft PDC 2005
sharepoint v3 limitations. • Cannot use ASP.NET 2.0 Web Part Pages; not directly compatible as-is • Pages must include SPWebPartZones and SPWebPartManager • This is done to automatically handle compatibility issues • No built-in support for treating .ASCX files (user controls) as Web Parts • You can use .ASCXs in pages, though • Wrappers for .ASCXs can and will be created Microsoft PDC 2005
Which Web Part Technology Should You Use? • Pros to ASP.NET 2.0 Web Parts: • Usable in WSS and in non-WSS ASP.NET 2.0 applications • Pros to SharePoint Web Parts: • Client side scripting & connections • Web Part data caching • WorkItem infrastructure • Where possible, build on base ASP.NET 2.0 Web Part model Microsoft PDC 2005
until sharepoint v3. • WSS v2 SP2 now available! • Supports .NET 2.0 assemblies • Does not support ASP.NET 2.0 features • WSS Only: SPS 2003 does not support .NET 2.0 • You’d need to create a WSS “v2” Web Part wrapper for ASP.NET 2.0 Web Parts Microsoft PDC 2005
sharepoint v3 “Son of SmartPart” • SmartPart version 2 • Community tool driven by Jan Tielens of U2U • Enables hosting ASP.NET 2.0 Web Parts and Web User Controls in WSS “v2” Web Part Pages • (The original SmartPart allowed ASP.NET 1.1 user controls to be contained in WSS/SPS Web Parts; it’s on www.gotdotnet.com) • Features include: • Connectable Web Parts / user controls • Properties support • Custom Tool Part support • For More Information: • Technology Preview on www.smartpart.info • Forthcoming Webcast Microsoft PDC 2005
resources • Eidenai Innovations: • http://www.eidenai.ca/ • Eli’s World of Blog: • http://weblogs.asp.net/erobillard/ • Eli’s SharePoint Resources • http://weblogs.asp.net/erobillard/articles/SPResources.aspx
wrap-up and prizes • Thank-you!