microsoft office system uk developers conference radisson edwardian, heathrow 29 th 30 th june 2005
DESCRIPTION
Agenda Web Part Basics Review Web Part Development and Debugging Developing Web Parts Advanced Web Part Topics Work Items and Timeouts IRuntimeFilter Caching ToolParts and ToolPanes Page Customization Deployment Packages and InstallerTRANSCRIPT
![Page 1: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/1.jpg)
Microsoft Office SystemMicrosoft Office SystemUK Developers ConferenceUK Developers ConferenceRadisson Edwardian, HeathrowRadisson Edwardian, Heathrow2929thth & 30 & 30thth June 2005 June 2005
![Page 2: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/2.jpg)
Web PartsDebugging, Deploying, And Best Practices
Michael O’DonovanConsultantMicrosoft UK
![Page 3: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/3.jpg)
AgendaWeb Part Basics Review
Web Part Development and DebuggingDeveloping Web PartsAdvanced Web Part Topics
Work Items and TimeoutsIRuntimeFilterCachingToolParts and ToolPanesPage Customization
DeploymentPackages and Installer
![Page 4: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/4.jpg)
Web PartsPrimary Platform Value of SharePoint
End-user Customization of PagesIn the Browser and in FrontPage
Standard Extensibility PointDerive from Microsoft.Sharepoint.WebPartPages.WebPartUse Web Part Library Templates
![Page 5: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/5.jpg)
Rendering TechniquesDirect Render Using Strings
HtmlTextWriter.Write(“…”)HtmlTextWriter.WriteBeginTag(“…”)
Use ASP.NET HTML PrimitivesHtmlTableClass
Delegating to ASP.NET ControlsComponentize Your Rendering Logic
![Page 6: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/6.jpg)
Basic Demo
![Page 7: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/7.jpg)
Debugging Web PartsMethods
DirectAttach to instance of W3WP.EXE
“Automatic”Denote URL of a given Web Part Page as application start page
![Page 8: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/8.jpg)
Debugging Web Parts (Continued)
Deploying to the GAC makes debugging a little harderMust be able to reach PDB fileOptions
Deploy to the bin directory while debuggingUse manual installation
TracingSystem.Diagnostics.TraceHttpContext.Trace
![Page 9: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/9.jpg)
Web.Config SettingsTurn on debugging
<SharePoint> <SafeMode CallStack=“true" /><system.web> <customErrors mode="Off" />
Change site’s Trust Level for the site<system.web> <trust level="WSS_Minimal" originUrl= ""/>
Also “WSS_Medium” or “Full”
![Page 10: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/10.jpg)
Debugging Web Parts
![Page 11: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/11.jpg)
Development Topologies
Windows Server Windows Server 20032003
WSSWSS SPSSPS
Visual Visual Studio.NET Studio.NET
20032003
Windows XPWindows XPVisual Visual
Studio.NET Studio.NET 20032003
Windows Server Windows Server 20032003
WSSWSS SPSSPS
Single MachineSingle MachineDevelopment Development
and Server All on and Server All on One BoxOne Box
Development Development Machine Pushes Machine Pushes
to Serverto Server
Shared ServerShared Server
![Page 12: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/12.jpg)
Single MachinePros
SimpleSpeedy
ConsLicensingTime to setupEvery dev an adminHard to clean
Windows Server Windows Server 20032003
WSSWSS SPSSPS
Visual Visual Studio.NET Studio.NET
20032003
![Page 13: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/13.jpg)
Shared ServerPros
Dev box is simplerCons
Two machinesNeed scripts
NotesSharing a server is not recommendedVirtual server per devCopy Microsoft.SharePoint.*assemblies from C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\ISAPI
Windows XPWindows XPVisual Visual
Studio.NET Studio.NET 20032003
Windows Server Windows Server 20032003
WSSWSS SPSSPS
![Page 14: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/14.jpg)
Advanced Web Part Techniques
![Page 15: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/15.jpg)
Work Items And TimeoutsBuilt-in support for asynchronous workAllows other components to renderScenarios
Data connectionsRSS Fetching
Timeout renders based on web.config setting
![Page 16: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/16.jpg)
WorkItems
![Page 17: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/17.jpg)
IRuntimeFilterAllows you to filter which web parts run Allows you to persist metadata on partsScoped to Virtual Server
NOTE: Portal uses this for Audience Management
![Page 18: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/18.jpg)
IRuntimeFilter
![Page 19: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/19.jpg)
CachingWeb Part Framework
Per User or Web PartIn Memory or Serialised into Database
ASP .Net Cache ObjectShare Cache across Part Instances
Enterprise Library Caching Application Block
In HashTableSurvives Application Restarts
![Page 20: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/20.jpg)
Caching
![Page 21: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/21.jpg)
ConfigurationHow do I Store Central Configuration?Do
Treat as .Net Server ControlDon’t
Use Web Part Resource File (XML)
![Page 22: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/22.jpg)
Zone CustomizationZone Properties
AllowCustomization – Determines if the zone web parts can be modifiedAllowPersonalization – Determines if personalization is allowedFrameType – Determines the default frame typeLockLayout – Determines if web parts can be added, resized, or removed
![Page 23: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/23.jpg)
ToolParts And Customization
ToolPart ControlsWebPart specifies list of supported toolparts
You derive from ToolPartSet properties on the parent web partRespond to Apply and Cancel
Custom ToolPane?Rather hide ToolPartsICustomizeToolPane
![Page 24: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/24.jpg)
Best PracticesHandle All ExceptionsImplement IDesignTimeHtmlProvider InterfaceMake Properties User FriendlyMake Properties SearchableCheck Web Part Zone Properties When Saving Changes
![Page 25: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/25.jpg)
Best PracticesCheck Permissions when RenderingValidate Properties before Attempting
a SaveSpecify Whether Your Web Part Can Be ExportedHtmlEncode User OutputCreate Custom Web Part Base Class
![Page 26: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/26.jpg)
Web Parts And UpgradeChanging Web Part Schema
AfterDeserialize eventAssembly Redirection in Web.Config
![Page 27: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/27.jpg)
Distributing Web Parts
![Page 28: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/28.jpg)
Distributing Web PartsManual
Copy required files into locationCAB files
Two-step process with STSADMStsadm –o addwppack –filename filenameStsadm –o addwppack –name filename
MSI filesInstall directly on each server
![Page 29: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/29.jpg)
Deploying Web PartsMethod 1: Manual
Copy assembly DLL to either/bin directory for a given IIS virtual server (e.g., c:\inetpub\wwwroot\bin)Global Assembly Cache(e.g., c:\windows\assembly)
Copy DWP file to C:\Inetpub\wwwroot\wpcatalogCopy resources to
For GAC-registered parts,C:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresourcesFor Web Parts in the /bin directory,C:\Inetpub\wwwroot\wpresources
![Page 30: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/30.jpg)
Deploying Web PartsMethod 1: Manual
Adjust web.configRegister as SafeControlSelect Code Access Security settings
![Page 31: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/31.jpg)
Deploying Web PartsMethod 2: CAB File
CAB file should containAssembly DLLDWP file(s)Manifest.XMLResource files (if needed)
CAB won’t containCode Access Security settings
![Page 32: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/32.jpg)
Deploying Web PartsMethod 2: CAB File
Server-side object model has methods for deploying such a CAB fileDeploy with STSADM.EXE
Located in C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\BINAdd it to your pathStsadm –o addwppack –filename filename
[–globalinstall] [–force]
![Page 33: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/33.jpg)
Deploying Web PartsMethod 3: MSI File via WPPackager
All of the features of CAB file deployment, but with
Code Access Security supportAbility to uninstall via Control Panel
Get WPPackager.EXE fromhttp://msdn.microsoft.com/sharepointAdd additional files to project for use by WPPackagerRun WPPackager after project is built
![Page 34: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/34.jpg)
Deploying Web PartsMethod 4: Standard MSI File
See the Site Definition Design and Deployment Talk later today for more detailsChallenges
Per-virtual server settings and assemblies
MSI Custom ActionsCommand Line Tools
![Page 35: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/35.jpg)
Custom Online Web Part Gallery
Easily Deploy .DWP FilesDoesn’t Deploy the Assembly or Resources
![Page 36: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/36.jpg)
Custom Online Gallery
![Page 37: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/37.jpg)
Not The Only Way/_layouts/ ApplicationDataView Web PartSmartPartIFrame
PageViewer
![Page 38: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/38.jpg)
What We Didn’t CoverHtmlDesignerAttributeCreateWebPartMenuConnectionsWeb Part Services Component (WPSC)
![Page 39: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/39.jpg)
SummaryDebugging OptionsAdvanced Techniques for Web PartsBest PracticesDeployment Options
![Page 40: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/40.jpg)
Discussion
![Page 41: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th 30 th June 2005](https://reader035.vdocuments.site/reader035/viewer/2022062401/5a4d1b677f8b9ab0599b12c0/html5/thumbnails/41.jpg)
© 2005 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.