29
Developing for SharePoint 2010 Regina Technology Community May 2011

Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Developing for SharePoint 2010

Regina Technology Community

May 2011

Page 2: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Agenda

• What is SharePoint? • Why SharePoint? • SharePoint architecture • Object model • Hardware setup • Deployment • Web Parts • Event Receivers • Workflows

Page 3: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

What is SharePoint?

Page 4: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

But what is SharePoint?

• .Net web application

• Application Platform

Page 5: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Out of the box

Custom Development

Custom Development

Why SharePoint?

.Net SharePoint

Data Storage

Presentation

Security

Clustering

APIs

Office Integration

Features Features

Data Storage

Presentation

Security

Clustering

APIs

Office Integration

Page 6: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

SharePoint Server and Site Architecture

Page 7: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Site Architecture

1. SPSite

2. SPWeb

3. SPList • SPDocumentLibrary

4. SPField

5. SPListItem

Page 8: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

SharePoint Object Models

• Server Object Model

– Microsoft.SharePoint namespace

• Client Object Model

– Microsoft.SharePoint.Client namespace (.Net)

– SP namespace (ECMAScript)

Page 9: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Comparison of Object Models

Server .NET / Silverlight ECMAScript

Microsoft.SharePoint.SPContext Microsoft.SharePoint.Client. ClientContext

SP.ClientContext

Microsoft.SharePoint.SPSite Microsoft.SharePoint.Client.Site SP.Site

Microsoft.SharePoint.SPWeb Microsoft.SharePoint.Client.Web SP.Web

Microsoft.SharePoint.SPList Microsoft.SharePoint.Client.List SP.List

Microsoft.SharePoint.SPListItem Microsoft.SharePoint.Client.ListItem SP.ListItem

Microsoft.SharePoint.SPField (including major derived classes)

Microsoft.SharePoint.Client.Field SP.Field

Microsoft.SharePoint.WebPartPages. SPLimitedWebPartManager

Microsoft.SharePoint.Client. WebParts.LimitedWebPartManager

SP.WebParts. LimitedWebPartManager

Page 10: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Development Setup - Hardware

• Only supports 64-bit architecture

• Quad core processor

• 4 GB RAM

• 80 GB for the system drive

Page 11: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Development Setup - Software

• Operating system

– Windows Server 2008 R2

– Windows Server 2008 Service Pack 2

– Windows 7 (non-production)

– Windows Vista Service Pack 2 (non-production)

• Visual Studio 2010

• SharePoint Designer 2010

Page 12: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Deploying solutions

• Deployment to localhost - F5

• Deployment to server – WSP file

– Copy file to server and install with STSADM.EXE or PowerShell

Page 13: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Features

• Modules or “chunks of code”

• Pluggable: can activate or deactivate at a given scope

• Can be activated/deactivated by

– PowerShell, object model, STSADM.exe, User Interface

Page 14: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Web Parts

• ASP.NET Web Parts

• SharePoint-based Web Parts

Page 15: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Web Parts

• Standard Web Parts

• Visual Web Parts

Page 16: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Web Parts Demo

Page 17: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Break

Page 18: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Event receivers

• Event receivers contain event handlers

• Allows you to execute code before/after certain actions take place

– ItemAdding, ItemAdded

– FieldUpdating, FieldUpdated

– SiteDeleting, SiteDeleted

• Synchronous (before)

• Asynchronous (after)

Page 19: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Understanding before and after

Before

• Cancelling an event

• Validating input/data

After

• Changing the properties of an object

• Notifying of success/failure

Page 20: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Event receivers: Lists

Before

• FieldAdding

• FieldDeleting

• FieldUpdating

• ListAdding

• ListDeleting

After

• FieldAdded

• FieldDeleted

• FieldUpdated

• ListAdded

• ListDeleted

Page 21: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Event receivers: List Items

Before

• ItemAdding

• ItemDeleting

• ItemUpdating

• ItemAttacmentAdding

• ItemAttachmentDeleting

• ItemCheckingIn

• ItemCheckingOut

• ItemUncheckingOut

• ItemFileMoving

• -

After

• ItemAdded

• ItemDeleted

• ItemUpdated

• ItemAttachmentAdded

• ItemAttachmentDeleted

• ItemCheckedIn

• ItemCheckedOut

• ItemUncheckedOut

• ItemFileMoved

• ItemFileConverted

Page 22: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Event receivers: List e-mails

Before

• -

After

• EmailReceived

Page 23: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Event receivers: List workflows

Before

• WorkflowStarting

• -

After

• WorkflowStarted

• WorkflowCompleted

Page 24: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Event receivers: Webs

Before

• SiteDeleting

• WebDeleting

• WebMoving

• WebAdding

After

• SiteDeleted

• WebDeleted

• WebMoved

• WebProvisioned

Page 25: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Event receivers: Features

Before

• -

• FeatureDeactivating

• -

• FeatureUninstalling

• FeatureUpgrading

After

• FeatureActivated

• -

• FeatureInstalled

• -

• -

Page 26: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Event receiver demo

Page 27: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Workflows

• Built on Windows Workflow Foundation 3.5

• Can create workflows with

– Visio 2010

– SharePoint Designer 2010

– Visual Studio 2010

• Can attach workflows to

– List / Libraries

– Web sites

Page 28: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Workflows Demo

Page 29: Developing for SharePoint 2010 - aarebrot.net€¦ · Web Parts •ASP.NET Web Parts •SharePoint-based Web Parts . Web Parts •Standard Web Parts •Visual Web Parts . Web Parts

Wrap up

• Questions?

• Training – Microsoft SharePoint 2010, Application Development (10175) – Designing and Developing Microsoft SharePoint 2010

Applications (10232) – [email protected]

• E-mail: [email protected] • Blog: http://aarebrot.net • Twitter: http://twitter.com/aarebrot