Wednesday, September 27, 2017

SharePoint 2019 Announced in the Microsoft Ignite 2017

SharePoint 2019 has been announced by Microsoft in the Ignite 2017 conference which was held from September 25, 2017 to September 29, 2017 at Orlando, FL.

SharePoint 2019 will be released by mid 2018 and expected to have a great deal of new improvements.

Also, some of the improvements that are in pipeline for SharePoint and One Drive  discussed in the Ignite 2017 are listed below:

OneDrive New Features
1) Files on demand
2) Improved File Sharing Capabilities
3) Shorter urls
4) Share from office
5) No Microsoft account needed for sharing securely!
6) File view analytics
7) File previews
8) Sync IRM-enabled libraries

SharePoint New Web Parts
1) Microsoft Forms
2) Planner
3) File previewer web part
4) Activity web part
5) Connector web part
6) Improved Yammer web part
7) 3D file viewer web part

Hope this post was helpful! This post will be updated with more features and add-on announced by Microsoft shortly.  

Saturday, May 27, 2017

Document Content Types

In this post we will see the implementation of document content types.

Document Content Type
In the previous post we discussed about the default list content types which is "Item". A document library is just an another form of list and has the default content type as "Document" which is inherited from the parent content type "Item".
However, the "Document" content type is simple and does not contain any metadata for documents in the document library except for the name, created by , created date, modified by and modified date information.

Let's consider an example of a document library named Employee reviews which is used to store the reviews for each employee as shown below. The default "Document" content type allows only name, so the only information that the document holds is the Employee name or ID, regardless of the information provided inside the document.
The ideal solution will be to add the metadata details like Employee ID, Name etc along with the document to make it robust and also searchable using a custom document content type, something like as shown below:

Implementing Document Content Types
1) Create the required Site Columns
2) Create new Content type
3) Add Content type to library

1) Create the required Site Columns
Go to Site Settings->Site columns.

Create the site columns required for the new content type as follows. You will notice that we have created the columns are created under a new group "SPTECHBYTES" so that it can be managed easily.


2) Create new Content type
Go to Site Settings->Site content types for creating new content type.

Create new list content type named "Employee Review" as follows. Please note that the parent content type will be "Document", since we are going to use it in a library. Also, we will create it under a new group named "SPTECHBYTES".
Since we created all the columns under the group "SPTECHBYTES", we can easily list down the columns and add to the content type.

All the columns will be added and now the content type is ready for use. You may explore the additional properties like Name, Group, Advanced settings etc for further customizing the content type.

3) Add Content type to library
Create a new custom document library named "Employee Reviews"and go to Library Settings->Advanced Settings.

To view\manage the content types, click "Yes" for the the "Allow management of content types" option.

You will notice that now there is new section named "Content Types" in the Library Settings page which will allow you to add/remove content types from the list. Click on "Add from existing site content types" link to add the "Employee Review" Site content type that we created in the above steps.

Add the "Employee Review" content type to library as follows. It would be easy to locate the content type if you select the group under which you created the content type (eg: "SPTECHBYTES" in our example).

Once the content type is added, go back to to the "Employee Reviews" list and click on "New Item" button. You will notice that now there is an additional link called "Employee Review".

Create\Upload a new file to the document library.

Once the document is uploaded you will be automatically redirected to the edit item form with all the columns that we included in the content type. In this way you can add additional information to the particular document uploaded.

Once saved, the item will be displayed as follows. (You may have to change the view to display all the fields).

Hope this post was informative! Please do leave your comments.

Sunday, April 30, 2017

List Content Types

In this post we will discuss about the implementation of List Content Types in SharePoint.

Site Content Types
The Site Content types are created and managed at the site collection level. For creating and managing site content types, go to Site Settings->Site content types.
Once the site content types are created, we can easily add to any of the lists in the site collection or sub-sites under it.

List Content Types
Once the existing Site Content Types are added to a list, a local copy of the content type will be created by SharePoint and added to the list know as List Content Types. Further changes or additional columns will affect only this local instance and not the original Site Content Type.

Implementing List Content Types
1) Create the required Site Columns
2) Create new Content type
3) Add Content type to a list
4) Reuse Content Type in another list
5) Delete Content type from a list

Now lets see each of the above mentioned steps in details:

1) Create the required Site Columns
Go to Site Settings->Site columns.

Create the site columns required for the new content type as follows. You will notice that we have created the columns are created under a new group "SPTECHBYTES" so that it can be managed easily.


2) Create new Content type
Go to Site Settings->Site content types for creating new content type.

Create new list content type named "Employee" as follows. Please note that the parent content type will be "Item", since we are going to use it in a list. Also, we will create it under a new group named "SPTECHBYTES".
Once the content type is created, we need to add the site columns that we created in the above steps.
Since we created all the columns under the group "SPTECHBYTES", we can easily list down the columns and add to the content type.
All the columns will be added and now the content type is ready for use. You may explore the additional properties like Name, Group, Advanced settings etc for further customizing the content type. 


