1 / 45

Windows SharePoint Services Development Part 2: The User Interface

Windows SharePoint Services Development Part 2: The User Interface. Mick Badran Breeze Training Consulting Trainer and Sharepoint Specialist. SPUser.About. Mick Badran Director Breeze Training ( www.breezetraining.com.au ) SharePoint 2001/2003 Experience

henrik
Télécharger la présentation

Windows SharePoint Services Development Part 2: The User Interface

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Windows SharePoint Services Development Part 2:The User Interface Mick BadranBreeze TrainingConsulting Trainer and Sharepoint Specialist

  2. SPUser.About • Mick Badran • Director Breeze Training (www.breezetraining.com.au) • SharePoint 2001/2003 Experience • Lots of training/mentoring and consulting on small, medium and large scale projects. • Involved in TAP programs, Microsoft Ascend training, development of SPS Training material. • SharePoint 2007 Experience • Early start in June 2005 with TAP workshops • Creation and delivery of Ascend training Australia wide. • Sharepoint migrations and implementations. • Creator of successful Australia wide MOSS bootcamps for Partners. • Contact Details • Email: mickb@brezetraining.com.au • IM: mickb@breezetraining.com.au • Blog: http://blogs.breezetraining.com.au/mickb

  3. Agenda • Architecture • components of the UI space • Page Model • Master Pages • Web Parts • ASP.NET AJAX • User Interface Extensions • Forms and Views UI and Navigation Web Parts Forms and Views Pages

  4. User Interface Architecture • SharePoint is “just” an ASP.NET application • Better integration with ASP.NET • More ASP.NET features “shine through” • Uses new ASP.NET features • VirtualPathProvider • PageParserFilter Windows SharePoint Services “v2” ASP.NET 1.1 ASP.NET 2.0 Windows SharePoint Services “v3”

  5. Differences Between SharePoint and ASP.NET • In SharePoint… • Knowledge workers can edit ASPX pages • Thousands of sites, based on templates • Lots of conventions around user interface • Therefore, a difference in security models • No-code Pages • No code behind • SafeControls

  6. Agenda • Architecture • Page Model • Master Pages • Web Parts • ASP.NET AJAX • User Interface Extensions • Forms and Views UI and Navigation Web Parts Forms and Views Pages

  7. Master Page Concepts • One page (master) holds the “chrome” • Many pages point at the Master • Master Page defines “Placeholders” which can be overridden in child page Master Page “Chrome” (default.master) Content Page (default.aspx)

  8. Master Pages Placeholders

  9. Master Pages In WSS • Each content page in WSS “points” to a master page • Each WSS site has a Master Page Gallery (document library) • Site metadata indicates where WSS looks for a master page • Content pages (e.g., default.aspx) default to the per-site master page gallery • Application pages default to the_layouts directory

  10. Master Page Tokens MOSS User Interface: • Two dynamic tokens • ~masterurl/default.master • spweb.MasterUrl • “System Master Page” in MOSS • ~masterurl/custom.master • spweb.CustomMasterUrl • “Site Master Page” in MOSS • Two static tokens • ~sitecollection/default.master • ~site/default.master

  11. SharePoint Page Layout Application Pages Content Pages - http://myserver/ spweb.MasterUrl /_layouts/ application.master /shared documents/ / /_catalogs/masterpage/ .master default.aspx allitems.aspx default.master .aspx .aspx .master /_layouts/ create.aspx “ghosting” Pages\ SiteTemplates\STS Global\ .aspx default.master viewpage.aspx default.aspx File System - \.. \web server extensions\12\

  12. Master Pages In SharePoint Sites

  13. Agenda • Architecture • Page Model • Master Pages • Web Parts • ASP.NET AJAX • User Interface Extensions • Forms and Views

  14. Web Parts • End-user customisable controls • Personalisation store • Web part framework now in ASP.NET • Support for assembly-based ASP.NET 2.0 parts • WSSv2 Web Parts fully supported • Improved in v3: User interface for Web Parts

  15. Types Of Web Parts • WSS Web Parts • Microsoft.SharePoint.WebPartPages.WebPart • Client Connections, Caching, Work Items • Uses XML Serialisation • Direct ASP.NET Web Parts • System.Web.UI.WebControls.WebParts.WebPart • Uses ASP.NET Serialisation

  16. ASP.NET 2.0 Web Parts

  17. SharePoint Developer Tips • Set your web.config appropriately • Use the Logs and the Event Viewer c:\inetpub\wwwroot\wss\virtualdirectories\80\web.config • …<SafeModeMaxControls="200" CallStack="true" …>… • …<compilation batch="false" debug="true">… • …<customErrors mode="Off" />… c:\program files\common files\microsoft shared\web server extensions\12\logs

  18. ASP.NET Web Part 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

  19. ASP.NET 2.0 Web Part Connections

  20. Integration 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

  21. Agenda • Page Model • Master Pages • Web Parts • ASP.NET AJAX • User Interface Extensions • Forms • SPDataSource • Extensible Field Types • Mobile Support

  22. ASP.NET AJAX • ASP.NET AJAX released mid-January • Consists of: • JavaScript Libraries • Extenders and Ajax Control Toolkit • Web Service/JSON support • UpdatePanels • SharePoint generally works well with ASP.NET AJAX • UpdatePanels do require a workaround…

  23. ASP.NET AJAX

  24. Agenda • Page Model • Master Pages • Web Parts • ASP.NET AJAX Integration • User Interface Extensions • Forms and Views

  25. Extending The User Interface • Extensible Toolbars, Menus, Settings Pages • Link to pages • Can use ASP.NET controls on toolbars • Associate by • List type • Content type • File Type

  26. Central Admin Site Settings Content Type Settings

  27. Site Actions EditControlBlock (“ECB”) View ToolBar Welcome Menu Display Form ToolBar

  28. User Interface Entry Points

  29. Agenda • Page Model • Master Pages • Web Parts • ASP.NET AJAX Integration • User Interface Extensions • Forms and Views UI and Navigation Web Parts Forms and Views Pages

  30. Forms and Views in WSS “v3” • Forms • ASP.NET Control Templates • Extensible Field Types • SPDataSource • Use ASP.NET controls that work with data sources • XSLT-based DataForms • Views • Out-of-Box List Views are still CAML XML-based • Can create custom list view web parts

  31. ASP.NET-Based Forms • Override out-of-box control templates • Form Control • Iterators • Field Controls • Specify form templates • By list type in schema.xml • By content type in feature.xml

  32. Working with Control Templates • Name of control template is key • Place control template files atc:\program files\common files\microsoft shared\web server extensions\12\template\controltemplates\ • Custom control templates override same-named default control templates

  33. 12\TEMPLATE\CONTROLTEMPLATES\DefaultTemplates.ascx <SharePoint:RenderingTemplate ID="DocumentLibraryForm" runat="server"> <Template> <SharePoint:InformationBarrunat="server"/> <wssuc:ToolBarCssClass="ms-formtoolbar" id="toolBarTbltop" RightButtonSeparator="&nbsp;" runat="server"> <Template_RightButtons> <SharePoint:SaveButtonrunat="server"/> <SharePoint:GoBackButtonrunat="server"/> </Template_RightButtons> </wssuc:ToolBar> <SharePoint:FormToolBarrunat="server"/> <SharePoint:FormComponentTemplateName="DocumentLibraryFormCore" runat="server"/> </Template> </SharePoint:RenderingTemplate> <SharePoint:RenderingTemplate ID="DocumentLibraryFormCore" runat="server"> <Template> <TABLE class="ms-formtable" style="margin-top: 8px;" border=0 cellpadding=0 id="formTbl" cellspacing=0 width=100%> <SharePoint:ChangeContentTyperunat="server"/> <SharePoint:DocumentLibraryFieldsrunat="server"/> <SharePoint:ApprovalStatusrunat="server"/> </TABLE> <SharePoint:WebPartPageMaintenanceMessagerunat="server"/> <SharePoint:DocumentTransformersInforunat="server"/> <table cellpadding=0 cellspacing=0 width=100%><tr><td class="ms-formline"><IMG SRC="/_layouts/images/blank.gif“ width=1 height=1 alt=""></td></tr></table> <TABLE cellpadding=0 cellspacing=0 width=100% style="padding-top: 7px"><tr><td width=100%> <SharePoint:ItemHiddenVersionrunat="server"/> <SharePoint:InitContentTyperunat="server"/> <wssuc:ToolBarCssClass="ms-formtoolbar" id="toolBarTbl" RightButtonSeparator="&nbsp;" runat="server"> <Template_Buttons> <SharePoint:CreatedModifiedInforunat="server"/> </Template_Buttons> <Template_RightButtons> <SharePoint:SaveButtonrunat="server"/> <SharePoint:GoBackButtonrunat="server"/> </Template_RightButtons> </wssuc:ToolBar> </td></tr></TABLE> </Template> </SharePoint:RenderingTemplate>

  34. ASP.NET Forms

  35. Views and CAML • “Collaboration Application Markup Language” • XML dialect for SharePoint list data, views, fields, queries, etc • Extremely performant • Deprecated for Forms • Support for more commonly-used alternatives being added with each major release of WSS

  36. XSLT-Based Forms And Views • DataFormWebPart • For forms and views • Use SharePoint List Data, Multiple Lists • Can query SQL Server, OLEDB, Web Services • Use SharePoint Designer to create these

  37. Extensible Field Rendering • Views • Must use CAML XML for view rendering • Fields base type is the default • Share field display behavior with views • Forms • Share the CAML XML view rendering • Use a custom control for form rendering

  38. Extensible Field Type Rendering

  39. Agenda • Page Model • Master Pages • Web Parts • ASP.NET AJAX • User Interface Extensions • Forms and Views • Mobile Support (Bonus!) UI and Navigation Web Parts Forms and Views Pages

  40. Mobile Page Architecture • http://mysitename/m redirects to http://mysitename/_layouts/mobile/default.aspx • Uses ASP.NET control overrides • Change home page via redirection by web template type • Customiseby: • Web Template Type • List Template Type • Field Type

  41. Title Contents Navigation ExampleHome page rendering • Customise Home page by Web/Site Template type • .ASCX rendering template with special IDs • Title: Mobile_[SiteTemplateID]_HomePage_Title • Contents: Mobile_[SiteTemplateID]_HomePage_Contents • Navigation: Mobile_[SiteTemplateID]_HomePage_Navigation • Deploy to 12\TEMPLATE\CONTROLTEMPLATES

  42. Mobile Rendering

  43. Customise look and feel of a site Customise Master Pages Customise CSS End-user customisable web user interface Build Web Parts Build a custom application Extend SharePoint UI Build Features with CustomActions Reusable UI Component Build a Control User Interface Pages Build a _layouts and Contents pages Forms and Views Build Control Templates Review - Extending the User Interface of SharePoint

More Related