SharePoint 2013 : Working with Chrome Control and Cross Domain Execution in Provider Hosted App

In the new SharePoint 2013 App model, the Apps can be hosted in one of the following hosting model: SharePoint Hosted (with in SharePoint Domain), Provided Hosted and Auto Hosted (Outside SharePoint Domain).

One of the biggest issue that we can see with Apps running outside SharePoint Domain is Branding, since these Apps has got separate Home or Landing Pages than SharePoint and does not follow Visual Paradigms like Navigation Menus, Back Link to Home Page and so on similar to SharePoint.

Intranet Users can feel disconnected with the App due to this huge gap in UI Experience.

In order to overcome this obvious issue SharePoint allows to import a very basic version of SharePoint 2013 Chrome into their Apps without apply the Custom CSS Styles manually by means of a Client Side Rendering Control called “Chrome Control”.

The functional implementation details of this control reside in “SP.UI.Controls.js” file located in the new “/_layouts/15” virtual directory or “Layouts” Folder in 15 Hive.

Hope up to this point you grasp a fair understanding in Chrome Control and now it is time to move on to see it in action.

In order to demonstrate this implementation of Chrome Control we will start with a Provider Hosted App as show in below steps:

Create a new SharePoint App Project by selecting “App for SharePoint” project template

1

Choose Hosting Model as “Provider-Hosted”

2

Choose “ASP.Net Web Forms Application” as template for provisioning the Remote Site

3

Specify the Certificate location, decrypting password and Issuer ID (This ID was generated while we configure the S2S Trust for Provider Hosted Apps)

4

Once the Project has been added to the solution it would look like as below:

5

I have added a dummy feature to force SharePoint to create an App Web for this App, though this is purely optional.

6

We can review the App Web using any SharePoint Object Browser, here I am using SharePoint Manager to lookout the same

7

Also notice that we have changed the Start Page for App to “ChromeCrossDomain.aspx” as highlighted below-

8

Allowing Read permission for the App in Site Collection Hosting it in AppManifest.xml

9

Also in the Remote Web Project we have Pages Folder which is containing pages for our App.

10

We have “ChromeCrossDomain.aspx” page residing inside this folder which will serve as Start Page for this App

11

Similarly we have Scripts folder which is holding all JavaScript Files in use by this App as shown below

Apart from standard JavaScript Files supporting JQuery, we also have two App specific custom JavaScript Files “ChromeLoader.js” & “CrossDomainExecutor.js” which is implementing the core of Chrome Control for this App

12

In the Start Page HTML –

Firstly we have to add the “Script” Tags to include custom Javascript Files

Then we need to add a “Div” Tag with id = “chrome_ctrl_container” (you can use any unique value as ID) at the top level as shown highlighted

13

Now if we explore the code in one of the Custom JS file “ChromeLoader.js”, we can see it as

Step 1 – “getParameterByName” is a helper function that can be utilized to read Query String Parameters from the incoming request

Step 2- Read the “SPHostUrl” Query String Parameter to get the handle on Host Web

Step 3- Load “SP.UI.Controls.js” file in context of Host Web and once loaded call “renderChrome” method

Step 4- Inside “renderChrome” method, we are preparing Object holding the Chrome Configuration Options

appIconUrl                –      Icon URL that we need to show at the top header of the App

appTitle                     –      Header Title for the App

appHelpPageUrl       –      Help Page Url for the App

settingsLinks            –      Links to be shown under settings menu

Step 5- “SP.UI.Controls.Navigation” method is used to load the Chrome Control inside the div with Id = “chrome_ctrl_container” along with settings applied based on the “options” object we created in Step 4

Step 6- Visible the Chrome Control and let the SharePoint UX rendering takes precedence over the App defaults

14

This is it for loading the Chrome Control in our custom App.

Now let see how we can enable Cross Domain Execution for this App.

If we investigate the other custom JS File “CrossDomainExecutor.js” we can notice the execution as follows-

Step 1- Getting “SPHostUrl” and “SPAppWebUrl” Query String Parameters using “getParameterByName” method as before. “SPHostUrl” provides the Url of Host Web where the App has been installed while “SPAppWebUrl” provided the Url of App Web which we got created during the App Installation (by means of Dummy Feature).

Step 2- Getting the reference of “SP.RequestExecutor.js” JS file in context of Host Web as earlier. “SP.RequestExecutor.js” is used to execute Cross Domain Calls to SharePoint i.e. the Call from SharePoint App (Domain 1) to SharePoint (Domain 2).

Step 3, 4, 5- Instantiating the context of App Web and instantiating the object of AppContextSite to get the handle on Host Web object. Once it is done rest of the things are simply applying JSOM operations

Step 6- Query Announcements List in Host Web and interface its records in the App Start Page

15

Before moving forward let’s have a look into the Announcements List to see what all items we have for query on App Start Page

16

We can see there are two items available to be displayed with in the App Start Page.

Build the Solution and deploy it

Trust the Security Certificate and move on

17

Trust the App when asked to and move on

18

Provide Credentials for Authentication

19

And we are all set with final outcome which can we analyzed as below:

