Windows SharePoint Services Development Part 2

Download Report

Transcript Windows SharePoint Services Development Part 2

Windows SharePoint Services
(Part 2)
including Enterprise Search
David Gristwood
James Akrigg
Microsoft Limited
Agenda
Windows SharePoint Services - part 2
Enterprise Search
Agenda
Windows SharePoint Services part 2
Follow on from part 1
User Interface focus
Uses HelpDesk sample
Quick review
Topics
Master Pages
Web Parts
Forms and rendering
SharePoint for ASP.NET
Developers
ASP.NET Integration Overview
SharePoint v3 has
better integration
with ASP.NET
Built on top of ASP.NET
More ASP.NET features
“shine through”
Still some conceptual
differences;
SharePoint has
Template Model for fast
site creation
Users can edit and
customise pages
Windows
SharePoint
Services
“v2”
ASP.NET 2.0
ASP.NET 1.1
Windows
SharePoint
Services “v3”
Under the covers
SharePoint v2
Integrated II6 and ASP.NET 1.10 via ISAPI
Requests routed to Windows SharePoint Services
before ASP.NET
Issue around context, extending sites, etc
SharePoint v3
Uses 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
WSS 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 v3
ASP.NET 2.0 virtual path
provider removes dependency
on file system
SharePoint v3 has
SPVirtualPathProvider for
SQL Server
Other differences
Need to understand template model
No-code Pages, so code behind model
SafeControls list of allowable controls
Content
Database
Customized
ASPX Pages
Web Front
End
Template
ASPX Pages
_layouts
Application
ASPX Pages
Master Pages
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)
Master Pages Concepts
<%@ master %>
<%@ page masterpagefile=“A.master”%>
<asp:Content runat=“server”
ContentPlaceHolderID=“Main”>
<asp:ContentPlaceHolder
runat=“server” ID=“Main” />
Master file:
“A.master”
<asp:ContentPlaceHolder
runat=“server” ID=“Footer” />
</asp:Content>
<asp:Content runat=“server”
ContentPlaceHolderID=“Footer”>
</asp:Content>
Rendered web page
Content file:
“B.aspx”
Master Pages
Placeholders
Master 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 Layout
Application Pages
Content Pages - http://myserver/
spweb.MasterUrl
/_layouts/
application.master
/shared documents/
/
/_catalogs/masterpage/
default.aspx
allitems.aspx
default.master
.aspx
.aspx
.master
.master
/_layouts/
create.aspx
“ghosting” / “uncustomized page”
SiteTemplates\STS
default.aspx
Pages\
Global\
viewpage.aspx default.master
File System - \.. \web server extensions\12\
.aspx
Master Pages
In SharePoint Sites
Master Page via Feature
Master Pages in SharePoint Designer
Extending The User Interface
Hooks in the User Interface to add your
own
Extensible Toolbars, Menus,
Settings Pages
Link to pages
Can use ASP.NET controls on toolbars
Associate by List type, Content type, File Type
All feature based
Display Form ToolBar
View ToolBar
Site Actions
Welcome Menu
Dropdowns
Extending and Customising
the UI:
Enterprise Search
Search Center
Anatomy Of Results Page
SEARCH BOX
HIDDEN SHARED OBJECT
ACTION LINKS
STATISTICS
PAGINATION
HIGH CONFIDENCE MATCH
CORE SEARCH RESULTS
MATCHING
KEYWORDS
AND BEST BETS
Search UI Programmability
Easy to powerful:
Customize using web part properties
Customize using XSLT, XML, and script
Manipulate 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
Parts
Search query and results
Results Page Information Flow
Browser
POST or GET Build links with
search results
URL
page
parameters
Server
Get query, scope
from request
parameters
Search OM
Service
•CSS applied
•Client-side code runs
Get SELECT
list from tool
pane
Query.Execute()
Write custom
Web Parts to
OM
Wrap results Edit Transform
in XML style sheets
Render
Change
the
Return results in
set of
transform
IDataReader objects
Get Doc IDs from index,
Properties from search DB
Customize 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 enable
query manipulations
Appropriate for scenarios requiring
Change results layout, look and feel
Keyword syntax queries
Web Parts
Web Parts
End-user customizable controls
Custom web parts popular extension point
for developers
Web part framework now in ASP.NET
Support for assembly-based ASP.NET 2.0 parts
Great backwards compatibility with WSS v2 Web
Parts
Improved user interface for Web Parts
Easier to build solutions around dashboards
Types Of Web
Parts
WSS v2 Web Parts
Microsoft.SharePoint.WebPartPages.WebPart
Some architectural changes required
e.g. Client Connections, Caching, Work Items
“rebased” to inherit from WebPart rather than Control class
Hybrid Web Parts
Microsoft.SharePoint.WebPartPages.WebPart
Use for Migration
ASP.NET Web Parts
Microsoft.Web.UI.WebControls.WebParts.WebPart
Main focus for WSS v3 development
ASP.NET 2.0 Web Parts
Adding a Web Part User Experience
Visual Studio Web Part project
Deploying a Web Part as Safe Control
ASP.NET Web Part Connections
•
“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
Web Part Connections
HelpDesk Picker/Display Web Parts
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
SharePoint Control Library
Out of the box SharePoint controls
Have SharePoint look and feel
Controls:
SPGridView
SPTreeView
Field Controls
DateField, TextField, UrlField, UserField
Validators
Forms
Forms In SharePoint
Forms In SharePoint v2
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 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 Forms
XSLT-Based Forms And Views
DataViewWebPart (deprecated)
DataFormWebPart
Misnomer - for views and forms
Take data from SP and render it via XSLT
Can query SQL Server, OLEDB,
Web Services
Use SharePoint Designer to create these
Extensible Field Rendering
E.g. Business Data Catalog has its own
extensible field rendering
Define at two levels
1. Views
Must use CAML XML for view rendering
Field’s base type is the default
2. Forms
Share the CAML XML view rendering
Use a custom control for form rendering
Extensible Field
Type Rendering
Summary
Tools for your web application toolbox
SharePoint Designer
Master Pages and tokens
Features
Reusable SharePoint Controls
Web part Framework
Forms
Extensible Types
© 2006 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.