Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

    Advertisements
  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand
  • Advertisements

Archive for March, 2015

SharePoint Web Services

Posted by Paul on March 30, 2015

In this article we can explore about SharePoint Web Services.

About SharePoint Web Services

SharePoint Web Services were introduced during the olden days of MOSS 2007 & SharePoint 2010. It helped to attain client-side interaction & interoperability during the time.

SharePoint have inbuilt web services for managing various functionalities like:

1. List Management

2. Administration

3. Authentication

4. Imaging

5. Permissions

Usage

We can use the web services by knowing the correct service-name. By default the web services reside in the _vti_bin virtual folder.

For example, following is the location of lists web service:

http://server/_vti_bin/Lists.asmx

List of Web Services

Following is the list of web services which you can refer from the link in References.

image

image

Please don’t confuse Web Services with REST Services. REST Services are the newer addition to SharePoint and provides much efficient way of usage.

References

https://msdn.microsoft.com/en-us/library/office/jj193051.aspx

Summary

In this article we have explored about SharePoint Web Services. In the next article we can see how to use a List web service.

Advertisements

Posted in SharePoint, SharePoint 2013 | Tagged: , | Leave a Comment »

SMAC and SharePoint

Posted by Paul on March 26, 2015

In this article we can explore the jargon SMAC and the SharePoint aspects around it.

SMAC

SMAC represents the following:

1. Social

2. Mobile

3. Analytics

4. Cloud

SMAC is an ongoing concept or trend in the industry. The enterprise applications are targeted or built satisfying the SMAC aspects. So it is important for us to keep a grip on it.

image

Social

Social Media provides a faster and expanded reach to customers. This makes business to invest in Social Medias like Facebook, Twitter etc. They also expanded the authentication through these Social Medias.

The actions of users on these Medias triggers notifications & thus improves more reach & collaboration.

Mobile

Mobile devices including Tablets and Mobile Phones play an important role of the customer. The PC sales were overridden by the mobile devices long back.

Analytics

Learning user interests is part of the Analytics. Analytics involves Qualitative & Quantitative exploration of data. It can also lead to Big Data analysis as well. Businesses are heavily investing on Analytics to make more accurate decisions.

Cloud

Cloud allows easier scalability at manageable costs. Cloud is no more a buzz word. Already, businesses are gaining from the available-anywhere, expand-any-time, no-staffing advantages of cloud.

SMAC and SharePoint

As the other technologies are keeping a SMAC grip, we SharePoint guys too have to do the same to play in the top most layer.

Following are the core aspects we can think about:

1. Integrate Social Medias like Facebook, Twitter, Yammer etc. to the application. SharePoint Social & Collaboration features like Blogs, Activity Feeds, and Tagging can be employed here.

2. Create SharePoint sites optimized for Mobile Devices. This include appropriate usage of Responsive Web Design, Device Channels, Mobile features. Additionally, one has to liberate the authentication mechanisms to allow easier & secured access from mobile devices.

3. SharePoint Web Analytics feature can be used to accommodate the Analytics aspects. Analytics can be integrated through OOTB as well as third-party like Web Trends.

4. SharePoint Online comes into play in this scenario. Compared with SharePoint On-Premises, the SharePoint Online provides better scalable, affordable, easier management of SharePoint sites. Depending on your organization’s custom solutions requirement choose an Online/On-Premise/Hybrid SharePoint infrastructure.

References

http://bit.ly/10uiVpB

http://searchcio.techtarget.com/definition/SMAC-social-mobile-analytics-and-cloud

Summary

In this article we have explored SMAC jargon and the SharePoint aspects associated around it.

Posted in SharePoint, SharePoint 2013 | Tagged: , | Leave a Comment »

Access Data using the REST API

Posted by Paul on March 26, 2015

In this article we can explore accessing data using the REST API in SharePoint 2013.

REST API

SharePoint 2013 introduce the REST API. These API allows SharePoint applications to do Data Operations from the client-side.

REST API usage from client-side is the main advantage of using it. This frees Server CPU cycles a lot.

The main operations we can perform are:

1. List CRUD Operations

2. List creation/updating/deletion operations

SharePoint lists including custom lists can be operated using the REST API. From the client-side a C# or JS application can invoke the REST API for the CRUD operation.

As sample of the REST call compatible with OData specification is given below.

· http://server/site/_api/lists/getbytitle(‘listname’)

Through new SharePoint service packs more and more server-side functionalities are made available through the REST services.

REST Specifications

As per the REST specifications, the HTTP verbs has to be used for the corresponding purpose.

· GET for retrieving data

· PUT to create data

· POST to update data

· DELETE for removing data

