Presentation is loading. Please wait.

Presentation is loading. Please wait.

Getting off the CAML Ride.. 2 | SharePoint Saturday Calgary – 06 JUN 2015.

Similar presentations


Presentation on theme: "Getting off the CAML Ride.. 2 | SharePoint Saturday Calgary – 06 JUN 2015."— Presentation transcript:

1 Getting off the CAML Ride.

2 2 | SharePoint Saturday Calgary – 06 JUN 2015

3 3 | SharePoint Saturday Calgary – 06 JUN 2015 Agenda

4

5 5 | SharePoint Saturday Calgary – 06 JUN 2015 Where we were (or are)…

6 6 | SharePoint Saturday Calgary – 06 JUN 2015 Review of Provisioning in SharePoint 2013?

7 7 | SharePoint Saturday Calgary – 06 JUN 2015 Review of Provisioning in SharePoint 2013?

8

9 9 | SharePoint Saturday Calgary – 06 JUN 2015 What Tools are available for Remote Provisioning?

10 10 | SharePoint Saturday Calgary – 06 JUN 2015 So What’s Different?

11 11 | SharePoint Saturday Calgary – 06 JUN 2015 What Else can be done using PnP

12

13 13 | SharePoint Saturday Calgary – 06 JUN 2015 Client Side Object Model (CSOM) using Microsoft.SharePoint.Client; using Microsoft.SharePoint.Client.EventReceivers; using Microsoft.SharePoint.Client.Publishing;

14 14 | SharePoint Saturday Calgary – 06 JUN 2015 CSS Branding with CSOM using (ClientContext clientContext = TokenHelper.CreateAppEventClientContext(properties, false)) { }

15 15 | SharePoint Saturday Calgary – 06 JUN 2015 CSS Branding with CSOM DirectoryInfo themeDir = new DirectoryInfo(System.Web.Hosting.HostingEnvironment.ApplicationPhysical Path + "CSS"); foreach (var themeFile in themeDir.EnumerateFiles()) { FileCreationInformation newFile = new FileCreationInformation(); newFile.Content = System.IO.File.ReadAllBytes(themeFile.FullName); newFile.Url = themeFile.Name; newFile.Overwrite = true; Microsoft.SharePoint.Client.File uploadAsset = assetLibrary.RootFolder.Files.Add(newFile); clientContext.Load(uploadAsset); break; } Web hostWebObj = clientContext.Web; List assetLibrary = hostWebObj.Lists.GetByTitle("Site Assets"); clientContext.Load(assetLibrary, l => l.RootFolder);

16 16 | SharePoint Saturday Calgary – 06 JUN 2015 CSS Branding with CSOM string actionName = "SampleCSSLink"; var existingActions = hostWebObj.UserCustomActions; clientContext.Load(existingActions); clientContext.ExecuteQuery(); foreach (var existingAction in existingActions) { if(existingAction.Name.Equals(actionName, StringComparison.InvariantCultureIgnoreCase)) existingAction.DeleteObject(); } clientContext.ExecuteQuery();

17 17 | SharePoint Saturday Calgary – 06 JUN 2015 CSS Branding with CSOM UserCustomAction cssAction = hostWebObj.UserCustomActions.Add(); cssAction.Location = "ScriptLink"; cssAction.Sequence = 100; cssAction.ScriptBlock = @"document.write(' ');"; cssAction.Name = actionName; cssAction.Update(); clientContext.ExecuteQuery();

18 18 | SharePoint Saturday Calgary – 06 JUN 2015 CSS Branding with CSOM using (ClientContext clientContext = TokenHelper.CreateAppEventClientContext(properties, false)) { result.Status = SPRemoteEventServiceStatus.Continue; return result; }

19

20

21 21 | SharePoint Saturday Calgary – 06 JUN 2015 Resources

22

23 23 | SharePoint Saturday Calgary – 06 JUN 2015 Sponsors CalSPUG  Special Thanks:

24 24 | SharePoint Saturday Calgary – 06 JUN 2015 Housekeeping


Download ppt "Getting off the CAML Ride.. 2 | SharePoint Saturday Calgary – 06 JUN 2015."

Similar presentations


Ads by Google