You are on page 1of 46

.

NET Development for


Microsoft SharePoint™ 2003 Technologies

Bob German
Technology Architect
Microsoft Technology Center – Boston
Agenda

• What is this SharePoint thing


(and why should I care?)
• Product Architecture and
Development Basics
 Web part development
 Data management via lists and document
libraries
 UI Customization
 Application Integration Options
• SharePoint Portal Server 2003:
Overview and Extensibility Options
• Summary
SharePoint™ 2003 Technologies

Correcting some Common Misconceptions:


• There is no product called “SharePoint”
 Windows SharePoint Services 2003
 SharePoint Portal Server 2003
• SharePoint 2003 products are scalable and
managable
 Stateless web servers and SQL Server back-end
 It’s come a long way since 2001!
• FrontPage 2003 is not a toy
 Greatly improved in 2003
 SharePoint-aware – some tasks best done in
FrontPage, others in Visual Studio 2003
SharePoint Family

SharePoint Enterprise Portal


Portal Server 2003 Solution

Team Collaboration
Windows Solution
SharePoint Windows
Services 2003 Site Framework Server 2003
Foundation Technologies

ASP.Net

SQL Server
SharePoint Family
• Windows SharePoint Services
 Site Framework Foundation
• Web Parts/Web Parts Pages
• Page ghosting
• Lists
• Sites
 Collaboration Features
• Document management
• Workspace sites
• Surveys, discussions, etc.
• SharePoint Portal Server
 An application of WSS
 Areas and Listings – provides
organization/structure
 Search, Alerts
 User Profiles, Audiences, “My Site”
• Windows SharePoint Services
2003:
“Out of the Box” experience
SharePoint Development

• Web Part Development


• Event Handlers
• UI Customizations
 Style sheets
 FrontPage customizations
• Custom Pages
• Custom Site Definitions
• Web Services Interfaces
Lists Rule in SharePoint!
• Virtual table storing item data and metadata
• Building block for collaborative applications
• Lists are everywhere!
 Obvious stuff (contacts, tasks, links, etc.)
 Clever stuff (calendars, surveys, threaded
discussions)
 With attached binaries (document libraries, forms
libraries, picture libraries)
 In Portal Areas (Listings)
 Custom lists and list templates
• Metadata “Auto-promotion” from Office
Web Parts and Page Rendering

• Web Parts are* ASP.NET WebControls


• Web Parts Pages are* ASP.NET Pages
 Standard .ASPX format (without inline script)
 Standard page object is in class hierarchy
 Can use standard ASP.NET server (a.k.a.
custom) controls
ASP.NET Page
ASP.NET Page
Zone 1 Web Part
Framework
Zone 3
Zone 2

Content
DB
* Inheritance relationship Web Part
• Web Part Galleries
• “Hello World” Web Part
SharePoint Page Rendering

• ISAPI filter handles


 Ghosting
 Web parts (if ISAPI
IIS 6.0 Filter
applicable)
 API context Web Part Framework Site
V. Server
• ASP.NET handles Profile
 Page and control ASP.NET
rendering
 By this time
• Ghosted pages
appear to be just
pages
• Web parts appear to
be just web controls
Composite Applications

Web Web Web WebPart Interaction


Part Part Part Personalization
Portal Categorization
Search
SharePoint Portal
Single Sign-On

WebServices Single Sign-On


Orchestration
Process and Integration: App Server: Business Rules
Integration BizTalk Windows.Net Schema Mapping
Load Balancing
BT Adapters Connectors
Sync/Async
Auditing

Applications SAP Siebel ...


Web Part Development

• SharePoint 2003 Web Parts are


controls which:
 Allow non-technical end users to create
site pages
 Live in Web Part Zones
(or are hard-coded on pages via FrontPage or
Visual Studio… more on that later)
 Are connectable (pass data to one
another)
 Have metadata (to configure – for all
users or individual users)
 Precursor to .NET 2.0 Web Parts (will
converge in next version)
Building Web Parts
Quick Approach:
2. Define Properties
3. Emit a lot of HTML in RenderWebPart

Better Approach (“Composite Control”):


5. Define properties
6. Override CreateChildControls
a. Instantiate controls and add to Controls collection
b. Define OnLoad event handler for each control
 Implement OnLoad event handler(s)
 Have controls render themselves during
RenderWebPart

“Cheating:”
 “Smart Part” (hosts user control – with caveats)
 Client-side only (script as metadata)
More Web Part Development

