45
Basel · Baden Bern · Brugg · Lausanne Zurich Düsseldorf · Frankfurt/M. · Freiburg i. Br. Hamburg · Munich · Stuttgart · Vienna Entwicklung von SharePoint 2010 Anwendungen Simon Amrein Consultant simon.amrein@trivadi s.com Zürich, 23.04.2010

Entwicklung von SharePoint 2010 Anwendungen

  • Upload
    reid

  • View
    20

  • Download
    0

Embed Size (px)

DESCRIPTION

Entwicklung von SharePoint 2010 Anwendungen. Simon Amrein Consultant [email protected] Zürich, 23.04.2010. Speaker. NameSimon Amrein CompanyTrivadis AG [email protected]. Data are always part of the game. Agenda. Visual Studio 2010 Support LINQ to SharePoint - PowerPoint PPT Presentation

Citation preview

Page 1: Entwicklung von SharePoint 2010 Anwendungen

Basel · Baden Bern · Brugg · Lausanne Zurich Düsseldorf · Frankfurt/M. · Freiburg i. Br. Hamburg · Munich · Stuttgart · Vienna

Entwicklung von SharePoint 2010 Anwendungen

Simon [email protected]

Zürich, 23.04.2010

Page 2: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 2

Speaker

Name Simon Amrein

Company Trivadis AG

Email [email protected]

Page 3: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 3

Agenda

Data are always part of the game.

Visual Studio 2010 Support

LINQ to SharePoint

Client Object Model

Business Connectivity Service

Page 4: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 4

Better support for SharePoint development

Support only for SharePoint 2010 (no extended SharePoint 2007 support)

Easy way to Debug Feature/Solution

F5 – Deployment

Visual Studio 2010

Page 5: Entwicklung von SharePoint 2010 Anwendungen

© 2010

Templates

Event Receivers

Web Partsincl Visual WebPart (no more SmartParts)

Workflows

Content Type

List / Site Definition

BCS Model

Empty Projext

MSDN TechTalk - SharePoint 2010 für Entwickler 5

Page 6: Entwicklung von SharePoint 2010 Anwendungen

© 2010

SharePoint 2010 Project Templates

All Projects built using standard structure

Common Project Properties Project File Project Folder Assembly Deployment Target Sandboxed Solution Site URL Startup Item

MSDN TechTalk - SharePoint 2010 für Entwickler 6

Page 7: Entwicklung von SharePoint 2010 Anwendungen

© 2010

SharePoint 2010 Project Structure

Standard Project Nodes Properties References Features

Package SharePoint Project Items

(optionally added by dev using SharePoint 2010 Developer Tools)

MSDN TechTalk - SharePoint 2010 für Entwickler 7

Page 8: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 8

Add-in for Server Explorer window Easy way to examine site artifacts Quick way to launch browser into site

SharePoint Explorer extensibility Developers can write add-ins to

populate nodes and provide contextual menu commands

Local machines only

Server Explorer

Page 9: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 9

Configure Feature with VS Support

Define Scope (Farm, Site, Web, WebApplication)

Feature Designer

Page 10: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 10

Define features and additional files for WSP-Package

Edit Manifest manually if required

The way to build your WSP File – No WSPBuilder needed anymore

Package Explorer

Page 11: Entwicklung von SharePoint 2010 Anwendungen

© 2010

Deployment

F5 deployment on testsystem

STSADM / Powershell

… but Solution Installer is still a good opportunity…

MSDN TechTalk - SharePoint 2010 für Entwickler 11

Page 12: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 12

Demo

Data are always part of the game.

Visual Studio 2010

Page 13: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 13

Agenda

Data are always part of the game.

Visual Studio 2010 Support

LINQ to SharePoint

Client Object Model

Business Connectivity Service

Page 14: Entwicklung von SharePoint 2010 Anwendungen

© 2010

SQL Query

