OData, short for Open Data protocol,
is a web protocol to consume Create, Read, Update, and Delete
operations using standard web protocols, such as HTTP, Atom, and JSON.
OData is a new emerging standard that allows producers to expose their
data via a Uniform Resource Locator (URL) and allows consumers to access this data over the web using the aforementioned protocol standards.
Business Connectivity Services in SharePoint
2013 can consume OData feeds. SharePoint 2010 required middleware code
to integrate OData, whereas users can now create a simple app connector
for SharePoint 2013 and integrate external data.
In this section, I shall provide a short demonstration to integrate a Netflix OData
feed into SharePoint. Of course, Netflix is not about to let me make
changes to the company’ video catalog data, so the feed is read-only,
but this service suffices to demonstrate OData integration with
SharePoint.
- Launch Visual Studio 2012.
- Start a new project.
- Select the template App for SharePoint 2013 (Figure 1).
- Give the app a name and location to store the project on disk.
- Click the OK button.
- In the next dialog, confirm the name and URL of the SharePoint site.
- Change the drop-down option to host the app in SharePoint.
- Click the Finish button.
- Right-click the project name in the Solution Explorer.
- Choose the Add menu item and then select the Content Types for External Data Source sub-menu item.
- Provide the OData service URL for Netflix and a friendly name—see Figure 2.
- Click the Next button.
- On the last dialog, check the check box for Title entity.
- Leave the check box for Create list instances for the selected data entries (except Service Operations) to create list instances.
- Click the Finish button.
Visual Studio has created a new external
content type for the OData Netflix Title entity, and created an
external list instance for the new external content type. Open the elements.xml file for the Titles list, and you should see the XML for the list definition (Figure 3). Be sure to make a note of the list URL.
- Right-click the AppManifest.xml file and view the code.
- Change the start page of the app to load the list you created, using the URL you noted earlier—in my case: ∼appWebUrl/Lists/Title.
Deploy the project app to SharePoint
(right-click the project name in the solution explorer and then select
the deploy menu option).
- Open your SharePoint site, where you just deployed the app.
- Click the gear icon.
- Select the menu item to view site contents.
- Scroll and find the Netflix Titles list.
- Click on the tile to open the external list.
- You should see Netflix aggregated data in SharePoint (Figure 4).