Votre première App SharePoint pour Office 365 avec Visual Studio !
Gilles Pommier – MVP Office 365 - SmartView
Qui suis-je ?
• Gilles Pommier
Office 365 MVP, MCT and co-founder of SmartView http://www.smartview.fr –
• SmartViewAgileSharePoint/Office 365Business IntelligenceCoaching/Training
Un peu de théorieSharePoint Hosted appsProvider Hosted appsApps Modèle MVC
Dev – Niveau 200
Agenda
Mode demo ON
Pour SharePoint Une extension réutilisable « à la facebook »
SharePoint 2013 & SharePoint Online : Tout est Apps !
Apps : Une définition ?
Les différents types d’apps
Immersive full page app (aka SPA)At least one required in every app—landing page; can still use SharePoint chroming; lives in remote web for a cloud-hosted app
App PartLike a web part; hosted in an IFRAME (can point to content in remote web)
UI custom actions (declarative)
Evolutions des Développements
SharePoint
SharePoint2007
SharePoint2010
SharePoint 2013/Office 365
Services (IIS, Apache, Other, …)
Services (Azure, IIS, Apache, Other…)
Services(Azure, IIS, Apache,Other, etc…)
SP2007 SP2010 SP2013
Declar. App & Workflow Events
Custom Code
Custom Code
CSOM
_vti_bin_vti_bin
_api
_api
Office 365 Environnement
Developer Site
NapaµOffice 365 Development Tools
SharePoint-hosted App Provider-hosted App
Visual StudioOffice Developer Tools
SharePoint Client Components
Office 365 Environnement
Apps live in their own isolated environment called the “app web”.
The site in which they function is called the “host web”
http://app-7b0fe2bced5247.apps.contoso.com/555DE569-4083-4397-8714-668B91D9C7A9
APP1UID
GUIDAPP1
Comment accéder aux données SP
.NET Managed client object model (CSOM)JavaScript client object model (JSOM)REST endpoints with OData
Différences entre C# et Javascript
C# JavaScript
using Microsoft.SharePoint.Client; ExecuteOrDelayUntilScriptLoaded(initFunc, “sp.js”); …or…$(document).ready(initFunc);
using (ClientContext context = new ClientContext(absoluteUrl))using (ClientContext context = TokenHelper…( ))
var context = SP.ClientContext.get_current();var context = new SP.ClientContext(relativeUrl);
string title = web.Title; var title = web.get_title();
context.Load(oList, list=>list.Title, list=>list.Created);
context.load(oList, ‘Title’, ‘Id’);context.load(oListColl, ‘Include(Title, Id)’);
context.ExecuteQuery();context.ExecuteQueryAsync();
context.executeQueryAsync(onSuccess, onError);
Value types: StringCollection Value types: string[], NaN
Automatic FormDigest handling Manual FormDigest handling
Issues creating RoleDefinitionBindingCollection’s
Apps vs WSP
Apps Sandboxed WSP No Code (*)
Full trust WSP(on prem only)
Where does server-side code run?
Anywhere but farm
Farm (User Code Service) Farm (w3wp.exe)
Scalable Highly Limited Based on farm
Who installs and removes Users Site collection admin Farm admin
Supported in SP2013 Yes Yes Yes
SharePoint Online compatible Yes Yes No
Azure-hosting compatible Yes No No
Requires local farm for developers No Yes Yes
Remote deployment and debugging from Visual Studio Yes No No
*SandBox Solution with code is deprecated in SP 2013 & O365
Complete-Me-Code-Sample
https://github.com/OfficeDev/Complete-Me-Code-Sample/tree/master/CompleteMeSharePointHostedApp
http://www.jeremythake.com/2013/10/sharepoint-hosted-app-with-angularjs-for-mvc-javascript/
• Thank you for your attention!
• This presentation will be available on the • Casablanca SharePoint Days web site after the • event.
Merci de votre attention !Cette présentation sera disponible sur le site internetde SharePoint Days Casablanca, après l’événement.