Step 1- Showing the App URL ensuring we are looking at the Start Page of the App

Step 2- Showing App Site Header Image and Title fetched by Chrome Control from within the Host Web Context

Step 3- Showing Settings Links added during configuring options for the Chrome Control

Step 4- Showing Announcement List Items queried from the Host Web executed by Cross Domain Request to SharePoint

20

So it is evident that by making use of Chrome Control we could save significant efforts in maintaining Synch between SharePoint and App UI Designs.

Hope you find it helpful.

Advertisements

SharePoint Developer Tools – Get Your Gears

There are quite a number of Must to Have developer tools that every SharePoint Developer must have in its arsenal in order to boost its own Productivity while developing solutions on SharePoint Platform.

Few of the tools which are my personal favorites also are listed below:

CAML Designer 2013

CAML Designer can generate the CAML Query Stubs based on the inputs provided by the developer and can quickly give a handle on even complex query formations.

It is not just about the Formation of Queries but also offers code Transition from actual CAML Query to

  • Corresponding Server Side Object Model Code
  • Corresponding Managed Client Side Object Model Code
  • Corresponding JSOM & REST API Calls
  • Corresponding PowerShell Code

1

Download Path: http://biwug-web.sharepoint.com/SitePages/Caml_designer.aspx

SharePoint Manager 2013

SharePoint Manager has got quite a simple and intuitive interface which allows you to quickly and easily navigate down the farm and investigate settings, properties, schema XML and so on. Most of the things in your SharePoint environment can be investigated from this tool.

This tool allows you to quickly navigate the Site Hierarchy and objects, and you can also get a quick handle on Schema of List, Fields and on object properties like Object GUIDs, Object Titles and so on.

2

Download Path: http://spm.codeplex.com

ULS Viewer

ULS Viewer allows you to look into the SharePoint ULS Logs in real time by parsing the Logs. The information (Correlation ID, Date Time Stamp, Event Source Process and so on )exposed by this tool is really useful for productive debugging capabilities.

3

With the evolution of SharePoint 2013 Developer Dashboard also includes these capabilities of reading & parsing ULS logs. Developer Dashboard contains a separate tab by the name “ULS” where we can see the ULS log entries.

4

Download Path: http://www.microsoft.com/en-in/download/details.aspx?id=44020

CKS Dev

CSK Dev is a Visual Studio extension which adds a bunch of new Project items for SharePoint Projects that are really helpful in increasing productivity of a developer.

Extension Project Items included

  • WCF Service SPI template
  • Contextual Web Part SPI template
  • Branding SPI Template
  • ASHX SPI template
  • Upgrade Solution Step
  • Restart IIS Step
  • Copy To SharePoint Root Step

And many more…

5

6

Download Path: http://visualstudiogallery.msdn.microsoft.com/cf1225b4-aa83-4282-b4c6-34feec8fc5ec

Color Palette Tool for Branding

Color Palette allows you create a composed looks for SharePoint 2013.

7

Download Path: http://www.microsoft.com/en-us/download/details.aspx?id=38182

SharePoint 2013 Search Tool

SharePoint Search Tool allows to you create and test SharePoint Search Keyword Query backed up by SharePoint REST API paradigm. It also allows you to analyze the Query Stats and adjust them as per the required output.

8

Download Path: http://sp2013searchtool.codeplex.com/

Fiddler

Fiddler is a Web Proxy that allows to Debug Web Traffic, do Performance Testing, HTTP/HTTPs Traffic Recording, Security Testing and so on.

The use of Fiddler becomes utmost necessary now with the evolution of SharePoint 2013 which is more focused on Development Strategies based on Client Side Scripting Technologies.

9

Download Path: http://fiddler2.com/get-fiddler

SPCAF – SharePoint Code Analysis Framework

SharePoint Code Analysis Framework helps to validate your custom SharePoint Solutions and Apps against Best Coding Practices prescribed the industry drawn by various industry standards.

This framework can be really helpful to let you verify if your custom solutions are Stable, Complying with Company Policies, Following Coding Best Practices, Well Designed and Maintainable and much more.

10

Download Path: http://www.spcaf.com

.NET Reflector from Red Gate

.Net Reflector is one of the best tools I have ever used for understanding code of Third Party DLLs for which I even did not had the Source Code.

Reflector allows you to look into the DLLs to see the code encapsulating inside it to understand its functioning.

11

Download Path: http://www.red-gate.com/products/dotnet-development/reflector/

PowerShell Tools for Visual Studio

This is an excellent Visual Studio Extensions for PowerShell which enables code intellisence for PowerShell Scripts within Visual Studio Editor.

12

Download Path: http://visualstudiogallery.msdn.microsoft.com/c9eb3ba8-0c59-4944-9a62-6eee37294597

SPFastDeploy

This tool is specially designed to enhance the productivity while working with SharePoint App.

This tool is best suited for pushing the code changes quickly to SharePoint Apps without re-deploying the Apps. This could save a significant amount of time during App Development.

13

Download Path: http://visualstudiogallery.msdn.microsoft.com/9e03d0f5-f931-4125-a5d1-7c1529554fbd

