430 likes | 643 Views
Olaf Feldkamp Developer Platform Advisor Microsoft Switzerland blogs.msdn.com/ swiss_dpe_team. Developing Web A pplications on WSS. Agenda. Introduction Web Parts Solution Deployment Lists Performance Conclusion. SharePoint Technology Stack. MOSS 2007.
E N D
Olaf Feldkamp Developer Platform Advisor Microsoft Switzerlandblogs.msdn.com/swiss_dpe_team Developing Web Applications on WSS
Agenda • Introduction • Web Parts • Solution Deployment • Lists • Performance • Conclusion
SharePoint Technology Stack MOSS 2007 Applications (Portal Solutions) Colla-boration Enterprise Content Manage-ment InfoPath Forms Services Portal Search Business Intelligence Platform Services WSS 3.0 Search Server 2008 Express Storage Security Manage-ment Topology Site Model API Windows Server 2003 or 2008 (with WSS SP1) optional ASP.NET 2.0 (Web Parts, Personalization, Master Pages, Provider Model for navigation, Membership, ..) ASP.NET AJAX Database Windows Workflow Foundation (.NET 3.0) Web Server (IIS)
WSS 3.0 SP1: Released last December • Download SP1 or special WSS 3.0 with SP1 slipstream (32 or 64-bit) • For MOSS 2007 also install MOSS 2007 SP1 • SP1 includes • Support to run WSS/MOSS on Windows Server 2008 • ASP.NET AJAX compatibility and support for Web Parts • New STSADM operations and properties • > 60 hotfixes • Also refreshes for WSS/MOSS SDKs available • Details on SharePoint Product Group Blog
The three Faces of WSS 3.0 Announcements, Presence, Contacts, Calendar, Project Tasks, Wikis,Doc Libs, Office Integration, Surveys, Discussions, Blogs, RSS, Mobility Collaboration Site Templates, Pages, Web Parts,Custom FieldTypes APIs,Web services, Features, Solutions Doc Libs, Site Columns, Content Types,Lists, Views, Events, Versioning, Permissions Web Platform Store
Site Model: Site Definitions • WSS provisions SharePoint sites based on Site Definitions ONET.XML(per Site Definition) SCHEMA.XML(per List Template) WEBTEMP.XML navigation bars configurations Located: 12\Template\Features\ AnnouncementsList\Announce 12\Template\Features\ HelpDeskList\HelpDesk modules Example Configs: Team Site Blank Site Basic Meeting Workspace Blog Located: 12\Template\1033\XML list instances feature references standard views default.aspx Located: 12\Template\SiteTemplates\ HelpDesk\XML
Whychoosing WSS as a DevPlatform? • End users can create and customize applications to a certain extent without the need of a • Database or System admin, or Web developer • Increased productivity with existing elements • Auditing, ChangeLog, Search, Alerts, Web Services • Data lists and document libraries incl. events and RSS • Integration with Office Clients • Scalable platform enables Software+Services scenarios • Leverage existing .NET and ASP.NET skills • Web 2.0 with ASP.NET AJAX and Silverlight • Customer may require „runs on SharePoint“
BPA SolutionsNeuchâtel partner Easy CRM (WSS based) SharePoint Consulting SharePoint Hosting
Agenda • Introduction • Web Parts • Solution Deployment • Lists • Performance • Conclusion
Web Part Development • ASP.NET 2.0 • Web Part Connections • Web Part Properties, .. • WSS 3.0 • Recommended: use ASP.NET 2.0 Web Parts • No built-in support for treating user controls (.ascx) as Web Parts • Use DelegateControl or custom shim • Compatibility for WSS 2.0 Web Parts
WSS 3.0 Tools: VS 2005 Extensions 1.1 • Released last month on MSDN, Visual Studio 2008 releaseplannedfornext June • Solution Packageediting • SharePoint Solution Generator • Content not supported: Somesiteandlisttemplates, lookupfields, customfieldtypes, somesettings
Developing Web Parts with VSeWSS 1.1 demo Hello World Web Part and Debugging Web Part accessing custom Data Web Part Properties
More SharePoint Tools and Components • SharePoint workflowdevelopment • Workflow templatesincluded in WSS SDK forVisual Studio 2005 • Visual Studio 2008 includes a richdevelopmentenvironmentfor MOSS 2007 workflows • >130 community SP projects: CodePlex.com • Solution PackagingandDeployment • STSDEV, SharePoint Solution Installer, WSPBuilder • SharePoint Developer Explorer • SmartPart for SharePoint • LINQ to SharePoint, ..
Install and Configure ASP.NET AJAX • Install ASP.NET AJAX 1.0 (or .NET FW 3.5) • Optional: Install ASP.NET AJAX ControlToolkit • Install on each Web Front End (WFE) Server • http://www.asp.net/ajax/ • Modify web.config on each WFE Server • Follow the steps at http://sharepoint.microsoft.com/blogs/mike/Lists/Posts/Post.aspx?ID=3 • Hint: Remember to add the ASP.NET AJAX <ScriptManager> to Master Page
Using the ASP.NET AJAX Extensions in your Web Parts demo AJAX SmartPart SharePoint DelegateControl
SilverlightBlueprintfor SharePoint • http://www.ssblueprints.net/sharepoint/
Agenda • Introduction • Web Parts • Solution Deployment • Lists • Performance • Conclusion
Topologyof Sites andtheObject Model • Farm: ≥ 1 web and app servers (one config DB) • Web Application: IIS web site extended with WSS • Site Collection: stored in one specific content DB Config DB Admin Content DB Content
Modular Provisioning: Features • Extend existing sites, instead of changing Site Templates • Combination of lists, views,Web Parts, EventHandlers, .. Elements.xml Feature.xml Scope FarmWeb ApplicationSite CollectionWeb Custom Actions Custom Views Content Type Definitions Layouts Pages Modules (files) List Instances List Templates Event Receivers Delegate Controls Workflow Bindings Feature Name ID Description ScopeReceiver assembly Activation Dependencies Element Manifests
Solution Deployment WSS ConfigDB Filename.wsp(WSS Solution Cab) stsadm.exe add Feature Manifests delete Template Files Assemblies Admin UI orstsadm.exe orOM “deploy” cmd retract deploy SharePointWeb Front End Servers
Solution Deploymentusingthe UI • Solution Information • Language pack • Deployment Status • Deployed to • Scheduled Deployment • Choose particular Web Application • Warns admin of GAC install
Agenda • Introduction • Web Parts • Solution Deployment • Lists • Performance • Conclusion
Querying Lists • Single-list query:SPQuery • XML based (CAML Query) • Community Tool: Caml Query Builder can be helpful • New in WSS 3.0 • SPSiteDataQuery class • Cross-site, multiple list queries • Indexed fields • Important SPSiteDataQuery properties • Lists (the FROM) • Query (the WHERE and ORDER BY) • ViewFields (the SELECT) • Webs (Site, SiteCollection or Recursive) • Running the query • SPWeb.GetSiteData(SPSiteDataQuery)
LINQ and SharePoint • If you do a lot of list queries: evaluate LINQ to Objects • LINQ is especially interesting when you need to join lists varqry = from SPListItemcust in myCustomerList.Items join SPListItemdocs in myDocLib.Items on (string)cust["Title"] equals (string)docs["Customer"] select new { Customer = (string)cust["Title"], DocName= (string)docs[“DocName"], Year = (double)docs["FiscalYear"] };
List Events • Supported on regular lists as well as document libraries • Accessing the current list item • prop.BeforeProperties (only doc libs) • prop.AfterProperties • Synchronous and asynchronous list events • Multiple handlers on a list
Item, List and Web Events • List Events • SPListEventReceiver • FieldAdded/ing • FieldDeleted/ing • FieldUpdated/ing • Web Events • SPWebEventReceiver • SiteDeleted/ing • WebDeleted/ing • WebMoved/ing • Item Events • SPItemEventReceiver • ItemAdded/ing • ItemAttachmentAdd/ing • ItemAttachmentDeleted/ing • ItemChecked/ingIn • ItemChecked/ingOut • ItemDeleted/ing • ItemFileConverted • ItemFileMoved/ing • ItemUnchecked/ingOut • ItemUnchecking/Out • ItemUpdated/ing
Agenda • Introduction • Web Parts • Solution Deployment • Lists • Performance • Conclusion
Performance • SPSite and SPWeb are managed wrappers (2 KB) to unmanaged classes (1 - 2 MB) • Always use Dispose()or the using clause • Small managed objects don’t put pressure on garbage collector (GC) don’t rely on GC! • MSDN articles (must read!) • Best Practices: Common Coding Issues When Using the SharePoint Object Model • Best Practices: Using Disposable Windows SharePoint Services Objects
Agenda • Introduction • Web Parts • Solution Deployment • Lists • Performance • Conclusion
Skills a SharePoint Developer Needs • ASP.NET 2.0 • Master Pages, ASP.NET Server and User Controls, ASP.NET Web Parts, ASP.NET Provider Model • Windows Workflow Foundation • Buildingworkflows, customactivitiesinteractingwithSharePoint • XML technologies (CAML) • Usedforqueriesandmostschemadefinitions: Site Definitions, lists, fields, Content Types, .. • WSS 3.0 and MOSS 2007 APIs and Web Services • Microsoft (and 3rdparty) developertoolsfor WSS • SharePoint Features and SharePoint Solutions
Key Takeaways • WSS is a powerful platformforweb basedapplications • Tools havestartedtoeasedevelopment { Developers } • Can takeadvantageofexisting WSS elements • Can leverageexisting .NET and ASP.NET skills • Havetolearn a lotabout SharePoint development
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Backup • The following slides were added to provide some useful additional information
Document and Data Store • Goals • Usable & Robust Document Management for the masses • Powerful APIs • Features • Per-item security • Versioning • Recycle bin (2-stage) • List capacity improvements (width and length) • List indexing and cross-list queries • Content Types and Site Columns • Forced Check-in/out for documents • Embedded Windows Workflow Foundation
Content Types • Metadata – Collection of Site Columns • Document template • Workflow Settings • Parent Content Type • Scope • MOSS 2007 only • Document InformationPanel Settings • Policy Settings
Web Part Security • Web Parts canbedeployedtoeither • the GAC • +Assembliesrun in any web app, must besigned • +AssembliesrunwithFull Trust • -IIS resetrequired after recompilation • or to the \bin directory of relevant web apps • +Partial trust (WSS_Minimalor WSS_Medium) • +Recommended for best security: Create a new trust policy file for each assembly, point your web.config file at the new file • -More configuration needed • Web Parts including Security on MSDN
Custom Field Types • Examples • AHV field, Ext. data lookup • Base type it is inherited from (e.g. SPFieldText) • Defines the SQL storage and defaults like rendering • Field Type Class • Defines data validation • Field Controls • Define rendering • Field Type • Defines field properties
Performance (2) • Assume a SPWeb.Webs collection consists of 10 subsites (1 - 2 MB) and you iterate through this collection
SharePoint Resources • Microsoft Office Interactive Developer Map (Version 2) • WSS 3.0: Updated SDK • Download • Online • Microsoft Press • Inside Microsoft Windows SharePoint Services 3.0