Depending on the Platform Infrastructure Polices the availability of DELETE & PUT verbs could be restricted. In this case contact the IT Support to enable them or use HTTP extension methods.

Advantages

To summarize the advantages of using REST API:

1. CRUD operations can be moved to client-side

2. Frees up server cycles & resources usage

3. Less line of code through the REST/OData syntax

4. Usage of HTTP verbs for CRUD operations

References

https://msdn.microsoft.com/en-us/library/office/fp142380.aspx

Summary

In this article we have explored accessing data using the REST API in SharePoint 2013. We can see live examples in the upcoming sections.

Posted in SharePoint, SharePoint 2013 | Tagged: , | Leave a Comment »

Right MIME Type for Application Cache

Posted by Paul on March 25, 2015

For HTML5 Application Cache to work we need to specify the cache file. This cache file will specify the application files which need to be cached.

MIME Type

The MIME (Multipurpose Internet Mail Extension) Type will vary for each extension.

For example: .ttf extension is pre-registered with MIME type application/x-font-ttf which makes the browser treat the file of such extension as font.

Extension

The cache file should be of the correct extension. For the Application Cache to work the MIME type should return text/cache-manifest.

Following is the correct extension:

  • .cachemanifest

The following extension is wrong as the MIME type associated as it returns application/x-ms-manifest

· .manifest

IIS MIME Types

Open IIS Manager to view the MIME types registered as shown below.

image

image

The above cache extension was tested in IE 11 and was working fine.  Please test with other browsers to ensure proper functioning of cache extension.  If you have a separate requirement of adding/editing MIME types in O365, the preferred approaches would be:

  1. Try Get-SPWebApplication Cmdlet
  2. Contact Microsoft Support

Summary

In this post we have explored the correct MIME type for Application Cache.  You can also refer to the W3C information here.

http://www.jeanpaulva.com/index.php/2015/05/03/cache-file-extension-appcache-or-cachemanifest/

 

Posted in SharePoint, SharePoint 2013 | Tagged: , | Leave a Comment »

O365 and Offline Cache Manifest Problem

Posted by Paul on March 21, 2015

While working on O365 for an Offline Web Application, I encountered the following problem.

Problem

MIME type of .manifest file is application/x-ms-manifest. We need it to be text/cache-manifest for enabling offline files.

The challenges here are that:

1. O365 is a Microsoft Managed environment & they do not allow adding/modification of MIME type.

Solution

Deploy the .manifest file to another public configurable location. In this way we can change the MIME type and the offline functionality should work.

image

Pre-Changes

Following is how your current application on O365 looks like.

INDEX.HTML

<html manifest=”app.manifest”>

</html>

APP.MANIFEST Contents

CACHE MANIFEST

index.html

logo.png

code.js

http://cdn.ms.com/script.js

Post-Changes

Following is how your application would look like after the changes.

INDEX.HTML Contents

<html manifest=”http://newlocation/webapp/app.manifest”>

</html>

In the http://newlocation/webapp the MIME type will be configured as text/cache-manifest.

Additionally, the app.manifest in the new location should have absolute paths of the files.

APP.MANIFEST Contents

CACHE MANIFEST

http://originallocation/app/index.html

http://originallocation/app/logo.png

http://originallocation/app/code.js

http://cdn.ms.com/script.js

image 

Do not forget to mention all the HTML, JavaScript, Image, CSS files which are part of the offline functionality.

References

http://www.html5rocks.com/en/tutorials/appcache/beginner/

Summary

In this article we have explored a rare scenario with O365 and Offline Application.

Posted in SharePoint, SharePoint 2013 | Leave a Comment »

JavaScript Cross Domain Issue in App Part

Posted by Paul on March 17, 2015

In this article we can explore the JavaScript cross domain issue while using App Parts.

Scenario

Following is the scenario:

1. You have a page with a JavaScript method

2. The page have an App Part too which displays from a PHA application

3. App Part need to invoke the JavaScript method in page

4. Due to cross-domain issue the App Part cannot invoke the parent page’s method

App Parts are rendered in IFrames. The scenario is depicted below:

image

Security Aspects

By default SharePoint prevents cross-domain script calls to avoid following security vulnerabilities:

1. An IFRAME code can manipulate the parent page’s HTML DOM objects

2. An IFRAME code can unwantedly invoke parent page’s script methods

image

Please note that the cross-domain issue won’t occur if the page & IFRAME page happens to be in the same SharePoint library. In our case the IFRAME content is an App Part which is coming from an externally hosted PHA application.

Solutions

Following are the solutions possible here:

1. Use Allow Framing control in the page

2. Use SP.RequestExecutor wiring

3. Use JavaScript Post Message functionality

Here I would like to show the JavaScript Post Message functionality.