Advanced REST Client plugin for Google Chrome

This is a Chrome Plugin that allows you configure and investigate REST Queries by configuring and executing REST API Call through the tool UI. It also allows us to look for the Stats of the REST Queries in execution.

14

Download Path: https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US

Postman – REST Client plugin for Google Chrome

This is again a Chrome Plugin that allows you deal with REST Calls same as “Advanced REST Client plugin for Google Chrome”.

It is just a matter of choice which one you prefer to work with.

15

Download Path: https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm

SharePoint 2013 Client Browser

This is the similar tool as SharePoint Manager with the only difference that it allows us to connect to SharePoint Sites Remotely using Client APIs. So now no more need to login to SharePoint Server to browser SharePoint Site Objects using this tool.

16

Download Path: https://spcb.codeplex.com/

smtp4dev

This is an awesome tool for testing SharePoint Send Mail Functionalities no matter if it is Custom or OOB functionality that we are testing.

It is used to verify if the SharePoint is sending mails to the recipients properly. This tool intercepts the mails that were sending to the recipients by SharePoint and allows you to view them in its own UI.

17

Download Path: http://smtp4dev.codeplex.com/

PowerGUI

PowerGUI is one of the best tools available for PowerShell Programming. It provides intellisence support for writing PowerShell Scripts at the same time provides lot of useful windows for Debugging purposes.

18

Download Path: http://powergui.org/downloads.jspa

SharePoint Software Factory

The SharePoint Software Factory is a Visual Studio Extension helping SharePoint Beginners, as well as experienced developers to create, manage and deploy SharePoint solutions without having to know schema internals of the SharePoint Artifacts.

19

Following is the list of few of the features offered by this extension-

20

And many more…

For a detailed list of available features you can visit : http://www.matthiaseinig.de/docs/SPSF/OutputHTML/SPSF_RECIPES_INDEX.html

Download Path: https://spsf.codeplex.com/

SharePoint Solution Deployer

SharePoint Solution Deployer helps you to deploy SharePoint solution packages (.wsp) to multiple SharePoint environments. It deploys, retracts and upgrades one or more WSPs and can be extended to perform additional custom tasks in PowerShell before or afterwards.

It provides a simple XML configuration file which allows you to define the deployment environment by using variables i.e. to perform different actions on different URLs depending to which farm you are currently deploying.

21

Download Path: https://spsd.codeplex.com/

SharePoint Diagnostic Studio 2010

Microsoft SharePoint Diagnostic Studio 2010 (SPDiag version 3.0) was created to simplify and standardize troubleshooting of Microsoft SharePoint 2010 Products, and to provide a unified view of collected data.

This tool can be used for-

  • Gathering relevant information from a farm
  • Displaying the results in a meaningful way
  • Identifying performance issues
  • Sharing or exporting the collected data
  • Providing reports for analysis

And much more…

22

Download Path: https://technet.microsoft.com/en-us/library/hh144782(v=office.14).aspx

SPServices

SPServices is a jQuery library which abstracts SharePoint’s Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install.

23

Download Path: http://spservices.codeplex.com/

SharePoint LogViewer

SharePoint Log Viewer is a Windows application for reading and filtering Microsoft SharePoint ULS Logs.

It offers the following key features-

  • View multiple SharePoint log files at once
  • Search by any field
  • Filter the log by any field
  • File drag & drop support
  • Live monitoring for entire farm
  • Export filtered log entries
  • Bookmark log entries
  • Get popup notification of SharePoint log events from system tray
  • Receive email notifications on errors
  • Redirect log entries to event log
  • Supports SharePoint 2007, 2010 and 2013

24

Download Path: http://sharepointlogviewer.codeplex.com/

FxCop

FxCop is an application that analyzes managed code assemblies (code that targets the .NET Framework common language runtime) and reports information about the assemblies, such as possible design, localization, performance, and security improvements. Many of the issues concern violations of the programming and design rules set forth in the Design Guidelines, which are the Microsoft guidelines for writing robust and easily maintainable code by using the .NET Framework.

25

Download Path: https://msdn.microsoft.com/en-us/library/bb429476(v=vs.80).aspx

JavaScript Beautifier

This online tool is used to beautify, unpack or De-obfuscate JavaScript and HTML, make JSON/JSONP readable, etc.

26

Download Path: http://jsbeautifier.org/

JSON Formatter & Validator

This is an online tool to that can be used to validate the JSON Packets

27

28

Download Path: https://jsonformatter.curiousconcept.com/

Being a SharePoint Developer I can say using these tools should be the second habit for SharePoint Developers to enhance their development capabilities which results in quick delivery turn around.

Hope you all find it helpful.

SharePoint 2010 References

SharePoint 2010 Installation

  1. Managing and Implementing Microsoft SharePoint 2010 Projects
  2. Practical SharePoint 2010 Information Architecture

SharePoint 2010 Architecture & Governance

  1. Pro SharePoint 2010 Disaster Recovery and High Availability
  2. Pro SharePoint 2010 Governance