string cs =“Data Source=localhost;…..“;using (SqlConnection c = new SqlConnection(cs)){ c.Open(); SqlCommand cmd = c.CreateCommand(cs); cmd.CommandType = CommandType.Text; cmd.CommandText = “SELECT * FROM…..”; SqlDataReader r = cmd.ExecuteReader();….

Page 15: Entwicklung von SharePoint 2010 Anwendungen

© 2010

XML Query

XmlTextReader r = new XmlTextReader(“c:\data.xml”);While(r.Read()){

XmlNodeType nt = r.NodeType; switch(nt) { case XmlNodeType.Element: …. case XmlNodeType.Attribute: ….

Page 16: Entwicklung von SharePoint 2010 Anwendungen

© 2010

2007-Style CAML Query

<Where> <Gt> <FieldRef Name='EndDate'/> <Value Type='DateTime'> <Today OffsetDays=\"-1\"/> </Value> </Gt></Where>

Page 17: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 17

What is LINQ?

Language Integrated Query

Simplified, object-oriented way to query

Bridges OOP and relational data

Compile-time checked queries

Provides IntelliSense inside Visual Studio

Unified syntax for querying any data source

Page 18: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 18

LINQ to SharePoint

No CAML Required

Entity classes form Business Layer

Strongly-typed queries, compile-time check

Intellisense helps query construction

Microsoft.SharePoint.Linq.dll Encapsulates the SharePoint object model queries based on the

created entity classes

Page 19: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 19

Using LINQ to SharePoint

Create Entity

Classes

Create DataContext

Writer Queries

Page 20: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 20

Creating Entity Classes

Generated from spmetal utilityspmetal /web:<site Url> /code:Projects.cs

Create classes and add them to project

Page 21: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 21

DataContext Object

DataContext class allows access to list data

Page 22: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 22

Modifying List Data

Changes to entity objects are tracked by Linq provider

Changes submitted SubmitChanges() method is called

Page 23: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 23

Demo

Data are always part of the game.

LINQ to SharePoint

Page 24: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 24

Agenda

Data are always part of the game.

Visual Studio 2010 Support

LINQ to SharePoint

Client Object Model

Business Connectivity Service

Page 25: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 25

Why Client Object Model?

More SharePoint Web services is a major request

Client Object Model provides complete API instead of more services

Provides an abstraction layer to return results as recognizable SharePoint objects

Consistent developer experience across platforms (.NET, ECMAScript, Silverlight)

Page 26: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 26

Supported Areas

Site Collections and Sites

Lists, List Items, Views, and List Schemas

Files and Folders

Web, List, and List Item Property Bags

Web Parts

Security

Content Types

Site Templates and Site Collection Operations

Page 27: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 27

Equivalent Objects

Server (Microsoft.SharePoint)

.NET Managed(Microsoft.SharePoint.Client)

Silverlight(Microsoft.SharePoint.Client.Silverlight)

JavaScript(SP.js)

SPContext ClientContext ClientContext ClientContext

SPSite Site Site Site

SPWeb Web Web Web

SPList List List List

SPListItem ListItem ListItem ListItem

SPField Field Field Field

Member names mostly the same from server to client (e. g., SPWeb.QuickLaunchEnabled = Web.QuickLaunchEnabled)

Page 28: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 28

Using the Client Object Model

Page 29: Entwicklung von SharePoint 2010 Anwendungen

© 2010

.NET Client OM

ClientContext clientContext = new ClientContext("http://server");

//Load methodclientContext.Load(clientContext.Web); clientContext.Load(clientContext.Web.Lists);

//LoadQuery methodvar q1 = from list          in context.Web.Lists         where list.Title != null         select list; var r1 = context.LoadQuery(q1);

Page 30: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 30

Demo

Data are always part of the game.

.net Client Object Model

Page 31: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 31

Silverlight Client OM

Silverlight Development Enabled by Client OM

Can use Silverlight in separate ASPX page or in Web Part

Can utilize Client OM in Silverlight to create SharePoint apps

Page 32: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 32

Creating Silverlight Web Parts

A Web Part can be a host for Silverlight

SharePoint ships with Silverlight web part

The web part can contain custom properties that are sent to Silverlight via the InitParameters property

The XAP file can be deployed to LAYOUTS and loaded at run time

The Silverlight application can then make use of the Client OM.

Page 33: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 33

Silverlight Client OM

Page 34: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 34

Demo

Data are always part of the game.

Silverlight WebPart

Page 35: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 35

Agenda

Data are always part of the game.

Visual Studio 2010 Support

LINQ to SharePoint

Client Object Model

Business Connectivity Service

Page 36: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 36

Business Connectivity Services

Provide connectivity support to the following types of external systems: Databases Web/WCF services Microsoft .NET Framework connectivity assemblies Custom data sources

Read and Write

Provides rich cache, offline work features and supports cache-based operations.

Batch and Bulk Operation Support

Page 37: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 37

BCS Architecture

CustomSQL

External DataWCF

Cache

Business Connectivity Services

Client Runtime

SharePoint Server 2010

Business Connectivity Services

Secure Store Service (SSS)

Search, Workflow, Web Parts

External Content Types (ECT)

Server Runtime

SharePoint Site

VSTOPackage

External List

Office Client

Office Integration

External Business Parts

Custom Code

.NET Connector

Page 38: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 38

Solution Types, Personas and Tools

Power User / No code RAD Dev

• OOB UX on thin and rich clients (Outlook and Groove) based on External Lists• Custom Forms in SharePoint and

Groove• Connect to existing back-end

integration services or simple databases• Simple BDC Models (few ECTs,

simple associations)• Transparent packaging (managed by

BCS)

Advanced

Advanced Dev Custom Code

• Custom UX and data integration on thin and rich clients (apps that support VSTO add-ins)• Through Office, SharePoint and BCS

Object Models• Custom back-end connectivity

through .Net objects• Complex BDC models (many ECTs,

complex associations)

• Explicit packaging (managed by dev)

SharePoint Designer

Simple

Page 39: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 39

Development ApproachesSharePoint Server

(Prod / Dev)IT Admin

Import & ConfigureWSP/BDC

SI/IT Devs

“Live” connection

SharePoint Designer

No code, discover and configure existing back-end integration end-points

Connect to (existing) WCF, ADO.Net and .Net Objects

Simultaneously author thin and rich client UX for External List and InfoPath Forms

Pro Dev

Produce WSP/ClickOnce Package w/BDC Model

WSP/ ClickOnce Package

Create custom back-end integration logic using .Net code

Author thin and rich client UX (independently) as SharePoint and VSTO customization projects

Page 40: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 40

SharePoint Designer

Connecting to an externaldatasource – Just a fewclicks to go…

Page 41: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 41

Agenda

Data are always part of the game.

External List – SharePoint Designer

Page 42: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 42

Visual Studio 2010 Support

The tool for creating “.NET Connectors”

Page 43: Entwicklung von SharePoint 2010 Anwendungen

© 2010MSDN TechTalk - SharePoint 2010 für Entwickler 43

Agenda

Data are always part of the game.

External List – Visual Studio

Page 44: Entwicklung von SharePoint 2010 Anwendungen

© 2010

Courses / Events

Microsoft Ignite Training SharePoint 2010 for developers (4Tg) 21.06.-24.06.2010 in Zürich 06.09.-09.09.2010 in Basel

SharePoint 2010 – Was ist neu für Administratoren und IT Professionals (5Tg) 20.09.-24.09.10 in München 18.10.-22.10.10 in Zürich

MSDN TechTalk - SharePoint 2010 für Entwickler 44

Page 45: Entwicklung von SharePoint 2010 Anwendungen

Basel · Baden Bern · Brugg · Lausanne Zurich Düsseldorf · Frankfurt/M. · Freiburg i. Br. Hamburg · Munich · Stuttgart · Vienna

Thank you!

?www.trivadis.com