3) Add Content type to a list
Lets create a new custom list named "Employee Details". If you click on New Item, you will see that there is only default "Item" Content type which has only one column named "Title".
To view\manage the content types for this list go to List Settings->Advanced Settings and click "Yes" for the the "Allow management of content types" option

You will notice that now there is new section named "Content Types" in the List Settings page which will allow you to add/remove content types from the list. Click on "Add from existing site content types" link to add the "Employee" Site content type that we created in the above steps.

Add the "Employee" content type to list as follows. It would be easy to locate the content type if you select the group under which you created the content type (eg: "SPTECHBYTES" in our example).
Once the content type is added, go back to to the "Employee Details" list and click on "New Item" button. You will notice that now there is an additional link called "Employee".

Once you click on the "Employee" link, the new item form will be open with the columns that we included in the content type. 

Once saved the item will be displayed as follows. (You may have to change the view to display all the fields).

4) Reuse Content types in another list
Repeat the above steps to add the "Employee" site content type to a new list named "Emergency Contacts". Here again a copy of the content type will be created for this list. Adding columns or deleting it will not affect the original "Employee" site content type at the site collection level.


5) Delete Content types from a list
Go to List Setting and click on the "Employee" content types. Click on the "Delete this content type link" to delete it from the list.

Please not that if there is any data related to the content type, you will not be able to delete the content type and face the following error. 

You can solve this issue in either of the following ways:
(i)  Delete all the list items from the list which are associated with this content type
(ii) Edit all the list items and change the content type from "Employee" to something else.
Try again to delete the content type and this time you will succeed.

Thank you for reading this post and please do let me know your comments!

Thursday, April 27, 2017

SharePoint Content Types

Content Types are reusable set of columns that defines the metadata\properties of the content to be stored in a list\library.

Why Content Types?
Let's take the example of a list named "Employee Details" which may have columns like Employee ID, Employee Name, Designation, Email, Phone etc. Normally we would create these columns inside the list itself. But what if you want to reuse or extend this set of columns in another list called "Shift Employees" in the same site or a sub site?

To solve the above problem, we can create a content type named "Employee" with the set of columns (Employee ID, Employee Name, Designation, Email, Phone) and reuse it in the other lists. In this post, we will see the step by step implementation of Content types.

Note: The default parent content type is "Item" and all the other content types provided by SharePoint are inherited from it. For instance, the "Document" or "Announcement" content type are inherited from parent content type "Item".

Implementation in Lists\Libraries
When you create a new custom list, you will notice that there is only one column names "Title" which is the part of the default SharePoint content type "Item".

To manage the content types associated to the list, go to the List Settings->Advanced Settings and click "yes" for allow the management of content types option.
You will notice that a new section named Content Types is visible in the List Settings page. Additional content types can be added to the list from the site content types available in the site. 

Site Content Types
To view the existing content types or create new ones, go to Site Settings->Site content types.

All the existing site content types will be listed under their respective groups.   

Advantages of Content Types
1) Reusable : The content types provided the advantage of using the same set of columns to be reused or extended in multiple lists\libraries. The underlying subsite can inherit the parent site content types and reuse in the list\libraries.

For instance, consider a list named "Employee Details". A content type named "Employee" can be used with a set of columns (Emp ID, Emp Name, Designation, Email, Phone) to emphasize that the type of content in this list is employee. Further we may reuse this content type for another list named "Emergency Contacts" or "Employee Details" list in a sub site, to define the employees who needs to be contacted in case of emergency.

2) Multiple content types support: A list\library may have multiple content types assigned to it based on the set of columns (metadata) required.

For Instance, a list named "Employee Details" can have 2 different content types like "Permanent" and "Contract". The contract employee details may have a few more additional details such as Contract ID, Contract Duration, Start Date, End Date etc.

Hope this post was helpful! In the upcoming posts we will see how to create and manage content types.

Friday, February 17, 2017

Creating Provider Hosted Add-ins in SharePoint Online (Cloud Add-ins)

In this post we will look into the various steps for creating and deploying a Provider-hosted add-in  for SharePoint Online using Azure ACS. We will use Visual Studio 2015 for developing and deploying the solutions.

Pre-requisites
1) Office 365 Enterprise subscription and SharePoint Online should be provisioned using Office 365 Enterprise subscription and App Catalog site must be created for publishing the add-in. See detailed steps here.
2) Microsoft Azure account for creating web apps. You can create\manage the azure portal here.
2) MS Office Developer Tools for Visual Studio 2015 must be installed else the project templates for add-ins will not be visible. You can download it here.
3) Visual Studio 2015 must be opened in "run as administrator" mode.
4) The user account used for deploying the solution should not be "System Account".

Steps for creating Provider Hosted Add-ins:
We shall analyze the following steps to get a better understanding about Provider hosted Add-ins:-
1) Create an Azure Web App.
2) Register Azure Web App with SharePoint Online
3) Create the Provider Hosted Add-in
4) Deploy the Add-in to SharePoint Online
5) Add the Provider-Hosted Add-in to your site

