Windows SharePoint Windows SharePoint Services (Part 2)Services (Part 2)including Enterprise including Enterprise SearchSearch
David GristwoodJames AkriggMicrosoft Limited
AgendaAgenda
Windows SharePoint Services - part 2
Enterprise Search
AgendaAgenda
Windows SharePoint Services part 2Follow on from part 1User Interface focus
Uses HelpDesk sampleQuick review
TopicsMaster PagesWeb PartsForms and rendering
SharePoint for ASP.NET SharePoint for ASP.NET DevelopersDevelopers
ASP.NET Integration ASP.NET Integration OverviewOverview
SharePoint v3 has better integration with ASP.NET
Built on top of ASP.NET
More ASP.NET features
“shine through”
Still some conceptualdifferences; SharePoint has
Template Model for fast site creation
Users can edit and customise pages
ASP.NET 2.0ASP.NET 2.0
Windows Windows SharePoint SharePoint Services Services
“v3”“v3”
Windows Windows SharePoint SharePoint Services Services
“v2”“v2”
ASP.NET 1.1ASP.NET 1.1
Under the coversUnder the covers
SharePoint v2Integrated II6 and ASP.NET 1.10 via ISAPI
Requests routed to Windows SharePoint Services before ASP.NET
Issue around context, extending sites, etc
SharePoint v3Uses ASP.NET 2.0 HttpModule and HttpHandler
Fully initialised before Windows SharePoint Services code executes
IIS Metabase Wildcard means all requests routed regardless of extension (e.g. .pdf, .docx, etc)
.ASPX Page Architecture.ASPX Page ArchitectureWSS v2
ASP.NET 1.1 page parser only works with files in local file systems
SharePoint architecture stores pages in SQL Server
Windows SharePoint Services v2 team had to build own .ASPX parser
Didn’t support all features
WSS v3ASP.NET 2.0 virtual path provider removes dependency on file system
SharePoint v3 has SPVirtualPathProvider for SQL Server
Other differencesOther differences
Need to understand template model
No-code Pages, so code behind model
SafeControls list of allowable controls
Template Template ASPX PagesASPX Pages
_layouts _layouts Application Application ASPX PagesASPX Pages
Customized Customized ASPX Pages ASPX Pages
Web Front Web Front EndEnd
Content Content DatabaseDatabase
Master PagesMaster Pages
Master Page ConceptsMaster 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)Master Page “Chrome” (default.master)
Content Page Content Page (default.aspx)(default.aspx)
Master Pages ConceptsMaster Pages Concepts
Master file: “A.master”
Content file: “B.aspx”
<%@ master %>
Rendered web page
<%@ page masterpagefile=“A.master”%>
<asp:ContentPlaceHolder runat=“server” ID=“Main” />
<asp:ContentPlaceHolder runat=“server” ID=“Footer” />
<asp:Content runat=“server” ContentPlaceHolderID=“Main”>
</asp:Content>
<asp:Content runat=“server” ContentPlaceHolderID=“Footer”>
</asp:Content>
Master Master Pages Pages PlaceholderPlaceholderss
Master Pages In WSSMaster Pages In WSS
• Each WSS site has a Master Page Gallery• Site metadata indicates where WSS looks
for a master page • Level of indirection so required to change
every page to use different master page• Can be set programmatically
• Tokens• ~masterurl/default.master• ~masterurl/custom.master• ~sitecollection/default.master• ~site/default.master
SharePoint Page LayoutSharePoint Page Layout
default.aspx
spweb.MasterUspweb.MasterUrlrl
.aspx .master
Content Pages - http://myserver/
/ /_catalogs/masterpage/allitems.aspx
.aspx
/shared documents/
create.aspx
.aspx
/_layouts/
Application Pages
.master
/_layouts/
application.master
File System - \.. \web server extensions\12\
default.aspxSiteTemplates\STS Global\
viewpage.aspx
Pages\
default.master
“ghosting” / “uncustomized page”
default.master
Master Pages Master Pages In SharePoint SitesIn SharePoint Sites
Master Page via FeatureMaster Pages in SharePoint Designer
Extending The User Extending The User InterfaceInterface
Hooks in the User Interface to add your own
Extensible Toolbars, Menus, Settings Pages
Link to pagesCan use ASP.NET controls on toolbarsAssociate by List type, Content type, File Type
All feature based
Display Form ToolBarDisplay Form ToolBar
View View ToolBarToolBar
Welcome Welcome MenuMenu
Site ActionsSite Actions
DropdownsDropdowns
Extending and Extending and Customising the UI:Customising the UI:Enterprise SearchEnterprise Search
Search CenterSearch Center
Anatomy Of Results PageAnatomy Of Results Page
SEARCH BOX
CORE SEARCH RESULTS
PAGINATIONSTATISTICS
ACTION LINKS
MATCHING KEYWORDS
AND BEST BETS
HIGH CONFIDENCE MATCH
HIDDEN SHARED OBJECT
Search UI ProgrammabilitySearch UI Programmability
Easy to powerful:Customize using web part properties
Customize using XSLT, XML, and scriptManipulate URL parameters
Build web parts and apps using the query OM
keyword and SQL syntax
Remote apps using the query web service
Customing Search Web Customing Search Web PartsParts
Search query and results
POST or GETsearch results page
Query.Execute()Query.Execute()
Get Doc IDs from index,Properties from search DB
Get Doc IDs from index,Properties from search DB
Return results in set of IDataReader objects
Return results in set of IDataReader objects
Wrap results in XML
Wrap results in XML
•CSS applied•Client-side code runs
Get query, scope from request parameters
Get query, scope from request parameters
Get SELECT list from tool pane
Get SELECT list from tool pane
Build links withURL
parameters
Build links withURL
parameters
TransformRender
TransformRender
Change the transform
Edit style
sheets
Write custom Web Parts to
OM
Results Page Information Results Page Information FlowFlowBrowserBrowser
ServerServer
Search OMSearch OM
ServiceService
Customize UI With XSLTCustomize UI With XSLT
Web part property specifies query columns
Search web parts get results XML
Web parts apply transform to XML nodes
Search page URL parameters enablequery manipulations
Appropriate for scenarios requiring
Change results layout, look and feel
Keyword syntax queries
Web PartsWeb Parts
Web PartsWeb Parts
End-user customizable controls
Custom web parts popular extension point for developers
Web part framework now in ASP.NETSupport for assembly-based ASP.NET 2.0 partsGreat backwards compatibility with WSS v2 Web Parts
Improved user interface for Web PartsEasier to build solutions around dashboards
Types Of Web Types Of Web PartsParts
WSS v2 Web PartsMicrosoft.SharePoint.WebPartPages.WebPart
Some architectural changes requirede.g. Client Connections, Caching, Work Items
“rebased” to inherit from WebPart rather than Control class
Hybrid Web PartsMicrosoft.SharePoint.WebPartPages.WebPart
Use for Migration
ASP.NET Web PartsMicrosoft.Web.UI.WebControls.WebParts.WebPart
Main focus for WSS v3 development
ASP.NET 2.0 Web PartsASP.NET 2.0 Web Parts
Adding a Web Part User ExperienceVisual Studio Web Part projectDeploying a Web Part as Safe Control
ASP.NET Web Part ASP.NET Web Part ConnectionsConnections• “pump” data between web parts
• Users configure as required
• WSS v2 used Connection Types• Generic “late bound” model• ICell -> IField, IList -> Itable
• WSS v3 uses ASP.NET 2.0• New Custom connection interfaces and
Custom transformers• Automatic translation from WSS v2
types
ASP.NET 2.0 ASP.NET 2.0 Web Part ConnectionsWeb Part Connections
HelpDesk Picker/Display Web Parts
Integration LimitationsIntegration Limitations
Cannot use ASP.NET 2.0 Web Part Pages
Not directly compatible as-isPages 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, thoughWrappers for .ASCXs can and will be created
SharePoint Control LibrarySharePoint Control Library
Out of the box SharePoint controlsHave SharePoint look and feel
Controls:SPGridViewSPTreeViewField Controls
DateField, TextField, UrlField, UserField
Validators
FormsForms
Forms In SharePointForms In SharePoint
CAML (Collaboration Application Markup Language)
XML dialect for SharePoint list data, views, fields, queries, etc
Extremely performant
Deprecated for v3 for froms
Support for more commonly-used alternatives being added with each major release of WSS
Forms In SharePoint v2Forms In SharePoint v2
Forms In SharePoint v3Forms In SharePoint v3
• ASP.NET Control Templates based model
• Override out-of-box control templates
• Support custom Field Types• SPDataSource to bind ASP.NET
controls• XSLT-based DataForms• Limitations
• Out-of-Box List Views are still CAML XML-based
ASP.NET FormsASP.NET Forms
XSLT-Based Forms And XSLT-Based Forms And ViewsViews
DataViewWebPart (deprecated)
DataFormWebPartMisnomer - for views and formsTake data from SP and render it via XSLTCan query SQL Server, OLEDB, Web Services
Use SharePoint Designer to create these
Extensible Field RenderingExtensible Field Rendering
E.g. Business Data Catalog has its own extensible field rendering
Define at two levels
1.ViewsMust use CAML XML for view renderingField’s base type is the default
2.FormsShare the CAML XML view renderingUse a custom control for form rendering
Extensible Field Extensible Field Type RenderingType Rendering
SummarySummary
Tools for your web application toolbox
SharePoint Designer Master Pages and tokensFeaturesReusable SharePoint Controls Web part FrameworkFormsExtensible Types
© 2006 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.