microsoft office system uk developers conference radisson edwardian, heathrow 29 th 30 th june 2005

41
Microsoft Office System Microsoft Office System UK Developers Conference UK Developers Conference Radisson Edwardian, Heathrow Radisson Edwardian, Heathrow 29 29 th th & 30 & 30 th th June 2005 June 2005

Upload: walter-hicks

Post on 18-Jan-2018

218 views

Category:

Documents


0 download

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 Installer

TRANSCRIPT

Page 1: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th  30 th June 2005

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

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

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

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

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

Basic Demo

Page 7: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th  30 th June 2005

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

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

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

Debugging Web Parts

Page 11: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th  30 th June 2005

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

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

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

Advanced Web Part Techniques

Page 15: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th  30 th June 2005

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

WorkItems

Page 17: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th  30 th June 2005

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

IRuntimeFilter

Page 19: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th  30 th June 2005

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

Caching

Page 21: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th  30 th June 2005

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

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

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

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

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

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

Distributing Web Parts

Page 28: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th  30 th June 2005

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

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

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

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

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

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

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

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

Custom Online Gallery

Page 37: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th  30 th June 2005

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

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

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

Discussion

Page 41: Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th  30 th June 2005

© 2005 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.