Presentation is loading. Please wait.

Presentation is loading. Please wait.

OFC406 Windows SharePoint Services (version 3) Development 2: ASP.NET, Web Parts, Master Pages, Field Types, and More Ted Pattison Researcher and Trainer.

Similar presentations


Presentation on theme: "OFC406 Windows SharePoint Services (version 3) Development 2: ASP.NET, Web Parts, Master Pages, Field Types, and More Ted Pattison Researcher and Trainer."— Presentation transcript:

1

2 OFC406 Windows SharePoint Services (version 3) Development 2: ASP.NET, Web Parts, Master Pages, Field Types, and More Ted Pattison Researcher and Trainer Ted Pattison Group

3 Agenda ASP.NET Integration Page Templates vs. Page Instances Master Pages Web Parts New ASP.NET Web Part Model Cross-site query User controls Extensible Field Types

4 Windows SharePoint Services 3.0 Terminology Farm The highest-level scope for a Windows SharePoint Services deployment An installation of one of more Web servers and back-end servers Each Windows SharePoint Services farm has one and only one configuration DB Web Application (a.k.a. Virtual Server) An IIS Web site extended with Windows SharePoint Services Entry point capable of hosting 10,000s of site collections Site Collection (a.k.a. Site) Unit of scale and ownership containing top-level site Stored in one specific content DB Site (a.k.a. Web) Many per site collection Uses same content DB as parent site

5 Sites and Site Collections Windows SharePoint Services manages sites in terms of site collections Each Web Application can host one or more site collections Each site collection has exactly one top-level site A site collection may (or may not) have child sites

6 High-level Windows SharePoint Services Architecture Windows SharePoint Services data and content stored in SQL Server Configuration data stored in Windows SharePoint Services configuration database Site content and customizations stored in content databases Basic DB architecture remains unchanged from v2 to v3 There are changes to undocumented database schemas

7 ASP.NET Integration Windows SharePoint Services 3.0 far more integrated with ASP.NET No more ISAPI filter No more separate page parser for Windows SharePoint Services Windows SharePoint Services 2.0 Windows SharePoint Services 3.0 ASP.NET 1.1 ASP.NET 2.0 Windows SharePoint Services 3.0

8 Moving from Windows SharePoint Services 2.0 to Windows SharePoint Services 3.0 Windows SharePoint Services v2 was built on ASP.NET 1.1 Windows SharePoint Services integrated more at the IIS level than at the ASP.NET level ASP.NET 1.1 does offer way to parse.aspx files from database ASP.NET 1.1 does not offer Web Part infrastructure ASP.NET 1.1 offers no satisfying page template solution ASP.NET 1.1 offers no built-in navigation infrastructure Windows SharePoint Services v3 is built on ASP.NET 2.0 Windows SharePoint Services integration in line with best practice ASP.NET extensibility ASP.NET 2.0 provides parser for.aspx pages from database ASP.NET 2.0 provides new Web Part infrastructure ASP.NET 2.0 offers Master Pages feature for page templates ASP.NET 2.0 offers rich navigation infrastructure

9 SPVirtualPathProvider New pluggable component type for ASP.NET Allows Windows SharePoint Services to perform ghost/unghost detection Windows SharePoint Services hands.aspx files over to ASP.NET for parsing PageParseFilter gives Windows SharePoint Services control over compilation

10 Web Pages in Windows SharePoint Services Sites Windows SharePoint Services Sites have two kinds of pages (.aspx files) Site pages that can be customized on a per site basis Application pages that cannot be customized on a per site basis Site pages are initially uncustomized Uncustomized version stored once on front-end Web server Uncustomized page also known as "ghosted" page Upon editing, customized site page stored in content DB Application pages only live on front-end Web server Single copy of application page used for all Windows SharePoint Services sites Served out of the _layout virtual directory