SharePoint 2010 Project Management

  1. SharePoint 2010 for Project Management, 2nd Edition
  2. Pro Project Management with SharePoint 2010

SharePoint 2010 Development

  1. Using Microsoft InfoPath 2010 with Microsoft SharePoint 2010 Step by Step
  2. Professional SharePoint 2010 Development
  3. SharePoint 2010 Development with Silverlight
  4. SharePoint 2010 Web Parts in Action
  5. Beginning SharePoint 2010
  6. Microsoft SharePoint 2010 Enterprise Applications on Windows Phone 7
  7. Inside Microsoft SharePoint 2010
  8. Microsoft SharePoint Foundation 2010 Inside Out

SharePoint 2010 Designer

  1. Pro SharePoint Designer 2010
  2. Beginning SharePoint Designer 2010
  3. Microsoft SharePoint Designer 2010 Step by Step

SharePoint 2010 Cloud Based Solution

  1. Developing Microsoft SharePoint Applications Using Windows Azure
  2. Professional SharePoint 2010 Cloud-Based Solutions
  3. Pro SharePoint 2010 Development for Office 365

SharePoint 2010 Search

  1. Pro SharePoint 2010 Search
  2. Working with Microsoft FAST Search Server 2010 for SharePoint

SharePoint 2010 PowerShell

  1. Microsoft SharePoint 2010 and Windows PowerShell 2.0

SharePoint Best Practices

  1. Expert SharePoint 2010 Practices

SharePoint 2010 Business Intelligence

  1. Professional Business Connectivity Services in SharePoint 2010
  2. Microsoft SharePoint 2010 Business Application Blueprints
  3. Microsoft SharePoint 2010 Business Intelligence Unleashed
  4. Microsoft SharePoint 2010 PerformancePoint Services Unleashed

SharePoint 2010 Branding

  1. Professional SharePoint 2010 Branding and User Interface Design
  2. Microsoft SharePoint 2010 Administration Cookbook

SharePoint 2010 Administration

  1. Pro SharePoint 2010 Administration
  2. SharePoint Server 2010 Administration 24 Hour Trainer

SharePoint 2010 Enterprise Content Management

  1. SharePoint Server 2010 Enterprise Content Management

SharePoint 2013 User Guides

  1. SharePoint 2010 at Work
  2. SharePoint 2010 Field Guide
  3. SharePoint 2010 Six-in-One
  4. SharePoint 2010 How-To
  5. Microsoft SharePoint Foundation 2010 Step by Step
  6. SharePoint 2010 All-in-One For Dummies
  7. Microsoft SharePoint Server 2010 Bible

SharePoint 2013 References

SharePoint 2013 Installation

  1. SharePoint 2013 Developer’s Installation Guide – LinkTech
  2. SharePoint 2013 Deployment Guide

SharePoint 2013 Architecture & Governance

  1. Microsoft SharePoint 2013: Designing and Architecting Solutions
  2. Microsoft SharePoint 2013: Planning for Adoption and Governance

SharePoint 2013 Development

  1. Beginning SharePoint 2013 Development
  2. Professional SharePoint 2013 Development
  3. SharePoint 2013 For Dummies
  4. Exploring Microsoft SharePoint 2013
  5. Microsoft SharePoint 2013 Developer Reference
  6. Microsoft SharePoint 2013 Inside Out
  7. Inside Microsoft SharePoint 2013
  8. Exam Ref 70-332: Advanced Solutions of Microsoft SharePoint Server 2013
  9. Exam Ref 70-331: Core Solutions of Microsoft SharePoint Server 2013
  10. QuickBooks 2013: The Missing Manual
  11. Custom SharePoint Solutions with HTML and JavaScript
  12. Microsoft SQL Server 2014 Business Intelligence Development
  13. Professional Visual Studio 2013
  14. QuickBooks 2013: The Missing Manual

SharePoint 2013 App Development

  1. Pro SharePoint 2013 App Development
  2. Microsoft SharePoint 2013 App Development

SharePoint 2013 PowerShell

  1. Beginning PowerShell for SharePoint 2013

SharePoint 2013 Business Intelligence

  1. Business Intelligence in Microsoft SharePoint 2013
  2. Pro SharePoint 2013 Business Intelligence Solutions

SharePoint 2013 Branding

  1. Pro SharePoint 2013 Branding and Responsive Web Development
  2. SharePoint 2013 Branding and User Interface Design

SharePoint 2013 Administration

  1. Professional SharePoint 2013 Administration
  2. Pro SharePoint 2013 Administration, 2nd Edition
  3. Microsoft SharePoint 2013 Disaster Recovery Guide
  4. Microsoft SharePoint 2013 Administration Inside Out

SharePoint 2013 Enterprise Content Management

  1. SharePoint 2013 WCM Advanced Cookbook
  2. Practical SharePoint 2013 Enterprise Content Management

SharePoint 2013 User Guides

  1. SharePoint 2013 User’s Guide, 4th Edition

SharePoint 2013 : Remote Event Receivers on List Item Event – Real Business Scenarios

In this fourth article in the series on Remote Event Receivers, we will look into some of the applicable business cases around the Remote Event Handlers.