1) Create an Azure Web App
Following are the steps for creating an empty Azure Web Application. Once the web app is created we will download a publish profile which will be used to publish the asp.net site in the add-in.

Go to Microsoft Azure management portal https://manage.windowsazure.com
Note: If you do not have an azure account, you can create a 30 days trial subscription using your office 365 account. 

Once you have subscribed, open the Azure portal.

Select the Web Apps link on the left pane and click on Create a Web App button.

Enter the desired name and other details for your Web App. Click Create Web App button.

The new empty web app will be created as follows. Click on the web app url to open it in browser.

In our example the new web app is https://sptechbytesproviderhostedapps.azurewebsites.net/

Now we have to download the publish profile for this web app in order to publish the Asp.Net web application in Provider hosted Add-in to this newly create azure web app. Following are the steps:

Click on the web app name to open the properties page.

Click on Download the publish profile link to download the .publishsettings file.

You can import the .publishsettings file for a publishing destination web site to this web app.


2) Register Azure Web App with SharePoint Online

Go to the App Catalog site in SharePoint Online. See the detailed steps for provisioning SharePoint Online sites in Office 365 Trial version here.

Append "/_layouts/15/appregnew.aspx" to the App Catalog site url for registering the Azure Web App with SharePoint Online and click Create to continue
Client Id: It is the GUID for the add-in. Click "Generate" to create new Client ID.
Client Secret: It is the password for the add-in. Click "Generate" create new client secret.
Title: Display name of the add-in that is used on the consent page where the user is prompted to trust the add-in.
App Domain: It is URL for the domain where the remote add-in is hosted. Enter the domain of the Azure web app that we created in the above steps. 
(Example: sptechbytesproviderhostedapps.azurewebsites.net).
Redirect Url : It is the endpoint in your remote application or service to which ACS sends an authentication code. Enter the url of the Azure web app that we created in the above steps.
(Example: https://sptechbytesproviderhostedapps.azurewebsites.net/)

Once the Add-in is registered a summary page will be shown. Copy these details and save in a notepad since we will be using these details in the upcoming steps.

3) Create the Provider Hosted Add-in

First of all, create a new project in visual studio 2015 selecting SharePoint Add-in located in Office/SharePoint->Web Add-ins as show in the following image.

Specify the SharePoint Online App Catalog Site url where the add-in should be deployed and hosting method as Provider-hosted. Click Next to continue.

Specify the version of SharePoint that will host the add-in. Click Finish to continue.

Choose the type of asp.net web application project that will be used.

Since we are using Azure ACS, choose the first option "Use Windows Azure Access Control Srevice (For SharePoint cloud add-ins)".

The project will be created and the add-in is ready for customization and deployment.

Open AppManifest.xml which consists of all the configuration and deployment information related to the add-in. In General tab, Enter the Azure Web App URL in the Start Page textbox.
(Example: https://sptechbytesproviderhostedapps.azurewebsites.net/)

In the Permission tab, choose the Scope as "Web" and Permission as "FullControl".

Now, open the AppManifest.xml in View Code mode.

Update the ClientID with the Client ID that we generate in the above steps.


4) Deploy the Add-in to SharePoint Online

Publish the solution as follows

Select "New" option for creating a new publish profile.

In the Import publishing profile section, upload the .publishsettings file that we created for the Azure Web App in the above steps. Click "Next" button to continue.
Example: (SpTechbytesProviderHostedApps.azurewebsites.net.PublishSettings)

Enter the Client ID and Client Secret that we generated while registering the add-in in the above steps. Click "Finish" button to close the wizard.

Click on Deploy your web project option to publish the asp.net site in the Add-in to the empty Azure Web App.

You can either go head will default configurations or make changes before publishing. Click Publish button to start publishing.

Output window will display the completion status as shown below.

Click on the Package the add-in option to create the deployment package for the Provider hosted Add-in (.app)

Provide the details of the Azure Web App URL and the Client ID that we created in the above steps.

The .app file will be created as follows.

Go to the SharePoint Online App Catalog site where we registered the Add-in
Upload the Provider Hosted Add-in (.app) file in the Apps for SharePoint library.

Once uploaded the add-in will be displayed as follows.

5) Add the Provider-Hosted Add-in to your site

Go to any site collection and click add an app.

Choose From Your Organization section and click on the newly deployed Add-in.

Select the Trust It option to authenticate the Add-in.

The Add-in will be added to your site and displayed as shown below.

Click on the Add-in and you will be redirected to the Azure Web App url. You will notice that  Asp.Net web application in the Add-in is displayed in this URL.

For customizing the app you can use the same procedure that is used for any other normal Asp.Net (MVC\Web Forms) project. You can use CSOM or JSOM communication with SharePoint.

Hope you like this post! We will discuss more about programming with add-ins in the upcoming posts!