450 likes | 573 Views
Entwicklung von SharePoint 2010 Anwendungen. Simon Amrein Consultant simon.amrein@trivadis.com Zürich, 23.04.2010. Speaker. Name Simon Amrein Company Trivadis AG Email simon.amrein@trivadis.com. Data are always part of the game. Agenda. Visual Studio 2010 Support LINQ to SharePoint
E N D
Entwicklung von SharePoint 2010 Anwendungen Simon Amrein Consultant simon.amrein@trivadis.com Zürich, 23.04.2010
Speaker • Name Simon Amrein • Company Trivadis AG • Email simon.amrein@trivadis.com MSDN TechTalk - SharePoint 2010 für Entwickler
Data are always part of the game. Agenda • Visual Studio 2010 Support • LINQ to SharePoint • Client Object Model • Business Connectivity Service MSDN TechTalk - SharePoint 2010 für Entwickler
Visual Studio 2010 • Better support for SharePoint development • Support only for SharePoint 2010 (no extended SharePoint 2007 support) • Easy way to Debug Feature/Solution • F5 – Deployment MSDN TechTalk - SharePoint 2010 für Entwickler
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
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
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
Server Explorer • 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 MSDN TechTalk - SharePoint 2010 für Entwickler
Feature Designer • Configure Feature with VS Support • Define Scope (Farm, Site, Web, WebApplication) MSDN TechTalk - SharePoint 2010 für Entwickler
Package Explorer • Define features and additional files for WSP-Package • Edit Manifest manually if required • The way to build your WSP File – No WSPBuilder needed anymore MSDN TechTalk - SharePoint 2010 für Entwickler
Deployment • F5 deployment on testsystem • STSADM / Powershell • … but Solution Installer is still a good opportunity… MSDN TechTalk - SharePoint 2010 für Entwickler
Data are always part of the game. Demo Visual Studio 2010 MSDN TechTalk - SharePoint 2010 für Entwickler
Data are always part of the game. Agenda • Visual Studio 2010 Support • LINQ to SharePoint • Client Object Model • Business Connectivity Service MSDN TechTalk - SharePoint 2010 für Entwickler
SQL Query string cs =“Data Source=localhost;…..“; using (SqlConnection c = new SqlConnection(cs)) { c.Open(); SqlCommandcmd = c.CreateCommand(cs); cmd.CommandType = CommandType.Text; cmd.CommandText = “SELECT * FROM…..”; SqlDataReader r = cmd.ExecuteReader(); ….
XML Query XmlTextReaderr = new XmlTextReader(“c:\data.xml”); While(r.Read()) { XmlNodeTypent = r.NodeType; switch(nt) { case XmlNodeType.Element: …. case XmlNodeType.Attribute: ….
2007-Style CAML Query <Where> <Gt> <FieldRef Name='EndDate'/> <Value Type='DateTime'> <Today OffsetDays=\"-1\"/> </Value> </Gt> </Where>
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 MSDN TechTalk - SharePoint 2010 für Entwickler
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 MSDN TechTalk - SharePoint 2010 für Entwickler
Using LINQ to SharePoint MSDN TechTalk - SharePoint 2010 für Entwickler
Creating Entity Classes • Generated from spmetal utilityspmetal /web:<site Url> /code:Projects.cs • Create classes and add them to project MSDN TechTalk - SharePoint 2010 für Entwickler
DataContext Object • DataContext class allows access to list data MSDN TechTalk - SharePoint 2010 für Entwickler
Modifying List Data • Changes to entity objects are tracked by Linq provider • Changes submitted SubmitChanges() method is called MSDN TechTalk - SharePoint 2010 für Entwickler
Data are always part of the game. Demo LINQ to SharePoint MSDN TechTalk - SharePoint 2010 für Entwickler
Data are always part of the game. Agenda • Visual Studio 2010 Support • LINQ to SharePoint • Client Object Model • Business Connectivity Service MSDN TechTalk - SharePoint 2010 für Entwickler
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) MSDN TechTalk - SharePoint 2010 für Entwickler
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 MSDN TechTalk - SharePoint 2010 für Entwickler
Equivalent Objects • Member names mostly the same from server to client (e. g., SPWeb.QuickLaunchEnabled = Web.QuickLaunchEnabled) MSDN TechTalk - SharePoint 2010 für Entwickler
Using the Client Object Model MSDN TechTalk - SharePoint 2010 für Entwickler
.NET Client OM ClientContextclientContext = new ClientContext("http://server"); //Load method clientContext.Load(clientContext.Web); clientContext.Load(clientContext.Web.Lists); //LoadQuery method var q1 = from list in context.Web.Lists where list.Title != null select list; var r1 = context.LoadQuery(q1);
Data are always part of the game. Demo .net Client Object Model MSDN TechTalk - SharePoint 2010 für Entwickler
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 MSDN TechTalk - SharePoint 2010 für Entwickler
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. MSDN TechTalk - SharePoint 2010 für Entwickler
Silverlight Client OM MSDN TechTalk - SharePoint 2010 für Entwickler
Data are always part of the game. Demo Silverlight WebPart MSDN TechTalk - SharePoint 2010 für Entwickler
Data are always part of the game. Agenda • Visual Studio 2010 Support • LINQ to SharePoint • Client Object Model • Business Connectivity Service MSDN TechTalk - SharePoint 2010 für Entwickler
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 MSDN TechTalk - SharePoint 2010 für Entwickler
BCS Architecture Office Client SharePoint Server 2010 SharePoint Site External Business Parts VSTO Package External List Custom Code Office Integration Search, Workflow, Web Parts Business Connectivity Services Secure Store Service (SSS) Custom WCF SQL Business Connectivity Services Client Runtime Cache External Content Types (ECT) Server Runtime External Data .NET Connector MSDN TechTalk - SharePoint 2010 für Entwickler
Solution Types, Personas and Tools • Simple SharePoint Designer MSDN TechTalk - SharePoint 2010 für Entwickler
Development Approaches SharePoint Server (Prod / Dev) IT Admin “Live” connection WSP/ ClickOnce Package SI/IT Devs Import & Configure WSP/BDC • 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 Produce WSP/ClickOnce Package w/BDC Model • Create custom back-end integration logic using .Net code • Author thin and rich client UX (independently) as SharePoint and VSTO customization projects SharePoint Designer Pro Dev MSDN TechTalk - SharePoint 2010 für Entwickler
SharePoint Designer • Connecting to an externaldatasource – Just a fewclicks to go… MSDN TechTalk - SharePoint 2010 für Entwickler
Data are always part of the game. Agenda External List – SharePoint Designer MSDN TechTalk - SharePoint 2010 für Entwickler
Visual Studio 2010 Support • The tool for creating “.NET Connectors” MSDN TechTalk - SharePoint 2010 für Entwickler
Data are always part of the game. Agenda External List – Visual Studio MSDN TechTalk - SharePoint 2010 für Entwickler
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
Thank you! ? www.trivadis.com