You can reach the previous three articles in this series as follows:

  1. SharePoint 2013: Remote Event Receivers
  2. SharePoint 2013: How to develop Remote Event Receivers for App Events
  3. SharePoint 2013: How to develop Remote Event Receivers for List And List Item Events

We will investigate the working of the following scenarios which are quite obvious while working with SharePoint List & List Items.

Scenario 1 – How to restrict users to delete a certain item

In order to show case this scenario let’s consider an Item “Product-001-1” added to the List called “Products” as shown below:

Now let’s try to delete this item as highlighted below-

1

2

As soon as user try to delete the item SharePoint looks for any registered Event Receiver with the List and looking for its Receiver Definition to see what all event this Receiver is allowed to receive and executes it.

In our case we have registered the following Receiver Definition with the list-

3

Let’s investigate the code for register Remote Event Handler –

Since this a Before Event (as explained in one of the earlier post “SharePoint 2013: Remote Event Receivers”), we need to write the Code in “ProcessEvent” Method.

Step 1 is to check the type of Event that triggers this Event Receiver by making use of “SPRemoteEventType” Enum and “EventType” Property of the “SPRemoteEventProperties” object

Step 2 is to check the List Title by making use of “ItemEventProperties” collection of “SPRemoteEventProperties” object and ensure that we are handling Delete Events received only from a specific which in our case is “Products”

Step 3 is to check for the desired condition and if satisfied then set “ErrorMessage” and “Status” properties exposed by “SPRemoteEventResult” object.

In this case we have set a user friendly message and set status to “CancelWithError”. For all the valid status values we can look for “SPRemoteEventServiceStatus” Enum.

Step 4 is to return the SPRemoteEventResult object back to SharePoint

4

The setting we did in Step 3 will let SharePoint to terminate the event raised due user action and return the error message to SharePoint which would be rendered as Error Message for the user as highlighted below-

5

Scenario 2 – How to get Item Details after Item has been updated

In order to show case this scenario we can consider the same item as above and this time let’s let Edit the item as highlighted below

6

7

Now next thing is to investigate the code for registered Remote Event Handler –

Since this an After Event (as explained in one of the earlier post “SharePoint 2013: Remote Event Receivers”), we need to write the Code in “ProcessOneWayEvent” Method.

Step 1 & Step 2 are same as mentioned above

Step 3 is to fetch the Items Properties by making use of “ItemEventProperties” collection and preparing a variable to make it use later

It is worth noting that at this point, “ItemEventProperties” collection will contain the Properties of the List Item after the Update got succeed, which means that we can find all the updated values in the respective columns for the list item as highlighted and can consume as needed

Just to keep the story simple we are consuming these values in compiling a message to be written to Windows Event Log.

It is important to notice how we are accessing values of “Title” & “Price” Columns of that Item.

Step 4 is to write this message variable to Windows Event Log

8

Once execution is successful we can see the message logged in the Windows Event Log as shown below

9

Scenario 3 – How to validate User inputs using Remote Event Receivers

This scenario will talk on validating user inputs and terminate the execution as soon as the input value falls outside the valid value range.

For instance in this demo we are assuming a hypothetical business requirement demanding “Item Price should not exceed $300”

In order to showcase this validation scenario we can consider the same Item as mentioned above.

Let’s edit the item as shown below

10

Now specify the Item Price any greater than $300, here we are updating the Product Price as $350

As soon as we try to save the item, SharePoint handover the control to Remote Event Receiver which is registered with this list on Item Updating Event and Event Receiver validate the Item Price value against the specified business logic which on fail produces the error message “Price cannot exceed $300” as highlighted below-

11

If we look into the logic driving this business requirement we can see

Step 1 is to write the code in “ProcessEvent” handler as this action of updating the List Item is a Before Event [ItemUpdating]

Step 2 is to identify the Event Type and ensure that the business logic should be executed only in case of ItemUpdating event

Step 3 is to identify the Source of Event and ensure to handle the event only if the Source is “Product” List

Step 4 is to read the value of “Price” Field entered by the user

Step 5 is to validate the input Price value against the needed business logic

Step 6 is to set the “ErrorMessage” and “Status” Properties of the SPRemoteEventResult object. Set “Price cannot exceed $300” as Error Message and “CancelWithError” as Status. These properties let SharePoint to terminate the Event generated and no updates to the Item will get persisted.

Finally Step 7 is to capture information about the Item and Event and write it back to Windows Event Log.

12

These few simple scenarios might help you to understand the mechanics and objects exposed by Remote Event Receiver API that can be extended to achieve even more complex business scenarios at hand.

Hope you find it helpful… 🙂

SharePoint 2016: The Inside Story

This small write-up is based on the Presentation made by Bill Baer on “BRK2188 – What’s New for IT Professionals in SharePoint Server 2016” in Ignite Conference ended recently.

In this presentation Bill explained a lot of Enhancements & Improvements in SharePoint 2016, the Public Preview of which is going to hit the market soon. I have compiled the Key Takeaways under different categories as mentioned below-

Release Timeline Milestones

