This sessions if for everybody that always wanted to know about SharePoint development, but didn’t have anyone to ask, or didn’t have opportunity to try on their own. We’ll show how to start with SharePoint development, what API to use, when to use client API, is server side object model deprecated, how to setup development environment and more tips & tricks which are not usually mentioned.
3. Agenda
• About SharePoint
• SharePoint APIs history
• SharePoint 2013 API overview
• What API to choose
• SharePoint Apps overview
• SharePoint Dev environment
• Key Takeaways
• Q&A
4. What is SharePoint?
• It’s web & intranet platform for…
•
•
•
•
•
•
•
Collaboration
Enterprise Content Management
Search
Business Process Management (Workflows)
Business Intelligence
Social Computing
Enterprise Application Integration
• More than 50% of intranets in the world use SharePoint!!!
5. Why SharePoint?
• Worldwide used product and platform
• Leading platform for ECM, BPM, BI and Social Computing
• On premise and Cloud ready
• Standardized and widely accepted functionalities
• Lot’s of Out-Of-The-Box features and platform for creating your
own applications
6. What is SharePoint Development?
End user
Power user
• SharePoint Configuration
• Internet Explorer
• XML, XSL, JavaScript, jQuery, UI Config
• SharePoint designer
Designer
• Master Page, Page layout, CSS
• SharePoint designer
Developer
• SSOM, CSOM, .NET, JS, REST
• Visual Studio
7. One day in life of SharePoint developer
• Server side OM
• Client side OM
• JavaScript
• Rest
• WCF (SOAP, OData)
• HTML, CSS
• XML, XSLT
• jQuery
• TypeScript
• Oauth
• NTLM, Kerberos
• FBA authentication
• Claims
• InfoPath forms
• Azure ACS
• AppFabric Cache
• Windows RT
• Windows Phone
• Workflow Foundation
• Silverlight
8. Development overview
Client Side
• Client Object
Model
• REST
Services
Data
Platform
•
•
•
•
Farm
Sites
List data
External lists
Server side
• Server Side
Object Model
9. APIs – History: SharePoint 2007
• Server-side object model
• RPC Calls (owssrc.dll)
• ASMX Web Services (The only client side possibility)
• SPServices (Community Project based on ASMX services)
10. APIs – History: SharePoint 2010
• Server Side object model
• RPC Calls (owssrc.dll)
• ASMX Web Services
• SPServices (Community Project based on ASMX services)
• ListData.svc (REST-like web service)
• Client Side Object Model
11. APIs – SharePoint 2013
• Server Side Object Model
• RPC Calls (owssrc.dll)
• ASMX Web Services
• Client-Side Object Model (extended)
• New REST APIs
12. Sever object model
• Largest API set
• Cover all functionalities of SharePoint – both end user and
administrative
• Microsoft.SharePoint… namespace
• Assemblies are deployed to GAC
• On premises use only
• Sandboxed solutions are deprecated in favor of Apps for SharePoint
14. Server object model – remember
• Code that use SharePoint data platform (SPSite, SPWeb, SPList,
SPListItem, SPFile …) should be on SharePoint server with Front
End role
• Use WSP – easier to deploy and maintain
• Check disposing of SharePoint objects
• Use it for Web Parts, Layout pages, Timer jobs, EventReceivers,
custom WCF/ASMX on SharePoint server,
• On premises only!!!
16. Client object model for managed code
• .NET client object model
• .NET application that run on a non-phone Windows client
• user computer
• external server
• web or worker role on Windows Azure
• Core classes in SSOM have corresponding classes in CSOM
• SPSite -> Site
• SPWeb -> Web
• SPList -> List
• Support for ECM, taxonomy, user profiles, publishing, search, BCS…
• Lines of code are sent to the server in batches (to improve
performance)
• Install SharePoint client components
• Namespace Microsoft.SharePoint.Client
17. Client object model for managed code
• Silverlight client object model
• Used in Silverlight applications regardless where the compiled .xap file
is persisted
•
•
•
•
Assets library on SharePoint 2013 site
Client computer
Cloud storage
External server
• Nearly identical to .NET Client object model
• Difference: in Silverlight version all batches of commands are sent to the server
asynchronously -> UI of the application remains active
• Silverlight .xap files can be included in Apps for SharePoint
18. Client object model for managed code
• Mobile object model
• Special version of the Silverlight client object model for Windows
Phone devices
• Additional API – relevant only to telephones (push notifications…)
• Supports only core SharePoint functionalities
• Support for ECM, taxonomy, user profiles, publishing, search, BCS…
19. JavaScript object model
• Inline script or separate .js files
• Includes all the same functionality as the .NET Framework and
Silverlight client object models
• Batches of code always run asynchronously
• Data is returned from the server in JavaScript Object
Notation (JSON)
24. REST/OData endpoints
• Access SharePoint entities from client technology that do not
use JavaScript and are not built on the .NET Framework or
Silverlight platforms
• CRUD operations on SharePoint list data using OData protocol
• Response: Atom or JSON format
32. Factors that determine which API to use
• The type of application
• SharePoint App, Web Part, Silverlight application, timer job…
• Your existing skill
• JavaScript, ASP.NET, REST/OData, Silverlight, Windows Phone…
• The device on which the code runs
• Server in the SharePoint farm, external server, a client computer,
mobile device…
34. If you want to do this
• Create an ASP.NET web application that performs
create/read/update/deleted (CRUD) operations across a firewall
on SharePoint data or external data that is surfaced in
SharePoint by a Microsoft Business Connectivity Services
(BCS) external content type
…use these APIs
• JavaScript client object model
35. If you want to do this
• Create an ASP.NET web application that performs CRUD
operations on SharePoint data or external data that is surfaced
in SharePoint by a BCS external content type, but does not
have to call SharePoint across a firewall
…use these APIs
• .NET Framework client object model, Silverlight client object
model, or REST/OData endpoints
36. If you want to do this
• Create a LAMP web application that performs CRUD operations
on SharePoint data or external data that is surfaced in
SharePoint by a BCS external content type
…use these APIs
• REST/OData endpoints
37. If you want to do this
• Create a Windows Phone app that performs CRUD operations
on SharePoint data
…use these APIs
• Mobile client object model
38. If you want to do this
• Create an iOS or Android app that performs CRUD operations
on SharePoint data
…use these APIs
• REST/OData endpoints
39. If you want to do this
• Create a .NET Framework application that performs CRUD
operations on SharePoint data
…use these APIs
• .NET Framework client object model
40. If you want to do this
• Create a Silverlight application that performs CRUD operations
on SharePoint data
…use these APIs
• Silverlight client object model
41. If you want to do this
• Create an HTML/JavaScript application that performs CRUD
operations on SharePoint data
…use these APIs
• JavaScript client object model
42. If you want to do this
• Create an app for Office that works with SharePoint
…use these APIs
• JavaScript client object model
43. If you want to do this
• Create a custom Windows PowerShell command
…use these APIs
• Server object model
44. If you want to do this
• Create a timer job
…use these APIs
• Server object model
45. If you want to do this
• Create a custom Web Part, application page, or ASP.NET user
control
…use these APIs
• Server object model
46. What to chose?
SharePoint
extensions
SharePoint
Data models
Web parts
Farm Solutions
Application
Pages
Event
Handlers
SharePoint
Business
customizatio
ns
Connectivity
Services
Service
Applications
Timer Jobs
Admin stuff
SharePoint Server Side Object Model
...
49. SharePoint solution types with SP 2013
1
2
Farm solutions
3
Sandbox
SP Apps
Full trust solutions
Declarative elements
New Apps model
Customizations to file system of
servers
Partially trusted code service
still included for limited server
side support
Deployed from corporate
catalog or office market place
Classic model from 2007
Manage permission and
licenses specifically
Preferred option
50. apps…
• …are not executed in SharePoint App pool
• …are in most of the cases not even running on SP Server
• …can have full trust, with user’s approval (OAuth)
• …can access SharePoint Data
• …can access outer world non-SharePoint Data
• …can use any external resources
• …can be executed in it’s own chrome, as app parts, or as
SharePoint extensions
52. SP App design - a choice of three approaches
Provider-Hosted App
Cloud-based Apps
“Bring your own server hosting infrastructure”
Developers will need to isolate tenants
Get remote events from
SharePoint
Use CSOM/REST +
OAuth to work with SP
SharePoint
Web
Your Hosted Site
SharePoint
Web
Azure
(from
WebDeploy,
DacPac)
Azure Auto-Hosted App
Windows Azure + SQL Azure
provisioned invisibly as apps are
installed
SharePoint-hosted App
Provision an isolated sub web on a parent
web
• Reuse web elements
(lists, files, out-of-box web parts)
• No server code allowed; use client
JavaScript for logic, UX
Parent
Web
App Web
(from WSP)
53. Types of Apps for SharePoint
Shape
Description
Example
Immersive App
(Full Page)
App that implements a new
scenario for customers
Resource Tracking,
Budgeting
App Part
Provides new parts you can add to
your sites
Weather,
Team Mascot, News
Extension App
(Custom Action)
Add new actions for documents
and items
Display Document
Visualization, Print to
Print Service Vendor
54. Development environment for SharePoint
2013
• Create solutions with server side object model or develop apps
for SharePoint for a corporate catalog (full control permission)
• VM
•
•
•
•
Windows Server 2008 R2(SP1)/2012
SQL Server 2008 R2/2012 (Express/Standard/Enterprise)
SharePoint 2013 Foundation/Standard/Enterprise
Visual Studio 2012, SharePoint Designer 2013, Office 2013
• Create and publish apps for SharePoint
• Get Office365 Developer site
• NAPA / Visual Studio 2012
55. Key Takeaways
• SharePoint is leading IWS solution
• SharePoint development is complex but worthy
• Invest time in choosing right technology and approach for
SharePoint development
• SharePoint Apps – be prepared for new trend
• SaaS, Cloud – dominate trends in future