• Exception Handling
• Web Parts as User Controls
• Web Part Connections
Data Interfaces
Cell ICellProvider ICellConsumer
Row IRowProvider IRowConsumer
List IListProvider IListConsumer
Filter IFilterProvider IFilterConsumer
Parameters IParametersOutProvi IParametersOutConsu
(name/value der mer
pairs)
IParametersInProvid IParametersInConsum
er er
• Application Surfacing Techniques
• Connected Web Parts
Great Web Parts

Factors that separate average Web Parts


from great
Web Parts:
(a.k.a., what most people haven’t quite figured out)
 Reusability – smart use of metadata and
connections
 State management
 Caching
 Deployment and security
 Logging and debugging
Sites, Workspaces and Areas
• Collection of pages, lists and other information
to present a set of related information
• Analogous to a “Site” in IIS
• Same as a “Site” or “Web”
in FrontPage
• Windows SharePoint
Services
 Team Sites
 Meeting workspaces
 Document workspaces
• SharePoint Portal
Server
 Areas
 Personal sites
(“My Site”)
Sites and Workspaces
• Refer to WSS (whether
or not SPS is installed)
Top-Level • Technically,
Site == Workspace
Site
• “Top-level” sites are
islands (without SPS site
directory)
Child Child • Child sites are sub-
Site Site directories below their
parents
• “Top-level site” and its
children are called a
Child Child “Site Collection”
Site Site • Site collection stores
common:
 Web Part Gallery
Site Collection
 List Template Gallery
 Site Template Gallery
Templates (WSS Only)

• List Templates and Site Templates


• Allows end-users to reuse and share
customizations
• Stored in site-collection level galleries
• Packaged as .STP files (import and export
from gallery)
 A FrontPage .FWP file is almost the same thing
 Rename to end in “.CAB” to see what’s inside!
• Template changes do not affect existing
sites and lists
• Site Templates
Page Customization

The best thing about SharePoint


technologies:
Ready-to-use “Out of the Box” UI
The worst thing about SharePoint
technologies:
Ready-to-use “Out of the Box” UI
Customizing the SharePoint look and
feel:
• Themes
• Cascading Stylesheets
• FrontPage 2003
• Themes and Cascading
Stylesheets
• Editing with FrontPage 2003
Ghosting and Site Definitions

• FrontPage 2003 and CSS Changes are


nice but…
 CSS options are limited
 FrontPage 2003 limits scalability in some
cases
• You may want to modify more than
web part pages:
 Administrative pages
 Javascript/client-side behavior
• Requires understanding what’s going
on at a deeper level: ghosting and site
definitions
SharePoint “Ghosting”
Site or Area

1
Site or Area
4

Physical File Structure


Site or Area

1 2 3 4

2
3

SharePoint Database Apparent File Structure


Ghosting and Site Definitions
• Pages and list schema are read from the
site definition files and cached at IIS
process startup
• Pages are only written to the database
when customized within a site
 Browser-based customization (i.e.
adding/removing web parts) does not change
the actual ASPX pages, hence doesn’t unghost
 FrontPage customization changes ASPX pages,
always unghosts
• Scalability impact:
 “One-off” unghosting is NO PROBLEM
 Site templates can propagate hundreds or
Where is the content?

}
• Site definitions
Files

n”
• Admin Pages

io
at
• Javascript

l ic
pp
• Style sheets

} “A
• Web part code

• Lists
SQL • Web part

t”
n
placement, te
on

metadata
“C

• Site metadata
• User Content
What Is A Site Definition?

• Each ‘Site Definition’ defines a unique type of


SharePoint site
• Multiple site definitions ship in Microsoft®
Windows® SharePoint™ Services
 Team Site
 Meeting Workspace
 Document Workspace
• Still more ship in Microsoft® Office SharePoint™
Portal Server 2003
 Portal Topic Area
 Portal My Site
• And others are available through other products…
 Great Plains
 Project Server 2003
What Is A Site Definition? (cont.)
• Set of files located in the file system of a Windows
SharePoint Services Web server (incl. SharePoint
Portal Server)
 XML files
 ASPX pages
 Document templates (.dot, .htm, etc.)
 Content files (.gif, .doc, etc.)
• Site definitions specify list types, Web pages,
navigation, and site content
• Site definitions reference installed list definitions,
Web Parts, event handlers, and custom JScript
Templates vs. Site Definitions

• Site and List Templates


 Stored in the database
 Starting point for a site or list
(if the template changes, derived sites
and lists stay the same)
 Easy, end-user accessible
• Site Definitions
 Stored in the filesystem (all the goodies
which are ghosted)
 Basis for a site or list
(if the site definition changes, all derived
sites and lists change – or break if you’re
not careful!)
 Best practice for scalability