11 The _layouts Directory _layouts directory provides common point for sites Configured as virtual directory for all Windows SharePoint Services Web applications C:\Program Files\Common Files\Microsoft Shared\ web server extensions\12\TEMPLATE\LAYOUTS Provides standard relative URL for all sites in Web Application /_layouts/SiteSettings.aspx Used for Windows SharePoint Services system application pages Can also be used for custom application pages Images directory configured in _layouts directory Used by Microsoft to deploy standard Windows SharePoint Services images /_layouts/images/ALLUSR.GIF Can also be used to deploy custom images/graphics

12 Page Templates vs. Page Instances Page templates live on Web server file system They are defined inside site definitions and features They are used to create page instances Page instances exist inside the scope of a site Page instance initially ghosted when created from page template Ghosted page is really a pointer back to page template Uhghosted page stored inside content database Page instance can be created without a template

13 Master Pages Master Pages are a primary feature in ASP.NET 2.0 Provides effective template solution for pages within site Content page reuses chrome from master page Content page fill in placeholders defined in master page Windows SharePoint Services v3 embraces ASP.NET master pages Windows SharePoint Services sites such as Team Site built using a standard master page Quick and easy to change look and feel of entire site Editing master page can be done with SharePoint Site Designer

14 Windows SharePoint Services Master Page Implementation How do master pages work in Windows SharePoint Services? Each site page in Windows SharePoint Services site “points” to a master page Each Windows SharePoint Services site has a Master Page Gallery (MPG) Site metadata tracks site-wide master page Content pages (e.g., default.aspx) default to the per-site MPG Form pages (e.g., allitems.aspx) default to the per-site MPG Application pages hard-coded to master page in /_layouts

15 Editing a Master Page

16 Customizing Site Pages

17 Web Parts Web Parts are used to build portal-style applications Content designed to modular, consistent and easy to navigate Web Parts add in support for customization and personalization

18 Web Part History Microsoft Windows SharePoint Services 2.0 (WSS V2) Designed with its own Web Part infrastructure Windows SharePoint Services serializes/stores/retrieves personalization data ASP.NET 2.0 Designed with newer universal Web Part infrastructure Serializes/stores/retrieves personalization data More flexible and more extensible than Windows SharePoint Services ASP.NET 2.0 does not support Windows SharePoint Services v2 Web Parts Microsoft Windows SharePoint Services 2007 (WSS V3) Supports Windows SharePoint Services V2 style Web Parts Supports ASP.NET 2.0 style Web Parts (preferred)

19 ASP.NET Web Part Page Structure Web Part Page in ASP.NET 2.0 is designed with… One instance of WebPartManager class One or more Web Part Zones Optionally an Editor Zone and/or a Catalog Zone WebPartManager WebPartZone (Left)WebPartZone (Right)Editor Zone Catalog Zone Web Part 1 Web Part 2 Web Part 3 Web Part 4 Web Part 5 Editor Part 1 Editor Part 2 Catalog Part 1 Catalog Part 2