JavaScript Post Message

The window.PostMessage() method allows safe communication across cross-boundary pages. Here the invoker is passing a message string to the target. The target may choose to process or ignore the message.

Implementation

For simplicity I am avoiding creating the PHA application. I would like to show the core functionality. Create a new page in SharePoint.

Add a content web part & insert the following code into it. (See parent.html)

function parentmethod()

{

alert(“Parent Method Invoked!”);

}

window.onmessage = function(e)

{

if (e.data == ‘ok’)

{

parentmethod();

}

};

/SiteAssets/frame.html

The code above performs the following:

1. Create a method named parentmethod() which displays an alert message

2. Create a message listener method for any incoming messages

3. Create an IFRAME displaying the child page

Now you need to upload the following content to the Site Assets library. Name it as frame.html. (See frame.html)

<input type=”button” value=”Click Me to invoke Parent Method”

onclick=”parent.postMessage(‘ok’, ‘*’);”>

</input>

Save changes & your page looks like below now.

image

Click on the button & you should be able to see the message box shown below.

image

Following is the functionality summary depiction.

image

This resolves the cross-domain script call issue.

References

https://msdn.microsoft.com/en-us/library/office/fp179921.aspx

Summary

In this article we have explored cross-domain issue of App Part and a Solution for it. The scripts are added to the article.

Posted in SharePoint, SharePoint 2013 | Tagged: , , , | Leave a Comment »

Hierarchical Tasks & Task Pane

Posted by Paul on March 12, 2015

In this article we can explore the Hierarchical Tasks & Task Pane in SharePoint 2013.

Hierarchical Tasks

In SharePoint 2013 we can create a Task & then Sub Tasks underneath it.

· Task 1

o Task 2

§ Task3

Example

Create a new Tasks list for trying it yourself. Create a new Task like below.

image

Now choose the ellipsis and you will get the following menu items.

image

Click on the CREATE SUBTASK menu item. Here you can enter multiple sub tasks as shown below.

image

image

Please note that the list went to the Data Sheet view. You need to click the Stop link to go back to the list view.

image

Tasks Pane

Tasks Pane provides further control with the following custom action ribbon buttons:

1. Insert

2. Outdent / Indent

3. Move Up / Move Down

4. Outline – Show / Hide Subtasks

Following is the Tasks Pane.

image

You can play with them to see the functionality.

Summary

In this article we have explored Hierarchical Tasks & Task Pane in SharePoint 2013.

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »

Create a SharePoint 2013 Development VM

Posted by Paul on March 10, 2015

In this article we can explore how to quickly acquire a SharePoint 2013 Development Virtual Machine.

Software Requirements

Following are the software requirements for a SharePoint Development VM:

1. Windows Server 2012

2. SQL Server 2012

3. Visual Studio 2013

4. SharePoint Server 2013

Azure VM

I am suggesting Azure VM for a Trial period of 30 days. Click on the link below to start with:

http://azure.microsoft.com/en-us/account/

You can use your personal email for registration. Click on MY ACCOUNT link on the top. You will get the page displayed below.

image

Click on the Management Portal from the left side bottom. You will get the portal shown below.

image

Here you can create & manage websites, virtual machines etc. Click on the VIRTUAL MACHINES item from the left pane. Then on the CREATE VIRTUAL MACHINE link.

image

In the appearing pane choose the COMPUTE > VIRTUAL MACHINE > FROM GALLERY option. Here you can select from pre-created templates. Using templates would save our time.

image

In the appearing page choose the following template.

image

The template Visual Studio Ultimate 2013 Update 4 on Windows Server 2012 is required as this installation will be having a PowerShell script on the desktop which will do the SharePoint 2013 installation.

We are first installing Visual Studio 2013 & then proceeding with SharePoint 2013 installation.

Click the Next button to continue.

image

Enter the machine, user information to continue.

On Page 3 you can choose the REGION closer to your location.

image

Select the default options in Page 4.

image

Click the TIK button for the installation to start. You will get the status shown below.

image

Once you see the status changed as Running (shown below)

image

Click on the CONNECT button from bottom row.

image

You should be getting a .RDP file. Open the file for Remote Desktop connectivity into the VM we created.

image

You can use the username & password given during VM creation. You will get the machine as shown below.

image

You are ready with th VM. For installing SharePoint 2013, we have to travel a bit more.

Run PowerShell scrip in the folder ConfigureDeveloperDesktop > Scripts > ConfigureSharePointForm.ps1 as shown below.

image

The script will install SQL Server & SharePoint. When prompted you have to respond with following:

1. Choose Yes for the policy prompt

2. Enter your username and password for Service Account prompt

It might take an hour for the operations to complete.