Resources

• SharePoint Products and Technologies on MSDN


http://msdn.microsoft.com/sharepoint
• User Samples and informal Resource postings on
GotDotNet
http://www.gotdotnet.com
• SharePoint Customization
http://www.sharepointcustomization.com
• SharePoint FAQ
http://www.spsfaq.com
• Web Component Directory
http://www.microsoft.com/sharepoint/webparts
• Product Information
http://www.microsoft.com/sharepoint
• Newsgroups on msnews.microsoft.com
SharePoint API’s

• WSS Object Model


• WSS Web Services
• SPS Object Model
• SPS Web Services
• Other interfaces:
 HTTP
 WebDAV
Accessing List Data
WSS Object Model

• Available objects under


Microsoft.SharePoint namespace:
 SPList – Basic list object for getting to list data
 SPListCollection – Collection of list objects
 SPListItem – Item/Row in a list
 SPListItemCollection – Collection of list items
 SPView – View of a SharePoint list
 SPField – Field/Column in a list
 SPListTemplate – Template of a list
Accessing List Data
WSS Code Snippet

• Get a SPList or SPDocumentLibrary object:


 SPList mylist = web.Lists[“Events”];
 SPDocumentLibrary myDocLib =
(SPDocumentLibrary) web.Lists[“Shared Documents”];
• Call .Items property to get list items collection:
 SPListItemCollection items = mylist.Items;
• Call GetItems() method and pass a SPQuery object to get
subset of list items:
 SPListItemCollection items = mylist.GetItems(query);
Accessing List Data
WSS Code Snippet

• To get data for a field, specify field name in


indexer for an SPListItem:
foreach (SPListItem item in items)
{
Response.Write(item["Due Date"].ToString());
Response.Write(item["Status"].ToString());
Response.Write(item["Title"].ToString());
}
• Note: SPEncode.HtmlEncode() should be used for
HTML output
Web Part Integration Models
Web Clip \ Page Graft Data Cache \ Warehouse
Web Web Web Web Web Web
Part Part Part Part Part Part

HTML / XML / HTTP DB/DW

App App App App App App

Point to Point App/Integration Server


Web Web Web Web Web Web
Part Part Part Part Part Part

WebServices / SQL / Custom App / Integration Server

App App App App App App


SharePoint Portal Server Overview
SharePoint Portal Server

• Application written on WSS platform


• Adds Portal features, including:
 Flexible navigation
 Audience Targeting
 Search
 Sites Directory
 Listings
 My Site
 Single Sign-On
Single Sign-on
• Credential Mapping Database
 Per-user credentials
 Group credentials
• Programmable at display or application tier
• Distributed Ticketing
 Integrated into BizTalk & adaptors (Actional first)
• Does not require Windows.Net/2000 AD deployment

3a. Login with Ex. Oracle


credentials

WP | WP | WP
1. Authenticate
3b. Pass ticket
Web FE WS
Adaptor BizTalk BizTalk
For 2002 Adaptors 5. Login with
2a. Retrieve credentials BizTalk credentials
for app/user
2b. Retrieve ticket
for app/user
4. Retrieve credentials for ticket

SSO Ex. SAP


Encrypted DB storage
SharePoint Search

• Content Sources
 Microsoft SharePoint™ Portal Server sites
 Microsoft Windows SharePoint™ Services sites
 Exchange 2000 Server folder
 File share
 Lotus Notes™
 Any web page or
web site
 Site registry
• Interactive Search
• Alerts
Core Search Architecture
Microsoft
Search Service

Content Source Filter Daemon Gatherer

Protocol Search
Handler Index Engine User
Engine queries
Documents Word-
IFilters breakers

Stemmers

Notifications
(optional) Full-text
Index
Programming Search

• Using the Search Engine


 Metadata Definition
 Search.asmx
 SQL Variant for queries
• Enhancing the Search Engine
 IFilters
 Protocol Handlers
Secure Searches

• When content source supports ACL, so does


Search
 Windows file system
 Exchange
 SharePoint Portal Server/Windows Sharepoint
Services
 Notes (via mapping layer)
• NT/AD groups must be domain-based and
resolvable by search server
Scalable Indexing

Web

Files

User queries
Microsoft
Exchange Propagates

SPS Search
Server

Notes
Dedicated
Index Builders
Scalable Distributed Search
User queries
 Duplicated query
servers
Search
 Complete server
replacement of
entire content
and index, User queries
including
subscriptions on
target
User queries
 Useful for slow
WANs
 Reduces load on Search
network servers
bandwidth

You might also like