Regarding the release timeline, there are 3 milestones:

  • Q4 2015 – Public Beta (Beta 1)
  • Q1 2016 – Release Candidate
  • Q2 2016 – Final Version (RTM)

Hardware & Software Requirements

Hardware requirements are mostly the same as we have in SharePoint 2013:

  • Memory: For Single Server Deployment Scenarios it should be 16-24 GB. For Multi Server Deployment Scenarios it should be 12-16 GB
  • CPU: For either of the Deployment Scenarios it should be x64 Bits, 1 Quad Core
  • HDD: For either of the Deployment Scenarios it should be 80 GB

Software requirements have got a couple of changes:

  • Operating Systems : Windows Server 2012 R2 or Windows Server 10
  • Database Server: SQL Server 2014 or SQL Server 201x (VNext)
  • .Net Framework:5.2 if running on Windows Server 2012 R2 or 4.5.6 if running on Windows Server 10

Other Prerequisites:

  • Windows Management Framework 3.0
  • Application Server Role
  • Web Server (IIS) Role
  • Microsoft .NET Framework 4.5.2
  • Update for the .NET Framework 4 (KB2898850)
  • Microsoft SQL Server 2012 Native Client
  • Microsoft Identity Extensions
  • Microsoft Sync Framework Runtime v1.0 SP1 (x64)
  • Windows Server AppFabric 1.1
  • Windows Identity Foundation v1.1
  • Microsoft Information Protection and Control Client
  • Microsoft WCF Data Services

Deployment Scenarios

Unsupported Scenarios:

  • Deployments on Workgroup is not supported
  • Deployments on Client OS is not supported
  • Deployments with Dynamic Memory is not supported
  • Deployments on Windows Web Server is not Supported
  • Deployments in Standalone mode (Mode with In-Built SQL Server Express) is not supported

Supported Scenarios:

  • Deployments on Domain Controller is supported but recommended only for Development/Evaluation or Small Farms Scenarios
  • Deployment with Single Server Farm recommended only for Development/Evaluation Scenarios

Roles & Services

With SharePoint 2016 Microsoft introduces a new concept “MinRole” that governs the notion of processing a User Request End To End by a specific server. Based on the type of requests, these Roles and Services are broadly categorized under following categories:

  • User Services: All requests initiated by Users fall under this category. For example- Excel Services, User Profile, OneNote, Sync Clients, User Code (Sandbox Code), Project and so on.
  • Robot Services: All Automated, Scheduled Jobs fall under this category .For example- Timer Jobs, Search Applications and so on
  • Caching Services: All requests regarding Cache Management Scenarios and sometimes can hold up Request Management Scenarios as well. For example- Caching Services

MinRole Roles & Services are implemented as follows:

  • WebFrontEnd: This Role falls under “User Services” so this role is meant to serve End User Request. Servers assigned to this role are optimized for low latency. Services complying with this role are:
    • Access Services
    • Business Data Connectivity
    • Central Administration
    • Managed Metadata
    • Secure Store Service
    • State Management
    • Subscription Settings
    • User Code
    • User Profile
    • Visio Graphics
    • SharePoint Foundation Web Application
  • Application: This Role falls under “Robot Services” so this role is meant to serve backend jobs or Servers assigned to this role are optimized for low latency. Servers assigned to this role are optimized for high throughput. Services complying with this role are:
    • Crawl
    • Machine Translation
    • PowerPoint Conversion
    • User Profile Synchronization
    • Word Automation
    • Workflow Timer Service
    • SharePoint Foundation Web Application
  • Specialized Load: This is special type of role to support Random Role Assignments as per business requirements like we have in SharePoint 2013. Recommended for Deployment of Isolated Services like 3rd Party Applications etc. This Role is not accounted by Health Checkup Analyzer as this is exempted in the Product Code Base of SharePoint 2016. Services complying with this role are:
    • Excel Calculation
    • PerfomancePoint
    • Project
    • Search
    • SharePoint Foundation Web Application
  • DistributedCache: This Role falls under “Caching Services” so this role is meant to distributed cache for the farm. Servers assigned to this role can load balance end user requests among the Web Front Ends. Services complying with this role are:
    • Distributed Cache
    • Request Management
    • SharePoint Foundation Web Application

1

Role Enforcement and Health:

  • SharePoint Health Analyzer has new Health Checkup Rules running on Daily Basis checking for the Topology Compliance
  • This Health Rule will run Daily and scan all the servers in the farm except server assigned to “Specialized Load” Role
  • The Code Base for this Health Rule compares the Service Instances on each server with the Role assigned to it and verify if the server comply with expected Topology recommendations from Microsoft. If Server doesn’t comply with the expected Topology recommendations, in health analyzer we can see the option to fix it directly from there.

Upgrade & Migration

  • Upgrade from SharePoint 2010 (UI Mode 14 or 14.5) and SharePoint 2015 (UI Mode 15): Upgrading to SharePoint 2016 will only be supported from SharePoint 2013. If you’re still using SharePoint 2010 or a previous version, you’ll first have to upgrade to SharePoint 2013 and your site collection will have to be converted to 15 mode before you can upgrade to SharePoint 2016.
  • Upgrade via Database Attach: The upgrade is done via the database attach process, so nothing new here.
  • Migration: You can also choose to migrate content from a previous version of SharePoint using one of the available third party software applications.

 Patching