20 ASP.NET 2.0 Web Parts Web Parts derive from WebPart base class All Web Part inherit common functionally using System; using System.Web.UI; using System.Web.UI.WebControls.WebParts; namespace LitwareWebParts { public class HelloWorldWebPart : WebPart { protected override void OnPreRender(EventArgs e) { this.Title = "Litware Project Revenue"; } protected override void RenderContents(HtmlTextWriter writer) { writer.Write("Hello, world"); }

21 Persistent Web Part Properties Web Parts support persistent properties Persistent personalization data tracked on per user basis Persistent customization data tracked once for all users Persistent properties can be modified by user through browser using System; using System.Web.UI; using System.Web.UI.WebControls.WebParts; namespace LitwareWebParts { protected string _ZipCode; [ Personalizable(), WebBrowsable(true), WebDisplayName("Zip Code"), WebDescription("used to track user zip code") ] public string ZipCode { get{ return _ZipCode; } set{ value = _ZipCode; } } //... }

22 Windows SharePoint Services Web Part Page Structure Web Part Page in Windows SharePoint Services is designed with… One instance of SPWebPartManager control One or more Windows SharePoint Services-specific WebPartZone controls Editor Zones and Catalog Zones supplied by WebPartPage base class SPWebPartManager WebPartZone (Left) WebPartZone (Right) Editor Zone Catalog Zone Web Part 1 Web Part 2 Web Part 3 Web Part 4 Web Part 5 Editor Part 1 Editor Part 2 Catalog Part 1 Catalog Part 2

23 Overview of Developing Web Parts Create a new class library DLL project Create a class that inherits from ASP.NET Web Part class Override methods as required (e.g. RenderContents) Deploy Web Part DLL Compile DLL into \bin directory Configure DLL in web.config file SafeControl list Import Web Part into a Windows SharePoint Services site collection Add Web Part class to Web Part Gallery Add Web Part to zone on a Web Part Page

24 Web Part as a Safe Control Web Parts usually run on Web Part Pages Web Parts must be registered as Safe in web.config file You must add entry to web.config before testing a Web Part <SafeControl Assembly="AcmeWebParts" Namespace="AcmeWebParts" TypeName="*" Safe="True" />

25 Web Part Security Caveats Web Parts loaded from \bin subject to security restrictions Security restrictions controlled by Code Access Security (more later) You might want to turn off security during development You can choose between three different built-in levels OSVR_Minimal (default for Office Server) WSS_Minimum (default for WSS V3) WSS_MediumFull -->

26 The Web Part Gallery Scoped to the Site Collection level Contains list of Web Parts available to place on pages Web Parts declared as SafeControls can be auto-populated Click New button on toolbar Web Parts imported into gallery using.webpast files Click Upload button on toolbar

27 Creating Web Parts for Windows SharePoint Services v3

28 Web Part Types for Windows SharePoint Services "V3" Windows SharePoint Services V3 supports 3 different types of Web Parts Windows SharePoint Services V2 Runtime Windows SharePoint Services Web Parts Windows SharePoint Services V3 Runtime ASP.NET 2.0 Runtime ASP Web Parts Hybrid Web Parts Windows SharePoint Services Web Parts

29 Web Part Type in Windows SharePoint Services v3 ASP.NET Web Parts Web parts that inherit from ASP.NET WebPart Imported via.webpart files Preferred style for all new development Windows SharePoint Services v2-style Web parts Web parts that inherit from Windows SharePoint Services WebPart Imported via.dwp files Supported mainly for backwards compatibility Hybrid Web Parts Web parts that inherit from Windows SharePoint Services WebPart Takes advantage of new ASP.NET base class features Imported via.webpart files

30 Extensible Field Types Windows SharePoint Services V3 allows developer to create custom fields types Create custom UI for easier data input Perform server-side data validation Use advanced rendering techniques Examples SSN field RatingsAddress

31 Parts of a Custom Field Type Base type it is inherited from Defines the actual SQL storage Defines defaults (like rendering) Query/Sort/Filter will be dependant on the base type Field type XML definition (fldtypes.xml) Defines field properties Auto generates field UI to collect these properties CAML rendering (optional) Views are still CAML based

32 Field Customization UI { Auto-generated field property input form based on field PropertySchema

33 Summary ASP.NET Integration Page Templates vs. Page Instances Master Pages Web Parts New ASP.NET Web Part Model Cross-site query User controls Extensible Field Types

34 The 2007 Microsoft Office System Clients. Servers. Solutions. Install Beta 2 today! It’s in your attendee bag Learn more at the Office System TLC Demo Stations / Hands-on-Labs / Chalk-talks Get more information Get more information http://www.microsoft.com/office/preview/default.mspx http://msdn.microsoft.com/office/ http://www.microsoft.com/office/preview/default.mspx http://msdn.microsoft.com/office/Talk Lab Demo

35 Fill out a session evaluation on CommNet and Win an XBOX 360!

36 © 2006 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.


Download ppt "OFC406 Windows SharePoint Services (version 3) Development 2: ASP.NET, Web Parts, Master Pages, Field Types, and More Ted Pattison Researcher and Trainer."

Similar presentations


Ads by Google