Top Banner
#CampusDays SharePoint App Architecture for the Cloud and on-premise Prod3003 Sonja Madsen SharePoint MVP
21

Share point app architecture for the cloud and on premise

Jul 14, 2015

Download

Internet

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Share point app architecture for the cloud and on premise

#CampusDays

SharePoint App Architecture for the Cloud and on-premiseProd3003

Sonja Madsen

SharePoint MVP

Page 2: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

Sonja Madsen

• SharePoint MVP

• Owner of Sonjasapps

• Blog at sp2013.blogspot.com, tweet at @sonjamadsen

• Consulting

• Microsoft partner and vendor

• Speaker at conferences on SharePoint topics

• Over 10 years with SharePoint

• Self-employed

• Creuna, Proactive, DIS-Play, Avanade, Microsoft

Page 3: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

Agenda

• Provider apps

• Demo - Create team sites on Office 365

• Office App Model Samples Team

• Farm code -> Client Object Model

• Demo – Create sites with metadata

• How it works

• JavaScript vs C#

Page 4: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

Provider apps

SharePoint 2013

Office 365

Provider app

Cloud

On-premise

Page 5: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

Projects Web

Demo: create team project sites on Office 365

Page 6: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

SharePoint out-of-box

No project metadata, no overview

No governance on how to call sites, where to create sites, permissions

How to find ”my project sites"

Look and feel, site templates?

Page 7: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

SharePoint Hosted vs Provider App

Client Object Model

Elevate permissions with Provider App

JavaScript vs C#

Hosting

Developer environment

Page 8: Share point app architecture for the cloud and on premise
Page 9: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

Demo

Page 10: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

Architecture

Provider app code List

Sites

Overview

Hosting, Visibility, Maintenance, Administration, UI, End-User Involvement

Page 11: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

User Voice

Office App Model Samples team

https://github.com/OfficeDev/PnP/tree/dev

http://blogs.office.com/2014/08/13/uservoice-driving-improvements-sharepoint-api/

Page 12: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

Farm Solution Provider Appusing (SPSite site = new SPSite(projectweburl))

{

using (SPWeb web = site.RootWeb)

{

web.AllowUnsafeUpdates = true;

int TemplateI = 0;

string lcid = System.Threading.Thread.CurrentThread.CurrentUICulture.LCID.ToString();

SPWebTemplateCollection webTemplates = site.GetWebTemplates(Convert.ToUInt32(lcid));

for (int i = 0; i < webTemplates.Count; i++)

{

if (webTemplates[i].Title == sitetemplatetitle)

{

TemplateI = i;

}

}

SPWebTemplate webTemplate = webTemplates[TemplateI];

string webTitle = title;

string webUrl = id;

//create project site

web.Webs.Add(webUrl, webTitle, "",

uint.Parse(lcid), webTemplate, false, false);web.Update();

}

}

var spContext = SharePointContextProvider.Current.GetSharePointContext(HttpContext);

using (var clientContext = spContext.CreateUserClientContextForSPHost())

{

if (clientContext != null)

{

WebCreationInformation creation = new WebCreationInformation();creation.Url = webTitle;

creation.Title = webTitle;

Web newWeb = clientContext.Web.Webs.Add(creation);

clientContext.Load(newWeb);

clientContext.ExecuteQuery();

}

}

Page 13: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

Farm Solution Provider App

ThmxTheme.SetThemeUrlForWeb(currentweb, currentweb.ServerRelativeUrl

+ "/_catalogs/theme/SK.thmx");

currentweb.Update();

siteWeb.ApplyTheme(colorPaletteFile.ServerRelativeUrl, fontSchemeFile.ServerRelativeUrl,null, true);

siteWeb.Update();

clientContext.ExecuteQuery();

Page 14: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

C# JavaScript

var context = SP.ClientContext.get_current();

SP.Utilities.Utility.logCustomAppError(context, "My custom error message.");

context.executeQueryAsync(function(){},function(){});

Page 15: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

Demo

Page 16: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

Demo

Page 17: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

JavaScript vs C#

Client Object Model

Elevate permissions with Provider App

JavaScript vs C#

No Web Parts with C#

Can’t remove Web Parts from page with C#

Custom forms – JavaScript

Intellisense

Page 18: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

Summary

• Provider apps

• Demo: create team sites on Office 365

• Demo - Office App Model Samples Team

• Farm code -> Client Object Model

• Demo – create sites with metadata

• How it works

• JavaScript vs C#

Page 19: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

SharePoint App Architecture for the Cloud and on-premiseProd3003

Page 20: Share point app architecture for the cloud and on premise

EVENT SPONSORER

EXPO SPONSORER

TRACK SPONSORER

Page 21: Share point app architecture for the cloud and on premise

#C

am

pusD

ays

Q&A#Ask me about everything!

Join me at the Microsoft Booth the next 30 minutes @Meet The Experts

Dont forget to: Evaluate this session!