Small Patch Size with no downtime:

  • Patches and updates will have a smaller footprint and will not require any downtime.
  • As with most of the new features, the new patching process was developed for SharePoint Online and SharePoint 2016 will now benefit from the lessons learned from managing SharePoint in the cloud.
  • In SharePoint 2013 an update is comprised of 37 packages and an additional 18 packages for each installed language pack.
  • In SharePoint 2016, an update is comprised of just 4 packages, plus 1 extra package for each installed language pack.

 Boundaries and Limits

In SharePoint 2016, here are the main improvements on different thresholds values:

  • Content Databases: Supports content databases with TBs (specific number is not yet defined). In SharePoint 2013 Size should not be more than 200GB per content database.
  • Site Collections: Supports 100,000 site collections per content database. In SharePoint 2013 this limit was 10,000 site collections per content database.
  • List Items: List item threshold will be over 5,000 items although no specific number is not defined yet.
  • Max File Size powered by BITS Protocol + Cobalt Protocol + Shredded Storage: Max file size is now 10GB and there won’t be character restrictions. Earlier it was 2GB in SharePoint 2013 with character restrictions. This file size is supported to be Uploaded or Downloaded is powered by combination of BITS Protocol (which is newly introduced in SharePoint 2016), Cobalt Protocol and Shredded Storage.
  • Search Indexing: Search index can now scale to to hold upto 500 million items which was 250 million items in SharePoint 2013’s search index

Performance and Reliability Enhancements

Some of these improvements were brought to SharePoint 2016 which is expected to support a four-9s availability level (99.99%):

  • Server role optimizations
  • Zero downtime patching strategy
  • Improved distributed cache reliability
  • Traffic management with intelligent routing and server health checks

Major Performance/Reliability/Flexibility improvements that can be seen in SharePoint 2016:

  • New File Management Protocols: SharePoint 2010 introduced the Cobalt protocol. With Cobalt, when a document is being edited and the user saves it, only the modified portion of the file is sent by the client application to the server, greatly reducing the amount of data transmitted between client and server. However, the server still has to fetch the whole document from the database and merge the existing content with the user changes before saving the whole document back to the content database. SharePoint 2013 brought the Shredded Storage mechanism which allows documents to be stored in small pieces in the content database. Because documents are already “shredded” in the database, the server does not have to fetch the whole document to merge the original contents with the changes, which reduces the server processing overhead. SharePoint 2016 adds BITS (Background Intelligent Transfer Service) protocol which will improve upload and download speeds and resiliency.
  • “Fast Site Creation“– A new Site Collection creation process: The new site collection creation process leverages the Copy method to clone a pre-configured site collection template at the content database level. This process avoids the overhead of feature activation since the features are already activated in the source site collection.
  • SMTP Connection Encryption: With the implementation of new “STARTTLS” connection encryption that supports sending mails to SMTP Servers on default or non-default ports. Earlier with till SharePoint 2013, only Default Port (25) was supported for SMTP Communications but now it is possible to choose any available port with the new “STARTTLS” connection encryption
  • User Profile Service: In SharePoint 2016 Bidirectional Synchronization has now been improved by removing built-in FIM Services and adding support for External FIM Service. 
  • Integrated Project Server: SharePoint 2016 included built-in Project Server with licensing controlled through Server/User Licensing

 2

  • Support for ODF Format: SharePoint 2016 included support for ODF Format in Document Libraries where documents can now be saved in ODF Format and then can be edited in with program of choice.

 UI Improvements

SharePoint 2016 looks and feels mostly like the current version of SharePoint Online (in Office 365), but a few improvements were made to the UI, namely:

  • Authoring Canvas: New Authoring Canvas, a new and modern way to create content for a web page using a Sway-like user experience
  • Durable Links: Support for Durable Links which allows documents to be moved while keeping the URL intact, because it is based on a resource ID

Cloud Accelerated Experiences

One of the most touted new features of SharePoint 2016 is the support for cloud accelerated experiences or, in other words, the ability to surface features that are only available in the cloud, using a hybrid scenario:

  • Compliance: Compliance and data loss prevention (DLP) across cloud and on-premises. Sensitive Data can be Identified, Monitored and Protected through deep content analysis.
  • Cloud Search Service Application: Cloud search service application which unifies the on-premises and cloud search indexes and provides support for Office Graph / Delve experiences on-premises. As per plan this service will be available to SharePoint 2013 also by the end of this year
  • Distributed team sites: Distributed team sites across SharePoint 2016 and Office 365
  • Hybrid deployment: Hybrid deployment automation guided by UI-based configuration

 Summary

  • SharePoint 2016 is still a year away which means some features are liable to change, improve and could be some more to be added by the time RTM Version is released next year.
  • Hybrid scenarios are easier than ever to deploy

Hope you find it helpful.

SharePoint 2013: How to develop Remote Event Receivers for List And List Item Events

