You are on page 1of 32

From .

NET to SharePoint:
Introduction to SharePoint
Programming for .NET
Developers
Eric Shupps, Microsoft MVP [SharePoint]
President
BinaryWave
Sponsored by:
Visit us on the web at www.binarywave.com
Real-time application monitoring, event
management, and operational health
metrics for Microsoft SharePoint
Reduce troubleshooting time by up to 30%
Increase efficiency and improve user satisfaction
Avoid downtime and costly outages
Meet or exceed service level agreements
Maximize investment in current infrastructure
Who Am I?
Founder and President, BinaryWave
Microsoft MVP (Windows SharePoint
Services)
ISPA Regional Evangelist (South Central US)
D/FW SharePoint Community Advisory
Member
SharePoint Development Patterns &
Practices Advisory Board Member
Blog: www.sharepointcowboy.com
Why SharePoint?
.NET
Data Storage
Presentation
Clustering
Security
Disaster Recovery
Web Services
API
Features
SharePoint
Data Storage
Presentation
Clustering
Security
Disaster Recovery
Web Services
API
Features
SharePoint 2007 and ASP.NET
SharePoint 2007 derives from ASP.NET 2.0 and adds an
extra layer of functionality (OM, Web Services, Features,
Solution Packages, etc.)
Many ASP.NET development practices transfer directly
to SharePoint development
Some ASP.NET development methods are suboptimal
or unsupported within a SharePoint environment and
new methods must be learned to take advantage of
SharePoint functionality (Database vs. OM)
Yes, you can utilize source control and managed code
deployment within SharePoint!
Web Applications & Site Collections
Web application = IIS Virtual Server
Web application is base management unit
A site collection resides within a web application
Site collections include basic WSS sites and full portal
sites; replace portal areas
Special site collection types include My Sites, Shared
Services Provider, Publishing Web
Each web application may be assigned its own app pool
Web applications may share one or more Shared
Service Providers
List Structures, Types and Views
Lists are ad-hoc data repositories with a limited number
of field types and data elements
List content is stored in a single table in SQL
List content is displayed in user-defined views that can
be filtered, sorted, grouped and styled
List views are somewhat similar to ASP.NET GridView
objects but are sealed and non-extensible
Lists may be accessed programmatically via the object
model or web services
Lists support list, folder and item level security
Features
A Feature is a defined set of functionality encapsulated
within a specific format
Features are the basic building block of SharePoint
development
Features may be comprised of configuration parameters,
code/file deployment, or both
Features may be deployed manually or automatically on
a local or global basis
Features are heavily dependent on CAML
Multiple features can be bundled into a single Solution
Package for easy deployment
Object Model
The SharePoint object model is a rich API provided for
.NET developers to extend the base functionality of
SharePoint
The OM contains a rich set of interfaces, including
extensive web services
Any custom code can utilize the SharePoint OM by
referencing the Microsoft.SharePoint.dll
NOTE: Majority of OM code must run on a SharePoint
server instance (limited remote development/debugging)
Get to the
Demos
Already!
Narrative
Bob, an ASP.NET developer, must create an application
in SharePoint to support his companys new product
introductions
Users must be able to comment on new product designs
WITHOUT having the ability to edit the list item
Management wants a dashboard providing easy access
to the latest comments
Product managers must be able to archive old product
designs for audit and retention purposes
The entire solutions must be provided to IT as a single
package
Meet Bob
Meet Bob
Meet Bob
Meet Bob
Meet Bob
DEMO
Creating Custom Lists
Application Pages
Shared set of resources used by all site collections
Provide access to a variety of (mostly) administrative
tasks, including setting properties, making configuration
changes, viewing content collections, assigning
permissions, etc.
Run in a separate virtual directory (/_layouts)
Stored on disk in the 12\TEMPLATE\LAYOUTS folder
Share a common design theme but use a fixed master
page separate from site master
Custom application pages are relatively easy to create
and deploy
DEMO
Creating an Application Page
Event Receivers
Event Receivers are handler assemblies that respond to
events on specific objects (Sites, Lists, etc.)
List ERs override one of the following methods:
ItemAdding (during event)
ItemAdded (post event)
ItemUpdating (during event)
ItemUpdated (post event)
No UI or user feedback mechanism (write errors and
status messages to event log)
Must run with Full Trust in the GAC
DEMO
Creating an Event Receiver
Web Parts
Web Parts are a specific type of server control that
inherit from System.Web.UI.WebPart
Web Parts contain discreet functionality that is exposed
to the user in the context of a Web Part Page
Web Parts may contain any custom code but do not
have an IDE; all controls must be built dynamically
Web Parts execute in the context of the current user
Require a WebPartManager and WebPartZone
Web Parts may be deployed individually or as part of a
solution package
DEMO
Creating a Web Part
Web Services
SharePoint Web Services provide remote access to a
number of Objet Model functions
Web Services are limited in scope to several primary
functional areas, such as Farm, Site, Web, List, List
Items, List Views, etc.
Web Services require a great deal of XML manipulation
Many Web Service functions require a solid
understanding of CAML
In some instances Web Services can be more
performant than direct OM interaction
Workflow
SharePoint Workflow inherits and builds upon Windows
Workflow Foundation (WF)
Simple workflows can be created in SharePoint
Designer, advanced workflows require Visual Studio
Two types of workflow Sequential and State Machine
User interaction provided via InfoPath forms or custom
ASPX pages
Workflows are tied directly to lists and list items
Built-in history, tasks, and tracking mechanisms
Customization & Branding
SharePoint 2007 utilizes ASP.NET master pages and
extensive CSS
Customization and branding can be done on a site-by-
site basis using SharePoint Designer or on a global
basis using custom Site Definitions
Site Definitions are advanced templates that may include
custom code, including server controls, user controls,
web parts, etc.
Site Definitions are deployed using the Feature
framework
Site Definition Structure
Solution Package
Features
Master
Page
Site
Columns
Content
Types
Layout
Pages
Files
Webtemp
Site
Templates
Styles Images
Solution Packages
Solution Packages are bundles of functionality that are
deployed and managed at the farm level
Solution Packages are created in Visual Studio using the
Cabinet SDK
Solution Packages may contain one or more Features,
assemblies, pages, controls, and other objects
SharePoint handles installation and configuration of
solution items automatically across entire farm
Solution Packages add development overhead but
dramatically decrease code maintenance and
deployment overhead
DEMO
Code Deployment Using Features and
Solution Packages
Please fill in the evaluation
forms!
Feel free to talk to me after the
seminar!
Resources
Slides and sample code:
www.sharepointcowboy.com, Presentations link
In Memory of Patrick Tisseghem
1968 - 2008

You might also like