The new SharePoint App Model provides different ways of building apps. As a developer you have to choose between development techniques, hosting options and more. This session discusses the architecture, various types of apps, application identity and permissions, and how to build these different types of apps. The session contains demos covering building SharePoint-hosted apps, implementing SharePoint 2013 chrome control, setting the right permissions, and more with Visual Studio 2012.
5. Development Evolution
Investment in
Portals & content App discovery & management
2003 2007 2010 2013
Web Parts LOB Silverlight Apps
applications CSOM Client side
Custom limited experience
server side Sandbox CSOM
code REST/oDat
WSP a
deployment
6. Customization Options
Farm Sandbox SharePoint Apps
Full trust solutions Hosted in isolated New Apps model
Customizations to process Deployed from
file system of Limited server side corporate catalog or
servers SharePoint API Office Store
Hosted in same access Manage permission
process as No external service and licenses
SharePoint calls specifically
Server side Simple install and
SharePoint API upgrade process
access Deprecated in Preferred option
Classic model from SharePoint
2007 2013
7. App Development Scenarios
Deployment Options Customization Options Development Tools
On-Premise Farm
Installation Farm-Trust Solutions Web Browser
Office 365 &
SharePoint Online Sandboxed Solutions SharePoint Designer
SharePoint-Hosted
Hosted Installation app Visual Studio
Provider-Hosted app Eclipse, etc
Autohosted app
9. App Shapes
Full page
Implement complete app experiences to satisfy business
scenarios
App Parts
Create app parts that can interact with the SharePoint
experience
UI command extensions
Add new commands to the ribbon and item menus
10. Hosting Options
Provider-hosted app
SharePoint
Provide your own hosting environment Host Web Your Hosted Site
Cloud-hosted apps
- Use server code
- Receive SP events
- Use OAuth to access Autohosted app
SP SharePoint
Windows Azure + SQL Azure provisioned Host Web Azure
automatically as apps are installed
SharePoint-Hosted app
SharePoint
Provisions an isolated sub web on a host web
- Use SP artifacts & out-of-box web parts
Host Web
- Use HTML & JavaScript for UI & client-side logic
- Use Workflows for middle tier logic SharePoint
App Web
12. Visual Studio SharePoint
Tools
• Development Environments
– Develop against a local SharePoint server
– Remote development against SharePoint
Online (Office 365)
• Tools
– Office Developer Tools (RTM)
– Download http://dev.office.com
13. Debug your app
• No app registration required
– SharePoint Developer Site
– ClientId & ClientSecret are generated for you
• IISExpress is used to host Web project
– ~remoteAppUrl token update so it points to IISExpress Url
(http://localhost:1234)
• LocalDB is used for SQL database
– Connection string updated in web.config from SQL project
• Local workflow service is started & configured
14. Publish your app
• SharePoint-hosted & Autohosted
– No app registration required
– Everything included in the .app package
• Provider-hosted
– Developer must acquire ClientId & ClientSecret via Seller
Dashboard
– SharePoint artifacts in .app package
– Web assets in Web Deploy package - developer must
deploy
• Developer must publish & deploy SQL assets if not in Web
Deploy package
15. Anatomy of an App Package
Host
Web
.app Package
App Web
WS
(OPC)
P
(from WSP)
Azure
19. Changes from 2010 to 2013
• The client.svc service extended with REST
capabilities
– client.svc now supports direct access from REST
clients
– client.svc accepts HTTP GET, PUT, POST requests
– Implemented in accordance with OData protocol
• CSOM Extended new APIs
– Focus investment on SharePoint Server APIs
– Search, Social, Taxonomy, Workflow, Analytics,
Sharing, Publishing, eDiscovery, IRM, BCS, … and
more
20. SharePoint 2013 Remote API
_api is new alias for _vti_bin/client.svc
Server
Client REST CSOM
OData
JSON
JavaScript Silverlight .Net CLR
Library Library Library
Custom Client Code
21. Why is REST Important?
• Significant Industry Momentum
• Simple and Easy to Use
– Much easier to use than SOAP-based Web service
– Higher productivity when using JavaScript and jQuery
– Results can be returned in JSON and ATOM format
– Test in a browser
– Platform agnostic
• Each query is submitted with a unique URL
– Results can be cached by proxy servers
22. REST URLs in SharePoint
2013
• CSOM URLS can go through _api folder
– Simplifies URLs that need to be built
– Removes client.svc file name from URL
• You can replace this URL
– http://contoso.com/_vti_bin/client.svc/web
• With this URL
– http://contoso.com/_api/web
23. Mapping Objects to
Resources
• Example REST URLs targeting
SharePoint
– _api/web/lists
– _api/web/lists/getByTitle('Announcements')
– _api/web/getAvailableWebTemplates(lcid=1033)
24. App Authentication
• Use OAuth for secure communications
– SharePoint & web application trust third party
(ACS)
• Trust developed using ClientId &
ClientSecret
– SharePoint & ACS know the ClientId
– Web application & ACS know the
ClientSecret
25. Authentication, cont’d
Access Control
Service
(ACS)
ClientID ClientSecret
SharePoint My Web
Access Token
server Application
Context Token
29. Remote Event Receivers
• Where to use
– Use RER to receive notification that a change has occurred
– Use interface to poll SharePoint for changes
– Write changes as required
• Event scopes: List Item, List, Web, App
• Support for the following types
– Synchronous Events
– Asynchronous After Events
30. Remote Event Receivers
Register declaratively or via code
string url=
"http://contoso.com/RemoteEventService.svc";
using (SPSite site = new SPSite(siteUrl))
{
using (SPWeb web = site.RootWeb)
{
SPList list = web.Lists[listTitle];
list.EventReceivers.Add(
SPEventReceiverType.ItemAdded,
url);
}
}
32. Summary
• The way forward for customizations on
SharePoint
• Build for the cloud (Office 365)
• Heavily invested in CSOM and REST,
allowing interaction with SharePoint
SandboxedSolutionsdeprecated statement: http://msdn.microsoft.com/en-us/library/jj163114.aspx (optioneel no-code sandboxedsolutions voorlopig wel ondersteund?)
Office Developer Tools RTM on Tue 4 March: http://blogs.msdn.com/b/somasegar/archive/2013/03/04/now-available-office-developer-tools-for-visual-studio-2012.aspx VS.NET development for both apps & solutions
Use when app is ready for…Testing by anther person or teamUpload to Store or App CatalogUse the packages from app.publish folder
Open Packaging Conventions (OPC): http://msdn.microsoft.com/en-us/magazine/cc163372.aspxStandard For Packaging Data, also used for Office Open XML.
Legacy of Frontpage…, finally gone
ACS = Access Control Service (Windows Azure Access Control Service)
Debugging Remote Event Receivers with Visual Studio (Provider-hosted apps)http://blogs.msdn.com/b/officeapps/archive/2013/01/03/debugging-remote-event-receivers-with-visual-studio.aspx
VSTO downside is distributionOffice users around the globe 1 billion (June 2010). Noteverybody has Office 2013, but it’sverylikelylots of themwillupcomingyears. VSTO: http://en.wikipedia.org/wiki/Visual_Studio_Tools_for_Office