In this third post on Remote Event Receivers we are going to explore the mechanics revolving around Remote Event Receivers on List/List Item Events.

The previous two posts in this series can be reached out at:

  1. SharePoint 2013: Remote Event Receivers
  2. SharePoint 2013: How to develop Remote Event Receivers for App Events

In order to show case this scenario we need to start with a Provider Hosted App as highlighted in the following steps:

  • Select “App for SharePoint” Project Template

1

  • Specify the URL of Host Web and select “Provider-Hosted” as Hosting Model.

2

  • Select “ASP.Net Web Forms Application” as Project Template for Hosting the Remote Web

3

  • Specify the Security Certificate details based on SharePoint Provider Hosted App Development Environment configuration

4

Click Finish to complete the Visual Studio Solution Wizard.

Now next thing is to add the required items to the SharePoint App Project

  • Select App Project => New Item => Add

5

  • Select “List” as Project Item Template and the list as “Products”

This List will act as the Source of Events which will be delegated to the Remote Event Receiver

6

On List Settings Page –

  • Select a Display Name for the List
  • Choose Template for List Instance as “Custom List”

7

In List Designer –

  • On Columns Tab, specify the Columns/Fields you need to add to the list

I took ProductName & Price as two fields to be added for Products List

8

  • On the List Tab, verify the Site Relative Url of List

9

Once we got our list created and configured, it is time to add a new SharePoint Item to the project. Guess What??

The Remote Event Receiver. Yes!!!!

  • Select App Project => New Item => Add

10

  • Select “Remote Event Receiver” as Project Item Template

11

  • Select Type of Event Receiver as “List Item Events”

12

  • Select Event Source as “Products” List
  • Choose what all events you want to let handle by this Remote Event Receiver. For now I am choosing “Item Added”, “Item Updated” and “Item Deleted” events

13

As soon as the List is added to the Project a Feature scoped to the App Web gets also added

Once we are done with the configuration steps as shown above, we can see following artifacts added to the Project as highlighted below:

  • Products List
  • List Instance of the Products List
  • Remote Event Receiver

14

If we notice Remote Web Project which is nothing but an ASP.Net Application, we can see the following artifacts added already to it:

  • Service Class [Product-Remote-Event-Receiver]: That represent the Remote Event Handler Code Base
  • TokenHelper.cs & SharePointContext.cs : These helper classes are added to VS2013 to execute all the heavy lifting related to Authorization and Authentication algorithms easily between Remote Web Server(SPWeb Host) & SharePoint Server(Front-end Server).

15

We will revisit the Service Class Code in a short while to understand its internal plumbing.

But for now let’s build the Solution and Run it.

16

Trust the App with all needed permissions when prompted.

17

As soon as we Grant the App with all of the required permissions, the App Launcher redirects the User to the Start Page for the App, which is residing in the Remote Web for this case as highlighted below

18

We can see the App Launcher added to the Site Contents of the Host Web as shown below

19

We can ensure the presence of App Web by using SharePoint Manager and inspects Products List that has been provisioned to the App Web during the App Deployment

20

We can browse the App Web from Browser also as shown below

21

Now in order to test the Event Receiver, let’s create a test item in Products List as shown below

22

Specify Product Name & Price and Click Save button

23

As soon as Item gets added, it triggers “ItemAdded” event which is delegated to Remote Event Receiver by SharePoint.

In Remote Event Receiver we have two methods “ProcessEvent” & “ProcessOneWayEvent”.

For more details on these methods you can revisit my earlier post SharePoint 2013: Remote Event Receivers

On Item added we can see Breakpoint hit in “ProcessEvent” Method as shown below

24

Similarly we can see Break Point hit every time the Item gets updated as highlighted in below steps

25

26

27

Likewise we can see Break Point hit when Item gets deleted as highlighted in below steps

28

29

Since we registered the Event Receivers to handle “ItemAdded”, “ItemUpdated”, “ItemDeleted” only so none of the other Events would be delegated to Remote Event Receiver by SharePoint.

In case if any more Events need to be handled we need to add <Receiver> Elements in the Element.xml file associated with Remote Event Receiver as and when needed.

SPRemoteEventProperties Object is your real friend:

“ProcessEvent” method of Remote Event Receiver provides an object called as “properties” that exposes a lot of useful properties that can help us to perform any desired operation on the Web or List or List Item.

Following are the important properties that are exposed by “properties” object:

  • Event Type: Returns the type of Event Triggered by SharePoint Source Object
  • Item Event Properties: If the Event Type is of “List Item Type”, then “ItemEventProperties” collection is returned with data entered by user in each field of the List Item
  • List Properties: Returns the List specific properties like List Name, List ID and so on
  • Login User Properties: Return User specific properties like User ID, Login Name and so on
  • Source Web Properties: Return Web specific properties like Web Url

30

This post is more focused on the mechanics offered by SharePoint around Remote Event Receivers for List/List Item Events.

We will meet in another post where it will be more focused on to the implementation details on Event Receivers dancing around some valid Business Use Cases.

Hope you find this post helpful.