image

To ensure you are optimizing your credit usage, you need to SHUTDOWN the machine after use.

image

Summary

In this article we have explored how to create a SharePoint 2013 Virtual Machine with Development Tools ready.

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »

Claims based Authentication

Posted by Paul on March 5, 2015

I am writing a series of articles about Claims based Authentication in SharePoint 2013.

Claims based Authentication

Claims based Authentication allows decoupling of Authentication from an Application. By default SharePoint uses Windows Classic mode Authentication.

Claims

Claims are XML based SAML 2.0 token. Each token will be encrypted and contains user identity information. For example a claim can contain:

1. User name

2. Access Rights

Federated Authentication

Claims based Authentication is also called Federated Authentication as the Authentication is federated to a 3rd party provider. Following would be a typical scenario for Claims based Authentication.

Imaging you has a SharePoint site for Document Management. You have shared the site in public. Your customers are different Corporations like Corp A, Corp B etc. A corporate employee of Corp A needs to access the SharePoint site. It is tedious to maintain an authentication for each corporation in the SharePoint active directory. Here the corporate employee who is authenticated with their own company public sites & produce the same claims to access our SharePoint site.

Thus the authentication is externalized.

image

The image above depicts the following:

1. User access to SharePoint Site

2. SharePoint Site redirects to the Corp A login page

3. User authenticates to Corp A

4. Corp A provides a set of claims to the user

5. Corp A redirects to SharePoint Site

6. SharePoint Site validates the claim

7. User is given access to SharePoint Site

There should be a pre-configured Trust between SharePoint Site & Corp A application for the above to work.

References

https://msdn.microsoft.com/en-us/library/ff359101.aspx

Summary

In this post we have explored basics of claims based authentication. In the upcoming articles I will explain how to setup create a custom claims provider for SharePoint 2013

Posted in SharePoint, SharePoint 2013 | Tagged: , | Leave a Comment »

Azure Virtual Machine for SharePoint 2013

Posted by Paul on March 3, 2015

For new developers in SharePoint 2013, Procuring a machine is a challenge.  Following are the available options & drawbacks.

  • Install as a Secondary Boot Operating System with SharePoint.  (Setbacks: Hardware may not have enough power)
  • Install a Virtual Machine on top of a Windows 7/8 machine (Setbacks: Hardware may not have enough power)

SharePoint 2013 Hardware Configuration

Following would be the preferable hardware specification for a SharePoint development machine.

  • 64-bit I5/I7 Processor
  • 12-16 GB RAM
  • SSD HDD

Azure Virtual Machine

If you cannot procure such a machine quickly, you can use Azure Virtual Machines.  I am giving below the steps & tips to procure & maintain a free azure virtual machine.

Free Trial

Azure is providing free trial for 1 month.  This will give a $200 credit for using the virtual machine.  After the credit Or trial period, the subscription comes to an end.

Steps

Open the URL: http://azure.microsoft.com/en-us/services/virtual-machines/

image

Click on the MY ACCOUNT link from the top row.

image

Click on the Management Portal link from the bottom.  Sign in with a Microsoft Registered Account.  (You can use your personal email id like gmail as well)  In the appearing page click on the VIRTUAL MACHINES from the left pane.

image

Click the NEW button from the bottom row.

image

You will get the following page.

image

Choose COMPUTE > VIRTUAL MACHINE > FROM GALLERY option.  (This will help you pick a pre-configured image, saves lot of time).  You can select the following image.

image

Select the SharePoint Server 2013 Trial image & Click the Next button arrow on the bottom. 

In the appearing page, choose the following options.  Enter your user name & password to continue. 

image 

Use the appropriate options in the next page.

image

In the next page accept the defaults & click the OK button (Tick mark)

image

You will get the following screen.  Wait for the provisioning to be completed.

image

Remote Desktop

Once the VM is provisioned & started, you can use Remote Desktop connectivity to the above machine.

image

Click on the CONNECT button.  You will get the RDP file downloaded.  Click on the downloaded file to open Remote Desktop connection. 

You should be get prompted with the Username dialog box like below.

image

(If you are not getting the dialog box, make sure your Network Settings allows connection to external machines / RDP ports)

Once authenticated you will be getting the new virtual machine.

image

Run the SharePoint 2013 Central Administration from the Start Menu.

For further configurations, please see the References link.

Tip

Make sure you are turning off your virtual machine after use using the SHUT DOWN option. (else your credit might reduce faster)

image 

References

http://azure.microsoft.com/en-us/pricing/free-trial-faq/

http://www.sharepointcto.com/View.aspx?id=5

Summary

In this post we have seen how to procure an Azure VM for SharePoint 2013 development purposes.

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »