sharepoint 2010/2013 for asp.net developers

26
SharePoint 2010/2013 for ASP.NET Developers Rob Windsor [email protected] @robwindsor

Upload: rob-windsor

Post on 11-May-2015

8.482 views

Category:

Technology


2 download

DESCRIPTION

SharePoint is an awesome tool. It allows you to build web sites, manage lists of data, collaborate on documents, and so much more – all done through a simple, easy to use, web interface. Even better, SharePoint is built on top of ASP.NET. So, when the platform doesn't have the functionality you need, you can extend it using the tools in Visual Studio and the SharePoint developer APIs. Unfortunately it's not all wine and roses. In addition to your ASP.NET development experience you'll need to learn SharePoint specific concepts, practices and terminology. This session is covers the SharePoint architecture, developer tools, APIs, and the different packaging and deployment models. Its goal is to give you enough to get started developing on the SharePoint platform while laying the foundation for further learning on the subject.

TRANSCRIPT

Page 1: SharePoint 2010/2013 for ASP.NET Developers

SharePoint 2010/2013 for

ASP.NET Developers

Rob Windsor

[email protected]

@robwindsor

Page 2: SharePoint 2010/2013 for ASP.NET Developers

About Me

• Senior SharePoint Architect with Portal Solutions

• Technical Contributor to the Pluralsight On-Demand Library

• Microsoft MVP, MCPD, MCT

• Founder and Past-President of the North Toronto .NET UG

• Co-author of Prof. Visual Basic 2012 and .NET 4.5 (Wrox)

Page 3: SharePoint 2010/2013 for ASP.NET Developers
Page 4: SharePoint 2010/2013 for ASP.NET Developers

SharePoint is a Platform

• SharePoint is a platform that sits on top of ASP.NET

• The platform provides business services

• The first step in learning SharePoint development is to get a

solid understanding the platform

This is a BIG step

It’s the same order of magnitude as getting a solid understanding of

the .NET Framework

• You need to understand the platform so you can determine

when custom development is, and is not, necessary

The goal of any SharePoint developer is to solve business problems

using the platform – that is, without custom development

Page 5: SharePoint 2010/2013 for ASP.NET Developers

SharePoint Architecture

2007 2010 2013

OS Server 2003 or 2008 Server 2008

Server 2012 (SP2)

Windows Vista or 7

Server 2008 R2 or 2012

.NET 3.0 or 3.5 3.5 SP1 4.5

Package Farm Solutions Farm Solutions

Sandbox Solutions

Farm Solutions

Sandbox Solutions *

SharePoint Apps

APIs Server OM

ASMX Services

Server OM

ASMX Services

Client OM

REST API

Server OM

ASMX Services *

Client OM

REST API

Notes:

• Operating systems for SharePoint 2010 and 2013 must by 64-bit

• Sandboxed solutions and ASMX web services have been deprecated in

SharePoint 2013

Page 6: SharePoint 2010/2013 for ASP.NET Developers

SharePoint Architecture (con’t)

Farm

Web App

Site Collection

Content Type

Web Part

Site

List

Library

SharePoint System Folders

SharePoint Database

Page 7: SharePoint 2010/2013 for ASP.NET Developers

SharePoint Editions

• SharePoint Foundation

Free

Core collaboration features and developer APIs

• SharePoint Server

Standard and Enterprise editions

Adds enterprise features valuable to mid to large size

organizations

• Office 365/SharePoint Online

Most of the collaboration features of Foundation

Some of the enterprise features of Server

Limited options for custom development

Page 8: SharePoint 2010/2013 for ASP.NET Developers

SharePoint Developer Enviroment

• SharePoint must be installed on developer

machine

Unless you only want to build Apps for Office 365

• Also have: SQL Server, Visual Studio, SharePoint

Designer, Office

• Suggested RAM requirements

SP 2010 Foundation: 2GB

SP 2010 Server: 6GB

SP 2013 Foundation or Server: 10GB+

Page 9: SharePoint 2010/2013 for ASP.NET Developers

SharePoint Developer APIs

• Server Object Model

Used by client apps running on SP server

• Client Object Models (CSOM)

Remote API

Three entry points: .NET Managed, Silverlight, JavaScript

Façade layer on top of WCF service

Uses batching model to access resources

• REST Web Services (API)

SP 2010: CRUD on list data only

SP 2013: API expanded to be more like CSOM

• SharePoint Web Services

“Legacy” SOAP-based web services

Page 10: SharePoint 2010/2013 for ASP.NET Developers

Package Models

• Farm Solutions

Full access to Server Object Model

Files deployed to SharePoint server file system

• Sandboxed Solutions

Access to a subset of the Server Object Model

Files deployed to SharePoint content database

Code executes in isolated worker process

• SharePoint Apps

No access to Server Object Model

Code executes on client or on remote server

Deployment location depends on App type

Page 11: SharePoint 2010/2013 for ASP.NET Developers

DEMO Building a Solution

Page 12: SharePoint 2010/2013 for ASP.NET Developers

Features and Elements

• SharePoint component model

• Define logical units of functionality

• Contain elements e.g. menu items, links, list types and list instances

Many other element types possible

• Support activation/deactivation by end-users and administrators Activation scoped to: Farm, Web Application, Site, or

Web

Events raised during activation and deactivation

Page 13: SharePoint 2010/2013 for ASP.NET Developers

User’s View of Features

• Features support concept of activation and deactivation

Page 14: SharePoint 2010/2013 for ASP.NET Developers

Feature Manifest

• Features defined in using Collaborative Application

Markup Language (CAML)

<Feature Id="B2CB42E2-4F0A-4380-AABA-1EF9CD526F20" Title="A Sample Feature: Hello World" Description=“This is a hand crafted Feature manifest" Scope="Web" Hidden="FALSE" xmlns="http://schemas.microsoft.com/sharepoint/"> <ElementManifests> <ElementManifest Location="elements.xml" /> </ElementManifests> </Feature>

Page 15: SharePoint 2010/2013 for ASP.NET Developers

Element Manifest

• This element defines a Site Actions menu item

• There are many other types of elements

<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction Id="SiteActionsToolbar" GroupId="SiteActions" Location="Microsoft.SharePoint.StandardMenu" Sequence="100" Title="Hello World" Description="A custom menu item added using a feature" ImageUrl="_layouts/images/crtsite.gif" > <UrlAction Url="http://msdn.microsoft.com"/> </CustomAction> </Elements>

Page 16: SharePoint 2010/2013 for ASP.NET Developers

Solution Packages

• Work done in Visual Studio packaged into a

solution for deployment

• Package is a CAB file with a WSP extension

• Package contains manifest with deployment

instructions

• Two types of solutions:

Farm solutions

Sandboxed solutions

Page 17: SharePoint 2010/2013 for ASP.NET Developers

DEMO Revisit the Project

Page 18: SharePoint 2010/2013 for ASP.NET Developers

What is the App Model?

• New development/deployment/hosting model for

extensions to Office and SharePoint

• Conceptually similar to apps for phones/tablets

Find / Try / Buy concept

Public and private App stores (catalogs)

Apps for SharePoint are self-contained pieces of

functionality that extend the capabilities of a SharePoint

website. Apps integrate the best of the Web and SharePoint;

they are targeted and easy-to-use, and do a great job at

solving a user need.

Page 19: SharePoint 2010/2013 for ASP.NET Developers

App Characteristics

• All custom code executes outside SharePoint

JavaScript in client browser

.NET (or other) code on external server

Code communicates with SharePoint via web services

• Apps have identity and permissions

App requests permissions when installed

Permissions have both scope and rights

App permissions are independent of user permissions

Page 20: SharePoint 2010/2013 for ASP.NET Developers

App Experiences

• Full Page

All apps must have a full page experience

• App Part

UI from full-page experience can be added to

SharePoint pages like a web part

Hosted in an IFrame

• Custom Actions

Can add options to ribbon or menus

Page 21: SharePoint 2010/2013 for ASP.NET Developers

App Hosting

• SharePoint Hosted

App hosted in SharePoint farm

• Externally Hosted

Also known as Developer, Provider or Cloud Hosted

App hosted in website external to SharePoint

Can be implemented using any Web technology

• Hybrid

App could a combination of two hosting models above

• Auto-Hosted

SharePoint Online and Azure

• Services

App support depends on two service applications

App Management and Site Subscription Management

Page 22: SharePoint 2010/2013 for ASP.NET Developers

SharePoint Hosted App Isolation

• Apps are isolated from the SharePoint site that hosts

them and from other Apps

• The SharePoint site where you install an App is called the

Host Web

• The SharePoint site where the App is deployed is called

the App Web

Lives in an isolated domain on SharePoint farm

Base URL is partially generated, partially configured

• Example: Host Web: www.contoso.com/sites/demo

App Name: Test

App Web: app-bdf2016ea7dacb.apps.contoso.com/sites/demo/Test

Page 23: SharePoint 2010/2013 for ASP.NET Developers

SharePoint Hosted App Capabilities

• Cannot use server-side code

• Can create many SharePoint elements

Lists, fields, content types, etc.

• Can provision content pages

Pages can use ASP.NET and SharePoint controls

No code-behind

• Elements and Pages provisioned in App Web

• Can only communicate with Host Web if granted

permissions

Communicate with Host Web using CSOM or REST

Page 24: SharePoint 2010/2013 for ASP.NET Developers

App Development Tools

• “Napa”

SharePoint App that enables App development

Only requires a browser

Designed for leaning and prototyping

• Visual Studio 2012

App development tools require download

Tools are still in Beta (Preview 2)

Page 25: SharePoint 2010/2013 for ASP.NET Developers

DEMO Building an App

Page 26: SharePoint 2010/2013 for ASP.NET Developers

Thank You

• Big thanks to the organizers, sponsors and you for making

this event possible

• Please fill out your evaluation

• Please keep in touch

[email protected]

@robwindsor

msmvps.com/blogs/windsor